extending mkm formats at the statement level

Extending MKM Formats at the Statement Level Fulya Horozal, Michael - PowerPoint PPT Presentation

Extending MKM Formats at the Statement Level Fulya Horozal, Michael Kohlhase and Florian Rabe Jacobs University Bremen CICM, 8.-13. July 2012 Bremen, Germany 1 Designing MKM Formats A design challenge Ease of modeling vs ease of


  1. Extending MKM Formats at the Statement Level Fulya Horozal, Michael Kohlhase and Florian Rabe Jacobs University Bremen CICM, 8.-13. July 2012 Bremen, Germany 1

  2. Designing MKM Formats A design challenge “Ease of modeling” vs “ease of implementation” Mathematics style Curry-Howard style < theorem name=”foo” > < constant name=”foo” > 1 + 1 . = 2 < type > 1 + 1 . < / theorem > = 2 < / type > < proof for=”foo” > < definition > proof - term proof - term < / proof > < / definition > < / constant > Standard solution: Extensibility Minimal core + extension principles 2

  3. Designing MKM Formats A design challenge “Ease of modeling” vs “ease of implementation” Mathematics style Curry-Howard style < theorem name=”foo” > < constant name=”foo” > 1 + 1 . = 2 < type > 1 + 1 . < / theorem > = 2 < / type > < proof for=”foo” > < definition > proof - term proof - term < / proof > < / definition > < / constant > Standard solution: Extensibility Minimal core + extension principles 2

  4. Designing MKM Formats A design challenge “Ease of modeling” vs “ease of implementation” Mathematics style Curry-Howard style < theorem name=”foo” > < constant name=”foo” > 1 + 1 . = 2 < type > 1 + 1 . < / theorem > = 2 < / type > < proof for=”foo” > < definition > proof - term proof - term < / proof > < / definition > < / constant > Standard solution: Extensibility Minimal core + extension principles 2

  5. Classification of Extension Principles What does the extension principle introduce? ◮ new object (typically identifier) e.g., 2 := succ ( succ ( zero )) ◮ new statement (typically with keyword) e.g., locales in Isabelle Who defines the extension principle? ◮ the user e.g., 2 := succ ( succ ( zero )) ◮ the programmer e.g., locales in Isabelle How is the extension principle interpreted? ◮ unconstrained interpretation at runtime ◮ constrained well-formedness judgments 3

  6. Some Extensible MKM Formats Extensions Object Level Statement Level LaTeX user user (narrative) unconstrained unconstrained MKM Formats Isabelle/HOL user programmer (formal math) (un)constrained unconstrained OMDoc 1.2 user programmer (content markup) constrained unconstrained LaTeX ◮ Object level: e.g., \ newcommand {\ mycommand }{ . . . } ◮ Statement level: e.g., \ newenvironment {\ myenv }{ . . . }{ . . . } 4

  7. Some Extensible MKM Formats Extensions Object Level Statement Level LaTeX user user (narrative) unconstrained unconstrained MKM Formats Isabelle/HOL user programmer (formal math) (un)constrained unconstrained OMDoc 1.2 user programmer (content markup) constrained unconstrained LaTeX ◮ Object level: e.g., \ newcommand {\ mycommand }{ . . . } ◮ Statement level: e.g., \ newenvironment {\ myenv }{ . . . }{ . . . } 4

  8. Some Extensible MKM Formats Extensions Object Level Statement Level LaTeX user user (narrative) unconstrained unconstrained MKM Formats Isabelle/HOL user programmer (formal math) (un)constrained unconstrained OMDoc 1.2 user programmer (content markup) constrained unconstrained Isabelle/HOL ◮ Object level: definitions, declarations, etc. ◮ Statement level: locales, type defns, case-based function defns 5

  9. Some Extensible MKM Formats Extensions Object Level Statement Level LaTeX user user (narrative) unconstrained unconstrained MKM Formats Isabelle/HOL user programmer (formal math) (un)constrained unconstrained OMDoc 1.2 user programmer (content markup) constrained unconstrained OMDoc 1.2 ◮ Object level: symbol declarations ◮ Statement level: theorems, definitions, proofs, etc. 5

  10. Our Approach: Generic Framework for Extension Principles Extensions Object Level Statement Level LaTeX user user (narrative) unconstrained unconstrained MKM Formats Isabelle/HOL user programmer (formal math) (un)constrained unconstrained OMDoc 1.2 user programmer (content markup) constrained unconstrained user user Our approach constrained constrained 6

  11. Our Approach: Generic Framework for Extension Principles Extensions Object Level Statement Level OMDoc 1.2 user programmer (content markup) constrained unconstrained OMDoc 2 user user (content markup) constrained constrained Redesign the OMDoc format extension layer minimal core pragmatic OMDoc 2 strict OMDoc 2 pragmatic-to-strict translation 6

  12. Motivating Example pragmatic surface syntax 1 + 1 . = 2 ( foo ) theorem proof proof - term notation parser pragmatic OMDoc 2 abstract syntax theorem 1 + 1 . foo : = 2 ( proof - term ) pragmatic-to-strict strict OMDoc 2 abstract syntax 1 + 1 . : = 2 = ( proof - term ) foo 7

  13. Our Core Language (strict OMDoc 2 = MMT) ◮ A module system for mathematical theories (MMT) ◮ Foundation-independent ◮ Logics and logical frameworks represented as theories ◮ Generic declarative language: theories, declarations, expressions Syntax ( theory T = { Σ } ) ∗ Modules ::= M ( c [ : E ] [= E ] | include T | meta T ) ∗ Theories Σ ::= Expressions OpenMath expressions E 8

  14. Our Core Language (strict OMDoc 2 = MMT) ◮ A module system for mathematical theories (MMT) ◮ Foundation-independent ◮ Logics and logical frameworks represented as theories ◮ Generic declarative language: theories, declarations, expressions Syntax ( theory T = { Σ } ) ∗ Modules ::= M ( c [ : E ] [= E ] | include T | meta T ) ∗ Theories Σ ::= Expressions OpenMath expressions E 8

  15. MMT Theories Examples theory FOL = { theory Propositions = { include Propositions type : term type → ∧ : prop → prop → prop lam . . prop : type . proof : prop → type ∃ : ( term → prop ) → prop } } 9

  16. Our Extension Layer (pragmatic OMDoc 2) ◮ Built on top of MMT ◮ Specify extension principles declaratively ◮ Two new primitives ◮ extension declarations to introduce extension principles ◮ pragmatic declarations to use extension principles Syntax Theories Σ ::= ( . . . | extension e = λ x 1 : E 1 . . . . λ x n : E n . { Σ } pragmatic c : e E 1 . . . E n ) ∗ | 10

  17. Examples An extension principle extension theorem = λ F : prop . λ D : proof F . { c : proof F = D } A pragmatic declaration pragmatic foo : theorem (1 + 1 . = 2) ( proof - term ) 11

  18. Modularity An extension principle theory Theorems = { meta Propositions extension theorem = λ F : prop . λ D : proof F . { c : proof F = D } } A pragmatic declaration theory MyTheorem = { meta Theorems include Nats pragmatic foo : theorem (1 + 1 . = 2) ( proof - term ) } 12

  19. Pragmatic-to-Strict Translation Semantics of pragmatic declarations: Elaborate pragmatic declarations into strict (core) declarations. extension e = λ x 1 : E 1 . . . . λ x n : E n . { : τ 1 = D 1 c 1 . . . c n : τ n = D n } pragmatic p : e A 1 . . . A n p . c 1 : γ ( τ 1 ) = γ ( D 1 ) elaborate . : p e A 1 . . . A n . . p . c n : γ ( τ n ) = γ ( D n ) γ substitutes A i for x i and p . c i for c i . 13

  20. Various Extension Principles Mizar-Style Functor Definitions theory FunctorDefinitions = { meta Propositions extension functor = λα : type . λβ : type . λ means : α → β → prop . λ existence : proof . . . . λ uniqueness : proof . . . . { f : α → β definitional theorem : proof ∀ x : α. means x ( f x ) } } 14

  21. Various Extension Principles HOL-Style Type Definitions theory Types = { meta Propositions extension typeDef = λα : type . λ A : α → prop . λρ : proof . . . . { T : type : T → α Rep Abs : α → T Rep ′ : proof ∀ x : T . A ( Rep x ) proof ∀ x : T . Abs ( Rep x ) . Rep inverse : = x proof ∀ x : α. A x ⇒ Rep ( Abs x ) . : = x Abs inverse } } 14

  22. Concrete Syntax for Our Extension Layer ◮ For bidirectional pragmatic-to-strict translation ◮ extension e = λ x 1 : E 1 . . . . λ x n : E n . { Σ } is written as < extension name=” e ” > < parameter name=” x 1 ” > E 1 < / parameter > . . . < parameter name=” x n ” > E n < / parameter > < theory > Σ < / theory > < / extension > ◮ pragmatic c : e A 1 . . . A n is written as < pragmatic name=” c ” extension=” � � e � � ” > A 1 . . . A n < / pragmatic > � � e � � denotes e ’s URI. 15

  23. Pragmatic Surface Syntax ◮ Notation parser specific to each pragmatic surface syntax ongoing work for our Twelf surface syntax done for our sTeX surface syntax pragmatic surface syntax 1 + 1 . theorem = 2 ( foo ) proof proof - term notation parser pragmatic OMDoc 2 abstract syntax theorem 1 + 1 . foo : = 2 ( proof - term ) pragmatic-to-strict strict OMDoc 2 abstract syntax 1 + 1 . foo : = 2 = ( proof - term ) 16

  24. Conclusion and Future Work ◮ User-definable, constrained, statement level extensions in MKM formats ◮ Generic: applicable to virtually any declarative language ◮ Realized within the OMDoc/MMT language ◮ Expressed common conservative extension principles ◮ Future: test with extension principles from widely used MKM formats ◮ create library of extension principles ◮ find limitations (candidates: abstract data types, proof schemas) 17

Recommend


More recommend