Jump to content

Logical framework: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Ruud Koot (talk | contribs)
cat
m top: minor ce
 
(34 intermediate revisions by 28 users not shown)
Line 1: Line 1:
In [[logic]], a '''logical framework''' provides a means to define (or present) a logic as a signature in a higher-order [[type theory]] in such a way that [[provability]] of a formula in the original logic reduces to a [[type inhabitation]] problem in the framework type theory.<ref name="Jacobs2001">{{cite book|author=Bart Jacobs|title=Categorical Logic and Type Theory|year=2001|publisher=Elsevier|isbn=9780444508539|page=598}}</ref><ref name="Gabbay1994">{{cite book|editor=Dov M. Gabbay|title=What is a logical system?|url=http://books.google.com/books?id=XqCu4XjHrIQC&pg=PA382|year=1994|publisher=Clarendon Press|isbn=9780198538592|page=382}}</ref> This approach has been used successfully for (interactive) [[automated theorem proving]]. The first logical framework was [[Automath]], however the name of the idea comes from the more widely known Edinburgh Logical Framework, '''LF'''. Several more recent proof tools like [[Isabelle (theorem prover)]] are based on this idea.<ref name="Jacobs2001"/> Unlike a direct embedding, the logical framework approach allows many logics to be embedded in the same type system.<ref name="BoveBarbosa2009">{{cite book|author1=Ana Bove|author2=Luis Soares Barbosa|author3=Alberto Pardo|title=Language Engineering and Rigourous (sic) Software Development: International LerNet ALFA Summer School 2008, Piriapolis, Uruguay, February 24 - March 1, 2008, Revised, Selected Papers|url=http://books.google.com/books?id=YOqHiA5MYpEC&pg=PA48|year=2009|publisher=Springer|isbn=9783642031526|pages=48}}</ref>
In [[logic]], a '''logical framework''' provides a means to define (or present) a logic as a signature in a higher-order [[type theory]] in such a way that [[Provability logic|provability]] of a formula in the original logic reduces to a [[type inhabitation]] problem in the framework type theory.<ref name="Jacobs2001">{{cite book|author=Bart Jacobs|title=Categorical Logic and Type Theory|year=2001|publisher=Elsevier|isbn=978-0-444-50853-9|page=598}}</ref><ref name="Gabbay1994">{{cite book|editor=Dov M. Gabbay|title=What is a logical system?|url=https://books.google.com/books?id=XqCu4XjHrIQC&pg=PA382|year=1994|publisher=[[Clarendon Press]]|isbn=978-0-19-853859-2|page=382}}</ref> This approach has been used successfully for (interactive) [[automated theorem proving]]. The first logical framework was [[Automath]]; however, the name of the idea comes from the more widely known Edinburgh Logical Framework, '''LF'''. Several more recent proof tools like [[Isabelle (theorem prover)|Isabelle]] are based on this idea.<ref name="Jacobs2001"/> Unlike a direct embedding, the logical framework approach allows many logics to be embedded in the same type system.<ref name="BoveBarbosa2009">{{cite book|author1=Ana Bove|author2=Luis Soares Barbosa|author3=Alberto Pardo|title=Language Engineering and Rigorous Software Development: International LerNet ALFA Summer School 2008, Piriapolis, Uruguay, February 24 - March 1, 2008, Revised, Selected Papers|url=https://books.google.com/books?id=YOqHiA5MYpEC&pg=PA48|year=2009|publisher=Springer|isbn=978-3-642-03152-6|pages=48}}</ref>


==Overview==
A logical framework is based on a general treatment of syntax, rules and proofs by means of a [[dependent type theory|dependently typed lambda calculus]]. Syntax is treated in a style similar to, but more general than [[Per Martin-Löf]]'s system of arities.
A logical framework is based on a general treatment of syntax, rules and proofs by means of a [[dependent type theory|dependently typed lambda calculus]]. Syntax is treated in a style similar to, but more general than [[Per Martin-Löf]]'s system of arities.


Line 11: Line 12:
This is summarized by:
This is summarized by:


''‘Framework = Language + Representation’''.
:"''Framework = Language + Representation''."


== LF as example ==
==LF==
In the case of the '''LF logical framework''', the meta-language is the [[λΠ-calculus]]. This is a system of first-order dependent function types which are related by the [[propositions as types principle]] to [[first-order logic|first-order]] [[minimal logic]]. The key features of the λΠ-calculus are that it consists of entities of three levels: objects, types and kinds (or type classes, or families of types). It is [[Impredicativity|predicative]], all well-typed terms are [[strongly normalizing]] and [[Church-Rosser]] and the property of being well-typed is [[Decidability (logic)|decidable]]. However, [[type inference]] is undecidable.


A logic is represented in the '''LF logical framework''' by the judgements-as-types representation mechanism. This is inspired by [[Per Martin-Löf]]'s development of [[Immanuel Kant|Kant]]'s notion of [[judgement (mathematical logic)|judgement]], in the 1983 Siena Lectures. The two higher-order judgements, the hypothetical <math>J\vdash K</math> and the general, <math>\Lambda x\in J. K(x)</math>, correspond to the ordinary and dependent function space, respectively. The methodology of judgements-as-types is that judgements are represented as the types of their proofs. A [[logical system]] <math>{\mathcal L}</math> is represented by its signature which assigns kinds and types to a finite set of constants that represents its syntax, its judgements and its rule schemes. An object-logic's rules and proofs are seen as primitive proofs of hypothetico-general judgements <math>\Lambda x\in C. J(x)\vdash K</math>.
In the case of the '''LF logical framework''', the meta-language is the [[λΠ-calculus|<math>\lambda\Pi</math>-calculus]]. This is a system of first-order dependent function types which are related by the [[propositions as types principle]] to first-order minimal logic. The key features of the <math>\lambda\Pi</math>-calculus are that it consists of entities of three levels: objects, types and families of types. It is [[Impredicativity | predicative]], all well-typed terms are [[strongly normalizing]] and [[Church-Rosser]] and the property of being well-typed is [[Decidability (logic)|decidable]]. However, [[type inference]] is [[Decidability (logic)|undecidable]].

A logic is represented in the '''LF logical framework''' by the judgements-as-types representation mechanism. This is inspired by [[Per Martin-Löf]]'s development of [[Kant]]'s notion of [[judgement (mathematical logic)|judgement]], in the 1983 Siena Lectures. The two higher-order judgements, the hypothetical <math>J\vdash K</math> and the general, <math>\Lambda x\in J. K(x)</math>, correspond to the ordinary and dependent function space, respectively. The methodology of judgements-as-types is that judgements are represented as the types of their proofs. A [[logical system]] <math>{\mathcal L}</math> is represented by its signature which assigns kinds and types to a finite set of constants that represents its syntax, its judgements and its rule schemes. An object-logic's rules and proofs are seen as primitive proofs of hypothetico-general judgements <math>\Lambda x\in C. J(x)\vdash K</math>.


An implementation of the LF logical framework is provided by the [[Twelf]] system at [[Carnegie Mellon University]]. Twelf includes
An implementation of the LF logical framework is provided by the [[Twelf]] system at [[Carnegie Mellon University]]. Twelf includes
:* a logic programming engine
* a logic programming engine
:* meta-theoretic reasoning about logic programs (termination, coverage, etc.)
* meta-theoretic reasoning about logic programs (termination, coverage, etc.)
:* an inductive [[meta-logic]]al theorem prover
* an inductive [[meta-logic]]al theorem prover

==See also==
* [[Grammatical Framework]]
* [[Turnstile (symbol)]]


==References==
==References==
Line 28: Line 32:


==Further reading==
==Further reading==
* {{cite book|editor=Helmut Schwichtenberg, Ralf Steinbrüggen|title=Proof and system-reliability|chapter=Logical frameworks&mdash;a brief introduction|year=2002|publisher=Springer|isbn=9781402006081|author=[[Frank Pfenning]]|url=http://www.cs.cmu.edu/~fp/papers/mdorf01.pdf}}
* {{cite book|editor=[[Helmut Schwichtenberg]], Ralf Steinbrüggen|title=Proof and system-reliability|chapter=Logical frameworksa brief introduction|year=2002| publisher=[[Springer Science+Business Media|Springer]] |isbn=978-1-4020-0608-1|author=[[Frank Pfenning]]|url=https://www.cs.cmu.edu/~fp/papers/mdorf01.pdf}}
*[[Robert Harper (computer scientist)|Robert Harper]], Furio Honsell and [[Gordon Plotkin]]. ''A Framework For Defining Logics''. Journal of the Association for Computing Machinery, 40(1):143-184, 1993
*[[Robert Harper (computer scientist)|Robert Harper]], Furio Honsell and [[Gordon Plotkin]]. ''A Framework For Defining Logics''. Journal of the Association for Computing Machinery, 40(1):143-184, 1993.
*Arnon Avron, Furio Honsell, Ian Mason and Randy Pollack. ''Using typed lambda calculus to implement formal systems on a machine''. Journal of Automated Reasoning, 9:309-354, 1992.
*[[Arnon Avron]], Furio Honsell, Ian Mason and Randy Pollack. ''Using typed lambda calculus to implement formal systems on a machine''. Journal of Automated Reasoning, 9:309-354, 1992.
*Robert Harper. ''An Equational Formulation of LF''. Technical Report, University of Edinburgh, 1988. LFCS report ECS-LFCS-88-67.
*Robert Harper. ''An Equational Formulation of LF''. Technical Report, [[University of Edinburgh]], 1988. LFCS report ECS-LFCS-88-67.
*Robert Harper, Donald Sannella and Andrzej Tarlecki. ''Structured Theory Presentations and Logic Representations''. Annals of Pure and Applied Logic, 67(1-3):113-160, 1994.
*Robert Harper, Donald Sannella and Andrzej Tarlecki. ''Structured Theory Presentations and Logic Representations''. Annals of Pure and Applied Logic, 67(1-3):113-160, 1994.
*Samin Ishtiaq and David Pym. ''A Relevant Analysis of Natural Deduction''. Journal of Logic and Computation 8, 809-838, 1998.
*Samin Ishtiaq and David Pym. ''A Relevant Analysis of Natural Deduction''. Journal of Logic and Computation 8, 809-838, 1998.
* Samin Ishtiaq and David Pym. ''Kripke Resource Models of a Dependently-typed, Bunched <math>\lambda</math>-calculus''. Journal of Logic and Computation 12(6), 1061-1104, 2002.
* Samin Ishtiaq and David Pym. ''Kripke Resource Models of a Dependently-typed, Bunched <math>\lambda</math>-calculus''. Journal of Logic and Computation 12(6), 1061-1104, 2002.
* Per Martin-Löf. "[http://www.hf.uio.no/filosofi/njpl/vol1no1/meaning/meaning.html On the Meanings of the Logical Constants and the Justifications of the Logical Laws]." "[[Nordic Journal of Philosophical Logic]]", 1(1): 11-60, 1996.
* Per Martin-Löf. "[https://web.archive.org/web/20060104064335/http://www.hf.uio.no/filosofi/njpl/vol1no1/meaning/meaning.html On the Meanings of the Logical Constants and the Justifications of the Logical Laws]." "[[Nordic Journal of Philosophical Logic]]", 1(1): 11-60, 1996.
* Bengt Nordström, Kent Petersson, and Jan M. Smith. ''Programming in Martin-Löf's Type Theory''. Oxford University Press, 1990. (The book is out of print, but [http://www.cs.chalmers.se/Cs/Research/Logic/book/ a free version] has been made available.)
* Bengt Nordström, Kent Petersson, and Jan M. Smith. ''Programming in Martin-Löf's Type Theory''. [[Oxford University Press]], 1990. (The book is out of print, but [http://www.cs.chalmers.se/Cs/Research/Logic/book/ a free version] has been made available.)
*David Pym. ''A Note on the Proof Theory of the <math>\lambda\Pi</math>-calculus''. Studia Logica 54: 199-230, 1995.
*David Pym. ''A Note on the Proof Theory of the <math>\lambda\Pi</math>-calculus''. Studia Logica 54: 199-230, 1995.
*David Pym and Lincoln Wallen. ''Proof-search in the <math>\lambda\Pi</math>-calculus''. In: G. Huet and G. Plotkin (eds), Logical Frameworks, Cambridge University Press, 1991.
*David Pym and [[Lincoln Wallen]]. ''Proof-search in the <math>\lambda\Pi</math>-calculus''. In: G. Huet and G. Plotkin (eds), Logical Frameworks, Cambridge University Press, 1991.
*Didier Galmiche and David Pym. ''Proof-search in type-theoretic languages:an introduction''. Theoretical Computer Science 232 (2000) 5-53.
*Didier Galmiche and David Pym. ''Proof-search in type-theoretic languages:an introduction''. Theoretical Computer Science 232 (2000) 5-53.
*Philippa Gardner. ''Representing Logics in Type Theory''. Technical Report, University of Edinburgh, 1992. LFCS report ECS-LFCS-92-227.
*Philippa Gardner. ''Representing Logics in Type Theory''. Technical Report, University of Edinburgh, 1992. LFCS report ECS-LFCS-92-227.
*Gilles Dowek. ''The undecidability of typability in the lambda-pi-calculus''. In M. Bezem, J.F. Groote (Eds.), Typed Lambda Calculi and Applications. Volume 664 of ''Lecture Notes in Computer Science'', 139-145, 1993.
*Gilles Dowek. ''The undecidability of typability in the lambda-pi-calculus''. In M. Bezem, J.F. Groote (Eds.), Typed Lambda Calculi and Applications. Volume 664 of ''Lecture Notes in Computer Science'', 139-145, 1993.
*David Pym. ''Proofs, Search and Computation in General Logic''. Ph.D. thesis, University of Edinburgh, 1990.
*David Pym. ''Proofs, Search and Computation in General Logic''. Ph.D. thesis, University of Edinburgh, 1990.
*David Pym. ''A Unification Algorithm for the <math>\lambda\Pi</math>-calculus.'' Int. J. of Foundations of Computer Science 3(3), 333-378, 1992.
*David Pym. ''A Unification Algorithm for the <math>\lambda\Pi</math>-calculus.'' International Journal of Foundations of Computer Science 3(3), 333-378, 1992.


== External links ==
==External links==
* [http://www.cs.cmu.edu/~fp/lfs-impl.html Specific Logical Frameworks and Implementations] (a list maintained by [[Frank Pfenning]])
* [https://www.cs.cmu.edu/~fp/lfs-impl.html Specific Logical Frameworks and Implementations] (a list maintained by [[Frank Pfenning]], but mostly dead links from 1997)


[[Category:Logic in computer science]]
[[Category:Logic in computer science]]
[[Category:Type theory]]
[[Category:Type theory]]
[[Category:Interactive theorem proving software]]
[[Category:Proof assistants]]
[[Category:Dependently typed programming]]
[[Category:Dependently typed programming]]
[[zh:逻辑框架]]

Latest revision as of 21:53, 4 November 2023

In logic, a logical framework provides a means to define (or present) a logic as a signature in a higher-order type theory in such a way that provability of a formula in the original logic reduces to a type inhabitation problem in the framework type theory.[1][2] This approach has been used successfully for (interactive) automated theorem proving. The first logical framework was Automath; however, the name of the idea comes from the more widely known Edinburgh Logical Framework, LF. Several more recent proof tools like Isabelle are based on this idea.[1] Unlike a direct embedding, the logical framework approach allows many logics to be embedded in the same type system.[3]

Overview

[edit]

A logical framework is based on a general treatment of syntax, rules and proofs by means of a dependently typed lambda calculus. Syntax is treated in a style similar to, but more general than Per Martin-Löf's system of arities.

To describe a logical framework, one must provide the following:

  1. A characterization of the class of object-logics to be represented;
  2. An appropriate meta-language;
  3. A characterization of the mechanism by which object-logics are represented.

This is summarized by:

"Framework = Language + Representation."

LF

[edit]

In the case of the LF logical framework, the meta-language is the λΠ-calculus. This is a system of first-order dependent function types which are related by the propositions as types principle to first-order minimal logic. The key features of the λΠ-calculus are that it consists of entities of three levels: objects, types and kinds (or type classes, or families of types). It is predicative, all well-typed terms are strongly normalizing and Church-Rosser and the property of being well-typed is decidable. However, type inference is undecidable.

A logic is represented in the LF logical framework by the judgements-as-types representation mechanism. This is inspired by Per Martin-Löf's development of Kant's notion of judgement, in the 1983 Siena Lectures. The two higher-order judgements, the hypothetical and the general, , correspond to the ordinary and dependent function space, respectively. The methodology of judgements-as-types is that judgements are represented as the types of their proofs. A logical system is represented by its signature which assigns kinds and types to a finite set of constants that represents its syntax, its judgements and its rule schemes. An object-logic's rules and proofs are seen as primitive proofs of hypothetico-general judgements .

An implementation of the LF logical framework is provided by the Twelf system at Carnegie Mellon University. Twelf includes

  • a logic programming engine
  • meta-theoretic reasoning about logic programs (termination, coverage, etc.)
  • an inductive meta-logical theorem prover

See also

[edit]

References

[edit]
  1. ^ a b Bart Jacobs (2001). Categorical Logic and Type Theory. Elsevier. p. 598. ISBN 978-0-444-50853-9.
  2. ^ Dov M. Gabbay, ed. (1994). What is a logical system?. Clarendon Press. p. 382. ISBN 978-0-19-853859-2.
  3. ^ Ana Bove; Luis Soares Barbosa; Alberto Pardo (2009). Language Engineering and Rigorous Software Development: International LerNet ALFA Summer School 2008, Piriapolis, Uruguay, February 24 - March 1, 2008, Revised, Selected Papers. Springer. p. 48. ISBN 978-3-642-03152-6.

Further reading

[edit]
  • Frank Pfenning (2002). "Logical frameworks – a brief introduction". In Helmut Schwichtenberg, Ralf Steinbrüggen (ed.). Proof and system-reliability (PDF). Springer. ISBN 978-1-4020-0608-1.
  • Robert Harper, Furio Honsell and Gordon Plotkin. A Framework For Defining Logics. Journal of the Association for Computing Machinery, 40(1):143-184, 1993.
  • Arnon Avron, Furio Honsell, Ian Mason and Randy Pollack. Using typed lambda calculus to implement formal systems on a machine. Journal of Automated Reasoning, 9:309-354, 1992.
  • Robert Harper. An Equational Formulation of LF. Technical Report, University of Edinburgh, 1988. LFCS report ECS-LFCS-88-67.
  • Robert Harper, Donald Sannella and Andrzej Tarlecki. Structured Theory Presentations and Logic Representations. Annals of Pure and Applied Logic, 67(1-3):113-160, 1994.
  • Samin Ishtiaq and David Pym. A Relevant Analysis of Natural Deduction. Journal of Logic and Computation 8, 809-838, 1998.
  • Samin Ishtiaq and David Pym. Kripke Resource Models of a Dependently-typed, Bunched -calculus. Journal of Logic and Computation 12(6), 1061-1104, 2002.
  • Per Martin-Löf. "On the Meanings of the Logical Constants and the Justifications of the Logical Laws." "Nordic Journal of Philosophical Logic", 1(1): 11-60, 1996.
  • Bengt Nordström, Kent Petersson, and Jan M. Smith. Programming in Martin-Löf's Type Theory. Oxford University Press, 1990. (The book is out of print, but a free version has been made available.)
  • David Pym. A Note on the Proof Theory of the -calculus. Studia Logica 54: 199-230, 1995.
  • David Pym and Lincoln Wallen. Proof-search in the -calculus. In: G. Huet and G. Plotkin (eds), Logical Frameworks, Cambridge University Press, 1991.
  • Didier Galmiche and David Pym. Proof-search in type-theoretic languages:an introduction. Theoretical Computer Science 232 (2000) 5-53.
  • Philippa Gardner. Representing Logics in Type Theory. Technical Report, University of Edinburgh, 1992. LFCS report ECS-LFCS-92-227.
  • Gilles Dowek. The undecidability of typability in the lambda-pi-calculus. In M. Bezem, J.F. Groote (Eds.), Typed Lambda Calculi and Applications. Volume 664 of Lecture Notes in Computer Science, 139-145, 1993.
  • David Pym. Proofs, Search and Computation in General Logic. Ph.D. thesis, University of Edinburgh, 1990.
  • David Pym. A Unification Algorithm for the -calculus. International Journal of Foundations of Computer Science 3(3), 333-378, 1992.
[edit]