andromeda 2 0
play

Andromeda 2.0 Anja Petkovi 1 1 University of Ljubljana, Slovenia - PowerPoint PPT Presentation

Andromeda 2.0 Anja Petkovi 1 1 University of Ljubljana, Slovenia Logic seminar, Stockholm, 13.11.2019 j.w.w. Andrej Bauer and Philipp G. Haselwarter 1 This material is based upon work supported by the Air Force Offjce of Scientifjc Research


  1. Andromeda 2.0 Anja Petković 1 1 University of Ljubljana, Slovenia Logic seminar, Stockholm, 13.11.2019 j.w.w. Andrej Bauer and Philipp G. Haselwarter 1 This material is based upon work supported by the Air Force Offjce of Scientifjc Research under award number FA9550-17-1-0326. 1 / 14 1. Hi, I’m Anja from University of Ljubljana. Thank you for inviting me to your seminar. 2. I will give a demo of Andromeda 2.0. It is work in progress, so if you are brave enough to try it out, you may encounter bugs and missing features. 3. Installation instructions: http://www.andromeda-prover.org/install.html 4. The fjles are compatible with the andromeda version at commit 3170f2e

  2. What is Andromeda? that a little later. 6. supports unicode 5. Andromeda is coded in Ocaml and its syntax resembles it at what we can do, but will not focus so much on that. functionality of a programming language. We will just briefmy take a look called Andromeda Meta Language (AML), which supplies the usual 4. Andromeda is comprised of a trusted kernel called Nucleus and the so but nonetheless many ideas are similar. general type theories, that is a little difgerent from what we have here, interval with rules. Guillaume has also been working on a defjnition of special features like cubical TT, because we cannot express the external intensional MLTT, book HoTT etc. It cannot support type theories with think most of you are familiar with, for example extensional MLTT, 3. We can input general type theories in the sense of BHL, with which I defjne our type theory by specifjing rules, we will see how exactly we do supported extensional type theory with Type:Type. Now we actually 2. For those who know about the previous versions of Andromeda, they rules of type theory hold and then use them accordingly. user-defjnable type theories. Meaning the user is able to specify which 1. Andromeda is in its essence a proof assistant, designed to support 2 / 14 Lumsdaine), related work: Brunerie theories 7. Origin of the name and fjle extension • Proof assistant designed to support user-defjnable type • Very difgerent from Andromeda 1.0 • General type theories (in the sense of Bauer, Haselwarter and • Trusted kernel Nucleus + Andromeda Meta Language (AML) • OCaml-like syntax • fjle extension .m31

  3. • inductive types • handlers Quick summary of AML syntax 4. types in AML are pre-fjxed by ml, so mltypes, to be distinguished from 9. AML also supports defjning your own inductive types and handler in we will see shortly. 8. we also have special mltypes for judgements, boundaries and derivations - 7. pattern matching is the default eliminator for lists, inductive types etc. make functions by using let name args = ... 6. we use the syntax let .... in .... to bind variables in AML. We can also our own types module ML (like option types ML. Some ..., ML.None) and we can defjne 5. we have some built in types like mlunit, mlist (polymorphic), some are in types in TT 3. We end the line with double colon ;;. Sometimes we may omit it, if it is clear from the syntax that it is actually there. 2. AML is a strongly typed language 1. fjle AML-intro.m31 3 / 14 Also supports: efg-style (for algebraic efgects), but we will not get into that • typed language • ;; • lists • let binding • functions • pattern matching

  4. Quick summary of AML syntax clear from the syntax that it is actually there. 9. AML also supports defjning your own inductive types and handler in we will see shortly. 8. we also have special mltypes for judgements, boundaries and derivations - 7. pattern matching is the default eliminator for lists, inductive types etc. make functions by using let name args = ... 6. we use the syntax let .... in .... to bind variables in AML. We can also our own types module ML (like option types ML. Some ..., ML.None) and we can defjne 5. we have some built in types like mlunit, mlist (polymorphic), some are in types in TT 4. types in AML are pre-fjxed by ml, so mltypes, to be distinguished from 3. We end the line with double colon ;;. Sometimes we may omit it, if it is 2. AML is a strongly typed language 1. fjle AML-intro.m31 3 / 14 Also supports: efg-style (for algebraic efgects), but we will not get into that • typed language • ;; • lists • let binding • functions • pattern matching • inductive types • handlers

  5. Concepts from general type theories order, but these are the concepts I would like to present. 5. Transitivity and symmetry we can defjne, but Nucleus believes in them for specifying rules. called abstracted judgement, that binds specifjed variables. This is useful 4. Abstraction, unlike in general TTs is a primitive notion. We have a so judgements back. have to deal with them explicitly. We do however get the contexts of 3. contexts are handled automatically by Nucleus and the user does not own intuition as well), we’ll se how they are implemented in Andromeda 2. You are already familiar with these from general type theoies (and your 1. This is sort of a table of contents for today’s talk. We will not go in this 4 / 14 Also: and uses them. • 4 kinds of judgements • boundaries • contexts (handled automatically by Nucleus) • abstraction (primitive) • rule • derived rules • congruence rules • equality checker: WIP, future work

  6. Judgements 1. fjle basic-judgements.m31 5. We give a rule iteratively, it is important what comes fjrst, for 4. The name of the rule will be the constructor get judgements. Rules with no parameters are constants, so judgements. 3. We introduce judgements by using the rules. When we apply the rules, we start with an easy example, ℕ . 2. We start with judgements. We have 4 kinds of judgements (show). I will 5 / 14 Γ ⊢ 𝑡𝑨 ≡ 𝑡𝑨 ∶ ℕ Γ ⊢ ℕ ≡ ℕ Γ ⊢ 𝑨 ∶ ℕ Γ ⊢ ℕ type typechecking in the Nucleus. • 4 kinds of judgements • AML type judgement • keyword rule

  7. Abstraction as a premise in the rule Γ, 𝑦 ∶ ℕ ⊢ 𝐷 type more than to the context. basically Γ , the special variables belong to the judgement on the right But what if contexts are not lists? Moreover, the context in the rule we write Γ, 𝑦 ∶ 𝐵 ⊢ 𝑨 ∶ ℕ , we know what the distinguished last variable is. 1. We usually think of contexts as lists of vriables with their types. So when 6 / 14 Γ ⊢ ℕ ind (𝐷, base , step , 𝑡𝑜) ≡ step (𝑜, ℕ ind (𝐷, base , step , 𝑜)) ∶ 𝐷(𝑡𝑜) Γ ⊢ 𝑜 ∶ ℕ Γ ⊢ base ∶ 𝐷(𝑨) 𝛾 -rule for successor Induction on natural numbers Γ ⊢ ℕ ind (𝐷, base , step , 𝑨) ≡ base ) ∶ 𝐷(𝑨) Γ ⊢ base ∶ 𝐷(𝑨) Γ, 𝑦 ∶ ℕ ⊢ 𝐷 type 𝛾 -rule for zero Γ ⊢ ℕ ind (𝐷, base , step , 𝑙)) ∶ 𝐷(𝑜) Γ ⊢ 𝑙 ∶ ℕ Γ ⊢ base ∶ 𝐷(𝑨) Γ, 𝑦 ∶ ℕ ⊢ 𝐷 type 2. Let us see how we would say these same things using abstractions Γ, 𝑜 ∶ ℕ, 𝑑 𝑜 ∶ 𝐷(𝑜) ⊢ step ∶ 𝐷(𝑡𝑜) Γ, 𝑜 ∶ ℕ, 𝑑 𝑜 ∶ 𝐷(𝑜) ⊢ step ∶ 𝐷(𝑡𝑜) Γ, 𝑜 ∶ ℕ, 𝑑 𝑜 ∶ 𝐷(𝑜) ⊢ step ∶ 𝐷(𝑡𝑜)

  8. Abstraction as a premise in the rule Induction on natural numbers 7 / 14 Γ ⊢ ℕ ind (𝐷, base , step , 𝑡𝑜) ≡ step (𝑜, ℕ ind (𝐷, base , step , 𝑜)) ∶ 𝐷(𝑡𝑜) Γ ⊢ 𝑜 ∶ ℕ Γ ⊢ base ∶ 𝐷(𝑨) Γ ⊢ {𝑦 ∶ ℕ}𝐷 type 𝛾 -rule for successor Γ ⊢ ℕ ind (𝐷, base , step , 𝑨) ≡ base ) ∶ 𝐷(𝑨) 1. code in the fjle basic-judgements.m31, paragraph end Γ ⊢ base ∶ 𝐷(𝑨) Γ ⊢ {𝑦 ∶ ℕ}𝐷 type 𝛾 -rule for zero Γ ⊢ ℕ ind (𝐷, base , step , 𝑙)) ∶ 𝐷(𝑜) Γ ⊢ 𝑙 ∶ ℕ Γ ⊢ base ∶ 𝐷(𝑨) Γ ⊢ {𝑦 ∶ ℕ}𝐷 type Γ ⊢ {𝑜 ∶ ℕ}{𝑑 𝑜 ∶ 𝐷(𝑜)} step ∶ 𝐷(𝑡𝑜) Γ ⊢ {𝑜 ∶ ℕ}{𝑑 𝑜 ∶ 𝐷(𝑜)} step ∶ 𝐷(𝑡𝑜) Γ ⊢ {𝑜 ∶ ℕ}{𝑑 𝑜 ∶ 𝐷(𝑜)} step ∶ 𝐷(𝑡𝑜)

  9. Abstraction Abstraction is a primitive notion. 8 / 14 1. fjle basic-judgement.m31 paragraph abstraction 2. abstraction is primitive and not as an arity of a symbol as in general type theories 3. instantiation of abstraction using curly braces. 4. we abstract the entire judgement! We cannot equate two abstractions for example. 5. abstracted judgements serve as the arguments for the rules. Let us code up the induction for natural numbers. • {𝑦∶ ℕ}𝑡𝑦 • instantiation of abstraction • free variables constructed with fresh • abstracting free variables with abstract

  10. Dependent sum Γ ⊢ {𝑦 ∶ 𝐵}𝐶 type rules fjrst. 2. how do we do the second projection? We need convert and congruence 1. fjle dependent-sum.m31 9 / 14 Γ ⊢ 𝜌 1 (𝐵, 𝐶, pair (𝐵, 𝐶, 𝑏, 𝑐)) ≡ 𝑏 ∶ 𝐵 Γ ⊢ 𝑐 ∶ 𝐶{𝑏} Γ ⊢ 𝑏 ∶ 𝐵 Γ ⊢ {𝑦 ∶ 𝐵}𝐶 type Γ ⊢ 𝐵 type Γ ⊢ 𝜌 2 (𝐵, 𝐶, 𝑡) ∶ 𝐶{𝜌 1 (𝐵, 𝐶, 𝑡)} Γ ⊢ 𝑡 ∶ Σ(𝐵, 𝐶) Γ ⊢ 𝐵 type Γ ⊢ 𝐵 type Γ ⊢ 𝜌 1 (𝐵, 𝐶, 𝑡) ∶ 𝐵 Γ ⊢ 𝑡 ∶ Σ(𝐵, 𝐶) Γ ⊢ {𝑦 ∶ 𝐵}𝐶 type Γ ⊢ 𝐵 type Γ ⊢ pair (𝐵, 𝐶, 𝑏, 𝑐) ∶ Σ(𝐵, 𝐶) Γ ⊢ 𝑐 ∶ 𝐶{𝑏} Γ ⊢ 𝑏 ∶ 𝐵 Γ ⊢ {𝑦 ∶ 𝐵}𝐶 type Γ ⊢ 𝐵 type Γ ⊢ Σ(𝐵, 𝐶) type Γ ⊢ {𝑦 ∶ 𝐵}𝐶 type 3. But to really make use of these things, we use derived rules.

Recommend


More recommend