A Standard Theory for the Pure Lambda-Value Calculus Álvaro García-Pérez Pablo Nogueira Paris, September 2014 1 / 18
Standard theory in the classical lambda calculus (a.k.a. Barendregt’s theme) ◮ Pure untyped lambda calculus ( λ K ) with reduction ( → ∗ β ) and conversion ( = β ) theories. ◮ Solvability: M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β I . [Barendregt, 1984] ◮ Unsolvable terms denote ⊥ in D ∞ [Wadsworth, 1976]. ◮ H = { M = β N | M , N ∈ Λ 0 unsolvables } + is a lambda theory [Barendregt, 1984]. ◮ D ∞ satifies H , i.e., D ∞ is sensible [Barendregt, 1984]. ◮ Quasi-leftmost reduction characterises complete strategies [Hindley and Seldin, 2008]. 2 / 18
Solvability and transformability in λ K M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β I . [Barendregt, 1984] M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β N ∈ NF. [Barendregt, 1971] 3 / 18
Solvability and transformability in λ K M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β I . [Barendregt, 1984] � M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β N ∈ NF. [Barendregt, 1971] Theorem ([Wadsworth, 1976]) Let N ∈ NF . For every M, there exists C h [ ] such that C h [ N ] → ∗ β M. 3 / 18
Solvability and transformability in λ K M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β I . [Barendregt, 1984] � M is solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β N ∈ NF. [Barendregt, 1971] Theorem ([Wadsworth, 1976]) Let N ∈ NF . For every M, there exists C h [ ] such that C h [ N ] → ∗ β M. M is solvable iff it has a head normal form. 3 / 18
Definition (Needed Redex in λ K [Barendregt et al., 1987]) A redex R in M ≡ C [ R ] is needed iff R (or some residual of it) is contracted in every reduction sequence ending in normal form: M ≡ C [ R ] → β . . . → β N ∈ NF 4 / 18
Polarity in λ K P ( x ) = x + ( λ x . P ( B )) + P ( λ x . B ) = ( P ( M ) N ( N )) + P ( M N ) = N ( x ) x − = N ( λ x . B ) ( λ x . N ( B )) − = N ( M N ) ( N ( M ) N ( N )) − = 5 / 18
Polarity in λ K P ( x ) = x + λ x . ( λ y . y ( λ z . M 1 ))( x M 2 ) ( λ x . P ( B )) + P ( λ x . B ) = ( P ( M ) N ( N )) + P ( M N ) = λ x N ( x ) x − = N ( λ x . B ) ( λ x . N ( B )) − = • N ( M N ) ( N ( M ) N ( N )) − = λ y • • x λ t y M 2 λ z M 1 5 / 18
Polarity in λ K P ( x ) = x + ( λ x . (( λ y . y + ( λ z . M − 1 ) − ) + ( x − M − 2 ) − ) + ) + ( λ x . P ( B )) + P ( λ x . B ) = ( P ( M ) N ( N )) + P ( M N ) = λ x + N ( x ) x − = N ( λ x . B ) ( λ x . N ( B )) − = N ( M N ) ( N ( M ) N ( N )) − • + = λ y + • − • + x − λ t − M − y + λ z − 2 M − 1 5 / 18
Polarity in λ K (a.k.a. head spine [Barendregt et al., 1987]) P ( x ) = x + λ x . ( λ y . y ( λ z . M 1 ))( x M 2 ) ( λ x . P ( B )) + P ( λ x . B ) = ( P ( M ) N ( N )) + P ( M N ) = λ x N ( x ) x − = N ( λ x . B ) ( λ x . N ( B )) − = • N ( M N ) ( N ( M ) N ( N )) − = hs ( x ) = x λ y • hs ( λ x . B ) = λ x . hs ( B ) hs ( M N ) = hs ( M ) N • x λ t bn ( x ) = x y bn ( λ x . B ) = λ x . B M 2 λ z bn ( M N ) = bn ( M ) N M 1 5 / 18
Polarity in λ K (head reduction) P ( x ) = x + λ x . ( λ y . y ( λ z . M 1 ))( x M 2 ) ( λ x . P ( B )) + P ( λ x . B ) = ( P ( M ) N ( N )) + P ( M N ) = λ x N ( x ) x − = N ( λ x . B ) ( λ x . N ( B )) − = • N ( M N ) ( N ( M ) N ( N )) − = hr ( x ) = x λ y • hr ( λ x . B ) = λ x . hr ( B ) hr ( M N ) = bn ( M ) N • x λ t bn ( x ) = x y bn ( λ x . B ) = λ x . B M 2 λ z bn ( M N ) = bn ( M ) N M 1 5 / 18
Head normal forms λ x 1 HNF ::= x λ x n | λ x . HNF | HNF Λ • • M m λ x 1 . . . x n . y M 1 . . . M m y M 1 6 / 18
Pure lambda-value calculus ( λ V ) [Egidi et al., 1991] ◮ λ V in [Plotkin, 1975] without primitive constants and δ -rules. N ∈ Val Val ::= x | λ x . Λ ( β V ) ( λ x . B ) N = β V [ N / x ] B 7 / 18
Pure lambda-value calculus ( λ V ) [Egidi et al., 1991] ◮ λ V in [Plotkin, 1975] without primitive constants and δ -rules. N ∈ Val Val ::= x | λ x . Λ ( β V ) ( λ x . B ) N = β V [ N / x ] B ◮ Why values as non applications? An irreducible application may become a divergent term when the free variables in it are substituted by other terms [Plotkin, 1975]. 7 / 18
Pure lambda-value calculus ( λ V ) [Egidi et al., 1991] ◮ λ V in [Plotkin, 1975] without primitive constants and δ -rules. N ∈ Val Val ::= x | λ x . Λ ( β V ) ( λ x . B ) N = β V [ N / x ] B ◮ Why values as non applications? An irreducible application may become a divergent term when the free variables in it are substituted by other terms [Plotkin, 1975]. “Preserving confluence by preserving potential divergence”. 7 / 18
Is there a standard theory for λ V ? ◮ Call-by-value solvability [Paolini and Ronchi Della Rocca, 1999]: M is v -solvable iff there exists C h [ ] ≡ ( λ x 1 . . . x m [ ]) N 1 . . . N n such that C h [ M ] = β V I . The order n of a v -unsolvable M informs about the number of preceding lambdas in the term, i.e., M = β V λ x 1 . . . λ x n . B . ◮ The v -unsolvables of order 0 can be equated in a consistent way [Paolini and Ronchi Della Rocca, 1999]. ◮ Domain H constructed from canonical solution of equation D ∼ = [ D → ⊥ D ] ⊥ [Egidi et al., 1991]. The v -unsolvable terms of order 0 denote ⊥ in H . ◮ Standard reduction in λ V [Plotkin, 1975] is complete. Does ‘complete’ imply ‘standard’? 8 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . ( λ x . ( λ y . ∆)( x I )∆) V 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ → ∗ β V . . . 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ → ∗ β V . . . 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . β V ( λ y . ∆) V ′ ∆ ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ → ∗ 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . β V ( λ y . ∆) V ′ ∆ ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ → ∗ → β V ∆ ∆ ≡ Ω 9 / 18
Objection on λ V normal forms in [Paolini and Ronchi Della Rocca, 1999] Ω and U ≡ ( λ y . ∆)( x I )∆ are observationally equivalent. Consider the context ( λ x . [ ]) V ( λ x . Ω) V → β V Ω → β V . . . β V ( λ y . ∆) V ′ ∆ ( λ x . ( λ y . ∆)( x I )∆) V → β V ( λ y . ∆)( V I )∆ → ∗ → β V ∆ ∆ ≡ Ω → β V . . . 9 / 18
Recommend
More recommend