Semantics with Intersection Types

Size: px
Start display at page:

Download "Semantics with Intersection Types"

Transcription

1 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., svb@doc.ic.ac.uk (Sections 4 through 7 are based on a paper co-authored by Maribel Fernández, of King s College, London.) Contents 1 Type assignment Eta reduction Subject reduction and expansion Approximation and normalization results Approximants Approximation result Principal pairs and Semantics Normalization results Strong normalisation Semantics and completeness Filter models Soundness and completeness of type assignment Combinator Systems CS versus LC Type assignment for CS Operations on types Type assignment Subject reduction Derivation reduction is strongly normalising Approximants Approximation and normalization Semantics The relation = R : equating terms through R The relation R : = R and equating unsolvables The relation hnf R : full-abstraction Filter semantics and full abstraction These notes contain material that appeared before, in slightly different form, in [1], [3], and [9] 1

2 Introduction In the recent years several notions of type assignment for several (extended) lambda calculi have been studied. The oldest among these is a well understood and elegantly defined notion of type assignment on lambda terms, known as the Curry type assignment system [18]. It expresses abstraction and application, and can be used to obtain a (basic) functional characterization of terms. It is well known that in that system, the problem of typeability Given a term M, are there a basis B and a type σ such that B M :σ? is decidable, and that it has the principal type property: If M is typeable, then there are P, π such that P M :π, and, for every B, σ such that B M :σ, there exist a way of generating B, σ from P, π. These two properties found their way into programming, mainly through the pioneering work of R. Milner [36]. He introduced a functional programming language ML, of which the underlying type system is an extension of Curry s system. The extension consists of the introduction of polymorphic functions, i.e. functions that can be applied to various kinds of arguments, even of incomparable type. The formal motivation of this concept lies directly in the notion of principal types. Though the Curry system is already powerful and convenient for use in programming practice, it has drawbacks. It is, for example, not possible to assign a type to the term (λx.xx), and terms that are β-equal can have different principal type schemes. The Intersection Type Discipline as presented in [14] by M. Coppo, M. Dezani-Ciancaglini, and B. Venneri (a more enhanced system was presented in [11] by H. Barendregt, M. Coppo, and M. Dezani-Ciancaglini) is an extension of Curry s system that does not have these drawbacks. The extension being made consists mainly of allowing for term variables (and terms) to have more than one type. Intersection types are constructed by adding, next to the type constructor of Curry s system, the type constructor and the type constant ω. This slight generalization causes a great change in complexity; in fact, now all terms having a (head) normal form can be characterized by their assignable types, a property that immediately shows that type assignment (even in the system that does not contain ω, see [1]) is undecidable. Also, by introducing this extension a system is obtained that is closed under β-equality: if B M :σ and M = β N, then B N :σ. The type assignment system presented in [11] (the BCD-system) is based on the system as presented in [14]. It defines the set of intersection types in a more general way by treating as a general type constructor, and introduces two derivation rules for introduction and elimination of intersections; the handling of intersection in this way is inspired by the similarity between intersection and logical conjunction. A big contribution of [11] to the theory of intersection types is the introduction of a filter λ-model and the proof of completeness of type assignment; to achieve the latter, the system is strengthened further by introducing a partial order relation on types as well as adding the type assignment rule ( ). A disadvantage of the BCD-system (and of any real intersection system, for that matter) is that type assignment in this system is undecidable. In recent years, some decidable restrictions have been studied. The first was the Rank2 intersection type assignment system [4], as first suggested by D. Leivant in [34], that is very close to the notion of type assignment as used in ML. The key idea for this system is to restrict the set of types to those of the shape ((σ 1 σ n ) τ), where the σ i (i n) are types that do not contain intersections. 2

3 That intersection types can be used as a basis for programming languages was first discussed by J. Reynolds in [40]. This led to the development of the (typed) programming language Forsythe [41], and to the work of B.C. Pierce [38, 39], who studied intersection types and bounded polymorphism in the field of typed lambda calculi. Because there only typed systems are considered, the systems are decidable. Another disadvantage of the BCD-system is that it is too general: in this system there are several ways to deduce a desired result, due to the presence of the derivation rules ( I), ( E) and ( ). These rules not only allow of superfluous steps in derivations, but also make it possible to give essentially different derivations for the same result. Moreover, in [11] the relation induced an equivalence relation on types. Equivalence classes are big (for example: ω (σ ω), for all types σ) and type assignment is closed for. The BCD-system has the principal type property, as was shown in [42]; although for every M the set { B, σ B M :σ} can be generated using operations specified in [42], the problem of type-checking Given a term M and type σ, is there a basis B such that B M :σ? is complicated. This is not only due to the undecidability of the problem, but even a semialgorithm is difficult to define, due to the equivalence relation on types. Moreover, because of the general treatment of intersection types, the sequence of operations needed to go from one type to another is normally not unique. The strict type assignment system as defined in [1] is a restriction of the system of [11]; it uses a set of strict types, that is actually the set of normalized tail-proper types of [14]. Although there are rather strong restrictions imposed, the provable results for the strict system are very close to those for the system of [11]. For example, the sets of normalizable terms and those having a normal form can be equally elegantly characterized. The main difference between the two systems is that the strict system is not closed for η-reduction, whereas the BCD-system is. The strict system gives rise to a strict filter λ-model that satisfies all major properties of the filter λ-model as presented in [11], but is an essentially different λ-model, equivalent to Engeler s model D A [22]. In [1] was shown that soundness for the notion of type assignment of [11] is lost if instead of simple type semantics, the inference type semantics is used. With the use of the inference type semantics, in [1] soundness and completeness for strict type assignment was proved, without having the necessity of introducing. The set of types assignable to a term M in the strict system is significantly smaller than the set of types assignable to M in the BCD-system. In particular, the problem of type checking for the strict system is, because of the smaller equivalence classes, less complicated than for the BCD-system. The type assignment system as presented here was first presented in [3] (albeit in different notation), and is a true restriction of the BCD-system that satisfies all properties of that system, and is also an extension of Curry s system. It will be shown that, in order to prove a completeness result using intersection types, there is no need to be as general as in [11]; this result can also be obtained for the system presented here. The main advantage of this system over the BCD-system is that the set of types assignable to a term is significantly smaller. An other advantage of the system is that derivations are syntax-directed: there is, unlike in the BCD-system, a one-one relationship between terms and skeletons of derivations. These two features are supported by a less complicated type structure. 3

4 The system presented here is also an extension of the strict type assignment system as presented in [1]. The major difference is that the system will prove to be closed for η-reduction: If B M :σ and M η N, then B N :σ. This does not hold for the strict system. Some results already known for, for example, the BCD-system, hold for the system. If B M :σ and M η N, then B N :σ. If B M :σ and M = β N, then B N :σ. B M :σ and σ ω, if and only if M has a head normal form. B M :σ and ω does not occur in B and σ, if and only if M has a normal form. has the principal type property. The first four of these properties will be reviewed here; for the last, see [3]. Notations In these notes, the symbol ϕ will be a type-variable; Greek symbols like α, β, µ, ρ, σ, and τ will range over types, and π will be used for principal types. will be assumed to associate to the right, and binds stronger than. M, N are used for lambda terms; C, D, E for (arbitrary) combinators, C, D, E for concrete combinators, and t, u, v for terms in Combinator Systems; x, y, z for term-variables, M[N/x] for the usual operation of substitution on lambda terms, A for terms in Λ -normal form, and a for approximants of combinator systems. B is used for bases, B\x for the basis obtained from B by erasing the statement that has x as subject, and P for principal bases. All symbols can appear indexed. We will write n for the set {1,..., n}, and will often use a vector notation for the purpose of abbreviation. For example, P M i stands for P M1 M n for a suitable n, and [N 1 /x 1,..., N n /x n ] is abbreviated by [N i /x i]. Two types (bases, pairs of basis and type) are disjoint if and only if they have no typevariables in common. Notions of type assignment are defined as ternary relations on bases, terms, and types, that are denoted by, possibly indexed if necessary. If in a notion of type assignment for M there are basis B and type σ such that B M :σ, then M is typed with σ, and σ is assigned to M. 1 Type assignment In this section a notion of type assignment system is presented that is a restricted version of the BCD-system presented in [11], together with some of its properties. The major feature of this restricted system is, compared to the BCD-system, a restricted version of the derivation rules and the use of strict types. It also forms a slight extension of the strict type assignment system that was presented in [1]; the main difference is that the strict system is not closed for η-reduction, whereas the system presented here is. Strict types are the types that are strictly needed to assign a type to a term in the BCDsystem. In the set of strict types, intersection type schemes and the type constant ω play a limited role. In particular, ω is taken to be the empty intersection: if n = 0, then n σ i ω, so ω does not occur in an intersection subtype. Moreover, intersection type schemes (so also ω) occur in strict types only as subtypes at the left-hand side of an arrow type scheme, as in the types of [12], [13], and [14]. 4

5 Definition 1.1 (TYPES) i) Let Φ be a countable (infinite) set of type-variables, ranged over by ϕ. T s, the set of strict types, and the set T of intersection types, both ranged over by σ, τ,..., are defined through: T s ::= ϕ (T T s ) T ::= (T s T s ) We will write ω for an intersection of zero strict types, and n σ i for the type σ 1 σ n ; we will also, as usual, omit right-most, outer-most brackets. ii) A statement is an expression of the form M :σ, with M Λ, and σ T. M is the subject and σ the predicate of M :σ. iii) The relation is defined as the least pre-order (i.e. reflexive and transitive relation) on T such that: n σ i σ i, for all i n τ σ i, for all i n τ n σ i ρ σ & τ µ σ τ ρ µ iv) On T, the relation is defined by: σ τ σ τ σ. Notice that σ ω, for all σ. Unless stated otherwise, if a type is written as n σ i, then all σ i (i n) are assumed to be strict. For the relation, the following properties hold: Lemma 1.2 i) σ τ σ τ. ii) ϕ σ σ ϕ. So {σ σ ϕ} = {ϕ}. iii) ω σ σ ω. So {σ σ ω} = {ω}. iv) σ τ ρ T s α T, β T s [ρ α β & α σ & τ β]. v) n σ i τ T s i n [σ i τ]. vi) σ τ σ i (i n), τ j (j m) [σ = n σ i & τ = m τ j & j m i n [σ i τ j ]]. Proof: Easy. Definition 1.3 (BASES) i) A basis is a partial mapping from term variables to types, normally written as a set of statements of the shape x:σ. ii) If B i (i n) are bases, then {B 1,..., B n } (or {n}b i ) is the basis defined as follows: x: m σ i {n}b i if and only if {x:σ 1,..., x:σ m } is the set of all statements about x that occur in B 1... B n. iii) B B if and only if for every x:σ B there is an x:σ B such that σ σ, and B B B B B. Often B {x:σ} (or B, x:σ) will be written for the basis {B, {x:σ}}, when x does not occur in B. Definition 1.4 (TYPE ASSIGNMENT) Type assignment and derivations are defined by the following natural deduction system (where all types displayed are strict, except for σ in the rule 5

6 (Ax), ( E) and ( I)): (Ax) : (σ τ T s ) B, x:σ x:τ ( I) : B, x:σ M :τ B λx.m :σ τ (σ T ) ( I) : B M :σ 1 B M :σ n (n 0) B M : n σ i ( E) : B M :σ τ B N :σ B MN :τ B M :σ is used if this statement is derivable using a strict intersection derivation, and D :: B M :σ specifies that this result was obtained through the derivation D. For this notion of type assignment, the following properties hold: Lemma 1.5 i) B x:σ ρ T [x:ρ B & ρ σ]. ii) B MN :σ & σ T s τ T [B M :τ σ & B N :τ]. iii) B λx.m :σ ρ T, µ T s [σ = ρ µ & B, x:ρ M :µ]. iv) B M :σ & σ T σ i (i n) [σ = n σ i & i n [B M :σ i ]]. v) B M :σ {x:τ B x fv(m)} M :σ. vi) B M :σ & B B B M :σ. vii) B M :σ {x:ρ x:ρ B & x fv(m)} M :σ. Proof: Easy. 1.1 Eta reduction Although the rule (Ax) is defined only for term-variables, is closed for and weakening. Lemma 1.6 (WEAKENING) is an admissible rule in : If B M :σ and B B, σ τ, then B M :τ, so the following ( ) : B M :σ (B B, σ τ) B M :τ Proof: By induction on. (Ax) : Then M x, and there is x:ρ B such that ρ σ. Since B B, there is x:µ B such that µ ρ. Notice that µ ρ σ τ, so, by Lemma 1.5(i), B x:τ. ( I) : Then M λx.m, and there are ρ T, µ T s such that σ = ρ µ and B, x:ρ M :µ. By Lemma 1.2(vi) & (iv) there are ρ i, µ i (i n) such that τ = n (ρ i µ i ), and for i n, ρ i ρ and µ µ i. Since B B and ρ i ρ, also B, x:ρ i B, x:ρ, and by induction B, x:ρ i M :µ i. So, by ( I), for every i n, B λx.m :ρ i µ i, so, by ( I), B λx.m :τ. ( E) : Then M M 1 M 2 and there is a µ T such that B M 1 :µ σ and B M 2 :µ. Since σ τ, also µ σ µ τ and, by induction, B M 1 :µ τ. Then, by ( E), B M 1 M 2 :τ. ( I) : Then σ = n σ i, and, for every i n, B M :σ i. By Lemma 1.2(vi), there are τ j (j m) such that τ = m τ j and, for every j m, there is a i n such that σ i τ j. By induction, for every j m, B M :τ j. But then, by ( I), B M :τ. 6

7 Now it is easy to prove that type assignment in this system is closed under η-reduction. The proof for this result is split in two parts, Lemma 1.7 and Theorem 1.8. The lemma is also used in the proof of Lemma 2.7. Lemma 1.7 If τ T s, B, x:σ Mx:τ and x fv(m) then B M :σ τ. Proof: τ T s & B, x:σ Mx:τ & x fv(m) ( E) µ [B, x:σ M :µ τ & B, x:σ x:µ & x fv(m)] (1.5(i)) µ [B, x:σ M :µ τ & σ µ & x fv(m)] (1.5(vii)) µ [B M :µ τ & σ µ] (1.1(iii)) µ [B M :µ τ & µ τ σ τ] (1.6) B M :σ τ. Theorem 1.8 ( CLOSED FOR η-reduction) If B M :σ and M η N, then B N :σ. Proof: By induction on the definition of η, of which only the part λx.mx η M is shown, where x does not occur free in M. The other parts are dealt with by straightforward induction. (σ T s ) : Then: B λx.mx:σ & x fv(m) ( I) ρ, µ [σ = ρ µ & B, x:ρ Mx:µ] (1.7) B M :σ. (σ = n σ i ) : Then, by ( I), B λx.mx:σ i for all i n, so, by the previous part, B M :σ i, so, by ( I), B M :σ. By the structure of this proof, below we will normally focus on strict types when proving properties. For example, λxy.xy:(σ τ) σ ρ τ and λx.x:(σ τ) σ ρ τ are both easy to derive. x:σ τ, y:σ ρ x:σ τ x:σ τ, y:σ ρ xy:τ x:σ τ λy.xy:σ ρ τ λxy.xy:(σ τ) σ ρ τ (σ ρ σ) x:σ τ, y:σ ρ y:σ x:σ τ x:σ ρ τ λx.x:(σ τ) σ ρ τ (σ τ σ ρ τ) 1.2 Subject reduction and expansion As in [13, 11, 1], it is possible to prove that the type assignment system is closed under = β. In the latter two papers this result was obtained by building a filter λ-model; from the fact that every M is interpreted by the set of its assignable types, and that set is a filter, the result is then immediate (see also Corollary 3.13). In this paper the result will first be obtained directly, without constructing a filter model; in this way the precise behaviour of the type constructor and the type constant ω can be made apparent. That the system is closed under subject reduction can be illustrated also by the following Cut and Paste proof: Suppose that B (λx.m)n :σ, with σ T s. By ( E), there exists τ 7

8 such that B λx.m :τ σ and B N :τ. Since ( I) should be the last step performed for the first result, also B, x:τ M :σ and B N :τ. Now there are (strict) types ρ j (j m) such that, for every ρ j, in the first derivation, there exists a sub-derivation of the shape B, x:τ x:ρ j and these are all the applications of rule (Ax) that deal with x. Then, for all j m, τ ρ j and, by Lemma 1.6, B N :ρ j. Then a derivation for B M[N/x]: σ can be obtained by replacing, for every j m, in the derivation for B, x:τ M :σ, the sub-derivation B, x:τ x:ρ j by the (new) derivation for B N :ρ j. The problem to solve in a proof for closure under β-equality is then that of β-expansion: (Ax) if B M[N/x]: σ, then B (λx.m)n :σ. Assume that the term-variable x occurs in M and the term N is a sub-term of M[N/x], so N is typed in the derivation for D :: B M[N/x]: σ, probably with several different types σ i (i n). A derivation for B, x: n σ i M :σ can be obtained by replacing, in D, all derivations for B N :σ i by the derivation for {x: n σ i } x:σ i. Then, using ( I), B N : n σ i, and, using ( I), B λx.m : n σ i σ. Then, using ( E), the redex can be typed. When the term-variable x does not occur in M, the term N is a not a sub-term of M[N/x] and B M[N/x]: σ stands for B M :σ. In this case, the type ω is used: since x does not occur in M, x:ω can be assumed to appear in B, and rule ( I) gives B λx.m :ω σ. By ( I), B N :ω, so, using ( E), the redex can be typed. To show this result formally, first a substitution lemma is proved. Notice that, unlike for many other notions of type assignment (Curry s system, the polymorphic type discipline [24]), the implication holds in both directions. Lemma 1.9 (SUBSTITUTION LEMMA) ρ [B, x:ρ M :σ & B N : ρ] B M[N/x]: σ. Proof: By induction on M. Only the case σ T s is considered. (M x) : ( ) : ρ [B, x:ρ x:σ & B N :ρ] (1.5(i)) ρ [ρ σ & B N :ρ] (1.6) B x[n/x]: σ. ( ) : B x[n/x]: σ B N :σ; take ρ = σ. (M y x) : ( ) : By Lemma 1.5(vii), since y[n/x] y. ( ) : B y[n/x]: σ B y:σ; take ρ = ω. 8

9 (M λy.m ) : ( ) : ρ [B, x:ρ λy.m :σ & B N :ρ] ( I) ρ, α, β [B, x:ρ, y:α M :β & σ = α β & B N :ρ] (IH) α, β [B, y:α M[N/x]: β & σ = α β] ( I) B λy.(m[n/x]): σ B (λy.m)[n/x]: σ. (M M 1 M 2 ) : ( ) : ρ [B, x:ρ M 1 M 2 :σ & B N :ρ] ( E) ρ, τ [B, x:ρ M 1 :τ σ & B, x:ρ M 2 :τ & B N :ρ] (IH) τ [B M 1 [N/x]: τ σ & B M 2 [N/x]: τ] ( E) B M 1 [N/x]M 2 [N/x]: σ B (M 1 M 2 )[N/x]: σ ( ) : B M 1 M 2 [N/x]: σ B M 1 [N/x]M 2 [N/x]: σ ( E) τ [B M 1 [N/x]: τ σ & B M 2 [N/x]: τ] (IH) ρ 1, ρ 2, τ [B, x:ρ i M 1 :τ σ & B N :ρ 1 & B, x:ρ 2 M 2 :τ & B N :ρ 2 ] (ρ = ρ 1 ρ 2 & ( I) & 1.5(vi)) ρ [B, x:ρ M 1 M 2 :σ & B N :ρ]. Theorem 1.10 ( CLOSED FOR = β ) M = β N (B M :σ B N :σ), so the following rule is an admissible rule in : (= β ) : B M :σ (M = β N) B N :σ Proof: By induction on the definition of = β. The only part that needs attention is that of a redex, B (λx.m)n :σ B M[N/x]: σ, where σ T s ; all other cases follow by straightforward induction. To conclude, notice that, if B (λx.m)n :σ, then, by ( E) and ( I), there exists a ρ such that B, x:ρ M :σ and B N :ρ; the converse of this result holds, obviously, as well. The result then follows by applying Lemma Approximation and normalization results In [42] an approximation theorem is proved for the BCD-system, that formulates the relation between the types assignable to a term and those assignable to its approximants, as defined in [46] (see Definition 2.1 below): B M :σ if and only if there exists A A(M) such that B A:σ. In this section, we will show this property for the system presented here. In [42] this result is obtained through a normalization of derivations, where all ( I) ( E) pairs, that derive a type for a redex (λx.m)n, are replaced by one for its reduct M[N/x], and all pairs of ( I) ( E) are eliminated. (This technique is also used in [13] and [11]. It requires a rather difficult notion of length of a derivation to show that this process terminates.) In this paper, the approximation theorem will be proved using the reducibility technique, following Tait [44], as was done in [15], and [20]. With this result, it can be shown that the BCD-system is conservative over the system presented here, and proven that the set of all terms having a (head) normal form are typeable in (with a type without ω-occurrences) (Theorem 2.21). 9

10 2.1 Approximants The notion of approximant was first presented by C. Wadsworth [46] and is defined using the notion of terms in Λ -normal form (like in [10], is used, instead of Ω; also, the symbol is used as a relation on Λ -terms, inspired by a similar relation defined on Böhm-trees in [10]). Definition 2.1 (APPROXIMATE NORMAL FORMS) i) The set of Λ -terms is defined as the set Λ of lambda terms, extended by: Λ. ii) The notion of reduction β is defined as β, extended by: λx. β M β iii) The set of normal forms for elements of Λ with respect to β is the set N of Λ normal forms or approximate normal forms, ranged over by A and is defined by: A ::= λx.a (A ) xa i (n 0) The type assignment rules of the system are generalized to terms containing by allowing for the terms to be elements of Λ. This implies that, because type assignment is almost syntax directed, if occurs in a term M and B M :σ, then either σ = ω, or in the derivation for M :σ, appears in the right hand sub-term of an application, and this right-hand term is typed with ω. Moreover, the terms λx. and M i are typeable by ω only. Definition 2.2 (APPROXIMANTS) and reflexive closure of: i) The partial order (Λ ) 2 is defined as the transitive M M M λx.m λx.m M 1 M 1 & M 2 M 2 M 1 M 2 M 1M 2 ii) For A N, M Λ, if A M, then A is a direct approximant of M. iii) The relation N Λ is defined by: A M M = β M [A M ]. iv) If A M, then A is an approximant of M. v) A(M) = {A N A M}. Lemma 2.3 B M :σ & M M B M :σ. Proof: By easy induction on the definition of ; the base case, M, follows from the fact that then σ = ω. The following properties of approximants hold: Lemma 2.4 i) If A A(xM i) and A A(N), then AA A(xM in). ii) If A A(Mz) and z fv(m), then either: A A z, z fv(a), and A A(M), or λz.a A(M). iii) If M = β N, then A(M) = A(N). 10

11 Proof: Easy. The following definition introduces an operation of join on Λ -terms. Definition 2.5 i) On Λ, the partial mapping join, : Λ Λ Λ, is defined by: M M M x x x (λx.m) (λx.n) λx.(m N) (M 1 M 2 ) (N 1 N 2 ) (M 1 N 1 ) (M 2 N 2 ) ii) If M N is defined, then M and N are called compatible. Note that can be defined as the empty join, i.e. if M M 1 M n, and n = 0, then M. The last alternative in the definition of defines the join on applications in a more general way than Scott s, that would state that (M 1 M 2 ) (N 1 N 2 ) (M 1 N 1 )(M 2 N 2 ), since it is not always sure if a join of two arbitrary terms exists. However, this more general definition will only be used on terms that are compatible, so the conflict is only apparent. The following lemma shows that the join acts as least upper bound of compatible terms. Lemma 2.6 If M 1 M, and M 2 M, then M 1 M 2 is defined, and M 1 M 1 M 2, M 2 M 1 M 2, and M 1 M 2 M. Proof: By induction on the definition of. i) If M 1, then M 1 M 2 M 2, so M 1 M 1 M 2, M 2 M 1 M 2, and M 1 M 2 M 2 M. (The case M 2 goes similarly.) ii) If M 1 λx.n 1, then M λx.n, N 1 N, and either M 2 = or M 2 λx.n 2. The first case has been dealt with in part (i), and for the other: then N 2 N. Then, by induction, N 1 N 1 N 2, N 2 N 1 N 2, and N 1 N 2 N. Then also λx.n 1 λx.n 1 N 2, λx.n 2 λx.n 1 N 2, and λx.n 1 N 2 λx.n. Notice that λx.n 1 N 2 (λx.n 1 ) (λx.n 2 ). iii) If M 1 P 1 Q 1, then M P Q, P 1 P, Q 1 Q, and either M 2 = or M 2 P 2 Q 2. The first case has been dealt with in part (i), and for the other: then P 2 P, Q 2 Q. By induction, we know P 1 P 1 P 2, P 2 P 1 P 2, and P 1 P 2 P, as well as Q 1 Q 1 Q 2, Q 2 Q 1 Q 2, and Q 1 Q 2 Q. Then also P 1 Q 1 (P 1 P 2 )(Q 1 Q 2 ), P 2 Q 2 (P 1 P 2 )(Q 1 Q 2 ), and (P 1 P 2 )(Q 1 Q 2 ) P Q. Notice that (P 1 P 2 )(Q 1 Q 2 ) (P 1 Q 1 ) (P 2 Q 2 ). Notice that, because of 2.4(iii), A(M) can be used to define a semantics for the Lambda Calculus. In fact, it is possible to show that {A A A(M)} = BT (M) where BT (M) stands for the Böhm tree of M, a tree that represents the (possible infinite) normal form of M (see [10]). 11

12 2.2 Approximation result In this subsection, the approximation theorem will be proved; the technique used differs slightly from that of [3]. For reasons of readability, in this subsection A A(M) [B A:σ] will be abbreviated by Appr (B, M, σ). The following basic properties are needed further on. Lemma 2.7 i) Appr (B, xm i, σ τ) & Appr (B, N, σ) Appr (B, xmin, τ). ii) Appr (B {z:σ}, Mz, τ) & z fv(m) & τ T s Appr (B, M, σ τ). iii) Appr (B, M[N/x] P, σ) Appr (B, (λx.m)n P, σ). Proof: i) A A(xM i) & B A:σ τ & A A(N) & B A :τ (2.4(i) & ( E)) AA A(xM in) & B AA :τ. ii) A A(Mz) & B, z:σ A:τ & z fv(m) (2.4(ii)) a) A A z & z fv(a ) & A A(M) & B, z:σ A z :τ (1.7) A A(M) & B A :σ τ. b) λz.a A(M) & B, z:σ A:τ λz.a A(M) & B λz.a:σ τ. iii) Since M[N/x] P = β (λx.m)n P, the result follows by Lemma 2.4(iii). In order to prove, that for each term typeable in, an approximant with the same type can be found, a notion of computability is introduced. Definition 2.8 (COMPUTABILITY PREDICATE) Comp (B, M, ρ) is inductively defined by: i) Comp (B, M, ϕ) Appr (B, M, ϕ). ii) Comp (B, M, σ τ) (Comp (B, N, σ) Comp ( {B, B }, MN, τ)). iii) Comp (B, M, n σ i ) i n [Comp (B, M, σ i )]. Notice that Comp (B, M, ω) holds as special case of part (iii). Lemma 2.9 If Comp (B, M, σ), and B B, then Comp (B, M, σ). Proof: By induction on the definition of Comp ( ). (σ = ϕ) : Comp (B, M, ϕ) & B B Appr (B, M, ϕ) Appr (B, M, ϕ) Comp (B, M, ϕ). (σ = α β) : Comp (B, M, α β) (2.8(ii)) (Comp (B, Q, α) Comp ( {B, B }, MQ, β)) (IH) (Comp (B, Q, α) Comp ( {B, B }, MQ, β)) (2.8(ii)) Comp (B, M, α β). (σ = n σ i ) : Comp (B, M, n σ i ) (2.8(iii)) i n [Comp (B, M, σ i )] (IH) i n [Comp (B, M, σ i )] (2.8(iii)) Comp (B, M, n σ i ). We will now show that the computability predicate is closed for. Lemma 2.10 Take σ and τ such that σ τ. Then Comp (B, M, σ) Comp (B, M, τ). Proof: By straightforward induction on the definition of. 12

13 ( n σ i σ i (i n)) : Comp (B, M, n σ i ) (2.8(iii)) Comp (B, M, σ i ). (τ σ i (i n) τ n σ i ) : Comp (B, M, τ) (IH) Comp (B, M, σ i ) (i n) (2.8(iii)) Comp (B, M, n σ i ). (ρ σ & τ µ σ τ ρ µ) : Comp (B, M, σ τ) (2.8(ii)) (Comp (B, N, σ) Comp ( {B, B }, MN, τ)) (IH 2 ) (Comp (B, N, ρ) Comp (B, N, σ) Comp ( {B, B }, MN, τ) Comp ( {B, B }, MN, µ)) (Comp (B, N, ρ) Comp ( {B, B }, MN, µ)) (2.8(ii)) Comp (B, M, ρ µ). We will now show that the computability predicate is closed for β-expansion Lemma 2.11 Comp (B, M[N/x] P, σ) Comp (B, (λx.m)n P, σ). Proof: By induction on the definition of Comp ( ). (σ = ϕ) : Comp (B, M[N/x] P, ϕ) Appr (B, M[N/x] P, ϕ) (2.7(iii)) Appr (B, (λx.m)n P, ϕ) Comp (B, (λx.m)n P, ϕ). (σ = α β) : Comp (B, M[N/x] P, α β) (2.8(ii)) (Comp (B, Q, α) Comp ( {B, B }, M[N/x] P Q, β)) (IH) (Comp (B, Q, α) Comp ( {B, B }, (λx.m)n P Q, β)) (2.8(ii)) Comp (B, (λx.m)n P, α β). (σ = n σ i ) : Comp (B, M[N/x] P, n σ i ) (2.8(iii)) i n [Comp (B, M[N/x] P, σ i )] (IH) i n [Comp (B, (λx.m)n P, σ i )] (2.8(iii)) Comp (B, (λx.m)n P, n σ i ). The following theorem essentially shows that all term-variables are computable of any type, and that all terms computable of a certain type have an approximant with that same type. Theorem 2.12 i) Appr (B, xm i, ρ) Comp (B, xmi, ρ). ii) Comp(B, M, ρ) Appr (B, M, ρ). Proof: Simultaneously by induction on the structure of types. The only interesting case is when ρ = σ τ; when ρ is a type-variable, the result is immediate and when it is an intersection type, it is dealt with by induction. i) Appr (B, xm i, σ τ) (IH (ii)) (Comp (B, N, σ) Appr (B, xm i, σ τ) & Appr (B, N, σ)) (2.7(i)) (Comp (B, N, σ) Appr ( {B, B }, xm in, τ)) (IH (i)) (Comp (B, N, σ) Comp ( {B, B }, xm in, τ)) (2.8(ii)) Comp (B, xm i, σ τ). ii) Comp (B, M, σ τ) & z fv(m) Comp (B, M, σ τ) & Comp ({z:σ}, z, σ) & z fv(m) Comp ( {B, {z:σ}}, Mz, τ) & z fv(m) Appr ( {B, {z:σ}}, Mz, σ) & z fv(m) Appr (B, M, σ τ). (IH (i)) (2.8(ii)) (IH (ii)) (2.7(ii)) 13

14 Notice that, as a corollary of the first of these two results, we get that term-variables are computable for any type. Corollary 2.13 Comp ({x:σ}, x, σ), for all x, σ. Theorem 2.14 If {x 1 :µ 1,..., x n :µ n } M :σ, and, for every i n, Comp(B i, N i, µ i ), then Comp ( {B 1,..., B n }, M[N i /x i], σ). Proof: By induction on the structure of derivations; let {x 1 :µ 1,..., x n :µ n } = B 0, and B 0 = {B 1,..., B n }. (Ax) : Then M x j, for some j n, µ j σ, and M[N i /x i] xj [N i /x i] Nj. From Comp (B j, N j, µ j ), by Lemma 2.10, also Comp (B j, N j, σ), and, since B 0 B j, by Lemma 2.9, also Comp (B 0, N j, σ). ( I) : Then M λy.m, σ = ρ τ, and B 0, y:ρ M :τ. i n [Comp (B i, N i, µ i )] & B 0, y:ρ M :τ (IH) (Comp (B, N, ρ) Comp ( {B 0, B }, M [N i /x i, N/y], τ)) (2.11) (Comp (B, N, ρ) Comp ( {B 0, B }, (λy.m [N i /x i])n, τ)) (2.8(ii)) Comp (B 0, (λy.m )[N i /x i], ρ τ). ( E) : Then M M 1 M 2, B 0 M 1 :ρ σ, and B 0 M 2 :ρ. i n [Comp (B i, N i, µ i )] & B 0 M 1 : ρ σ & B 0 M 2 :ρ (IH) Comp (B 0, M 1 [N i /x i], ρ σ) & Comp (B 0, M 2 [N i /x i], ρ) (2.8(ii)) Comp (B 0, (M 1 M 2 )[N i /x i], σ). ( I) : Straightforward by induction. As for the BCD-system and the strict system, the relation between types assignable to a lambda term and those assignable to its approximants can be formulated as follows: Theorem 2.15 (APPROXIMATION THEOREM) B M :σ A A(M) [B A:σ]. Proof: ( ) : B M :σ (2.14 & 2.13) Comp (B, M, σ) (2.12(ii)) A A(M) [B A:σ]. ( ) : Let A A(M) be such that B A:σ. Since A A(M), there is an M such that M = β M and A M. Then, by Lemma 2.3, B M :σ and, by Theorem 1.10, also B M :σ. 2.3 Principal pairs and Semantics For terms in N, a notion of principal pair can be defined as follows: Definition 2.16 (PRINCIPAL PAIR) i) Let A N. pp E (A), the principal pair of A, is defined by: a) pp E ( ) =, ω. b) pp E (x) = {x:ϕ}, ϕ. c) If A, and pp E (A) = P, π, then: 1) If x occurs free in A, and x:σ P, then pp E (λx.a) = P \x, σ π. 2) Otherwise pp E (λx.a) = P, ω π. 14

15 d) If for i n, pp E (A i ) = P i, π i (disjoint in pairs), then pp E (xa i) = {P 1,..., P n, {x:π 1 π n ϕ}}, ϕ, where ϕ is a type-variable that does not occur in pp E (A i ), for i n. ii) P = { P, π A N [pp E (A) = P, π ]}. The definition is brought to arbitrary terms via: Definition 2.17 ([3]) i) Let M be a term. Let Π(M) be the set of all principal pairs for all approximants of M: Π(M) = {pp E (A) A A(M)}. ii) Π(M) is an ideal in P, and therefore: a) If Π(M) is finite, then there exists a pair P, π = Π(M), where P, π P. This pair is then called the principal pair of M. b) If Π(M) is infinite, Π(M) does not exist in P. The principal pair of M is then the infinite set of pairs Π(M). That this gives indeed the principal pair for a term M is shown in [3]. Like in [13, 42, 2], it can be proved that there exists a precise relation between terms in N and principal pairs, both equipped with an appropriate ordering. Here, the relation on pairs as given below is used. Definition 2.18 ([3]) The relation on pairs is defined by: i) B, σ, ω. ii) i n (n 2) [ B i, σ i B i, σ i ] {n}b i, n σ i {n}b i, n σ i. iii) B {x:ρ}, µ B {x:ρ }, µ B, ρ µ B, ρ µ. iv) i n [ B i, σ i B i, σ i ] {B 1,..., B n, {x:σ 1 σ n σ}}, σ {B 1,..., B n, {x:σ 1 σ n σ}}, σ. The following result links the approximant semantics to principal types. Theorem 2.19 ([3]) P, is a meet semi-lattice isomorphic to N,. 2.4 Normalization results To prepare the characterization of terms by their assignable types, first is proved that a term in Λ -normal form is typeable without ω, if and only if it does not contain. This forms the basis for the result that all normalizable terms are typeable without ω. Lemma 2.20 i) If B A:σ and B, σ are ω-free, then A is -free. ii) If A is -free, then there are ω-free B and σ, such that B A:σ. Proof: By induction on A. i) As before, only the part σ T s is shown. (A ) : Impossible, since is only typeable by ω. (A λx.a ) : Then σ = α β, and B, x:α A:β. Since B, σ are ω-free, so are B, x:α and β, so, by induction, A is -free, so also λx.a is -free. 15

16 (A xa i) : Then, by ( E) and (Ax), there are σi (i n), τ j (j n), τ, such that x:τ 1 τ n τ B, for every i n, B A i :σ i, and τ 1 τ n τ σ 1 σ n σ. So, especially, for every i n, σ i τ i. By Theorem 1.8, also for every i n, B A i :τ i. Since each τ i occurs in B, all are ω-free, so by induction each A i is -free. Then also xa i is -free. ii) a) A λx.a. By induction there are B, τ such that B A :τ and B, τ are ω-free. If x does not occur in B, take an ω-free σ T s. Otherwise, there exist x:σ B, and σ is ω-free. In any case, B\x λx.a :σ τ, and B\x and σ τ are ω-free. b) A xa i, with (n 0). By induction there are Bi (i n) and σ i (i n) such that for every i n, B i A i : σ i, and B i, σ i are ω-free. Take σ strict, such that ω does not occur in σ, and B = {B 1,..., B n, {x:σ 1 σ n σ}}. Then B xa i :σ, and B and σ, are ω-free. Now, as in [1] for the strict system, it is possible to prove that the type assignment system satisfies the main properties of the BCD-system. Theorem 2.21 (NORMALISATION) i) B, σ [B M :σ & B, σ ω-free] M has a normal form. ii) B, σ T s [B M :σ] M has a head normal form. Proof: i) ( ) : If B M :σ, then, by Theorem 2.15, A A(M) [B A:σ]. Because of Lemma 2.20(i), this A is -free. By Definition 2.1, there exists M = β M such that A M. Since A is -free, in fact A M, so M itself is in normal form, so, especially, M has a normal form. ( ) : If M is the normal form of M, then it is a -free approximate normal form. Then, by Lemma 2.20(ii), there are ω-free B, σ such that B M :σ. Then, by Theorem 1.10, B M :σ. ii) ( ) : If B M :σ, then, by Theorem 2.15, A A(M) [B A:σ]. By Definition 2.1, there exists M = β M such that A M. Since σ T s, A, so A is either λx.a 1 or xa i, with n 0. Since A M, M is either λx.m 1, or xm i. Then M has a head-normal form. ( ) : If M has a head-normal form, then there exists M = β M such that M is either λx.m 1 or xm i, with each Mi Λ. 1) M λx.m 1. Since M 1 is in head-normal form, by induction there are B, σ T s such that B M 1 :σ. If x:τ B, then B\x λx.m 1 :σ τ, otherwise B λx.m 1 :ω τ. 2) M xm i, (n 0). Take σ Ts, then {x:ω ω σ} xm i :σ. 2.5 Strong normalisation The other well-know result B M : σ without using ω M is strongly normalisable also holds, but needs a seperate proof in that it is not a consequence of the Approximation Theorem See [1] for a proof for this property for the BCD system that follows very much the structure of the proof of Theorem 2.15, which could be applied directly here. Alternatively, 16

17 see [5] for a proof for the strict system where it is a direct consequence of the result that cutelimination is strongly normalizable; this technique has not yet been extended to the system considered here. We will now give an alternative proof. We shall prove that, when omega is removed from the system, every typeable term is strongly normalisable. This will be done using Tait-Girard s method. In the sequel, we will accept the following without proof: Fact 2.1 i) If xm i and N are strongly normalizable, then so is xmin. ii) If M[N/x] P and N are strongly normalizable, then so is (λx.m)n P. We use SN for the set of strongly normalisable terms. Definition 2.22 We define the set Red ρ inductively over types by: Red ϕ = SN Red σ τ = {M N [N Red σ MN Red τ ]} Red n σ i = 1 i n Red σ i. We now show that reducibility implies strongly normalisability, and that all term variables are reducible. For the latter, we need to show that all typeable strongly normalisable terms that start with a term variable are reducible. The result then follows from the fact that each term variable is trivially strongly normalisable and that we can type any term variable with any type. Lemma 2.23 For all ρ, i) Red ρ SN. ii) xn SN xn Red ρ. Proof: By simultaneous induction on the structure of types, using Definition i) (ϕ) : Immediate. (σ τ) : M Red σ τ (IH(ii)) x Red σ & M Red σ τ (2.22) Mx Red τ (IH(i)) Mx SN M SN. ( n σ i ) : M Red n σ i (2.22) M Red σ i (IH(ii)) M SN. ii) (ϕ) : xn SN (2.22) xn Red ϕ. (σ τ) : xn SN (2.22 & IH(i)) P Red σ xn SN & P SN (2.1(i)) P Red σ xn P SN (IH(ii)) P Red σ xn P Red τ (2.22) xn Red σ τ ( n σ i ) : By Definition 2.22 and induction. We will now show that the reducibility predicate is closed for. Lemma 2.24 Take σ and τ such that σ τ. Then Red σ Red τ. Proof: By straightforward induction on the definition of. ( n σ i σ i (i n)) : Red n σ i = (2.22) i n Red σ i Red σ i. 17

18 (τ σ i (i n) τ n σ i ) : M Red τ (IH) M Red σ i ( i n) M i n Red σ i (2.22) M Red n σ i. (ρ σ & τ µ σ τ ρ µ) : M Red σ τ (2.22) (N Red σ MN Red τ ) (IH 2 ) (N Red ρ N Red σ MN Red τ MN Red µ ) (N Red ρ MN Red µ ) (2.22) M Red ρ µ. We will now show that the reducibility predicate is closed for subject expansion. Lemma 2.25 M[N/x] P Red σ & N Red ρ (λx.m)n P Red σ. Proof: By induction on the structure of types. (ϕ) : M[N/x] P Red ϕ & N Red ρ (2.22) M[N/x] P SN & N SN (2.1(ii) & (i)) (λx.m)n P SN (2.22) (λx.m)n P Red ϕ (σ τ) : M[N/x] P Red σ τ & N Red ρ (2.22) Q Red σ M[N/x] P Q Red τ & N Red ρ (IH) Q Red σ (λx.m)n P Q Red τ (2.22) (λx.m)n P Red σ τ ( n σ i ) : Directly by induction and Definition We shall prove our strong normalisation result by showing that every typeable term is reducible. For this, we need to prove a stronger property: We will now show that if we replace term variables by reducible terms in a typeable term, we obtain a reducible term. Theorem 2.26 Let B = {x 1 :µ 1,..., x n :µ n }. If B ω M :σ, and, for i n, N i Red µ i, then M[N i /x i] Red σ. Proof: By induction on the structure of derivations. (Ax) : Then M x j, for some j n, µ j σ, and M[N i /x i] xj [N i /x i] Nj. From N j Red µ j, by Lemma 2.24, also N j Red σ. ( I) : Then M λy.m, σ = ρ τ, and B, y:ρ ω M :τ. i n [N i Red µ i ] & B, y:ρ ω M :τ (IH) N Red ρ M [N i /x i, N/y] Red τ (2.25) N Red ρ (λy.m [N i /x i])n Red τ (2.22) (λy.m )[N i /x i] Red ρ τ. ( E), ( I) : Straightforward by induction and Definition Theorem 2.27 (STRONG NORMALISATION) Any typeable term is strongly normalisable. Proof: By Lemma 2.23(ii), all term variables are reducible of any type, so, by 2.26, every typeable term is reducible. Strong normalisation then follows from Lemma 2.23(i). 18

19 3 Semantics and completeness 3.1 Filter models As in [11] and [1], a filter λ-model can be constructed. Definition 3.1 (FILTERS) i) A subset d of T is a filter if and only if: a) σ i d (i n, n 0) n σ i d. b) τ d & τ σ σ d. ii) If V is a subset of T, then V is the smallest filter that contains V, and σ = {σ}. iii) F S = {d T d is a filter}. Application on F S is defined by: d e = {τ σ e [σ τ d]}. Notice that a filter is never empty; because of part (i.a), for all d, ω d. Notice that, as in [1], application must be forced to yield filters, since in each arrow type scheme σ τ T, τ is strict. F S, is a cpo and henceforward it will be considered with the corresponding Scott topology. For filters the following properties hold: Lemma 3.2 i) σ τ τ σ. ii) σ {τ B M :τ} σ {τ B M :τ}. (So {σ B M :σ} F S.) Proof: Easy. Definition 3.3 (DOMAIN CONSTRUCTORS) by: i) F d e = d e. ii) Gf = {σ τ τ f( σ)}. Define F : F S [F S F S ] and G : [F S F S ] F S It is easy to check that F and G are continuous. Theorem 3.4 (FILTER MODEL) F S,, F, G, with F and G as defined in 3.3, is a λ-model. Proof: By [10] it is sufficient to prove that F G = Id [FS F S ]. F Gfd = F (Gf)d = F ( {σ τ τ f( σ)})d = {µ ρ d [ρ µ {σ τ τ f( σ)}]} = (3.2(i)) {µ ρ d [µ f( ρ)]} = f(d). Definition 3.5 (TERM INTERPRETATION) Let M be a lambda model, and ξ be a valuation of term variables in M. i) M ξ, the interpretation of terms in M via ξ is inductively defined by: a) x M ξ = ξ(x). b) MN M ξ = F M M ξ N M ξ. c) λx.m M ξ = G(λ d M. M M ξ(d/x)). ii) B ξ = {x:σ σ ξ(x)}. 19

20 Since F S is the model studied here, ξ stands for F S ξ. Notice that B ξ is not really a basis, since it can contain infinitely many statements with subject x; however, for all its design and purposes, it can be regarded as one. Theorem 3.6 For all M, ξ: M ξ = {σ B ξ M :σ}. Proof: By induction on the structure of lambda terms. i) x ξ = ξ(x). If σ ξ(x), then certainly B ξ x:σ. Assume B ξ x:σ: if x:ρ B ξ, then ρ σ, so σ ρ. Since ρ ξ(x), also ρ ξ(x), so σ ξ(x). ii) MN ξ = F M ξ N ξ = M ξ N ξ = (IH) {ρ B ξ M :ρ} {ρ B ξ N :ρ} = (3.1(iii)) {τ σ {ρ B ξ N :ρ} [σ τ {ρ B ξ M :ρ}]} = {τ σ [B ξ N :σ & B ξ M :σ τ]} = ( E) {τ B ξ MN :τ} = (3.2(ii)) {τ B ξ MN :τ} iii) λx.m ξ = G(λ d F S. M ξ(d/x) ) = (IH) G(λ d F S.{ρ B ξ(d/x) M :ρ}) = {σ τ τ (λ d F S.{ρ B ξ(d/x) M :ρ})( σ)} = {σ τ τ {ρ B ξ( σ/x) M :ρ}} = {σ τ B ξ( σ/x) M :τ} = (B ξ = B ξ \x) {σ τ B ξ {x:µ µ σ} M :τ} = (3.2(i) & 1.5(vi)) {σ τ B ξ {x:σ} M :τ} = ( I) {σ τ B ξ λx.m :σ τ} = (1.5(v)) {σ τ B ξ λx.m :σ τ} = (( I) & 3.2(ii)) {ρ B ξ λx.m :ρ}. 3.2 Soundness and completeness of type assignment The main result of [11] is the proof for completeness of type assignment. In constructing a complete system, the semantics of types plays a crucial role. Definition 3.7 (TYPE INTERPRETATION) Let D,, ε be a continuous λ-model. A mapping υ : T (D) = {X X D} is an type interpretation if and only if: i) υ(σ τ) = {d e υ(σ) [d e υ(τ)]}. ii) υ(σ τ) = υ(σ) υ(τ). Lemma 3.8 Let υ be a type interpretation. Then σ τ implies υ(σ) υ(τ). Proof: Easy. This notion of type interpretation leads, naturally, to the definition for semantic satisfiability. 20

21 Definition 3.9 (SATISFIABILITY) i) Let M = D,, be a λ-model and ξ a valuation of term-variables in D. Then M M ξ D is the interpretation of M in M via ξ. ii) Define by (where M is a λ-model, ξ a valuation and υ a type interpretation); a) M, ξ, υ M:σ M M ξ υ(σ). b) M, ξ, υ B M, ξ, υ x:σ for every x:σ B. c) B M :σ M, ξ, υ [M, ξ, υ B M, ξ, υ M :σ]. Since no confusion is possible, the superscript on is omitted. Theorem 3.10 (SOUNDNESS) B M :σ B M :σ. Proof: By Definition 3.9(ii.c), for all M, ξ, υ, if M, ξ, υ B then M, ξ, υ M :σ. This then means that, if M, ξ, υ x:ρ for every x:ρ B, then M, ξ, υ M :σ, so, to show: if x ξ M υ(ρ) for every x:ρ B, then M ξ M υ(σ). We prove the property for the model F S, by induction on the structure of derivations. (Ax) : Then B x:σ, so there exists x:ρ B such that ρ σ. Assume x ξ υ(ρ), then, by Lemma 3.8, x ξ υ(σ). ( I) : Then B λy.m :α β, and also B, y:α M :β. Let e υ(α), and ξ = ξ(e/y). Then: x:τ B, y:α [ x ξ υ(τ)] (IH) M ξ υ(β) (3.6) {δ B ξ M :δ} υ(β) ( I) {δ γ e [B ξ λy.m :γ δ]} υ(β) {δ γ e [γ δ {ρ B ξ λy.m :ρ}]} υ(β) (3.1(iii)) {ρ B ξ λy.m :ρ} e υ(β). So, for all e υ(α), we have shown that {ρ B ξ λy.m :ρ} e υ(β), so, by Definition 3.7, we get {ρ B ξ λy.m :ρ} υ(α β). ( E) : Then M P Q, and there exists µ such that B P :µ σ and B Q:µ. Then: x:τ B, y:α [ x ξ υ(τ)] (IH) P ξ υ(µ σ) & Q ξ υ(µ) (3.6) {ρ B ξ P :ρ} υ(µ ρ) & {ρ B ξ Q:ρ} υ(µ) ( I) {ρ B ξ P :ρ} {d e υ(µ) [d e υ(τ)} & {ρ B ξ Q:ρ} υ(µ) {ρ B ξ P :ρ} {ρ B ξ Q:ρ} υ(τ) (3.1(iii)) {β α {ρ B ξ Q:ρ} [α β {ρ B ξ P :ρ}]} υ(τ) {β α [B ξ Q:α & B ξ P :α β]} υ(τ) ( E) {β B ξ P Q:β} υ(τ) {β B ξ P Q:β} υ(τ). ( I) : Then σ = n σ i, and, for i n, B M :σ i. Then: x:τ B, y:α [ x ξ υ(τ)] (IH) i n [{ρ B ξ M :ρ} υ(σ i )] {ρ B ξ M :ρ} υ(σ 1 ) υ(σ n )] (3.7) {ρ B ξ M :ρ} υ( n σ i ). The method followed in [11] for the proof of completeness of type assignment is to define 21

22 a type interpretation υ that satisfies: for all types σ, υ(σ) = {d F S σ d}. The approach taken here is to define a function, and to show that it is a type interpretation. Theorem 3.11 The map ν 0 defined by: ν 0 (σ) = {d F S σ d} is a type interpretation. Proof: It is sufficient to check the conditions of Definition 3.7: (ν 0 (σ τ) = {d e ν 0 (σ) [d e ν 0 (τ)]}) : e [e ν 0 (σ) d e ν 0 (τ)] (3.1(iii)) e [e ν 0 (σ) {β α e [α β d]} ν 0 (τ)] e [σ e τ {β α e [α β d]}] (τ T s ) e [σ e α e [α τ d]] ( : take e = σ) σ τ d d ν 0 (σ τ) (ν 0 (σ τ) = ν 0 (σ) ν 0 (τ)) : Easy. Lemma 3.12 i) B M :σ B ξb M :σ. ii) F S, ξ B, ν 0 B. Proof: i) Because for every x, ξ B (x) is a filter. ii) x:σ B ((i))σ {τ B ξb x:τ} σ x ξb. So x ξb {d F S σ d} = ν 0 (σ). Since the interpretation of terms by their derivable types gives a λ-model, the following corollary is immediate and an alternative proof for Theorem Corollary 3.13 If M = β N and B M :σ, then B N :σ. Proof: Since F S is a λ-model, if M = β N, then M ξ = N ξ, for any ξ, and, by Lemma 3.12(i), {σ B M :σ} = {σ B N :σ}. Theorem 3.14 (COMPLETENESS) Let σ T, then B M :σ B M :σ. Proof: B M :σ (3.9(ii.c), 3.12(ii) & 3.11) F S, ξ B, ν 0 M :σ (3.9(i)) M ξb ν 0 (σ) σ M ξb (3.6) B ξb M :σ (3.12(i)) B M :σ. 4 Combinator Systems In this section, we will give a detailed presentation of Combinator Systems (CS). CS will be defined as a special kind of applicative TRS [32], with the restriction that formal parameters of function symbols are not allowed to have structure, and right-hand sides of term rewriting rules are constructed of term-variables only. We have chosen this kind of presentation in view of a future extension of the results to full TRS, in the spirit of [8]. Notice that our treatment differs from, for example, that of [21], where only combinatory complete CS are considered. Definition 4.1 (COMBINATOR TERMS) i) An alphabet or signature Σ = (C,X ) consists of a countable infinite set X of variables ranged over by x, y, z,..., a non-empty set C = 22

23 {D, Z,...} of combinators, ranged over by C, D, E,..., each equipped with an arity greater than 0, and the binary function symbol Ap (application). ii) The set T (C, V) of terms, ranged over by t, is defined by: t ::= x C Ap (t 1, t 2 ) As usual, we will write (t 1 t 2 ) instead of Ap (t 1, t 2 ), and left-most, outermost brackets will be omitted, so t 1 t 2 (t 3 t 4 ) stands for Ap (Ap (t 1, t 2 ), Ap (t 3, t 4 )). The following is the usual notion of term-substitution formulated for combinator systems. Definition 4.2 (TERM-SUBSTITUTIONS) A term-substitution R is a map from terms to terms, determined by its restriction to a finite set of variables, satisfying R (t 1 t 2 ) = R (t 1 )R (t 2 ). We will write t R instead of R (t). If R maps x i to u i, for i n, we write {x 1 u 1,..., x n u n } for R, and write t u for t R. Combinator Systems, and the notion of rewriting on combinator terms, are defined by the following: Definition 4.3 (COMBINATOR SYSTEMS) i) A combinator rule on Σ = (C,X ) is a pair (l, r) of terms in T (C, V), such that: a) There are C and distinct x 1,..., x n, such that l = C x 1 x n, where n = arity(c). b) The variables occurring in r are contained in l, and r contains no symbols from C. ii) A Combinator System (CS) is a pair of an alphabet Σ and a set R of combinator rules on Σ = (C,X ), such that there is exactly one rule in R for each combinator C C. This rule (l, r) is called the combinator rule for C; we will use the symbol C also as name for this rule and write l C r. iii) A combinator rule l C r determines a set of reductions l R C r R for all term-substitutions R. The left-hand side l R is called a redex; it may be replaced by its contractum r R inside any context C[ ]; this gives rise to reduction steps: C[ l R ] C C[ r R ]. iv) We will write t R t if there is a rule l C r in R such that t C t, and call R the one-step rewrite relation generated by R, and + R (respectively R ) the transitive (respectively reflexive and transitive) closure of R (the index R will be omitted when it is clear from the context). If t 0 + t n, then t n is a reduct of t 0. Example 4.4 (COMBINATORY LOGIC) The standard example of a CS is Combinatory Logic (CL) defined by Curry independently of LC [16] that is, in our notation, formulated as follows: CL = (((S, K, I), X ), R), where R contains the rules S xyz xz (yz) K xy x I x x The last rule was not part of the original definition, but is nowadays normally added. We will assume that no two combinators have the same interpretation in LC (see Definition 4.7), so a CS like Ix x Jx x 23

24 is excluded, since it would give an immediate counter example against any full-abstraction result with respect to the filter semantics (see Section 7). This notion of reduction on combinator terms as in Definition 4.3 is also known as weak reduction and satisfies the Church-Rosser Property (see [10]). Proposition 4.5 (CHURCH-ROSSER) and v w. If t u and t v, then there exists w such that u w We now define (head-)normal forms, (head-)normalizability, strongly normalizability, and unsolvable terms. Definition 4.6 ((HEAD-)NORMAL FORMS) Let ((C,X ),R) be a CS. i) A term is in normal form with respect to R if it is irreducible. ii) A term t is in head-normal form with respect to R if either a) there are a variable x and terms t 1,..., t n (n 0) such that t xt 1 t n, or b) there are a combinator C C and terms t 1,..., t n T (C, V) such that t C t 1 t n, and n < arity(c). iii) A term is (head-)normalizable if it can be reduced to a term in (head-)normal form. A rewrite system is strongly normalizing (or terminating) if all rewrite sequences are finite; it is (head-)normalizing if every term is (head-)normalizable. iv) A term is called unsolvable if it has no head-normal form. 4.1 CS versus LC We now focus on the relation between reduction in CS and in LC. Definition 4.7 Let C = ((C,X ),R) be a CS. C λ : T (C, V) Λ, the interpretation of combinator terms over C in LC, is defined by: x C λ = x for all x X t 1 t 2 C λ = t 1 C λ t 2 C λ C C λ = λx 1 x n. r C λ where C x 1 x n r R Notice that, since we assume the set of term variables for CS and LC to be the same, as well as the two notions of application on terms, r C λ = r for every r that is the right-hand side of a combinator rule. The interpretation in LC of a CS, C λ, respects reduction: Proposition 4.8 Let C = ((C,X ),R) be a CS, then, for all t, t T (C, V): if t t, then t C λ β t C λ. Proof: By easy induction on the definition of. In general, the length of the reduction sequence increases significantly. Only for particular CS it is possible to also define an interpretation of LC; the standard example is that of CL (see also [18, 10, 21]; in [21] also other combinatory complete CS are discussed). 24

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

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 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

Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees

Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees Information and Computation 178, 1 11 (2002) doi:101006/inco20022907 Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees Toshihiko Kurata 1 Department of Mathematics, Tokyo Metropolitan

More information

Realisability methods of proof and semantics with application to expansion

Realisability methods of proof and semantics with application to expansion Realisability methods of proof and semantics with application to expansion First Year Examination Supervisors : Professor Fairouz Kamareddine and Doctor Joe B. Wells Student : Vincent Rahli ULTRA group,

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

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK Abstract This

More information

Mathematical Logic IV

Mathematical Logic IV 1 Introduction Mathematical Logic IV The Lambda Calculus; by H.P. Barendregt(1984) Part One: Chapters 1-5 The λ-calculus (a theory denoted λ) is a type free theory about functions as rules, rather that

More information

On the Standardization Theorem for λβη-calculus

On the Standardization Theorem for λβη-calculus On the Standardization Theorem for λβη-calculus 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

Equational Logic. Chapter Syntax Terms and Term Algebras

Equational Logic. Chapter Syntax Terms and Term Algebras Chapter 2 Equational Logic 2.1 Syntax 2.1.1 Terms and Term Algebras The natural logic of algebra is equational logic, whose propositions are universally quantified identities between terms built up from

More information

Constructive approach to relevant and affine term calculi

Constructive approach to relevant and affine term calculi Constructive approach to relevant and affine term calculi Jelena Ivetić, University of Novi Sad, Serbia Silvia Ghilezan,University of Novi Sad, Serbia Pierre Lescanne, University of Lyon, France Silvia

More information

A Behavioural Model for Klop s Calculus

A Behavioural Model for Klop s Calculus 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. A Behavioural Model for Klop s Calculus Mariangiola Dezani-Ciancaglini

More information

Graph lambda theories

Graph lambda theories Under consideration for publication in Math. Struct. in Comp. Science Graph lambda theories A N T O N I O B U C C I A R E L L I 1 and A N T O N I N O S A L I B R A 2 1 Equipe PPS (case 7014), Université

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

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF Origin

More information

Justifying Algorithms for βη-conversion

Justifying Algorithms for βη-conversion Justifying Algorithms for βη-conversion Healfdene Goguen AT&T Labs, 180 Park Ave., Florham Park NJ 07932 USA hhg@att.com. Abstract. Deciding the typing judgement of type theories with dependent types such

More information

Strong normalization of a symmetric lambda calculus for second order classical logic

Strong normalization of a symmetric lambda calculus for second order classical logic Archive for Mathematical Logic manuscript No. (will be inserted by the editor) Strong normalization of a symmetric lambda calculus for second order classical logic YAMAGATA, yoriyuki e-mail: yoriyuki@ms.u-tokyo.ac.jp

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Minimal logic for computable functionals

Minimal logic for computable functionals Minimal logic for computable functionals Helmut Schwichtenberg Mathematisches Institut der Universität München Contents 1. Partial continuous functionals 2. Total and structure-total functionals 3. Terms;

More information

Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010

Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010 Lambda-Calculus (I) jean-jacques.levy@inria.fr 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010 Plan computation models lambda-notation bound variables conversion

More information

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic Mathematics 114L Spring 2018 D.A. Martin Mathematical Logic 1 First-Order Languages. Symbols. All first-order languages we consider will have the following symbols: (i) variables v 1, v 2, v 3,... ; (ii)

More information

summer school Logic and Computation Goettingen, July 24-30, 2016

summer school Logic and Computation Goettingen, July 24-30, 2016 Università degli Studi di Torino summer school Logic and Computation Goettingen, July 24-30, 2016 A bit of history Alonzo Church (1936) The as formal account of computation. Proof of the undecidability

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

Intersection Types and Lambda Theories

Intersection Types and Lambda Theories Intersection Types and Lambda Theories M.Dezani-Ciancaglini S.Lusin Abstract We illustrate the use of intersection types as a semantic tool for showing properties of the lattice of λ-theories. Relying

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

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg Type Theory and Constructive Mathematics Type Theory and Constructive Mathematics Thierry Coquand University of Gothenburg Content An introduction to Voevodsky s Univalent Foundations of Mathematics The

More information

Introduction to λ-calculus

Introduction to λ-calculus p.1/65 Introduction to λ-calculus Ken-etsu FUJITA fujita@cs.gunma-u.ac.jp http://www.comp.cs.gunma-u.ac.jp/ fujita/ Department of Computer Science Gunma University :Church 32, 36, 40; Curry 34 1. Universal

More information

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF The Combinatory

More information

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1 Přednáška 12 Důkazové kalkuly Kalkul Hilbertova typu 11/29/2006 Hilbertův kalkul 1 Formal systems, Proof calculi A proof calculus (of a theory) is given by: A. a language B. a set of axioms C. a set of

More information

AN ALTERNATIVE NATURAL DEDUCTION FOR THE INTUITIONISTIC PROPOSITIONAL LOGIC

AN ALTERNATIVE NATURAL DEDUCTION FOR THE INTUITIONISTIC PROPOSITIONAL LOGIC Bulletin of the Section of Logic Volume 45/1 (2016), pp 33 51 http://dxdoiorg/1018778/0138-068045103 Mirjana Ilić 1 AN ALTERNATIVE NATURAL DEDUCTION FOR THE INTUITIONISTIC PROPOSITIONAL LOGIC Abstract

More information

VC-DENSITY FOR TREES

VC-DENSITY FOR TREES VC-DENSITY FOR TREES ANTON BOBKOV Abstract. We show that for the theory of infinite trees we have vc(n) = n for all n. VC density was introduced in [1] by Aschenbrenner, Dolich, Haskell, MacPherson, and

More information

Propositional Logic Language

Propositional Logic Language Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite

More information

arxiv: v1 [cs.pl] 19 May 2016

arxiv: v1 [cs.pl] 19 May 2016 arxiv:1605.05858v1 [cs.pl] 19 May 2016 Domain Theory: An Introduction Robert Cartwright Rice University Rebecca Parsons ThoughtWorks, Inc. Moez AbdelGawad SRTA-City Hunan University This monograph is an

More information

Komponenten- und Service-orientierte Softwarekonstruktion

Komponenten- und Service-orientierte Softwarekonstruktion Komponenten- und Service-orientierte Softwarekonstruktion Vorlesung 5: Combinatory Logic Synthesis Jakob Rehof LS XIV Software Engineering TU Dortmund Sommersemester 2015 SS 2015 J. Rehof (TU Dortmund)

More information

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω 1 Preliminaries In this chapter we first give a summary of the basic notations, terminology and results which will be used in this thesis. The treatment here is reduced to a list of definitions. For the

More information

Infinite λ-calculus and non-sensible models

Infinite λ-calculus and non-sensible models Infinite λ-calculus and non-sensible models Alessandro Berarducci Dipartimento di Matematica, Università di Pisa Via Buonarroti 2, 56127 Pisa, Italy berardu@dm.unipi.it July 7, 1994, Revised Nov. 13, 1994

More information

Call-by-value non-determinism in a linear logic type discipline

Call-by-value non-determinism in a linear logic type discipline Call-by-value non-determinism in a linear logic type discipline Alejandro Díaz-Caro? Giulio Manzonetto Université Paris-Ouest & INRIA LIPN, Université Paris 13 Michele Pagani LIPN, Université Paris 13

More information

Intersection Synchronous Logic

Intersection Synchronous Logic UnB 2007 p. 1/2 Intersection Synchronous Logic Elaine Gouvêa Pimentel Simona Ronchi della Rocca Luca Roversi UFMG/UNITO, 2007 UnB 2007 p. 2/2 Outline Motivation UnB 2007 p. 2/2 Outline Motivation Intuitionistic

More information

10 Propositional logic

10 Propositional logic 10 The study of how the truth value of compound statements depends on those of simple statements. A reminder of truth-tables. and A B A B F T F F F F or A B A B T F T F T T F F F not A A T F F T material

More information

The Minimal Graph Model of Lambda Calculus

The Minimal Graph Model of Lambda Calculus The Minimal Graph Model of Lambda Calculus Antonio Bucciarelli 1 and Antonino Salibra 2 1 Université Paris 7, Equipe PPS, 2 place Jussieu, 72251 Paris Cedex 05, France buccia@pps.jussieu.fr, 2 Università

More information

Tutorial on Semantics Part I

Tutorial on Semantics Part I Tutorial on Semantics Part I Basic Concepts Prakash Panangaden 1 1 School of Computer Science McGill University on sabbatical leave at Department of Computer Science Oxford University Fields Institute,

More information

Subtyping and Intersection Types Revisited

Subtyping and Intersection Types Revisited Subtyping and Intersection Types Revisited Frank Pfenning Carnegie Mellon University International Conference on Functional Programming (ICFP 07) Freiburg, Germany, October 1-3, 2007 Joint work with Rowan

More information

Non-Idempotent Typing Operators, beyond the λ-calculus

Non-Idempotent Typing Operators, beyond the λ-calculus Non-Idempotent Typing Operators, beyond the λ-calculus Soutenance de thèse Pierre VIAL IRIF (Univ. Paris Diderot and CNRS) December 7, 2017 Non-idempotent typing operators P. Vial 0 1 /46 Certification

More information

Categories, Proofs and Programs

Categories, Proofs and Programs Categories, Proofs and Programs Samson Abramsky and Nikos Tzevelekos Lecture 4: Curry-Howard Correspondence and Cartesian Closed Categories In A Nutshell Logic Computation 555555555555555555 5 Categories

More information

A Non-Topological View of Dcpos as Convergence Spaces

A Non-Topological View of Dcpos as Convergence Spaces A Non-Topological View of Dcpos as Convergence Spaces Reinhold Heckmann AbsInt Angewandte Informatik GmbH, Stuhlsatzenhausweg 69, D-66123 Saarbrücken, Germany e-mail: heckmann@absint.com Abstract The category

More information

The Sensible Graph Theories of Lambda Calculus

The Sensible Graph Theories of Lambda Calculus The Sensible Graph Theories of Lambda Calculus Antonio Bucciarelli Université Paris 7 Equipe PPS 2 place Jussieu, 72251 Paris Cedex 05, France buccia@ppsjussieufr Antonino Salibra Università Ca Foscari

More information

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012 1 λ Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky Radboud University Nijmegen March 5, 2012 2 reading Femke van Raamsdonk Logical Verification Course Notes Herman Geuvers Introduction to

More information

Congruence Boolean Lifting Property

Congruence Boolean Lifting Property Congruence Boolean Lifting Property George GEORGESCU and Claudia MUREŞAN University of Bucharest Faculty of Mathematics and Computer Science Academiei 14, RO 010014, Bucharest, Romania Emails: georgescu.capreni@yahoo.com;

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

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms Alonzo Church (1903-1995) Lambda Calculus 2 λ-calculus : syntax Grammar for terms : t, u ::= x (variable) t u (application) λx.t (abstraction) Notation : Application is left-associative so that t 1 t 2...

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

Using models to model-check recursive schemes

Using models to model-check recursive schemes Using models to model-check recursive schemes S Salvati and I Walukiewicz Université de Bordeaux, INRIA, CNRS, LaBRI UMR5800 Abstract We propose a model-based approach to the model checking problem for

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

(Head-)Normalization of Typeable Rewrite Systems

(Head-)Normalization of Typeable Rewrite Systems (Head-)Normalization of Typeable Rewrite Systems (Proceedings of RTA 95, LNCS 914, pages 279 293, 1995) Steffen van Bakel 1 and Maribel Fernández 2 1 Dipartimento di Informatica, Università degli Studi

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

A Cut-Free Calculus for Second-Order Gödel Logic

A Cut-Free Calculus for Second-Order Gödel Logic Fuzzy Sets and Systems 00 (2014) 1 30 Fuzzy Sets and Systems A Cut-Free Calculus for Second-Order Gödel Logic Ori Lahav, Arnon Avron School of Computer Science, Tel Aviv University Abstract We prove that

More information

Safety Analysis versus Type Inference

Safety Analysis versus Type Inference Information and Computation, 118(1):128 141, 1995. Safety Analysis versus Type Inference Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus

More information

ClC (X ) : X ω X } C. (11)

ClC (X ) : X ω X } C. (11) With each closed-set system we associate a closure operation. Definition 1.20. Let A, C be a closed-set system. Define Cl C : : P(A) P(A) as follows. For every X A, Cl C (X) = { C C : X C }. Cl C (X) is

More information

TR : Binding Modalities

TR : Binding Modalities City University of New York (CUNY) CUNY Academic Works Computer Science Technical Reports Graduate Center 2012 TR-2012011: Binding Modalities Sergei N. Artemov Tatiana Yavorskaya (Sidon) Follow this and

More information

A domain-theoretic characterisation of strong normalisation in the λ-r-calculus

A domain-theoretic characterisation of strong normalisation in the λ-r-calculus Domains VIII Sobolev Institute of Mathematics Novosibirsk Akademgorodok 11-15 September, 2007 A domain-theoretic characterisation of strong normalisation in the λ-r-calculus Ulrich Berger Swansea University

More information

Lecture Notes on Sequent Calculus

Lecture Notes on Sequent Calculus Lecture Notes on Sequent Calculus 15-816: Modal Logic Frank Pfenning Lecture 8 February 9, 2010 1 Introduction In this lecture we present the sequent calculus and its theory. The sequent calculus was originally

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

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

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 1: Introducing Formal Languages Motivation I This course is about the study of a fascinating

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

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

1. each λ-variable is a λρ-term, called atom or atomic term, 2. if M and N are λρ-term then (MN) is a λρ-term called application,

1. each λ-variable is a λρ-term, called atom or atomic term, 2. if M and N are λρ-term then (MN) is a λρ-term called application, Yuichi Komori Arato Cho λρ-calculus abstract. In [K02], one of the authors introduced the system λρ-calculus and stated without proof that the strong normalization theorem hold. We have discovered an elegant

More information

Safety Analysis versus Type Inference for Partial Types

Safety Analysis versus Type Inference for Partial Types Safety Analysis versus Type Inference for Partial Types Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus University Ny Munkegade, DK-8000

More information

Lecture Notes on Combinatory Modal Logic

Lecture Notes on Combinatory Modal Logic Lecture Notes on Combinatory Modal Logic 15-816: Modal Logic Frank Pfenning Lecture 9 February 16, 2010 1 Introduction The connection between proofs and program so far has been through a proof term assignment

More information

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ (Annals of Pure and Applied Logic 161, pp 1400-1430, 2010) Steffen van Bakel Department of Computing, Imperial College

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

Completeness Theorems and λ-calculus

Completeness Theorems and λ-calculus Thierry Coquand Apr. 23, 2005 Content of the talk We explain how to discover some variants of Hindley s completeness theorem (1983) via analysing proof theory of impredicative systems We present some remarks

More information

TR : Possible World Semantics for First Order LP

TR : Possible World Semantics for First Order LP City University of New York (CUNY) CUNY Academic Works Computer Science Technical Reports Graduate Center 2011 TR-2011010: Possible World Semantics for First Order LP Melvin Fitting Follow this and additional

More information

CS522 - Programming Language Semantics

CS522 - Programming Language Semantics 1 CS522 - Programming Language Semantics Simply Typed Lambda Calculus Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 We now discuss a non-trivial extension of

More information

Behavioural Inverse Limit λ-models

Behavioural Inverse Limit λ-models Behavioural Inverse Limit λ-models Mariangiola Dezani-Ciancaglini a,1, Silvia Ghilezan b,2, Silvia Likavec a,b,c,1 a Dipartimento di Informatica, Università di Torino, Corso Svizzera 185, 10149 Torino,

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

Herbrand Theorem, Equality, and Compactness

Herbrand Theorem, Equality, and Compactness CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order

More information

On Upper Bounds on the Church-Rosser Theorem

On Upper Bounds on the Church-Rosser Theorem On Upper Bounds on the Church-Rosser Theorem Ken-etsu Fujita Department of Computer Science Gunma University Kiryu, Japan fujita@cs.gunma-u.ac.jp The Church-Rosser theorem in the type-free λ-calculus is

More information

Propositional logic (revision) & semantic entailment. p. 1/34

Propositional logic (revision) & semantic entailment. p. 1/34 Propositional logic (revision) & semantic entailment p. 1/34 Reading The background reading for propositional logic is Chapter 1 of Huth/Ryan. (This will cover approximately the first three lectures.)

More information

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule. 32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,

More information

Third-Order Matching via Explicit Substitutions

Third-Order Matching via Explicit Substitutions 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.

More information

3.2 Equivalence, Evaluation and Reduction Strategies

3.2 Equivalence, Evaluation and Reduction Strategies 3.2 Equivalence, Evaluation and Reduction Strategies The λ-calculus can be seen as an equational theory. More precisely, we have rules i.e., α and reductions, for proving that two terms are intensionally

More information

PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS

PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS PROPOSITIONAL MIXED LOGIC: ITS SYNTAX AND SEMANTICS Karim NOUR 1 and Abir NOUR 2 Abstract In this paper, we present a propositional logic (called mixed logic) containing disjoint copies of minimal, intuitionistic

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

Cut-elimination for Provability Logic GL

Cut-elimination for Provability Logic GL Cut-elimination for Provability Logic GL Rajeev Goré and Revantha Ramanayake Computer Sciences Laboratory The Australian National University { Rajeev.Gore, revantha }@rsise.anu.edu.au Abstract. In 1983,

More information

Axiomatisation of Hybrid Logic

Axiomatisation of Hybrid Logic Imperial College London Department of Computing Axiomatisation of Hybrid Logic by Louis Paternault Submitted in partial fulfilment of the requirements for the MSc Degree in Advanced Computing of Imperial

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and

More information

Simply Typed λ-calculus

Simply Typed λ-calculus Simply Typed λ-calculus Lecture 1 Jeremy Dawson The Australian National University Semester 2, 2017 Jeremy Dawson (ANU) COMP4630,Lecture 1 Semester 2, 2017 1 / 23 A Brief History of Type Theory First developed

More information

Equational Logic. Chapter 4

Equational Logic. Chapter 4 Chapter 4 Equational Logic From now on First-order Logic is considered with equality. In this chapter, I investigate properties of a set of unit equations. For a set of unit equations I write E. Full first-order

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

MONADIC FRAGMENTS OF INTUITIONISTIC CONTROL LOGIC

MONADIC FRAGMENTS OF INTUITIONISTIC CONTROL LOGIC Bulletin of the Section of Logic Volume 45:3/4 (2016), pp. 143 153 http://dx.doi.org/10.18778/0138-0680.45.3.4.01 Anna Glenszczyk MONADIC FRAGMENTS OF INTUITIONISTIC CONTROL LOGIC Abstract We investigate

More information

Partially commutative linear logic: sequent calculus and phase semantics

Partially commutative linear logic: sequent calculus and phase semantics Partially commutative linear logic: sequent calculus and phase semantics Philippe de Groote Projet Calligramme INRIA-Lorraine & CRIN CNRS 615 rue du Jardin Botanique - B.P. 101 F 54602 Villers-lès-Nancy

More information

Advanced Lambda Calculus. Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands

Advanced Lambda Calculus. Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands Advanced Lambda Calculus Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands Form of the course Ordinary lecture Seminar form Exam: working out an exercise

More information

Advanced Lambda Calculus Lecture 5

Advanced Lambda Calculus Lecture 5 Advanced Lambda Calculus Lecture 5 The fathers Alonzo Church (1903-1995) as mathematics student at Princeton University (1922 or 1924) Haskell B. Curry (1900-1982) as BA in mathematics at Harvard (1920)

More information

Hierarchy among Automata on Linear Orderings

Hierarchy among Automata on Linear Orderings Hierarchy among Automata on Linear Orderings Véronique Bruyère Institut d Informatique Université de Mons-Hainaut Olivier Carton LIAFA Université Paris 7 Abstract In a preceding paper, automata and rational

More information

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 Neil D. Jones DIKU 2005 14 September, 2005 Some slides today new, some based on logic 2004 (Nils Andersen) OUTLINE,

More information

Intersection and Union Types for X

Intersection and Union Types for X ITRS 2004 Preliminary Version Intersection and Union Types for X Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK, svb@doc.ic.ac.uk Abstract This

More information

Small families. (at INRIA with Gérard and in the historical λ-calculus) Jean-Jacques Lévy

Small families. (at INRIA with Gérard and in the historical λ-calculus) Jean-Jacques Lévy Small families (at INRIA with Gérard and in the historical λ-calculus) Jean-Jacques Lévy INRIA Rocquencourt and Microsoft Research-INRIA Joint Centre June 22, 2007 caml years coq sixty years is 31,557,600

More information

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic The Importance of Being Formal Martin Henz February 5, 2014 Propositional Logic 1 Motivation In traditional logic, terms represent sets, and therefore, propositions are limited to stating facts on sets

More information