νλμ : The Computational Content of Classical Natural Deduction Alexander J Summers Department of Computing Imperial College London Set context of work/intro
Curry-Howard Correspondence Historically relates minimal logic and λ-calculus Formulas relate to types Proofs relate to terms Proof reductions relate to β reductions Logic and calculus were invented independently We can borrow the idea of the correspondence.. Existing calculus => logic-based type system Existing logic => new programming calculus Extract the ‘computational content’ of the logic For Classical Logic, some work exists, but nothing as “nice” as the original correspondence What we’re going to talk about the effect of different connectives on term calculi Write this at the end, when all other slides are done.#
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it)
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it)
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it)
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) (Ax) Γ, x:A ⊢ x : A
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction (If Lambda Calculus did not exist, it would be necessary to invent it) Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction Reductions? Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction Reductions? A standard notion of proof reduction exists.. Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
Curry-Howard Correspondence Minimal Natural Deduction Reductions? A standard notion of proof reduction exists.. Furthermore, it gives rise to the β-rule from the λ-calculus! Γ, x:A ⊢ M : B (Ax) (→I) Γ, x:A ⊢ x : A Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
To extract the computational content of a logic.. Write down the proof rules Write a syntactic representation Label the formulas in contexts Subproofs become subterms Formulas bound correspond to syntax binders If the logic has canonical reduction rules, use them Throw away all the types This is only possible if reduction rules depend on syntax only Now the proof rules form a simple type-assignment system Syntax directed Principal typings Strong Normalisation of typeable terms
What about Classical Logic? Classical Natural Deduction
What about Classical Logic? Classical Natural Deduction (Ax) Γ, x:A ⊢ x : A Γ, x:A ⊢ M : B (→I) Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A (→E) Γ ⊢ (M N) : B
What about Classical Logic? Classical Natural Deduction (Ax) Γ, x:A ⊢ x : A Γ, x:A ⊢ M : B (→I) Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B (→I) Γ ⊢ λx.M : A→B Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Classical Natural Deduction Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
What about Classical Logic? The νλμ-calculus Γ, x:A ⊢ M : (Ax) (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
New features The νλμ-calculus Γ, x:A ⊢ M : Γ, x:A ⊢ x : A (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
New features The νλμ-calculus Γ, x:A ⊢ M : Γ, x:A ⊢ x : A (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
New features The νλμ-calculus Γ, x:A ⊢ M : Γ, x:A ⊢ x : A (¬I) Γ, x:A ⊢ x : A Γ ⊢ νx.M : ¬A Γ, x:A ⊢ M : B Γ ⊢ M : ¬A Γ ⊢ N : A (→I) (¬E) Γ ⊢ λx.M : A→B Γ ⊢ [M]N : Γ ⊢ M : A→B Γ ⊢ N : A Γ, x: ¬A ⊢ M : (→E) (PC) Γ ⊢ (M N) : B Γ ⊢ μx.M : A
New features νx.M ¬A [M]N μx.M
New features νx.M ¬A [M]N μx.M
New features νx.M ¬A [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features ¬A νx.M [M]N μx.M
New features - bottom type represents ‘no output’ ¬A - negated type for continuation with input of type A νx.M - terms to explicitly represent continuations Informally, terms which consume an input but produce no output [M]N - continuation application Pass the argument N to the continuation M μx.M - control operator Capture the surrounding ‘context’ and bind it to x What about reductions? Many alternative ideas exist, particularly for the μ-bound terms Identify a common theme, and generalise the existing work ¬A νx.M [M]N μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC)
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC)
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC)
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC)
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) μx.M : A
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A μx.M
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A μx.M : A
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A z : A
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) νz. Γ ⊢ μx.M : A z : A : ¬A
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) νz. Γ ⊢ μx.M : A z : A : ¬A
μ reductions.. General idea: μ-bound terms consume their contexts Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) νz. Γ ⊢ μx.M : A z : A : ¬A
μ reductions.. General idea: μ-bound terms consume their contexts. Recall the typing rule: Find a term of type ¬A Substitute the term for x Term of type ¬A is a continuation with a ‘hole’ of type A Any context around μx.M must have a ‘hole’ of type A Γ, x: ¬A ⊢ M : (PC) Γ ⊢ μx.M : A Γ, x: ¬A ⊢ M : (PC) νz. Γ ⊢ μx.M : A z : A : ¬A
μ reductions.. More formally, using a special kind of context Ec Ec{μx.M} → M< νz.Ec{z} / x > This behaviour can be broken down into ‘local’ rules Each rule consumes one level of surrounding context [μx.M]N → M< νz.[z]N/ x > The resulting rules largely subsume those in the literature Γ, x: ¬A ⊢ M : (PC) νz. Γ ⊢ μx.M : A z : A : ¬A
Comparisons and related work There is plenty of existing work on similar calculi λμ-calculus of Parigot λC calculus of Griffin Many others and variants Aim to faithfully inhabit the original logic Aim for a set of reductions encompassing existing work Aim for the simulation of existing control operators Another yardstick: classical sequent calculus Has fairly well-understood and accepted reduction rules Aim to be able to encode, and simulate these The νλμ calculus manages all of this
Details
Details (don’t panic) Coming soon to a thesis near you Also, there’s a paper on my web page google for “Alexander J Summers” Thank you for listening