diagram operators in a logical framework
play

Diagram Operators in a Logical Framework LFMTP 2020: Session 1, - PowerPoint PPT Presentation

Diagram Operators in a Logical Framework LFMTP 2020: Session 1, Formalizing Logics Computer Science, FAU Erlangen-Nrnberg This work is licensed under a CC BY-SA 4.0 license. 1 https://orcid.org/0000-0002-8348-2441 2


  1. Diagram Operators in a Logical Framework LFMTP 2020: Session 1, Formalizing Logics Computer Science, FAU Erlangen-Nürnberg This work is licensed under a “CC BY-SA 4.0” license. 1 https://orcid.org/0000-0002-8348-2441 2 https://orcid.org/0000-0003-3040-3655 Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators 1 / 17 Navid Roux 1 and Florian Rabe 2

  2. ∶ type } Motivation: Logics in Theory Graphs ⎩ } } ⎭ UntypedLogic = { include PL tm TypedLogic = ⎧ { ⎨ { include PL } tp ∶ type tm ∶ tp → type ⎫ } ⎬ } ⎭ Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators ⎬ } Goal: Formalize logics in a reusable and modular way { Use logical frameworks to formalize logics into theories e.g. LF Use inclusions to structure theories into a theory graph Example: PL UntypedLogic TypedLogic FOL TFOL PL = ⎧ { ⎫ ⎨ { { ⎩ prop ∶ type ⊢ ∶ prop → type ¬ ∶ prop → prop ∧, ∨, ⇒ ∶ prop → prop → prop 2 / 17

  3. Motivation: Logics in Theory Graphs ⎩ } } ⎭ UntypedLogic = { include PL tm TypedLogic = ⎧ { ⎨ { include PL } tp ∶ type tm ∶ tp → type ⎫ } ⎬ } ⎭ Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators ⎬ } Goal: Formalize logics in a reusable and modular way { Use logical frameworks to formalize logics into theories e.g. LF Use inclusions to structure theories into a theory graph Example: PL UntypedLogic TypedLogic FOL TFOL PL = ⎧ { ⎫ ⎨ { { ⎩ prop ∶ type ⊢ ∶ prop → type ¬ ∶ prop → prop ∧, ∨, ⇒ ∶ prop → prop → prop 2 / 17 ∶ type }

  4. (Π𝑦∶ tm 𝑇. ⊢ 𝑄 𝑦) → ⊢ ∀ ′ 𝑇 𝑄 Example Problem ∶ Π𝑄 ∶ tm → prop . ∀ ND ′ ∃ ND ′ TFOLND ∀ ∶ ( tm → prop ) → prop ∀𝐽 ∀ ′ (Π𝑦∶ tm . ⊢ 𝑄 𝑦) → ⊢ ∀𝑄 ∃𝐽 ′ ∶ Π 𝑇∶ tp . ( tm 𝑇 → prop ) → prop ∀𝐽 ′ ∶ Π 𝑇∶ tp . Π𝑄 ∶ tm 𝑇 → prop . Problem: syntactic redundancy that is not expressible in logical framework Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators ∃𝐹 ′ ∀𝐹 ′ Untyped variant ∃𝐹 PL UntypedLogic ∀ ∃ ∀𝐽 ∀𝐹 ∃𝐽 ∀ ND ∀𝐽 ′ ∃ ND FOLND Typed Variant PL TypedLogic ∀ ′ ∃ ′ 3 / 17

  5. Example Problem ∶ Π𝑄 ∶ tm → prop . ∀ ND ′ ∃ ND ′ TFOLND ∀ ∶ ( tm → prop ) → prop ∀𝐽 (Π𝑦∶ tm . ⊢ 𝑄 𝑦) → ⊢ ∀𝑄 ∃𝐽 ′ ∀ ′ ∶ Π 𝑇∶ tp . ( tm 𝑇 → prop ) → prop ∀𝐽 ′ ∶ Π 𝑇∶ tp . Π𝑄 ∶ tm 𝑇 → prop . Problem: syntactic redundancy that is not expressible in logical framework Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators ∃𝐹 ′ ∀𝐹 ′ Untyped variant ∀𝐽 ′ PL UntypedLogic ∀ ∃ ∀𝐽 ∀𝐹 ∃𝐽 ∃𝐹 ∀ ND ∃ ND FOLND Typed Variant PL TypedLogic ∀ ′ ∃ ′ 3 / 17 (Π𝑦∶ tm 𝑇. ⊢ 𝑄 𝑦) → ⊢ ∀ ′ 𝑇 𝑄

  6. Example Problem ∶ Π𝑄 ∶ tm → prop . ∀ ND ′ ∃ ND ′ TFOLND ∀ ∶ ( tm → prop ) → prop ∀𝐽 (Π𝑦∶ tm . ⊢ 𝑄 𝑦) → ⊢ ∀𝑄 ∃𝐽 ′ ∀ ′ ∶ Π 𝑇∶ tp . ( tm 𝑇 → prop ) → prop ∀𝐽 ′ ∶ Π 𝑇∶ tp . Π𝑄 ∶ tm 𝑇 → prop . Problem: syntactic redundancy that is not expressible in logical framework Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators ∃𝐹 ′ ∀𝐹 ′ Untyped variant ∀𝐽 ′ PL UntypedLogic ∀ ∃ ∀𝐽 ∀𝐹 ∃𝐽 ∃𝐹 ∀ ND ∃ ND FOLND Typed Variant PL TypedLogic ∀ ′ ∃ ′ 3 / 17 (Π𝑦∶ tm 𝑇. ⊢ 𝑄 𝑦) → ⊢ ∀ ′ 𝑇 𝑄

  7. Inevitable Redundancies Usually module systems good at reusing expressions defjnitions reusing theories inclusions transporting across compositional translations Coq functors, Mmt morphisms However no elegant methods for anything non-compositional even if just minor syntactic changes Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators 4 / 17

  8. Computing Theories Turing-complete, arbitrary AST manipulation Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) not expressive enough purely compositional, e.g. pushouts our goal sweet spot? makes meta-theory diffjcult How much computation do we allow? Goal: preserve diagrams, includes, well-typedness, names our approach outside via preprocessor/plugin possible, but requires programming extension in framework via refmection ideal, but don’t know how in framework via novel abstraction mechanism Where/how does the computation happen? Solution Space: 5 / 17

  9. Computing Theories Turing-complete, arbitrary AST manipulation Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) not expressive enough purely compositional, e.g. pushouts our goal sweet spot? makes meta-theory diffjcult How much computation do we allow? Goal: preserve diagrams, includes, well-typedness, names our approach outside via preprocessor/plugin possible, but requires programming extension in framework via refmection ideal, but don’t know how in framework via novel abstraction mechanism Where/how does the computation happen? Solution Space: 5 / 17

  10. Computing Theories Turing-complete, arbitrary AST manipulation Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) not expressive enough purely compositional, e.g. pushouts our goal sweet spot? makes meta-theory diffjcult How much computation do we allow? Goal: preserve diagrams, includes, well-typedness, names our approach outside via preprocessor/plugin possible, but requires programming extension in framework via refmection ideal, but don’t know how in framework via novel abstraction mechanism Where/how does the computation happen? Solution Space: 5 / 17

  11. | 𝑃(𝑈 ∗ ) Mmt /LF Syntax declarations Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) End goal: specify class of operators on fmat theories and lift where 𝑃 names a diagram operator 𝜇𝑦∶𝐵. 𝐵 | Π𝑦∶𝐵. 𝐵 terms 𝐵 | type | 𝑑 | 𝑦 | 𝐵 𝐵 | 𝐵→ ∶∶= 𝐵 𝑑∶ 𝐵 [= 𝐵] | include 𝑈 A module system over LF: ∶∶= Decl theories ∶∶= Thy structured diagrams Thy ∗ ∶∶= Diag 6 / 17 𝑈 = { Decl ∗ }

  12. | 𝑃(𝑈 ∗ ) Mmt /LF Syntax declarations Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) End goal: specify class of operators on fmat theories and lift where 𝑃 names a diagram operator 𝜇𝑦∶𝐵. 𝐵 | Π𝑦∶𝐵. 𝐵 terms 𝐵 | type | 𝑑 | 𝑦 | 𝐵 𝐵 | 𝐵→ ∶∶= 𝐵 𝑑∶ 𝐵 [= 𝐵] | include 𝑈 A module system over LF: ∶∶= Decl theories ∶∶= Thy structured diagrams Thy ∗ ∶∶= Diag 6 / 17 𝑈 = { Decl ∗ }

  13. Mmt /LF Syntax declarations Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) End goal: specify class of operators on fmat theories and lift where 𝑃 names a diagram operator 𝜇𝑦∶𝐵. 𝐵 | Π𝑦∶𝐵. 𝐵 terms 𝐵 | type | 𝑑 | 𝑦 | 𝐵 𝐵 | 𝐵→ ∶∶= 𝐵 𝑑∶ 𝐵 [= 𝐵] | include 𝑈 A module system over LF: ∶∶= Decl theories ∶∶= Thy structured diagrams ∶∶= Diag 6 / 17 ( Thy | 𝑃(𝑈 ∗ )) ∗ 𝑈 = { Decl ∗ }

  14. Mmt /LF Syntax declarations Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) End goal: specify class of operators on fmat theories and lift where 𝑃 names a diagram operator 𝜇𝑦∶𝐵. 𝐵 | Π𝑦∶𝐵. 𝐵 terms 𝐵 | type | 𝑑 | 𝑦 | 𝐵 𝐵 | 𝐵→ ∶∶= 𝐵 𝑑∶ 𝐵 [= 𝐵] | include 𝑈 A module system over LF: ∶∶= Decl theories ∶∶= Thy structured diagrams ∶∶= Diag 6 / 17 ( Thy | 𝑃(𝑈 ∗ )) ∗ 𝑈 = { Decl ∗ }

  15. Mmt /LF Syntax declarations Diagram Operators Roux, Rabe (FAU Erlangen-Nürnberg) End goal: specify class of operators on fmat theories and lift where 𝑃 names a diagram operator 𝜇𝑦∶𝐵. 𝐵 | Π𝑦∶𝐵. 𝐵 terms 𝐵 | type | 𝑑 | 𝑦 | 𝐵 𝐵 | 𝐵→ ∶∶= 𝐵 𝑑∶ 𝐵 [= 𝐵] | include 𝑈 A module system over LF: ∶∶= Decl theories ∶∶= Thy structured diagrams ∶∶= Diag 6 / 17 ( Thy | 𝑃(𝑈 ∗ )) ∗ 𝑈 = { Decl ∗ }

  16. Mmt /LF Semantics Semantics given by fmat theories on diagrams: on theories: ⇒ Results in plain LF theories Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators 7 / 17 Interpretation given by fmattening − ♭ eliminating includes ⋅ ♭ ∶= ∅ (𝑈 = {Σ}, 𝐸) ♭ ∶= (𝑈 = {Σ ♭ }, 𝐸 ♭ ) ⋅ ♭ ∶= ∅ (𝑑∶ 𝐵 [= 𝐵], Σ) ♭ ∶= {𝑑∶ 𝐵 [= 𝐵]} ∪ Σ ♭ ( include 𝑇, Σ) ♭ ∶= 𝑇 ♭ ∪ Σ ♭

  17. Main Defjnition Defjnition (Linear Diagram Operator) For theories 𝑇 , 𝑈 , we call a partial function 𝑃∶ fmat theories → fmat theories linear from 𝑇 to 𝑈 if it maps 𝑇 -extensions to 𝑈 -extensions, 𝑃(𝑇) = 𝑈 , declaration-wise, 𝑃(𝑇, Σ, 𝑑∶ 𝐵 [= 𝑏]) = 𝑃(𝑇, Σ), Δ Σ (𝑑∶ 𝐵 [= 𝑏]) for some function Δ − (−) . Δ − (−) may map a single declaration to multiple Δ − (−) uniquely determined by 𝑃 upon existence Roux, Rabe (FAU Erlangen-Nürnberg) Diagram Operators 8 / 17

Recommend


More recommend