incorporating quotation and evaluation into church s type
play

Incorporating Quotation and Evaluation Into Churchs Type Theory: - PowerPoint PPT Presentation

CICM 2016 Incorporating Quotation and Evaluation Into Churchs Type Theory: Syntax and Semantics William M. Farmer Department of Computing and Software McMaster University 26 July 2016 Outline Motivation. Syntax and semantics of ctt qe .


  1. CICM 2016 Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics William M. Farmer Department of Computing and Software McMaster University 26 July 2016

  2. Outline Motivation. Syntax and semantics of ctt qe . Examples. Sketch of a proof system. Conclusion. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 2/27

  3. MKM Challenge: Schemas How can we express a schema in a proof assistant? Example: The induction schema ( ϕ [ x �→ 0] ∧ ∀ x . ( ϕ ⊃ ϕ [ x �→ S ( x )])) ⊃ ∀ x . ϕ represents an infinite collection of axioms where ϕ ranges over a set of (open) first-order formulas. Note that ϕ ranges over syntactic expressions, not over semantic values. The induction schema is used to define the first-order theories of both Presburger arithmetic and Peano arithmetic with ϕ ranging over different sets of formulas. What happens to the induction schema after a new constant is defined? ◮ ϕ ranges over the same set? ◮ ϕ ranges over an extended set? W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 3/27

  4. Approach 1: Replace with a Single Axiom The induction schema is replaced with the second-order induction axiom ∀ P . ( P (0) ∧ ∀ x . ( P ( x ) ⊃ P ( S ( x )))) ⊃ ∀ x . P ( x ) where P ranges over unary predicates of natural numbers. Advantages: 1. The induction axiom is a single formula. 2. The induction axiom is stronger than the induction schema. Disadvantages: 1. The induction axiom is not expressible in first-order logic. 2. Presburger arithmetic and Peano arithmetic cannot be defined using the induction axiom. This approach is cheating! W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 4/27

  5. Approach 2: Implemented as a Rule of Inference The induction schema is implemented as a rule of inference. Advantages: 1. Instances of the induction schema can be used in proofs. 2. Presburger arithmetic and Peano arithmetic can be defined. Disadvantages: 1. The induction schema is expressed in the proof assistant’s metalogic, but not in its logic. 2. Presburger arithmetic and Peano arithmetic cannot be defined independently of the proof assistant’s proof system. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 5/27

  6. Approach 3: Local Reflection The induction schema is expressed in the proof assistant’s logic using the following infrastructure: 1. An inductive type of syntactic values that represent the syntactic structures of the formulas in a language L nat . 2. A quotation operator in the metalogic that maps a formula in L nat to the syntactic value that represents it. 3. An evaluation operator in the logic that maps a syntactic value e to the value of the formula in L nat that e represents. Advantages: 1. The induction schema is expressed as a single formula. 2. Presburger arithmetic and Peano arithmetic can be defined. Disadvantages: 1. The evaluation operator may not be definable in the logic. 2. The infrastructure is local; a new infrastructure is needed for each new kind of schema. 3. The infrastructure must be expanded for new defined constants. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 6/27

  7. Is there a better approach for problems like these? W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 7/27

  8. Replete Approach: Global Reflection The following infrastructure is added to the logic: 1. An inductive type of syntactic values that represent all the expressions in the language of the logic. 2. Global quotation ( � · � ) and evaluation ( � · � ) operators. This approach is employed in Lisp and other programming languages that support metaprogramming with reflection. Advantages: 1. We can reason directly about the syntax of the entire language of the logic in the logic itself. 2. The infrastructure thus provides a foundation for metareasoning with reflection. 3. The infrastructure does not have to be augmented or expanded. Disadvantages: 1. The proof assistant’s logic must be modified. 2. Several problems make the modification of the logic challenging. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 8/27

  9. Problems Confronting the Replete Approach Evaluation Problem. The liar paradox can be expressed in the logic if the evaluation operator is not restricted. Variable Problem. Syntactic notions — like whether a variable is free in an expression — can depend on the semantics of the expression as well as on its syntax. ◮ For example, if c = � x + 3 � , then x is free in � c � since � c � = � � x + 3 � � = x + 3 . Double Substitution Problem. Substitution of an expression e for a variable x occurring in � e ′ � may require two substitutions. ◮ For example, if the value of x is � x � , then � x � = � � x � � = x = � x � . W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 9/27

  10. Can metareasoning with reflection be implemented in a traditional logic using the replete approach? This is largely an open question! W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 10/27

  11. Our Research Plan 1. Develop a version of Church’s type theory called ctt qe that is engineered to support the replete approach. ◮ ctt qe is based on Q 0 , Peter Andrews’ elegant version of Church’s type theory. 2. Develop a proof system for ctt qe . 3. Implement ctt qe . 4. Demonstrate the utility of ctt qe by using the implementation to formalize a series of examples that involve the interplay of syntax and semantics. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 11/27

  12. Syntax: Types A type of ctt qe is defined inductively as follows: 1. Type of individuals: ι is a type. 2. Type of truth values: o is a type. 3. Type of constructions: ǫ is a type. 4. Function type: If α and β are types, then ( α → β ) is a type. W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 12/27

  13. Syntax: Logical Constants = α → α → o for all α ∈ T is-var ǫ → o is-con ǫ → o app ǫ → ǫ → ǫ abs ǫ → ǫ → ǫ quo ǫ → ǫ is-expr α for all α ∈ T ǫ → o W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 13/27

  14. Syntax: Expressions An expression of type α of ctt qe is defined inductively as follows: 1. Variable: x α is an expression of type α . 2. Constant: c α is an expression of type α . 3. Function application: ( F α → β A α ) is an expression of type β . 4. Function abstraction: ( λ x α . B β ) is an expression of type α → β . 5. Quotation: � A α � is an expression of type ǫ if A α is eval-free. 6. Evaluation: � A ǫ � B β is an expression of type β . W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 14/27

  15. Syntax: Constructions A construction of ctt qe is an expression of type ǫ defined inductively as follows: 1. � x α � is a construction. 2. � c α � is a construction. 3. If A ǫ and B ǫ are constructions, then app ǫ → ǫ → ǫ A ǫ B ǫ , abs ǫ → ǫ → ǫ A ǫ B ǫ , and quo ǫ → ǫ A ǫ are constructions. Let E be the function mapping eval-free expressions to constructions that is defined inductively as follows: 1. E ( x α ) = � x α � . 2. E ( c α ) = � c α � . 3. E ( F α → β A α ) = app ǫ → ǫ → ǫ E ( F α → β ) E ( A α ). 4. E ( λ x α . B β ) = abs ǫ → ǫ → ǫ E ( x α ) E ( B β ). 5. E ( � A α � ) = quo ǫ → ǫ E ( A α ). W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 15/27

  16. Syntax: Five Kinds of Eval-Free Expressions Kind Syntax Syntactic Values Variable x α � x α � Constant c α � c α � Function application F α → β A α app ǫ → ǫ → ǫ E ( F α → β ) E ( A α ) Function abstraction abs ǫ → ǫ → ǫ E ( x α ) E ( B β ) λ x α . B β Quotation � A α � quo ǫ → ǫ E ( A α ) W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 16/27

  17. Syntax: Definitions and Abbreviations ( A α = B α ) stands for = α → α → o A α B α . T o stands for = o → o → o = = o → o → o . F o stands for ( λ x o . T o ) = ( λ x o . x o ) . ( ∀ x α . A o ) stands for ( λ x α . T o ) = ( λ x α . A o ). ∧ o → o → o stands for λ x o . λ y o . (( λ g o → o → o . g o → o → o T o T o ) = ( λ g o → o → o . g o → o → o x o y o )) . ( A o ∧ B o ) stands for ∧ o → o → o A o B o . ⊃ o → o → o stands for λ x o . λ y o . ( x o = ( x o ∧ y o )) . ( A o ⊃ B o ) stands for ⊃ o → o → o A o B o . ¬ o → o stands for = o → o → o F o . ( ¬ A o ) stands for ¬ o → o A o . ∨ o → o → o stands for λ x o . λ y o . ¬ ( ¬ x o ∧ ¬ y o ) . ( A o ∨ B o ) stands for ∨ o → o → o A o B o . ( ∃ x α . A o ) stands for ¬ ( ∀ x α . ¬ A o ). � A ǫ � β stands for � A ǫ � B β . W. M. Farmer Incorporating Quotation and Evaluation Into Church’s Type Theory: Syntax and Semantics 17/27

Recommend


More recommend