## Using Reflection to Explain and Enhance Type Theory (1994)

Venue: | Proof and Computation, volume 139 of NATO Advanced Study Institute, International Summer School held in Marktoberdorf, Germany, July 20-August 1, NATO Series F |

Citations: | 11 - 5 self |

### BibTeX

@INPROCEEDINGS{Constable94usingreflection,

author = {Robert L. Constable},

title = {Using Reflection to Explain and Enhance Type Theory},

booktitle = {Proof and Computation, volume 139 of NATO Advanced Study Institute, International Summer School held in Marktoberdorf, Germany, July 20-August 1, NATO Series F},

year = {1994},

pages = {65--100},

publisher = {Springer}

}

### OpenURL

### Abstract

The five lectures at Marktoberdorf on which these notes are based were about the architecture of problem solving environments which use theorem provers. Experience with these systems over the past two decades has shown that the prover must be extensible, yet it must be kept safe. We examine a way to safely add new decision procedures to the Nuprl prover. It relies on a reflection mechanism and is applicable to any tactic-oriented prover with sufficient reflection. The lectures explain reflection in the setting of constructive type theory, the core logic of Nuprl.

### Citations

1562 | The Definition of Standard ML
- Miller, Tofte, et al.
- 1990
(Show Context)
Citation Context ...tics, or a reduction (rewrite) semantics, or a structural operational semantics or something else. We choose to base the account on inductively defined relations and partial functions in the style of =-=[13, 35, 39, 43], sometimes called &-=-quot;natural semantics". We use a lazy evaluator [1, 13, 35]. We define first a relation "evaluates to," t evals to t 0 . Then we define val as a map val : fx : term j 9t : term x evals... |

1286 | A structural approach to operational semantics
- Plotkin
- 1981
(Show Context)
Citation Context ...tics, or a reduction (rewrite) semantics, or a structural operational semantics or something else. We choose to base the account on inductively defined relations and partial functions in the style of =-=[13, 35, 39, 43], sometimes called &-=-quot;natural semantics". We use a lazy evaluator [1, 13, 35]. We define first a relation "evaluates to," t evals to t 0 . Then we define val as a map val : fx : term j 9t : term x evals... |

471 |
The calculus of constructions
- Coquand, Huet
- 1988
(Show Context)
Citation Context ...s of the prover could be expanded by users and was not the exclusive province of the designers ("power to the people" is a slogan of this community). Many other provers have now adopted this=-= approach [13, 15, 24, 41]-=-. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM [44] among others used such ... |

265 |
Constructive mathematics and computer programming
- Martin-Löf
- 1982
(Show Context)
Citation Context ...tics, or a reduction (rewrite) semantics, or a structural operational semantics or something else. We choose to base the account on inductively defined relations and partial functions in the style of =-=[13, 35, 39, 43], sometimes called &-=-quot;natural semantics". We use a lazy evaluator [1, 13, 35]. We define first a relation "evaluates to," t evals to t 0 . Then we define val as a map val : fx : term j 9t : term x evals... |

202 | A Basis for a Mathematical Theory of Computation
- McCarthy
- 1963
(Show Context)
Citation Context ...echnique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore [8], Weyrauch [50], Howe [29], as well as =-=[3, 6, 16, 37, 47, 48]-=-. Acknowledgements I want to thank Kate Ricks for preparing this manuscript in L a T E X and for cheerfully tolerating such complexity in her first such project. I appreciate Stuart Allen's comments o... |

190 |
Reflection and semantics in lisp
- Smith
- 1984
(Show Context)
Citation Context ...echnique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore [8], Weyrauch [50], Howe [29], as well as =-=[3, 6, 16, 37, 47, 48]-=-. Acknowledgements I want to thank Kate Ricks for preparing this manuscript in L a T E X and for cheerfully tolerating such complexity in her first such project. I appreciate Stuart Allen's comments o... |

157 |
An intuitionistic theory of types: Predicative part
- Martin-Löf
- 1975
(Show Context)
Citation Context ...n it. 11 3 Formalizing Type Theory Nuprl presents a particular formalization of type theory. There are several others [17, 22, 23, 24, 26, 42]. At the core are ideas from deBruijn [17] and Martin-Lof =-=[34]-=- extended with the notions of inductive types and direct computation which give Nuprl its unique architecture. The formalization comes in two parts. First we lay down the structure of terms and then e... |

141 |
The system F of variable types, fifteen years later. Theoretical Computer Science 45
- Girard
- 1986
(Show Context)
Citation Context ... new type, say Type, for this purpose. But then it must belong to a type. We might try attaining closure by postulating. Type 2 Type. But this causes many troubles. It allows us to inhabit every type =-=[21]-=- and permits nonterminating functions in the function spaces [28]. So following the traditions of predicative type theory [45, 34, 19, 20], we introduce a hierarchy of types. Following [35] we call th... |

132 |
Contraction-free Sequent Calculi for Intuitionistic Logic
- Dyckhoff
- 1992
(Show Context)
Citation Context ...tic example would be decision procedures commonly used such as arith or sup \Gamma inf , but those are too complex to treat in these lectures, and the tautology procedure is used in some provers, see =-=[18]-=-. 5.1 Sample Decision Procedure The tableau decision procedure for classical propositional formulas is especially well understood (and still current, see the account in [40]). The idea is that given a... |

118 |
The complexity of elementary algebra and geometry
- Ben-Or, Kozen, et al.
- 1986
(Show Context)
Citation Context .../CV-arith [11], congruence closure [32], sup-inf [46] are from this period and all are actively used today. New decision procedures are always being studied, monotone closure [36], real-closed fields =-=[33]-=-, etc. Here are typical uses of arith. x ! x 2 & x 6= 0 ) 2sxsx ! 0 by arith or (x \Gamma ysy & ysx + 1 & x \Gamma 1sz & zsx + 1 & y \Gamma 1sz & zsy + 1) ) (x = y)s(y = z)s(z = x) by arith Nuprl was ... |

117 |
Mathematical logic as based on the theory of types
- Russell
- 1908
(Show Context)
Citation Context ...2 Type. But this causes many troubles. It allows us to inhabit every type [21] and permits nonterminating functions in the function spaces [28]. So following the traditions of predicative type theory =-=[45, 34, 19, 20]-=-, we introduce a hierarchy of types. Following [35] we call them universes. They are denoted U 1 ; U 2 ; : : :, and we have that U i 2 U i+1 and if A 2 U i then A 2 U j for i ! j. Logic is introduced ... |

104 |
Introduction to HOL
- Gordon, Melham
- 1993
(Show Context)
Citation Context ...s of the prover could be expanded by users and was not the exclusive province of the designers ("power to the people" is a slogan of this community). Many other provers have now adopted this=-= approach [13, 15, 24, 41]-=-. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM [44] among others used such ... |

102 |
Metafunctions: proving them correct and using them efficiently as new proof proceedures
- Boyer, Moore
- 1981
(Show Context)
Citation Context .... I think that this will be an important technique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore =-=[8]-=-, Weyrauch [50], Howe [29], as well as [3, 6, 16, 37, 47, 48]. Acknowledgements I want to thank Kate Ricks for preparing this manuscript in L a T E X and for cheerfully tolerating such complexity in h... |

99 |
Edinburgh LCF: a mechanized logic of computation
- Gordon, Milner, et al.
- 1979
(Show Context)
Citation Context ...heories, it is possible to write tactics and decision procedures directly in the logic itself. This is true for Nuprl whose computation system is a functional programming language in the spirit of ML =-=[25]-=-, which is the language of choice for writing tactics. In this case the decision procedure is both proven correct and directly executable. A critical part of writing tactics inside a type theory is to... |

90 |
A survey of the project AUTOMATH
- Bruijn
- 1980
(Show Context)
Citation Context ...onth; m:Day), where Day is a family of twelve types. And (x:maxday[x]) is a term in it. 11 3 Formalizing Type Theory Nuprl presents a particular formalization of type theory. There are several others =-=[17, 22, 23, 24, 26, 42]-=-. At the core are ideas from deBruijn [17] and Martin-Lof [34] extended with the notions of inductive types and direct computation which give Nuprl its unique architecture. The formalization comes in ... |

88 | W.E.: The Semantics of Reflected Proof
- Allen, Constable, et al.
- 1990
(Show Context)
Citation Context ...e implementation language. This approach is being 3 followed by E. Gunter for HOL90 where the implementation language is SML-NJ. This is a very large task which resembles the reflection work in Nuprl =-=[3, 4, 6]-=- on which this paper is based, but one must rely on the stability of a large programming language and must define a substantially more complex system. 1.3 Summary of a solution A critical step in solv... |

80 |
Constable et al. Implementing Mathematics with the NuPRL Proof Development System
- L
- 1986
(Show Context)
Citation Context ...s of the prover could be expanded by users and was not the exclusive province of the designers ("power to the people" is a slogan of this community). Many other provers have now adopted this=-= approach [13, 15, 24, 41]-=-. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM [44] among others used such ... |

77 | Elf: A language for logic definition and verified meta-programming
- Pfenning
- 1989
(Show Context)
Citation Context ...onth; m:Day), where Day is a family of twelve types. And (x:maxday[x]) is a term in it. 11 3 Formalizing Type Theory Nuprl presents a particular formalization of type theory. There are several others =-=[17, 22, 23, 24, 26, 42]-=-. At the core are ideas from deBruijn [17] and Martin-Lof [34] extended with the notions of inductive types and direct computation which give Nuprl its unique architecture. The formalization comes in ... |

70 |
Notes on data structuring
- Hoare
- 1972
(Show Context)
Citation Context ...tivated both by mathematical and computational considerations. So we will see a tight relationship to the notion of type in programming languages. The notes by C.A.R. Hoare, Notes on Data Structuring =-=[27]-=-, make the point well. 2.2.1 Cartesian products If A and B are types, then so is their product, written A \Theta B. There will be many formation rules of this form, so we adopt a simple convention for... |

65 |
A practical decision procedure for arithmetic with function symbols
- Shostak
- 1979
(Show Context)
Citation Context ...very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM [44] among others used such procedures. In particular the PL/CV-arith [11], congruence closure [32], sup-inf =-=[46]-=- are from this period and all are actively used today. New decision procedures are always being studied, monotone closure [36], real-closed fields [33], etc. Here are typical uses of arith. x ! x 2 & ... |

63 | A semantic basis for Quest
- Cardelli, Longo
- 1991
(Show Context)
Citation Context ... or fails. H ` G by Decide(dp). This simple example illustrates the essential ideas behind the method of using relfection to justify decision procedures and for type checking in programming languages =-=[10]-=-. I think that this will be an important technique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore ... |

62 |
Self-Reference and Modal Logic
- Smoryński
- 1985
(Show Context)
Citation Context ...echnique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore [8], Weyrauch [50], Howe [29], as well as =-=[3, 6, 16, 37, 47, 48]-=-. Acknowledgements I want to thank Kate Ricks for preparing this manuscript in L a T E X and for cheerfully tolerating such complexity in her first such project. I appreciate Stuart Allen's comments o... |

58 |
Complexity of Finitely Presented Algebras
- Kozen
(Show Context)
Citation Context ...rocedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM [44] among others used such procedures. In particular the PL/CV-arith [11], congruence closure =-=[32]-=-, sup-inf [46] are from this period and all are actively used today. New decision procedures are always being studied, monotone closure [36], real-closed fields [33], etc. Here are typical uses of ari... |

49 | A logic programming approach to manipulating formulas and programs
- Miller, Nadathur
- 1987
(Show Context)
Citation Context ...inition in terms of rules for sequents. We organize them topdown, e. g. ` (x:b) 2 A ! B by x : A ` b 2 B Nuprl supports a problem-solving style that is top-down or goal-driven (like Prolog and Prolog =-=[38]-=-). In this style, the goals is ` G thought of as `? 2 G starting with G we try to synthesize g. Rules in this style look like ` A ! B by D0 [new x] x : A ` B 18 The rule name Di means decompose hypoth... |

46 |
Logic for Applications
- Nerode, Shore
- 1997
(Show Context)
Citation Context ... used in some provers, see [18]. 5.1 Sample Decision Procedure The tableau decision procedure for classical propositional formulas is especially well understood (and still current, see the account in =-=[40]-=-). The idea is that given a formula, we try to systematically falsify it by building up a truth assignment to the subformulas, eventually including the atomic ones (the variables). If we succeed, then... |

37 |
Computational Metatheory in Nuprl
- Howe
- 1988
(Show Context)
Citation Context ...be an important technique for modern provers that employ decision procedures. There are many other uses of reflection, and I recommend `looking at articles by Boyer and Moore [8], Weyrauch [50], Howe =-=[29]-=-, as well as [3, 6, 16, 37, 47, 48]. Acknowledgements I want to thank Kate Ricks for preparing this manuscript in L a T E X and for cheerfully tolerating such complexity in her first such project. I a... |

37 |
Ontic: A knowledge representation system for mathematics
- McAllester
- 1988
(Show Context)
Citation Context ...res. In particular the PL/CV-arith [11], congruence closure [32], sup-inf [46] are from this period and all are actively used today. New decision procedures are always being studied, monotone closure =-=[36]-=-, real-closed fields [33], etc. Here are typical uses of arith. x ! x 2 & x 6= 0 ) 2sxsx ! 0 by arith or (x \Gamma ysy & ysx + 1 & x \Gamma 1sz & zsx + 1 & y \Gamma 1sz & zsy + 1) ) (x = y)s(y = z)s(z... |

34 |
PX: A Computational Logic
- Hayashi, Nakano
- 1988
(Show Context)
Citation Context ...onth; m:Day), where Day is a family of twelve types. And (x:maxday[x]) is a term in it. 11 3 Formalizing Type Theory Nuprl presents a particular formalization of type theory. There are several others =-=[17, 22, 23, 24, 26, 42]-=-. At the core are ideas from deBruijn [17] and Martin-Lof [34] extended with the notions of inductive types and direct computation which give Nuprl its unique architecture. The formalization comes in ... |

25 |
Formalized metareasoning in type theory
- Knoblock, Constable
- 1986
(Show Context)
Citation Context ...ond our reach; we need a way to link this result to the Nuprl logic itself. The final step of the solution I am describing here [5] relies on the Nuprl reflection rule, a unique feature of the system =-=[3, 4, 6, 31]-=-. This rule says that to prove a goal G under hypothesis H , it suffices to show that the reflected sequent, pH ` Gq, is provable. That is, H ` G if 9p : Proof: p proves pH ` Gq: Now we can apply the ... |

23 |
The lazy -calculus
- Abramsky
- 1990
(Show Context)
Citation Context ...or something else. We choose to base the account on inductively defined relations and partial functions in the style of [13, 35, 39, 43], sometimes called "natural semantics". We use a lazy =-=evaluator [1, 13, 35]. We defin-=-e first a relation "evaluates to," t evals to t 0 . Then we define val as a map val : fx : term j 9t : term x evals to tg ! term: We give some cases of the evaluation relation to illustrate ... |

23 |
Polymorphic typed lambda-calculi in a type-free axiomatic framework
- Feferman
- 1990
(Show Context)
Citation Context ...2 Type. But this causes many troubles. It allows us to inhabit every type [21] and permits nonterminating functions in the function spaces [28]. So following the traditions of predicative type theory =-=[45, 34, 19, 20]-=-, we introduce a hierarchy of types. Following [35] we call them universes. They are denoted U 1 ; U 2 ; : : :, and we have that U i 2 U i+1 and if A 2 U i then A 2 U j for i ! j. Logic is introduced ... |

23 |
Logics for termination and correctness of functional programs II: Logics of strength PRA
- Feferman
- 1992
(Show Context)
Citation Context ...2 Type. But this causes many troubles. It allows us to inhabit every type [21] and permits nonterminating functions in the function spaces [28]. So following the traditions of predicative type theory =-=[45, 34, 19, 20]-=-, we introduce a hierarchy of types. Following [35] we call them universes. They are denoted U 1 ; U 2 ; : : :, and we have that U i 2 U i+1 and if A 2 U i then A 2 U j for i ! j. Logic is introduced ... |

23 |
An introduction to formal specification and verification using EHDM
- Rushby, Henke, et al.
- 1991
(Show Context)
Citation Context ...is approach [13, 15, 24, 41]. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV [11], and EHDM =-=[44]-=- among others used such procedures. In particular the PL/CV-arith [11], congruence closure [32], sup-inf [46] are from this period and all are actively used today. New decision procedures are always b... |

18 |
Implementing metamathematics as an approach to automatic theorem proving
- Constable, Howe
- 1990
(Show Context)
Citation Context ...2 is not possible, so TB 3 which contradicts FB 3 5.2 Formalizing the Decision Procedure There are many ways to present the tableau decision procedure formally. In Nuprl we have looked at two of them =-=[9, 14]-=-. Caldwell's account [9] is based on the approach in [14]. The methods referred to above can also be extended to the full set of connectives and to a notion of propositional proof derived from the int... |

18 |
Metamathematical extensibility for theorem verifiers and proof checkers
- Davis, Schwartz
- 1979
(Show Context)
Citation Context |

17 |
Automatic program verification i: a logical basis and its implementation
- Igarashi, London, et al.
- 1973
(Show Context)
Citation Context ...provers have now adopted this approach [13, 15, 24, 41]. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier =-=[30]-=-, PL/CV [11], and EHDM [44] among others used such procedures. In particular the PL/CV-arith [11], congruence closure [32], sup-inf [46] are from this period and all are actively used today. New decis... |

14 |
Proof Theory and Logical Complexity, volume 1
- Girard
- 1987
(Show Context)
Citation Context |

14 |
The computational behaviour of Girard’s paradox
- Howe
(Show Context)
Citation Context ... a type. We might try attaining closure by postulating. Type 2 Type. But this causes many troubles. It allows us to inhabit every type [21] and permits nonterminating functions in the function spaces =-=[28]-=-. So following the traditions of predicative type theory [45, 34, 19, 20], we introduce a hierarchy of types. Following [35] we call them universes. They are denoted U 1 ; U 2 ; : : :, and we have tha... |

7 |
An algorithm for checking PL/CV arithmetic inferences
- Chan
- 1982
(Show Context)
Citation Context ... now adopted this approach [13, 15, 24, 41]. Experience from the 1970s and earlier showed also that decision procedures are very effective in building proofs. The Stanford Pascal Verifier [30], PL/CV =-=[11]-=-, and EHDM [44] among others used such procedures. In particular the PL/CV-arith [11], congruence closure [32], sup-inf [46] are from this period and all are actively used today. New decision procedur... |

3 |
Reflecting on NuPRL : Lessons 1–4
- Aitken, Constable
- 1992
(Show Context)
Citation Context ...e implementation language. This approach is being 3 followed by E. Gunter for HOL90 where the implementation language is SML-NJ. This is a very large task which resembles the reflection work in Nuprl =-=[3, 4, 6]-=- on which this paper is based, but one must rely on the stability of a large programming language and must define a substantially more complex system. 1.3 Summary of a solution A critical step in solv... |

3 | Computability and Logic (second edition - Boolos, Jeffrey - 1980 |

3 |
PVS : An integrated approach to specification and verification
- Owre, Rushby, et al.
- 1992
(Show Context)
Citation Context |

2 |
Assigning meaning to proofs: a semantic basis for problem solving environments
- Constable
- 1989
(Show Context)
Citation Context ...ed U 1 ; U 2 ; : : :, and we have that U i 2 U i+1 and if A 2 U i then A 2 U j for i ! j. Logic is introduced into type theory by taking propositions-as-types. This is well explained elsewhere, e. g. =-=[12, 13, 17, 23, 34, 35]-=-. According to this principle, Prop i = U i : 4 Reflecting Formal Type Theory 4.1 The Basic Ideas We used the Naive Type Theory of section 2 to present the Nuprl type theory, e. g. term is an inductiv... |

1 |
A formal introduction to the lambda calculus
- Aitken
- 1993
(Show Context)
Citation Context ...nt that is mathematically rigorous, yet transparently clear to users. To illustrate how this is accomplished, I refer to the working material by W. Aitken A Formal Introduction to the Lambda Calculus =-=[2]-=-. This theory is easy to express in Naive Type Theory. Here are some highlights. Definition The terms are the following inductively defined class. 13 terms Variables x; y; z; : : : If f; a are terms a... |

1 |
Metaprogramming in Nuprl Using Reflection
- Aitken
- 1994
(Show Context)
Citation Context ...e implementation language. This approach is being 3 followed by E. Gunter for HOL90 where the implementation language is SML-NJ. This is a very large task which resembles the reflection work in Nuprl =-=[3, 4, 6]-=- on which this paper is based, but one must rely on the stability of a large programming language and must define a substantially more complex system. 1.3 Summary of a solution A critical step in solv... |

1 |
Using reflected decision procedures
- Aitken, Constable, et al.
- 1993
(Show Context)
Citation Context ...ich form an instance of IPC. But still these decision procedures are beyond our reach; we need a way to link this result to the Nuprl logic itself. The final step of the solution I am describing here =-=[5]-=- relies on the Nuprl reflection rule, a unique feature of the system [3, 4, 6, 31]. This rule says that to prove a goal G under hypothesis H , it suffices to show that the reflected sequent, pH ` Gq, ... |

1 |
A constructive proof of propositional completeness in Nuprl. implementation notes
- Caldwell
- 1993
(Show Context)
Citation Context ...2 is not possible, so TB 3 which contradicts FB 3 5.2 Formalizing the Decision Procedure There are many ways to present the tableau decision procedure formally. In Nuprl we have looked at two of them =-=[9, 14]-=-. Caldwell's account [9] is based on the approach in [14]. The methods referred to above can also be extended to the full set of connectives and to a notion of propositional proof derived from the int... |