Third-Order Matching via Explicit Substitutions

Size: px
Start display at page:

Download "Third-Order Matching via Explicit Substitutions"

Transcription

1 Third-Order Matching via Explicit Substitutions Flávio L. C. de Moura 1 and Mauricio Ayala-Rincón 1 and Fairouz Kamareddine 2 1 Departamento de Matemática, Universidade de Brasília, Brasília D.F., Brasil. flavio@mat.unb.br,ayala@mat.unb.br 2 School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh, Scotland. fairouz@macs.hw.ac.uk Abstract. We show how Dowek s third-order matching decision procedure can be adapted to the simply typed λσ-calculus of explicit substitutions. The advantages of this approach include being closer to low-level implementations based on the λ-calculus, where substitution has to be made explicit. The work is done by, firstly, reducing matching problems to interpolation problems in the language of the λσ-calculus and, secondly, showing that if an interpolation problem has a solution then it is possible to find a solution which depends only on a measure of the structure of the initial matching problem, where this measure is based on the notion of λσ-böhm trees. 1 Introduction Matching is a basic operation extensively used in implementations of automated deduction environments and programming languages. Calculi of explicit substitutions are refinements of the λ-calculus by internalizing the substitution operation. By studying matching using explicit substitutions, we can ensure a more accurate description of implementations based on the λ-calculus. This is useful when we consider low-level implementations in which matching algorithms are to be implemented in the level of the language itself. In this paper we prove the decidability of a special class of third-order matching problems in the λσ-calculus[accl91]. This class consists of those matching problems originated in the simply typed λ-calculus. Our result is achieved by extending the techniques in [Dow94] to the language of the simply typed λσcalculus. In the next subsection we present the necessary background. In section 2, we define λσ-böhm trees for λσ-terms and present relevant results related to this notion. In section 3, we show how a matching problem in the language of λσ is translated to an interpolation problem. In section 4, we show how to decide third-order interpolation problems. Corresponding author. Supported by Brazilian CAPES Foundation. Partially supported by Brazilian CNPq Council.

2 1.1 The λσ-calculus The λσ-calculus of explicit substitutions extends the λ-calculus with explicit operators to simulate the substitution (meta-)operation of the λ-calculus. The λσ-calculus uses indexes to represent variables, the well-known de Bruijn notation [db72], and its rewriting system is given in Table 1. (Beta) (λa b) a [b id] (App) (a b)[s] (a [s]) (b [s]) (Abs) (λa)[s] λ(a [1 (s )]) (Clos) (a [s])[t] a [s t] (VarCons) 1 [a s] a (Id) a[id] a (Assoc) (s t) u s (t u) (Map) (a s) t a [t] (s t) (IdL) id s s (IdR) s id s (ShiftCons) (a s) s (VarShift) 1 id (SCons) 1[s] ( s) s (Eta) λ(a 1) b if a = σ b[ ] Table 1. The λσ-rewriting System The syntax of the typed λσ-calculus is given by: Types A ::= K A B Contexts ::= nil A. Terms a ::= 1 X (a b) λ A.a a[s] where X X Substitutions s ::= id a.s s s The set of λσ-terms is written as Λ λσ (X ). The λσ-typing rules are given by: (var) A. 1 : A (lambda) A. a : B λ A.a : A B (app) a : A B b : A s a : A (clos) (a b) : B a[s] : A (id) id (shift) A. a : A s s s (cons) a.s A. (comp) s s In addition, to each meta-variable X we associate a unique type T X and a unique context X. We assume that for each pair (, A) there is an infinite set of meta-variables X such that X = and T X = A. We add the following typing rule for meta-variables: (Metavar) X X : T X. We write a A to say that the λσ-term a has type A under context. The simply typed λσ-calculus is weakly terminating and, hence every typed term has a normal form. The λσ-nf (λσ-nf for short) of a λσ-term is essential in this work and is given by the following definition taken from [Río93]. Proposition 1. Any λσ-term in λσ-nf has one of the following forms: 1. λ.a, where a is in λσ-nf. 2. (a b 1... b q ), where a and b i are in λσ-nf and a is either 1, 1[ n ], X or X[s] where s is a substitution term in λσ-nf and different from id. 3. a 1... a p n, where a 1,..., a p are in λσ-nf and a p n. 2

3 2 λσ-böhm Trees We introduce λσ-böhm trees for simply typed λσ-terms and for λσ-terms in η-long β-normal form and set the ground for our main result. Definition 2 (Occurrence). An occurrence is a list of strictly positive integers α = s 1,..., s n. The number n is called the length of the occurrence α. Definition 3 (Occurrence Path). Let T be a tree and α = s 1,..., s n be an occurrence in T. The path of α is the set of occurrences { s 1,..., s k k n}. We now define the so-called λσ-böhm trees for simply typed λσ-terms. Definition 4 (λσ-böhm Trees). A λσ-böhm tree is a tree whose nodes are labeled with pairs l, va such that l is a positive integer and v A is a λσ-term of type A under context. From now on, we use λσ-nf to denote the η-long β-normal form of a λσ-term. Below, we define the λσ-böhm tree for λσ-terms in η-long β-normal form. Notice that a similar definition can be done requiring just a kind of head normal form because each normal form is a head normal form. Definition 5 (λσ-böhm tree of a λσ-nf). Let a A = λ A1 λ Ak.(h B 1... B m B b 1 B1 b m Bm ) be a term in λσ-nf, where = A 1... A k. The Böhm tree of a A is recursively defined as the tree whose root is labeled with the pair k, h B 1... B m B and whose sons are the λσ-böhm trees of: 1. b 1B1,...,b mbm, if h B 1... B m B is a de Bruijn index; 2. a 1A1,..., a pap, b 1B1,..., b mbm, if h B 1... B m B is a meta-variable of the form XA [a 1 A 1... a pap n ], where a 1A1... a pap n is a substitution in λσ-nf. As in [Dow94], we write a A to denote the depth of the λσ-böhm tree of the λσ-nf of the term a A. Example 6. The λσ-böhm tree of the term λ A λ A λ A.(4 A A A X A 1 A), where = A A A A A A nil is given by: 3, 4 A A A 0, XA 0, 1 A 3

4 The λσ-böhm tree of the term λ A λ A λ A.(4 A A A (X A A [(λ A.1 A A ) 1 A 2 2 ] 2 A) 1 A), where = A A A A A A nil and = A A A 2 is given by: 0, X A [(λ A.1 A 1, 1 A A 3, 4 A A A A ) 1 A 2 2 ] 0, 1 A 0, 1 A 0, 2 A Definition 7 (Free occurrence). A free occurrence of a de Bruijn index i in the λσ-term a is defined by: 1. If a = X[s] then i does not occur free in a, where X is a meta-variable and s is any substitution. 2. If a = i then i occurs free in a. 3. If a = λ A.b and i occurs free in b then i + 1 occurs free in a. 4. If a = (b c) and i occurs free in b or c (or in both) then i occurs free in a. Definition 8 (Relevant term). A λσ-term a = λ A1... λ Ak.b is relevant in its i-th (1 i k) argument if the index k i + 1 occurs free in b. Lemma 9. Let a A be a λσ-nf and a 1 A 1,..., a pap be λσ-terms of atomic type, where = A 1... for some context. For all 1 j p, if the de Bruijn index j occurs free in a A then the λσ-nf of a A[a 1 A1... a p n ] contains a j Aj as a sub-term, and hence a A a A [a 1 A 1... a p Ap n ]. Proof. Note that all possible free occurrences of j in a are in non functional positions because they have atomic types; i.e., all these free occurrences are leaves. Therefore, the normalisation of a A [a 1 A 1... a p Ap n ] does not include any simulation of β-reduction. Thus, if β is a free occurrence of j in a A, then after a σ-normalisation, every occurrence α in the λσ-böhm tree of the λσnf of a j Aj will become the occurrence βα in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a p n ]. This means that the λσ-böhm tree of a j A j is a sub-tree of the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a pap n ]. Lemma 10. Let a be a term in λσ-nf. Then a A a A n ] where k, n 0, i k n, =... and n is a well-typed substitution. 4

5 Proof. By structural induction on a A : If a A = r A and r k then k A n ] = i r I r = 0. Otherwise, r A n ] = r k + n B = 0 If a A = XΠ A [a 1 A 1... a p m Π ], then XΠ A [a 1 A 1... a p m def. Π ] = 1 + max( a 1A1,..., a pap ). In addition, a A n ] = { XA Π[a 1 A 1... a pap m Π ] n ] t1, if m k σ t 2, if m > k where t 1 = XA Π[a 1 A 1 n ]... a pap n ] i m I m n ] and t 2 = XA Π[a 1 A 1 n ]... a pap... i k n ] m k+n Π ]. In the first case, i.e., m k, by IH, for all 1 j p, a j A j a j A j n ] and by definition of λσ-böhm trees, we have that X Π A [a 1 A 1 n ]... a p Ap... i k n ] i m I m... i k n ] = 1+max( a 1 A1... i k n ],..., a p Ap max( a 1 A1,..., a p ) = X Π A [a 1 A 1... a p m Π ] In the second case, i.e., m > k, by IH, for all 1 j p, a j A j a j A j n ] n ], i m I m,..., i k ) 1 + and then XA Π[a 1 A 1 n ]... a pap n ] m k+n Π ] 1 + max( a 1 A 1 n ],..., a p Ap n ] ) 1 + max( a 1 A1,..., a p ) = X Π A [a 1 A 1... a p If a A = λ B.b B C i k B n+1b m Π ] then by IH we have that b B C bb C [1B B B i 1... ] for an adequate context. In addition, by the definition of λσ-böhm trees, we have that b B C [1B B λ B.b B C [1B B i 1 B B n+1b i 1 B ] = (λ B.b B C B n+1b ] = )... i n 1 ] and the lemma holds. If a A = (b B A c B ) then, by IH, we have that b B A b B A... i k n ] and cb = c B n ]. Since a A = (b B A a B ) is in λσ-nf, we have that a A = 1 + max( b B A, c B ) 1 + max( b B A... i k n ], c B n ] ) = a B n ]. Proposition 11. Let a A be a λσ-normal term and a 1 A 1,..., a p be λσ-normal terms of at most second order, where = A 1... for some context. For all 1 j p, if the de Bruijn index j occurs free in a A then a j A j a A[a 1 A1... a p n ] 5

6 for some n 0 such that n is a well-typed substitution. Proof. The proof is by structural induction on a A : If a A = j A then j A [a 1 A 1... a p Ap n ] = a j Aj. If a A = λ B.b B C then a A [a 1 A 1... a pap n ] = (λ B.b B C )[a 1 A 1... a pap n ] σ λ B.b B C [1B B a 1A1 [ B ]... a p [ B ] n+1b ] and by IH we have that, for all 1 j p + 1, if the de Bruijn index j occurs free in b B C then b j A j [ B b B C [1B B ] b B C [1 B B a 1A1 [ B ]... a p [ B { 1 B where b j A j [ B ] = B, if j = 1 a j 1Aj 1 [ B ], if 1 < j p. Therefore, using Lemma 10 and equation (1), we have that: j > 1: a j 1Aj 1 a j 1Aj 1 [ B ] a j Aj [ B ]... a p [ B ] n+1b ] = λ B.b B C [1B B (λ B.b B C j = 1: a 1A1 [ B )[a 1 A 1... a pap n ] 1 B B λ B.b B C [1B B b B C [1B B a 1 A1 [ B ]... a p [ B ] n+1b ] = a j Aj [ B ]... a p [ B ] n+1b ] = (λ B.b B C )[a 1 A 1... a p n ] If a A = (b B A c B ) then a A [a 1 A 1... a pap n ] = (b B A c B )[a 1 A 1... a p Ap n ] σ ] n+1b ] (1) ]... a p [ B ] n+1b ] = (b B A [a 1 A 1... a pap n ] c B [a 1 A 1... a pap n ]) and now we have the following cases according to the existence of a free occurrence of a de Bruijn index j with 1 j p in b B A and/or in c B : 1. Assume j with 1 j p occurs free in b B A. If this occurrence is in the head of the term then we have (we omit type information for clarity): (b[a 1... a p n ] c[a 1... a p n ]) = ((j b 1... b k )[a 1... a p n ] c[a 1... a p n ]) σ (a j b 1 [a 1... a p n ]... b k [a 1... a p n ] c[a 1... a p n ]) = (λ B1... λ Bk+1.d b 1 [a 1... a p n ]... b k [a 1... a p n ] c[a 1... a p n ]) λσ d[c[a 1... a p n ] b k [a 1... a p n ]... b 1 [a 1... a p n ] id]. Using Lemma 9, we conclude that a j = λ B1... λ Bk+1.d = d d[c[a 1... a p n ] b k [a 1... a p n ]... b 1 [a 1... a p n ] id] = (b[a 1... a p n ] c[a 1... a p n ]). If the occurrence of j is not in the head of b B A then the λσ-nf of (b B A [a 1 A 1... a p n ] c B [a 1 A 1... a p n ]) is of the form (b B A c B ), where b B A (resp. c B ) is the λσ-nf of b B A [a 1 A 1... a p Ap 6

7 n ] (resp. c B [a 1 A 1... a p Ap n ]). Therefore, b B A [a 1 A 1... a p Ap n ] (b B A [a 1 A 1... a p Ap n ] c B [a 1 A 1... a p Ap n ]) and by IH, we have that a j Aj b B A [a 1 A 1... a p Ap n ] because j occurs free in b B A. 2. Suppose that j with 1 j p occurs free in c B. By IH, we have that a j A j c B [a 1 A 1... a p n ] (b B A [a 1 A 1... a pap n ] c B [a 1 A 1... a pap n ]). Proposition 12. Let a A be a λσ-normal term and, a 1 A 1,..., a p be λσ-terms of at most second order, and = A 1... for some context. Let α = s 1,..., s n be an occurrence in the λσ-böhm tree of a A and β 1 = s 1,..., s k1,..., β l = s 1,..., s kl be all the occurrences of free de Bruijn indexes j with 1 j p that are in the path of α. For each 1 i l, if the term a j Aj is relevant in its r-th argument, where r is the position of the son of β in the path of α, i.e., r = s ki +1 then there exists an occurrence α in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a p n ], for some n 0 where n is well typed and, such that all the labels occurring in the path of α, except j, occur in the path of α and the number of times they occur in the path of α is greater than or equal to the number of times they occur in the path of α. Moreover, if the occurrence α is labeled with a symbol different from j then the occurrence α is labeled with the same symbol and, if a j Aj = 0 then the length of α is greater than or equal to the length of α. Proof. By induction on the number of occurrences of free de Bruijn indexes j with 1 j p in the path of α. We consider occurrences from the lowest to the highest in the λσ-böhm tree of a A. In addition, whenever it is possible, we omit for clarity, the decoration of terms. Let α = β l β l 1... β 2 β 1 γ (2) be an occurrence in the λσ-böhm tree of a A. If there is no free occurrence of j (1 j p) in the path of α, i.e., l = 0 in (2), then α is also an occurrence in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a pap n ] and then we take α = α = γ. If there exists exactly one free occurrence of j (1 j p) in the path of α, then α = β 1 r γ, where γ = r γ and suppose that the term a A at the occurrence β 1 has the form λ B1... λ Bv.(j e 1... e u ), where j corresponds to a free occurrence of j. By hypothesis a j Aj = λ C1... λ Cu.d is relevant in the r-th argument (that corresponds to the son of β 1 that is in the path of α). Let ξ be a free occurrence of u r + 1 in the λσ-böhm tree of d. After the substitution, every occurrence β 1 θ have been removed, where θ is an occurrence in the λσ- Böhm tree of e i ; and the following occurrences have been added: β 1 δ, where δ is an occurrence in the λσ-böhm tree of d not labeled with a free de Bruijn index less than or equal to u. 7

8 β 1 δγ, where δ is a free occurrence of a de Bruijn index less than or equal to u and γ is an occurrence in the λσ-böhm tree of e i. In this case we take α as follows: α = β 1 ξγ β 1 q + 1 ξγ, if the label at the occurrence β 1 in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a p n ] has the form k, X A [b 1 B 1... b q B q m ]., if the label at the occurrence β 1 in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a p n ] has the form k, k A. Now, suppose that the result holds for an occurrence α = β l 1... β 2 β 1 γ in a A containing l 1 occurrences of free de Bruijn indexes less than or equal to p. Hence, there exists an α satisfying the proposition. For α = β l β l 1... β 2 β 1 γ = β l α the induction step is built as above when there exists exactly one free occurrence of j in the path of α. If a j A j = 0 then the length of α can be less than the length of α because α = β 1 r γ and the above construction will give α = β 1 γ since the occurrence of u r + 1 is in the head of a j Aj. Therefore, when a j Aj = 0, the occurrence ξ above cannot be empty and then the length of α is greater than or equal to the length of α. Corollary 13. Let a A be a λσ-nf, a 1 A 1,..., a pap be λσ-normal terms of at most second order, and = A 1... for some context. If for all 1 i p, the terms a iai are relevant in all its arguments and a iai = 0 then a A a A[a 1 A1... a p n ] Proof. Let α be the longest occurrence in the λσ-böhm tree of a A. By Proposition 12, there exists an occurrence α in the λσ-böhm tree of the λσ-nf of a A [a 1 A 1... a pap n ] that is, at least, as long as α. For a given matching (or interpolation) problem Ψ, the way to find substitutions that are solutions to Ψ is by using the unification method developed in [DHK00]. Instead of higher-order substitution, this method uses grafting (firstorder substitution) and to do so, the given matching (or interpolation) problem needs to be precooked. The precooking translation protects the meta-variables occurring in the problem avoiding capture and is defined as follows.: Definition 14 ([DHK00]). Let a Λ db (X ) such that a : T. To every meta-variable X of type U in the term a, we associate the type U and the context in λσ-calculus. The precooking of a from Λ db (X ) to the set of λσterms, written Λ λσ (X ), is defined by a F = F (a, 0) where F (a, n) is defined by: (a) F ((λ B.a), n) = λ B (F (a, n + 1)) (b) F (k, n) = 1[ k 1 ] (c) F ((a b), n) = F (a, n) F (b, n) (d) F (X, n) = X[ n ] 8

9 3 From Matching Problems to Interpolation Problems We describe how matching problems can be converted into equivalent interpolation problems. Third-order interpolation problems in the language of the λσ-calculus are solved using the matching rules presented in Table 2, that are adapted from [dmkar05]. σ, P {λ A.a <<? λσ λ A.b} Dec m -λ σ, P {a <<? λσ b} Dec σ, P {(n a 1... a p ) <<? λσ (n b 1... b p )} m-app σ, P {a 1 <<? λσ b1,..., ap <<? λσ bp} σ, P {(n a 1... a p ) <<? λσ (m b 1... b q )} Dec m-fail, if m n. F ail σ, P Exp m -λ Y : (A 1..A k. Y : B), σ, P {X λ A1... λ Ak.Y } if ( X : A 1 A k B) T Var(P ), Y T Var(P ), and X is not a solved variable. where σ = σ{x λ A1... λ Ak.Y } Imit Proj σ, P {X[a 1..a p. n ] <<? λσ (m b 1... b q )} σ, P σ {(m n+p H 1... H q )[a 1 σ..a p σ. n ] <<? λσ (m b 1... b q )} if X has atomic type and m > n. where σ = σ{x (m n+p H 1... H q )}, H 1,..., H q are metavariables with appropriate type and with contexts Hi = X ( 1 i q). σ, P {X[a 1..a p. n ] <<? λσ (m b 1... b q )} σ, P σ {(j H 1... H q )[a 1 σ..a p σ. n ] <<? λσ (m b 1... b q )} if X has atomic type and the j-th element (1 j p) of the list a 1..a p has the same type of X, where σ = σ{x (j H 1... H q)}, H 1,..., H q are metavariables with appropriate type and with contexts Hi = X( 1 i q). σ, P {a <<? λσ b} Normalise m if a or b is not in Eta-long form. σ, P {a <<? λσ b } where a (resp. b ) is the Eta-long form of a (resp. b), and σ is obtained from σ by normalising all its terms. if a (resp. b) is not a solved variable and a (resp. b) otherwise. Table 2. The Matching Rules Definition 15. Let a? λσ b be a matching equation and σ a ground solution to this equation, i.e., the λσ-normal form of aσ is equal to b. We define the interpolation problem Φ(a? λσ b, σ) inductively over the number of occurrences of a as follows: If a = λ A.c then b is also an abstraction of the form λ A.d and then σ is also a solution of c? λσ d and we let Φ(a? λσ b, σ) = Φ(c? λσ d, σ). 9

10 If a = (k c 1... c m ) then b is also of the form (k d 1... d m ) because a? λσ b is solvable and we let Φ(a? λσ b, σ) = Φ(c i? λσ d i, σ). i If a = (X[a 1... a p n ] c 1... c m ) then we let Φ(a? λσ b, σ) = {(X[a 1... a p n ] c 1 σ... c m σ)? λσ b} i H i, where Φ(c i? λσ c iσ, σ), if the dummy symbol occurs in the λσ-normal form of H i = (Xσ[a 1 σ... a p σ n ] c 1 σ... c i 1 σ c i+1 σ... c m σ)., otherwise. Proposition 16. Let a? λσ b be a matching equation and σ a ground solution to this equation. Then the substitution σ is a solution to Φ(a? λσ b, σ) and, conversely, if σ is a solution to Φ(a? λσ b, σ) then σ is also a solution to the matching equation a? λσ b. Proof. By induction on the structure of the terms on the left-hand side of all the equations occurring in the problem. Let σ be a ground solution of a? λσ b. If a is an abstraction of the form λ A.c then b is also an abstraction of the form λ A.d and σ a ground solution of c? λσ d. By IH σ is a solution to Φ(c? λσ d, σ) and hence also a solution to all the equations of Φ(a? λσ b, σ). If a is an application of the form (k c 1... c m ) then b is also an application of the form (k d 1... d m ) and σ is also a ground solution of the equations c 1? λσ d 1,...,c m? λσ d m. By IH, we have that σ is a solution to Φ(c i? λσ d i, σ) i and hence σ is also a solution to Φ(a? λσ b, σ). If a is of the form (X[a 1... a p n ] c 1... c m ) then σ is a solution to X[a 1... a p n ] c 1 σ... c m σ? λσ b and c 1? λσ c 1σ,..., c m? λσ c mσ. By IH, σ is also a ground solution to m Φ(c i? λσ c i σ, σ) i=1 and therefore, σ is a solution to {X[a 1... a p n ] c 1 σ... c m σ? λσ b} where H i is as in Def. 15. m H i = Φ(a? λσ b, σ), i=1 Conversely, let σ be a ground solution to Φ(a? λσ b, σ): If a is an abstraction of the form λ A.c then b is also of the form λ A.d and Φ(c? λσ d, σ) Φ(a? λσ b, σ) and hence σ is also a solution to c? λσ d and therefore, a solution to a? λσ b. 10

11 If a is an application of the form (k c 1... c m ) then b is also of the form (k d 1... d m ) and, since Φ(c i? λσ d i, σ) Φ(a? λσ b, σ), we have that i σ is also a solution to all the equations c i? λσ d i for i = 1,..., m and therefore, σ is also a solution to a? λσ b. If a is of the form (X[a 1... a p n ] c 1... c m ) then σ is also a solution to (X[a 1... a p n ] c 1 σ... c m σ)? λσ b and to Φ(c i? λσ c i σ, σ), i.e., i c i σ = λσ c i σ for all i = 1,..., m. Therefore, (X[a 1... a p n ]σ c 1 σ... c m σ) = λσ b (X[a 1... a p n ]σ c 1 σ... c m σ ) = λσ b (X[a 1... a p n ] c 1... c m )σ = λσ b aσ = λσ b Definition 17. Let Ψ be a third-order matching problem and σ be a solution to Ψ. We let Φ(Ψ, σ) be the following third-order interpolation problem: Φ(Ψ, σ) = Φ(a? λσ b, σ). a? λσ b Ψ Proposition 18. Let Φ be an interpolation problem generated from a precooked matching problem Ψ and σ be a ground solution to Φ. Then all the equations of Φ are of the form (X[a 1... a p n ] c 1... c q )? λσ b, where all the terms a 1,..., a p, c 1,..., c q and b are ground. Proof. Def. 15 implies that any interpolation equation is flexible-rigid. Flexiblerigid equations are of the form (X[a 1... a p n ] c 1... c q )? λσ b. The right-hand side of a matching equation is a ground term and, since b comes from terms in the same side of matching equations b should be ground. The proof is by inspection on the matching rules. Let Ψ be a matching problem which is in the image of the precooking translation. Then all meta-variables occurring in Ψ have the form X[ n ], where n 0 means that X is under the scope of n abstractors. Therefore, after converting the matching problem Ψ into the interpolation problem Φ, we get that all interpolation equations are of the form (X[ n ] c 1... c q )? λσ b because no λσ-rule is applied in this conversion. Moreover, all the terms c 1,..., c q are ground. The matching rules that can be applied for this equation are Exp m -λ, Imit or Proj. In the first case, X is replaced by λ C1... λ Cq.Y, where C i is the type of c i and the equation must be normalised. During the normalisation, the λσ-rules that insert terms inside substitutions are (Beta) or (Abs). In the case of Imit or Proj, the introduced meta-variables are always in the head of the new equations. Applications of Dec m -λ, Dec m -App and Dec m -Fail do not change the structure of the explicit substitutions. 4 Third-Order Interpolation Problems We show how interpolation problems are decided concluding the decidibility of third-order matching. 11

12 Definition 19 (Occurrence accessible w.r.t. an equation). Consider an equation of the form (X[a 1... a p n ]c 1... c q ) = b and the term t = λ C1... λ Cq.u with the same type of X. The set of occurrences in the λσ-böhm tree of t accessible with respect to the equation (X[a 1... a p n ] c 1... c q ) = b is inductively defined as: the root of the λσ-böhm tree of t is accessible. if α is an accessible occurrence labeled with a de Bruijn index j with 1 j p + q and d j is relevant in its r-th argument then the occurrence α r is accessible, where: d j = { aj if q < j p + q, c q i+1 if 1 j q. if α is an accessible occurrence labeled with a de Bruijn index greater than p + q or with a meta-variable then all the sons of α are accessible. if α is an accessible occurrence labeled with a meta-variable then each son of α is accessible. Definition 20 (Occurrence accessible w.r.t. an interpolation problem [Dow94]). An occurrence is accessible with respect to an interpolation problem if it is accessible with respect to one of the equations of this problem. Definition 21 (λσ-term accessible w.r.t. to an interpolation problem). A λσ-term is accessible with respect to an interpolation problem if all occurrences of its λσ-böhm tree which are not leaves are accessible with respect to this problem. Definition 22 (Accessible solution built from a solution). Let Φ be an interpolation problem and let σ be a ground solution to this problem. For each meta-variable X occurring in the equations of Φ consider the λσ-term t such that {X t} σ. In the λσ-böhm tree of t, we prune all occurrences non accessible (that are not leaves) with respect to the equations of Φ in which X has an occurrence and put λσ-böhm trees of ground terms of depth 0 of the expected type as leaves. Call t the term whose λσ-böhm is obtained this way and σ the resulting substitution. Proposition 23. Let Φ be an interpolation problem generated from a precooked matching problem and let σ be a ground solution to Φ. Then the accessible solution σ, built from σ, is a solution to Φ. Proof. Let (X[a 1... a p n ] c 1... c q )? λσ b be an equation of Φ,σ be a ground solution to Φ, t = Xσ = λ C1... λ Cq.d and t = X σ = λ C1... λ Cq.d. It is enough to prove that d[c q... c 1 a 1... a p n ] = λσ d [c q... c 1 a 1... a p n ] because the left-hand side of the above equation reduces to b and the right-hand side is λσ-equivalent to (X[a 1... a p n ] c 1... c q ) σ. By construction, the λσ-böhm trees of d and d differ only on the non accessible occurrences. So, let β r be a non accessible occurrence in a path in the 12

13 λσ-böhm tree of t such that the occurrence β is accessible w.r.t the equation (X[a 1... a p n ] c 1... c q ). From the definition of accessible occurrence, we conclude that β is labeled with a de Bruijn index j (1 j p + q) and d j is { aj q, if j > q not relevant in its r-th argument, where d j =. During the c q j+1, if j q normalisation step, j will be replaced by d j and since d j is not relevant in its r-th argument, the label of β r will disappear during the normalisation. Proposition 24. Let Φ be an interpolation problem, σ a solution to Φ and σ the accessible solution built from σ. If h is the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ and t = X σ = λ C1... λ Cq.u (u atomic) then there are at most h + 1 occurrences of de Bruijn indexes k with k > q on a path in the λσ-böhm tree of t. Proof. Notice that the occurrences in the λσ-böhm tree of t and those in the λσ- Böhm tree of u are the same, except that the label at the root differ. Suppose that there exists an occurrence α in the λσ-böhm tree of u such that there exists more than h + 1 occurrences of de Bruijn indexes k with k > q in the path of α. Let β be the h+1-th occurrence of such index. The occurrence β is not a leaf and hence it is accessible w.r.t. an equation of Φ, say (X[a 1... a p n ] c 1... c q )? λσ b. For each occurrence γ = s 1,..., s l, in the path of β, labeled with a de Bruijn index j with 1 j q, we have that c q j+1 is relevant in its r-th argument, where r = s l+1. Using Proposition 12 we conclude that there exists an occurrence β in the λσ-böhm tree of u[c q... c 1 n ] = λσ b such that β contains at least h + 1 occurrences and thus the length of β is at least h. Moreover, the labels of β and β are the same and hence β is not a leaf. In this case, the depth of b is greater than h which contradicts the hypothesis. Definition 25 (Compact λσ-term). A λσ-term t = λ C1... λ Cq.u (u atomic) is compact w.r.t. an interpolation problem Φ if no de Bruijn index j with 1 j q appears free in a path of the λσ-böhm tree of u more than h + 1 times, where h is the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ. Proposition 26. Let Φ be an interpolation problem, σ be an accessible solution to Φ, h be the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ and t = X σ = λ C1... λ Cq.u (u atomic). If α is an occurrence in the λσ-böhm tree of u that contains more than h + 1 free occurrences of the de Bruijn index j (1 j q) in its path, then: for all equations (X[a 1... a p n ] c 1... c q )? λσ b of Φ where the (h + 2)- th occurrence labeled with j is accessible w.r.t. this equation, the term c q j+1 is a projection, i.e., there exists an integer 1 r p such that c q j+1 = λ B1... λ Bp.r. Proof. Let β be the first occurrence with label j (1 j q) in the λσ-böhm tree of u that is in the path of α and suppose that the (h + 2)-th free occurrence of j in the path of α is accessible w.r.t. the equation (X[a 1... a p n ] c 1... c q ). If 13

14 α = β r β for some β then we have that c q j+1 is relevant in its r-th argument. If the head of c q j+1 is not first order then c q j+1 = 0 and, by Proposition 12, we have that there exists an occurrence α as long as the occurrence α in the λσ-böhm tree of u[c q... c 1 a 1... a p n ], where a 1,..., a p, c 1,..., c q are λσ-terms of at most second order and hence the depth of the λσ-böhm tree of u[c q... c 1 a 1... a p n ], which reduces to b, is at least h + 1 which is contradictory. Therefore, c q j+1 must be a λσ-term with depth equals to 0 and hence c q j+1 = λ B1... λ Bp.r. Definition 27. [Compact Accessible Solution built from an Accessible Solution] Let Φ be an interpolation problem, σ be an accessible solution to this problem and h be the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ. The grafting σ is a compact accessible solution built from an accessible solution to Φ if, for all meta-variable X occurring in Φ, the term t = X σ = λ C1... λ Cq.u (u atomic) is such that there is no path in the λσ-böhm tree of u containing more than h+1 occurrences labeled with the de Bruijn index j (1 j q). If there exists a path in the λσ-böhm tree of u that has more than h + 1 free occurrences of the de Bruijn index j (1 j q) then the compact accessible solution is built as follows: By Proposition 26, if these occurrences are accessible w.r.t. the equation (X[a 1... a p n ] c 1... c q ), we have that c q j+1 is of the form λ B1... λ Bp.r. In this case, we replace all these occurrences of j by λ B1... λ Bp.r. The compact accessible solution built from the accessible solution σ is denoted by σ. Proposition 28. Let Φ be an interpolation problem, σ a solution to Φ, σ be the accessible solution built from σ and σ be the compact accessible solution built from σ. Then σ is also a solution to Φ. Proof. The proof is similar to that of Proposition 23. Notice that, in the construction of the compact accessible solution, the replacement of j for the term c q j+1 occurs during the normalisation step of the term ((λ C1... λ Cq.u)[a 1... a p n ] c 1... c q ), where j occurs free in u. Proposition 29. Let Φ be an interpolation problem, σ be a solution to Φ, σ be the accessible solution built from σ and σ be the compact accessible solution built from σ. If h is the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ, then for every meta-variable X of arity q, the depth of the λσ-böhm tree of Xσ = λ C1... λ Cq.u is less than or equal to (n + 1)(h + 1) 1. Proof. By Def. 27 and Proposition 24, we know that a path in the λσ-böhm tree of u may have at most h + 1 occurrences of a free de Bruijn index j. Therefore, since X has arity q, a path in the λσ-böhm tree of u may have at most (q + 1)(h + 1) symbols, i.e., its depth is at most (q + 1)(h + 1) 1. Corollary 30. Let Φ be a third-order interpolation problem, σ be a solution to Φ, σ be the accessible solution built from σ and σ be the compact accessible solution built from σ. If h is the maximum depth in the λσ-böhm tree of the right-hand side of the equations of Φ, then for every meta-variable X of arity q, 14

15 the depth of the λσ-böhm tree of Xσ = λ C1... λ Cq.u is less than or equal to (n + 1)(h + 1) 1. Proposition 16 allows us to use the boundary of the solution of the interpolation problem in Corollary 30 for third-order matching problems. In this way we can build a decision procedure as follows: Theorem 31 (Decision procedure). The class of third-order λσ-matching problems that come from the simply typed λ-calculus is decidable. Proof. Let Ψ be a third-order matching problem in the λσ-calculus. Enumerate all ground substitutions for the meta-variables occurring in the equations of the form (X[a 1... a p n ] c 1... c q )? λσ b of Ψ, such that the terms to be substituted for X have depth less than or equal to (q + 1)(h + 1) 1, where h is the depth of the λσ-böhm tree of b. If none of these substitutions is a solution Φ then Φ is not solvable. Otherwise, it is solvable. 5 Conclusion We studied third-order matching problems in the λσ-calculus of explicit substitutions. Both matching and explicit substitutions are important tools in the implementation of higher order programming languages and proof assistants. Studies such as the one carried out in this paper, help to improve the design and implementation of languages based on the λ-calculus. Our main contributions can be summarized as follows: The notion of λσ-böhm trees for the λσ-calculus which extends the usual notion of Böhm trees. The extension of the decision algorithm of [Dow94] to the language of the λσ-calculus. We believe that this extension might be useful for developing implementations based on the simply typed λσ-calculus. Future work includes the analysis and comparison of third-order matching in different styles of explicit substitutions. References [ACCL91] M. Abadi, L. Cardelli, P.-L. Curien, and J.-J. Lévy. Explicit Substitutions. J. of Func. Programming, 1(4): , [db72] N.G. de Bruijn. Lambda-Calculus Notation with Nameless Dummies, a Tool for Automatic Formula Manipulation, with Application to the Church-Rosser Theorem. Indag. Mat., 34(5): , [DHK00] G. Dowek, T. Hardin, and C. Kirchner. Higher-order unification via explicit substitutions. Information and Computation, 157: , [dmkar05] F. L. C. de Moura, F. Kamareddine, and M. Ayala-Rincón. Second order matching via explicit substitutions. In F. Baader and A. Voronkov, editors, LPAR , volume Springer-Verlag, [Dow94] G. Dowek. Third-order matching is decidable. APAL 69: , [Río93] A. Ríos. Contributions à l étude de λ-calculs avec des substitutions explicites. Thèse de doctorat, Université Paris VII,

Comparing Calculi of Explicit Substitutions with Eta-reduction

Comparing Calculi of Explicit Substitutions with Eta-reduction Replace this file with prentcsmacro.sty for your meeting, or with entcsmacro.sty for your meeting. Both can be found at the ENTCS Macro Home Page. Comparing Calculi of Explicit Substitutions with Eta-reduction

More information

Intersection Type System with de Bruijn Indices

Intersection Type System with de Bruijn Indices Intersection Type System with de Bruijn Indices Daniel Lima Ventura 1 and Mauricio Ayala-Rincón 1 and Fairouz Kamareddine 2 1 Grupo de Teoria da Computação, Dep. de Matemática Universidade de Brasília,

More information

Comparing Calculi of Explicit Substitutions with Eta-reduction

Comparing Calculi of Explicit Substitutions with Eta-reduction Comparing Calculi of Explicit Substitutions with Eta-reduction Mauricio Ayala-Rincón 1, Flavio L. C. de Moura 1, and Fairouz Kamareddine 2 1 Departamento de Matemática, Universidade de Brasília, Brasília

More information

Dependent Types and Explicit Substitutions

Dependent Types and Explicit Substitutions NASA/CR-1999-209722 ICASE Report No. 99-43 Dependent Types and Explicit Substitutions César Muñoz ICASE, Hampton, Virginia Institute for Computer Applications in Science and Engineering NASA Langley Research

More information

Explicit Substitutions

Explicit Substitutions Explicit Substitutions M. Abadi L. Cardelli P.-L. Curien J.-J. Lévy September 18, 1996 Abstract The λσ-calculus is a refinement of the λ-calculus where substitutions are manipulated explicitly. The λσ-calculus

More information

Sequent Combinators: A Hilbert System for the Lambda Calculus

Sequent Combinators: A Hilbert System for the Lambda Calculus Sequent Combinators: A Hilbert System for the Lambda Calculus Healfdene Goguen Department of Computer Science, University of Edinburgh The King s Buildings, Edinburgh, EH9 3JZ, United Kingdom Fax: (+44)

More information

URL: 13 pages Eigenvariables, bracketing and the decidability of positive minimal intuitionistic log

URL:   13 pages Eigenvariables, bracketing and the decidability of positive minimal intuitionistic log URL: http://www.elsevier.nl/locate/entcs/volume85.html 13 pages Eigenvariables, bracketing and the decidability of positive minimal intuitionistic logic Gilles Dowek 1 École polytechnique and INRIA, LIX,

More information

A call-by-name lambda-calculus machine

A call-by-name lambda-calculus machine A call-by-name lambda-calculus machine Jean-Louis Krivine University Paris VII, C.N.R.S. 2 place Jussieu 75251 Paris cedex 05 (krivine@pps.jussieu.fr) Introduction We present, in this paper, a particularly

More information

Formalizing a Named Explicit Substitutions Calculus in Coq

Formalizing a Named Explicit Substitutions Calculus in Coq Formalizing a Named Explicit Substitutions Calculus in Coq Washington L. R. de C. Segundo 1, Flávio L. C. de Moura 1, Daniel L. Ventura 2 1 Departamento de Ciência da Computação Universidade de Brasília,

More information

Nominal Unification. Key words: Abstract Syntax, Alpha-Conversion, Binding Operations, Unification

Nominal Unification. Key words: Abstract Syntax, Alpha-Conversion, Binding Operations, Unification Nominal Unification Christian Urban a Andrew M. Pitts a Murdoch J. Gabbay b a University of Cambridge, Cambridge, UK b INRIA, Paris, France Abstract We present a generalisation of first-order unification

More information

Clausal Presentation of Theories in Deduction Modulo

Clausal Presentation of Theories in Deduction Modulo Gao JH. Clausal presentation of theories in deduction modulo. JOURNAL OF COMPUTER SCIENCE AND TECHNOL- OGY 28(6): 1085 1096 Nov. 2013. DOI 10.1007/s11390-013-1399-0 Clausal Presentation of Theories in

More information

Semantics with Intersection Types

Semantics with Intersection Types Semantics with Intersection Types Steffen van Bakel Department of Computing, Imperial College of Science, Technology and Medicine, 180 Queen s Gate, London SW7 2BZ, U.K., E-mail: svb@doc.ic.ac.uk (Sections

More information

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P. First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable

More information

Unification via Explicit Substitutions: The Case of Higher-Order Patterns

Unification via Explicit Substitutions: The Case of Higher-Order Patterns Unification via Explicit Substitutions: The Case of Higher-Order Patterns Gilles Dowek INRIA Rocquencourt B.P. 105 78153 Le Chesnay Cedex, France Gilles.Dowek@inria.fr Claude Kirchner INRIA Lorraine &

More information

Applied Logic for Computer Scientists. Answers to Some Exercises

Applied Logic for Computer Scientists. Answers to Some Exercises Applied Logic for Computer Scientists Computational Deduction and Formal Proofs Springer, 2017 doi: http://link.springer.com/book/10.1007%2f978-3-319-51653-0 Answers to Some Exercises Mauricio Ayala-Rincón

More information

Nominal Matching and Alpha-Equivalence (Extended Abstract)

Nominal Matching and Alpha-Equivalence (Extended Abstract) Nominal Matching and Alpha-Equivalence (Extended Abstract) Christophe Calvès and Maribel Fernández King s College London, Department of Computer Science, Strand, London WC2R 2LS, UK Christophe.Calves@kcl.ac.uk

More information

Universal Algebra for Termination of Higher-Order Rewriting. Makoto Hamana

Universal Algebra for Termination of Higher-Order Rewriting. Makoto Hamana Universal Algebra for Termination of Higher-Order Rewriting Makoto Hamana Department of Computer Science, Gunma University, Japan RTA 05 2005, April 1 Intro: First-Order Term Rewriting System (TRS) Terms

More information

Propositional and Predicate Logic - V

Propositional and Predicate Logic - V Propositional and Predicate Logic - V Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - V WS 2016/2017 1 / 21 Formal proof systems Hilbert s calculus

More information

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018

More information

Mary Southern and Gopalan Nadathur. This work was funded by NSF grant CCF

Mary Southern and Gopalan Nadathur. This work was funded by NSF grant CCF A Translation-Based Animation of Dependently-Typed Specifications From LF to hohh(and back again) Mary Southern and Gopalan Nadathur Department of Computer Science and Engineering University of Minnesota

More information

A simple proof that super-consistency implies cut elimination

A simple proof that super-consistency implies cut elimination A simple proof that super-consistency implies cut elimination Gilles Dowek 1 and Olivier Hermant 2 1 École polytechnique and INRIA, LIX, École polytechnique, 91128 Palaiseau Cedex, France gilles.dowek@polytechnique.edu

More information

Computational Logic for Computer Science

Computational Logic for Computer Science Motivation: formalization - proofs & deduction Computational proofs - logic & deduction Formal proofs Pr Computational Logic for Computer Science Mauricio Ayala-Rinco n & Fla vio L.C. de Moura Grupo de

More information

CHAPTER 2. FIRST ORDER LOGIC

CHAPTER 2. FIRST ORDER LOGIC CHAPTER 2. FIRST ORDER LOGIC 1. Introduction First order logic is a much richer system than sentential logic. Its interpretations include the usual structures of mathematics, and its sentences enable us

More information

Nominal Completion for Rewrite Systems with Binders

Nominal Completion for Rewrite Systems with Binders Nominal Completion for Rewrite Systems with Binders Maribel Fernández King s College London July 2012 Joint work with Albert Rubio Summary Motivations Nominal Rewriting Closed nominal rules Confluence

More information

On Sequent Calculi for Intuitionistic Propositional Logic

On Sequent Calculi for Intuitionistic Propositional Logic On Sequent Calculi for Intuitionistic Propositional Logic Vítězslav Švejdar Jan 29, 2005 The original publication is available at CMUC. Abstract The well-known Dyckoff s 1992 calculus/procedure for intuitionistic

More information

Principal Typings in a Restricted Intersection Type System for Beta Normal Forms with de Bruijn Indices

Principal Typings in a Restricted Intersection Type System for Beta Normal Forms with de Bruijn Indices Principal Typings in a Restricted Intersection Type System for Beta Normal Forms with de Bruijn Indices Daniel Lima Ventura 1 and Mauricio Ayala-Rincón 1 and Fairouz Kamareddine 2 1 Grupo de Teoria da

More information

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Reducibility proofs in λ-calculi with intersection types

Reducibility proofs in λ-calculi with intersection types Reducibility proofs in λ-calculi with intersection types Fairouz Kamareddine, Vincent Rahli, and J. B. Wells ULTRA group, Heriot-Watt University, http://www.macs.hw.ac.uk/ultra/ March 14, 2008 Abstract

More information

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing Cesare Tinelli tinelli@cs.uiowa.edu Department of Computer Science The University of Iowa Report No. 02-03 May 2002 i Cooperation

More information

Normalization by Evaluation

Normalization by Evaluation Normalization by Evaluation Andreas Abel Department of Computer Science and Engineering Chalmers and Gothenburg University PhD Seminar in Mathematical Engineering EAFIT University, Medellin, Colombia 9

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Today s class will be an introduction

More information

The Curry-Howard Isomorphism

The Curry-Howard Isomorphism The Curry-Howard Isomorphism Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) The Curry-Howard Isomorphism MFES 2008/09

More information

Proof Theoretical Studies on Semilattice Relevant Logics

Proof Theoretical Studies on Semilattice Relevant Logics Proof Theoretical Studies on Semilattice Relevant Logics Ryo Kashima Department of Mathematical and Computing Sciences Tokyo Institute of Technology Ookayama, Meguro, Tokyo 152-8552, Japan. e-mail: kashima@is.titech.ac.jp

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

Mathematical Logic Propositional Logic - Tableaux*

Mathematical Logic Propositional Logic - Tableaux* Mathematical Logic Propositional Logic - Tableaux* Fausto Giunchiglia and Mattia Fumagalli University of Trento *Originally by Luciano Serafini and Chiara Ghidini Modified by Fausto Giunchiglia and Mattia

More information

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Mauro Ferrari 1, Camillo Fiorentini 2 1 DiSTA, Univ. degli Studi dell Insubria, Varese, Italy 2 DI, Univ.

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

Five Basic Concepts of. Axiomatic Rewriting Theory

Five Basic Concepts of. Axiomatic Rewriting Theory Five Basic Concepts of Axiomatic Rewriting Theory Paul-André Melliès Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Université Paris Denis Diderot 5th International Workshop on Confluence

More information

Traditional and Non Traditional lambda calculi

Traditional and Non Traditional lambda calculi Strategies July 2009 Strategies Syntax Semantics Manipulating Expressions Variables and substitutions Free and bound variables Subterms and substitution Grafting and substitution Ordered list of variables

More information

Rewriting, Explicit Substitutions and Normalisation

Rewriting, Explicit Substitutions and Normalisation Rewriting, Explicit Substitutions and Normalisation XXXVI Escola de Verão do MAT Universidade de Brasilia Part 1/3 Eduardo Bonelli LIFIA (Fac. de Informática, UNLP, Arg.) and CONICET eduardo@lifia.info.unlp.edu.ar

More information

The Suspension Notation as a Calculus of Explicit Substitutions

The Suspension Notation as a Calculus of Explicit Substitutions The Suspension Notation as a Calculus of Explicit Substitutions Gopalan Nadathur Digital Technology Center and Department of Computer Science University of Minnesota [Joint work with D.S. Wilson and A.

More information

17.1 Correctness of First-Order Tableaux

17.1 Correctness of First-Order Tableaux Applied Logic Lecture 17: Correctness and Completeness of First-Order Tableaux CS 4860 Spring 2009 Tuesday, March 24, 2009 Now that we have introduced a proof calculus for first-order logic we have to

More information

The Lambda-Calculus Reduction System

The Lambda-Calculus Reduction System 2 The Lambda-Calculus Reduction System 2.1 Reduction Systems In this section we present basic notions on reduction systems. For a more detailed study see [Klop, 1992, Dershowitz and Jouannaud, 1990]. Definition

More information

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge Mathematical Synthesis of Equational Deduction Systems Marcelo Fiore Computer Laboratory University of Cambridge TLCA 2009 3.VII.2009 Context concrete theories meta-theories Context concrete theories meta-theories

More information

SKETCHY NOTES FOR WEEKS 7 AND 8

SKETCHY NOTES FOR WEEKS 7 AND 8 SKETCHY NOTES FOR WEEKS 7 AND 8 We are now ready to start work on the proof of the Completeness Theorem for first order logic. Before we start a couple of remarks are in order (1) When we studied propositional

More information

Relating Nominal and Higher-Order Pattern Unification

Relating Nominal and Higher-Order Pattern Unification Relating Nominal and Higher-Order Pattern Unification James Cheney University of Edinburgh UNIF 2005 April 22, 2005 1 Motivation Higher-order unification: studied since ca. 1970 Undecidable, infinitary,

More information

Automated Synthesis of Tableau Calculi

Automated Synthesis of Tableau Calculi Automated Synthesis of Tableau Calculi Renate A. Schmidt 1 and Dmitry Tishkovsky 1 School of Computer Science, The University of Manchester Abstract This paper presents a method for synthesising sound

More information

Reasoning with Higher-Order Abstract Syntax and Contexts: A Comparison

Reasoning with Higher-Order Abstract Syntax and Contexts: A Comparison 1 Reasoning with Higher-Order Abstract Syntax and Contexts: A Comparison Amy Felty University of Ottawa July 13, 2010 Joint work with Brigitte Pientka, McGill University 2 Comparing Systems We focus on

More information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

A Simplified Suspension Calculus and its Relationship to Other Explicit Substitution Calculi

A Simplified Suspension Calculus and its Relationship to Other Explicit Substitution Calculi A Simplified Suspension Calculus and its Relationship to Other Explicit Substitution Calculi Andrew Gacek and Gopalan Nadathur Digital Technology Center and Department of Computer Science and Engineering

More information

Complete Partial Orders, PCF, and Control

Complete Partial Orders, PCF, and Control Complete Partial Orders, PCF, and Control Andrew R. Plummer TIE Report Draft January 2010 Abstract We develop the theory of directed complete partial orders and complete partial orders. We review the syntax

More information

2.5.2 Basic CNF/DNF Transformation

2.5.2 Basic CNF/DNF Transformation 2.5. NORMAL FORMS 39 On the other hand, checking the unsatisfiability of CNF formulas or the validity of DNF formulas is conp-complete. For any propositional formula φ there is an equivalent formula in

More information

A Resolution Method for Modal Logic S5

A Resolution Method for Modal Logic S5 EPiC Series in Computer Science Volume 36, 2015, Pages 252 262 GCAI 2015. Global Conference on Artificial Intelligence A Resolution Method for Modal Logic S5 Yakoub Salhi and Michael Sioutis Université

More information

Classical Propositional Logic

Classical Propositional Logic The Language of A Henkin-style Proof for Natural Deduction January 16, 2013 The Language of A Henkin-style Proof for Natural Deduction Logic Logic is the science of inference. Given a body of information,

More information

07 Equational Logic and Algebraic Reasoning

07 Equational Logic and Algebraic Reasoning CAS 701 Fall 2004 07 Equational Logic and Algebraic Reasoning Instructor: W. M. Farmer Revised: 17 November 2004 1 What is Equational Logic? Equational logic is first-order logic restricted to languages

More information

Diagrams for Meaning Preservation

Diagrams for Meaning Preservation Diagrams for Meaning Preservation 2003-06-13 Joe Wells Detlef Plump Fairouz Kamareddine Heriot-Watt University University of York www.cee.hw.ac.uk/ultra www.cs.york.ac.uk/ det Diagrams for Meaning Preservation

More information

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang Overview of Topics Finite Model Theory Part 1: Introduction 1 What is finite model theory? 2 Connections to some areas in CS Qing Wang qing.wang@anu.edu.au Database theory Complexity theory 3 Basic definitions

More information

Decidability of SHI with transitive closure of roles

Decidability of SHI with transitive closure of roles 1/20 Decidability of SHI with transitive closure of roles Chan LE DUC INRIA Grenoble Rhône-Alpes - LIG 2/20 Example : Transitive Closure in Concept Axioms Devices have as their direct part a battery :

More information

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing Cesare Tinelli (tinelli@cs.uiowa.edu) Department of Computer Science The University of Iowa Iowa City, IA, USA Abstract. We propose

More information

Lazy Strong Normalization

Lazy Strong Normalization Lazy Strong Normalization Luca Paolini 1,2 Dipartimento di Informatica Università di Torino (ITALIA) Elaine Pimentel 1,2 Departamento de Matemática Universidade Federal de Minas Gerais (BRASIL) Dipartimento

More information

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy Reasoning in First Order Logic FBK-IRST, Trento, Italy April 12, 2013 Reasoning tasks in FOL Model checking Question: Is φ true in the interpretation I with the assignment a? Answer: Yes if I = φ[a]. No

More information

Local computation of β-reduction A concrete presentation of Game Semantics

Local computation of β-reduction A concrete presentation of Game Semantics 1 2 3 4 Local computation of β-reduction A concrete presentation of Game Semantics William Blum and C.H. Luke Ong Oxford University Computing Laboratory 5 6 Abstract We show that... Key words: Lambda calculus,

More information

Theoretical Computer Science 323 (2004) Nominal unication. Cambridge CB3 OFD, UK b INRIA, Paris, France

Theoretical Computer Science 323 (2004) Nominal unication. Cambridge CB3 OFD, UK b INRIA, Paris, France Theoretical Computer Science 323 (2004) 473 497 www.elsevier.com/locate/tcs Nominal unication Christian Urban a, Andrew M. Pitts a;, Murdoch J. Gabbay b a University of Cambridge, Marconi Laboratory, William

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

Value Iteration and Action ɛ-approximation of Optimal Policies in Discounted Markov Decision Processes

Value Iteration and Action ɛ-approximation of Optimal Policies in Discounted Markov Decision Processes Value Iteration and Action ɛ-approximation of Optimal Policies in Discounted Markov Decision Processes RAÚL MONTES-DE-OCA Departamento de Matemáticas Universidad Autónoma Metropolitana-Iztapalapa San Rafael

More information

Type Soundness for Path Polymorphism

Type Soundness for Path Polymorphism Type Soundness for Path Polymorphism Andrés Ezequiel Viso 1,2 joint work with Eduardo Bonelli 1,3 and Mauricio Ayala-Rincón 4 1 CONICET, Argentina 2 Departamento de Computación, FCEyN, UBA, Argentina 3

More information

Connection-Driven Inductive Theorem Proving

Connection-Driven Inductive Theorem Proving Connection-Driven Inductive Theorem Proving Christoph Kreitz (kreitz@cs.cornell.edu) Department of Computer Science, Cornell-University, Ithaca, NY 14853-7501, USA Brigitte Pientka (bp@cs.cmu.edu) Department

More information

Developing Modal Tableaux and Resolution Methods via First-Order Resolution

Developing Modal Tableaux and Resolution Methods via First-Order Resolution Developing Modal Tableaux and Resolution Methods via First-Order Resolution Renate Schmidt University of Manchester Reference: Advances in Modal Logic, Vol. 6 (2006) Modal logic: Background Established

More information

185.A09 Advanced Mathematical Logic

185.A09 Advanced Mathematical Logic 185.A09 Advanced Mathematical Logic www.volny.cz/behounek/logic/teaching/mathlog13 Libor Běhounek, behounek@cs.cas.cz Lecture #1, October 15, 2013 Organizational matters Study materials will be posted

More information

Decidable Subsets of CCS

Decidable Subsets of CCS Decidable Subsets of CCS based on the paper with the same title by Christensen, Hirshfeld and Moller from 1994 Sven Dziadek Abstract Process algebra is a very interesting framework for describing and analyzing

More information

Determining Unify-Stable Presentations (long version)

Determining Unify-Stable Presentations (long version) Determining Unify-Stable Presentations (long version) Thierry Boy de la Tour 1 and Mnacho Echenim 2 1 CNRS - Laboratoire d Informatique de Grenoble, France Thierry.Boy-de-la-Tour@imag.fr 2 Dipartimento

More information

A Goal-Oriented Algorithm for Unification in EL w.r.t. Cycle-Restricted TBoxes

A Goal-Oriented Algorithm for Unification in EL w.r.t. Cycle-Restricted TBoxes A Goal-Oriented Algorithm for Unification in EL w.r.t. Cycle-Restricted TBoxes Franz Baader, Stefan Borgwardt, and Barbara Morawska {baader,stefborg,morawska}@tcs.inf.tu-dresden.de Theoretical Computer

More information

Intersection Types for

Intersection Types for Intersection Types for -Trees Steffen van Bakel Franco Barbanera Mariangiola Dezani-Ciancaglini Fer-Jan de Vries Department of Computing, Imperial College, 180 Queen s Gate, London SW7 2BZ, UK E-mail:

More information

The Logic of Proofs, Semantically

The Logic of Proofs, Semantically The Logic of Proofs, Semantically Melvin Fitting Dept. Mathematics and Computer Science Lehman College (CUNY), 250 Bedford Park Boulevard West Bronx, NY 10468-1589 e-mail: fitting@lehman.cuny.edu web page:

More information

Outline. Overview. Introduction. Well-Founded Monotone Algebras. Monotone algebras. Polynomial Interpretations. Dependency Pairs

Outline. Overview. Introduction. Well-Founded Monotone Algebras. Monotone algebras. Polynomial Interpretations. Dependency Pairs Overview Lecture 1: Introduction, Abstract Rewriting Lecture 2: Term Rewriting Lecture 3: Combinatory Logic Lecture 4: Termination Lecture 5: Matching, Unification Lecture 6: Equational Reasoning, Completion

More information

Lupe Latin squares of order odd, 3-odd, A 2 + 3B 2 with gcm(a, B) = 1

Lupe Latin squares of order odd, 3-odd, A 2 + 3B 2 with gcm(a, B) = 1 Toyama Math. J. Vol. 34(2011), 1-22 Lupe Latin squares of order odd, 3-odd, A 2 + 3B 2 with gcm(a, B) = 1 Kazuo Azukawa Abstract. Let p be an odd integer which is written as p = A 2 + 3B 2 with gcm(a,

More information

1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15

1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15 1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15 For example, if L is reducible to L and L P then L P. A decision problem is NP-hard if every problem in NP is polynomial time reducible to it. A decision problem

More information

Power of controlled insertion and deletion

Power of controlled insertion and deletion Power of controlled insertion and deletion Lila Kari Academy of Finland and Department of Mathematics 1 University of Turku 20500 Turku Finland Abstract The paper investigates classes of languages obtained

More information

Introduction to lambda calculus Part 6

Introduction to lambda calculus Part 6 Introduction to lambda calculus Part 6 Antti-Juhani Kaijanaho 2017-02-16 1 Untyped lambda calculus 2 Typed lambda calculi 2.1 Dynamically typed lambda calculus with integers 2.2 A model of Lisp 2.3 Simply

More information

CMPS 217 Logic in Computer Science. Lecture #17

CMPS 217 Logic in Computer Science.   Lecture #17 CMPS 217 Logic in Computer Science https://courses.soe.ucsc.edu/courses/cmps217/spring13/01 Lecture #17 1 The Complexity of FO-Truth on a Structure Structure A Complexity of Th(A) Structure of the natural

More information

hal , version 1-21 Oct 2009

hal , version 1-21 Oct 2009 ON SKOLEMISING ZERMELO S SET THEORY ALEXANDRE MIQUEL Abstract. We give a Skolemised presentation of Zermelo s set theory (with notations for comprehension, powerset, etc.) and show that this presentation

More information

The Many Faces of Modal Logic Day 4: Structural Proof Theory

The Many Faces of Modal Logic Day 4: Structural Proof Theory The Many Faces of Modal Logic Day 4: Structural Proof Theory Dirk Pattinson Australian National University, Canberra (Slides based on a NASSLLI 2014 Tutorial and are joint work with Lutz Schröder) LAC

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2017 Fall Hakjoo Oh COSE212 2017 Fall, Lecture 1 September 4, 2017 1 / 9 Inductive Definitions Inductive definition (induction)

More information

COMP6463: λ-calculus

COMP6463: λ-calculus COMP6463: λ-calculus 1. Basics Michael Norrish Michael.Norrish@nicta.com.au Canberra Research Lab., NICTA Semester 2, 2015 Outline Introduction Lambda Calculus Terms Alpha Equivalence Substitution Dynamics

More information

Optimal Tableau Systems for Propositional Neighborhood Logic over All, Dense, and Discrete Linear Orders

Optimal Tableau Systems for Propositional Neighborhood Logic over All, Dense, and Discrete Linear Orders Optimal Tableau Systems for Propositional Neighborhood Logic over All, Dense, and Discrete Linear Orders Davide Bresolin 1, Angelo Montanari 2, Pietro Sala 1, and Guido Sciavicco 34 1 Department of Computer

More information

Hypersequent Calculi for some Intermediate Logics with Bounded Kripke Models

Hypersequent Calculi for some Intermediate Logics with Bounded Kripke Models Hypersequent Calculi for some Intermediate Logics with Bounded Kripke Models Agata Ciabattoni Mauro Ferrari Abstract In this paper we define cut-free hypersequent calculi for some intermediate logics semantically

More information

Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus

Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus Forcing-based cut-elimination for Gentzen-style intuitionistic sequent calculus Hugo Herbelin 1 and Gyesik Lee 2 1 INRIA & PPS, Paris Université 7 Paris, France Hugo.Herbelin@inria.fr 2 ROSAEC center,

More information

Math 225A Model Theory. Speirs, Martin

Math 225A Model Theory. Speirs, Martin Math 225A Model Theory Speirs, Martin Autumn 2013 General Information These notes are based on a course in Metamathematics taught by Professor Thomas Scanlon at UC Berkeley in the Autumn of 2013. The course

More information

Rules and derivations in an elementary logic course arxiv: v1 [cs.lo] 7 Jan 2016

Rules and derivations in an elementary logic course arxiv: v1 [cs.lo] 7 Jan 2016 Rules and derivations in an elementary logic course arxiv:160101483v1 [cslo] 7 Jan 2016 Gilles Dowek Inria, 23 avenue d Italie, CS 81321, 75214 Paris Cedex 13, France gillesdowek@inriafr When teaching

More information

On the Correctness of the Krivine Machine

On the Correctness of the Krivine Machine On the Correctness of the Krivine Machine Mitchell Wand Northeastern University 2003-10-03 15:55:00 wand October 3, 2003 Abstract We provide a short proof of the correctness of the Krivine machine by showing

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

Random Reals à la Chaitin with or without prefix-freeness

Random Reals à la Chaitin with or without prefix-freeness Random Reals à la Chaitin with or without prefix-freeness Verónica Becher Departamento de Computación, FCEyN Universidad de Buenos Aires - CONICET Argentina vbecher@dc.uba.ar Serge Grigorieff LIAFA, Université

More information

Grammatical resources: logic, structure and control

Grammatical resources: logic, structure and control Grammatical resources: logic, structure and control Michael Moortgat & Dick Oehrle 1 Grammatical composition.................................. 5 1.1 Grammar logic: the vocabulary.......................

More information

Orthogonality and Boolean Algebras for Deduction Modulo

Orthogonality and Boolean Algebras for Deduction Modulo Orthogonality and Boolean Algebras for Deduction Modulo Aloïs Brunel 1, Olivier Hermant 2, and Clément Houtmann 3 1 ENS de Lyon, Alois.Brunel@ens-lyon.org 2 ISEP, Olivier.Hermant@isep.fr 3 INRIA Saclay,

More information

Deciding Validity in a Spatial Logic for Trees

Deciding Validity in a Spatial Logic for Trees Under consideration for publication in J. Functional Programming 1 Deciding Validity in a Spatial Logic for Trees Cristiano Calcagno Imperial College London Luca Cardelli, Andrew D. Gordon Microsoft Research

More information

Towards Correctness of Program Transformations Through Unification and Critical Pair Computation

Towards Correctness of Program Transformations Through Unification and Critical Pair Computation Towards Correctness of Program Transformations Through Unification and Critical Pair Computation Conrad Rau and Manfred Schmidt-Schauß Institut für Informatik Johann Wolfgang Goethe-Universität Postfach

More information

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

Computation Tree Logic (CTL) & Basic Model Checking Algorithms Computation Tree Logic (CTL) & Basic Model Checking Algorithms Martin Fränzle Carl von Ossietzky Universität Dpt. of Computing Science Res. Grp. Hybride Systeme Oldenburg, Germany 02917: CTL & Model Checking

More information

A General Type for Storage Operators

A General Type for Storage Operators A General Type for Storage Operators Karim NOUR LAMA - Equipe de Logique, Université de Chambéry 73376 Le Bourget du Lac e-mail nour@univ-savoie.fr Abstract In 1990, J.L. Krivine introduced the notion

More information

Handout: Proof of the completeness theorem

Handout: Proof of the completeness theorem MATH 457 Introduction to Mathematical Logic Spring 2016 Dr. Jason Rute Handout: Proof of the completeness theorem Gödel s Compactness Theorem 1930. For a set Γ of wffs and a wff ϕ, we have the following.

More information