core type theory
play

Core type theory David Ripley Monash University - PowerPoint PPT Presentation

Core type theory David Ripley Monash University http://davewripley.rocks Core logic Core logic What is it? Core logic (aka intuitionistic relevant logic) is a system of logic devised and developed by Neil Tennant over the last 40ish


  1. Core type theory David Ripley Monash University http://davewripley.rocks

  2. Core logic

  3. Core logic What is it? Core logic (aka ‘intuitionistic relevant logic’) is a system of logic devised and developed by Neil Tennant over the last 40ish years.

  4. Core logic What is it? No, not that Neil Tennant (At least I don’t think so.)

  5. Core logic What is it? No, not that Neil Tennant (At least I don’t think so.)

  6. Core logic . . . . . . What is it? . . . . . . [ φ ] n [ ψ ] n [ φ ] n ψ φ → ψ φ θ � → I! n : → E: → I n : φ → ψ φ → ψ θ [ φ ] n ¬ φ φ � ¬ E: ¬ I n : ¬ φ � In → I and → E, discharge may be vacuous. In → I! and ¬ I, discharge must not be vacuous.

  7. Core logic What is it? As it stands, that’s a proof system for intuitionistic logic. With the additional restriction that major premises for elimination must be assumptions, we get to core logic. (Caveat: this isn’t exactly how Tennant does it. His proofs are more restrictive. But all the same things are provable.)

  8. Core logic What is it? Then core validity is not closed under cut: Let an argument Γ � C be core valid iff: there is a core proof of C whose open assumptions are all in Γ . ¬ φ � φ → ψ and φ → ψ, φ � ψ are both core valid, but ¬ φ, φ � ψ is not. Rather, ¬ φ, φ � � is.

  9. Core logic What is it? Core validity is closely related to intuitionistic validity: Results (Tennant): The difference is in what follows from inconsistent premise sets. • Γ ⊢ Core � iff Γ ⊢ Int ⊥ • If Γ ̸⊢ � , then Γ ⊢ Int φ iff Γ ⊢ φ

  10. Curry-Howard

  11. Curry-Howard Types The simply-typed lambda calculus encodes a theory of typed data and functions on that data. This is importantly connected to intuitionistic logic, via the Curry-Howard correspondence.

  12. Curry-Howard Types Our types are atoms, or ⊥ , or formed by → from other types. ⊥ is interpreted as an empty type, and φ → ψ the type of functions that take an input of type φ and give an output of type ψ .

  13. Curry-Howard Terms (variables are assumptions) (function application is modus ponens) (function formation is conditional proof; variable binding is discharging an assumption) (crying uncle is explosion) There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ , given a term M ⊥ , there is ( explode M ) ϕ .

  14. Curry-Howard Terms (variables are assumptions) (function application is modus ponens) (function formation is conditional proof; variable binding is discharging an assumption) (crying uncle is explosion) There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ , given a term M ⊥ , there is ( explode M ) ϕ .

  15. Curry-Howard Terms (variables are assumptions) (function application is modus ponens) (function formation is conditional proof; variable binding is discharging an assumption) (crying uncle is explosion) There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ , given a term M ⊥ , there is ( explode M ) ϕ .

  16. Curry-Howard Terms (variables are assumptions) (function application is modus ponens) (function formation is conditional proof; variable binding is discharging an assumption) (crying uncle is explosion) There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ , given a term M ⊥ , there is ( explode M ) ϕ .

  17. Curry-Howard Terms (variables are assumptions) (function application is modus ponens) (function formation is conditional proof; variable binding is discharging an assumption) (crying uncle is explosion) There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ , given a term M ⊥ , there is ( explode M ) ϕ .

  18. Curry-Howard Reduction Given a term with a selected redex as a subterm, we can reduce the whole term by one step by replacing the redex with its reduct, leaving the context alone. The result is always well-formed. Any term of the form (( λ x . M ) N ϕ ) ψ is a redex; its reduct is M [ x �→ N ] ψ .

  19. Curry-Howard Reduction have some nice properties: Type Preservation Confluence Strong Normalization All reduction paths are finite One-step reduction ▷ 1 β and its reflexive transitive closure ▷ β If M ϕ ▷ β N , then N ϕ If M ▷ 1 β N and M ▷ 1 β O , then there is a P with N ▷ β P and O ▷ β P

  20. Curry-Howard Reduction which can be reached by reducing it willy-nilly until it can’t be reduced farther. normal forms as the values calculated, and reduction as program execution. Together, these mean that every M ϕ has a unique normal form N ϕ , This supports thinking of M ϕ as a program for calculating a φ ,

  21. Core type theory

  22. Core type theory Types Again, propositions serve as types. There is no ⊥ , and � is not a proposition/type. → is as before ¬ φ is the type of things that take input of type φ and then crash.

  23. Core type theory Terms There are variables x ϕ , y ϕ , z ϕ , . . . of each type φ , given terms M ϕ → ψ and N ϕ , there is ( MN ϕ ) ψ , given a variable x ϕ and a term M ψ , there is ( λ x . M ) ϕ → ψ ,

  24. Core type theory Terms if it crashes, we can note that it crashes, and if it crashes, we can pretend it outputs any with the right input, we can make it crash given a variable x ϕ and a term M � in which x occurs, there is ( λ x . M ) ¬ ϕ and ( λ x . M � ) ϕ → ψ , given M ¬ ϕ and N ϕ , there is ( MN ϕ ) � .

  25. Core type theory Terms if it crashes, we can note that it crashes, with the right input, we can make it crash given a variable x ϕ and a term M � in which x occurs, there is ( λ x . M ) ¬ ϕ and ( λ x . M � ) ϕ → ψ , and if it crashes, we can pretend it outputs any ψ given M ¬ ϕ and N ϕ , there is ( MN ϕ ) � .

  26. Core type theory Terms if it crashes, we can note that it crashes, with the right input, we can make it crash given a variable x ϕ and a term M � in which x occurs, there is ( λ x . M ) ¬ ϕ and ( λ x . M � ) ϕ → ψ , and if it crashes, we can pretend it outputs any ψ given M ¬ ϕ and N ϕ , there is ( MN ϕ ) � .

  27. Core type theory Reduction Redexes and their reducts are ‘as before’. A redex is anything of the form ( λ x . M ) N , and its reduct is M [ x �→ N ] .

  28. Core type theory Reduction Redex Reduct • • • (( λ x . M ψ ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] ψ (( λ x . M � ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] � (( λ x . M � ) ¬ ϕ N ϕ ) � M [ x �→ N ] �

  29. Core type theory Reduction Redex Reduct • • • Reduction does not always preserve type! (( λ x . M ψ ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] ψ (( λ x . M � ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] � (( λ x . M � ) ¬ ϕ N ϕ ) � M [ x �→ N ] �

  30. Core type theory Reduction Redex Reduct • • • Reduction can remove free variables! (( λ x . M ψ ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] ψ (( λ x . M � ) ϕ → ψ N ϕ ) ψ M [ x �→ N ] � (( λ x . M � ) ¬ ϕ N ϕ ) � M [ x �→ N ] �

  31. Core type theory Reduction So one-step reduction of a term at a redex is not so simple. Just replacing the redex with its reduct, leaving the context alone, is not always well-formed. (!) The solution: leave the context alone when you can, and otherwise discard what you must.

  32. Core type theory • • • Reduction • • • If M ϕ ▷ 1 β M ′ ϕ , then MN ▷ 1 β M ′ N If M ▷ 1 β M ′ � , then MN ▷ 1 β M ′ If N ϕ ▷ 1 β N ′ ϕ , then MN ▷ 1 β MN ′ If N ▷ 1 β N ′ � , then MN ▷ 1 β N ′ � If M ϕ ▷ 1 β M ′ ϕ , then λ x . M ▷ 1 β λ x . M ′ If M ▷ 1 β M ′ � , • if x ∈ FV ( M ′ ) , then λ x . M ▷ 1 β λ x . M ′ (preserving hat) • if x ̸∈ FV ( M ′ ) , then λ x . M ▷ 1 β M ′

  33. Core type theory Reduction Example Example Example ( λ y ϕ . ( x ¬ ϕ y ϕ ) � ) ϕ → θ z ϕ ) θ is a redex, and it reduces in one step to ( ( x ¬ ϕ z ϕ ) � . Let M be the above redex, and let M ′ be its reduct. Then ( λ w ρ . M θ ) ρ → θ ▷ 1 β M ′ � . With the same M and M ′ , we have λ z ϕ . ( λ w ρ . M θ ) ρ → θ ) ϕ → ρ → θ ▷ 1 β ( λ z ϕ . M ′ � ) ϕ → ρ → θ . (

  34. Results

  35. Results Preservation? Reduction does not preserve type. But: it can only change from a type to � Never from one type to another, or from � to a type

  36. Results Confluence? Reduction is not confluent. Example ( λ u ¬ ρ . ( u ¬ ρ v ρ ) � ) ¬ ρ → ψ z ¬ ρ ) ψ ) θ ) ρ → θ ( ( ( λ x ψ . y θ ) ψ → θ ( λ v ρ . reduces in one step to ( λ v ρ . y θ ) ρ → θ , or to ( λ v ρ . ( z ¬ ρ v ρ ) � ) ρ → θ

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend