fixed conflicts

This commit is contained in:
wadler 2018-06-10 21:31:37 -03:00
commit ecde68df1e
21 changed files with 207 additions and 162 deletions

View file

@ -18,38 +18,38 @@ fixes are encouraged.
## Front matter
- [Preface]({{ site.baseurl }}{% link out/Preface.md %})
- [Preface]({{ site.baseurl }}{% link out/plta/Preface.md %})
## Part 1: Logical Foundations
(This part is ready for review. Please comment!)
- [Naturals: Natural numbers]({{ site.baseurl }}{% link out/Naturals.md %})
- [Naturals: Natural numbers]({{ site.baseurl }}{% link out/plta/Naturals.md %})
- [Properties: Proof by induction](Properties)
- [Relations: Inductive definition of relations]({{ site.baseurl }}{% link out/Relations.md %})
- [Equality: Equality and equational reasoning]({{ site.baseurl }}{% link out/Equality.md %})
- [Isomorphism: Isomorphism and embedding]({{ site.baseurl }}{% link out/Isomorphism.md %})
- [Connectives: Conjunction, disjunction, and implication]({{ site.baseurl }}{% link out/Connectives.md %})
- [Negation: Negation, with intuitionistic and classical Logic]({{ site.baseurl }}{% link out/Negation.md %})
- [Quantifiers: Universals and existentials]({{ site.baseurl }}{% link out/Quantifiers.md %})
- [Lists: Lists and higher-order functions]({{ site.baseurl }}{% link out/Lists.md %})
- [Decidable: Booleans and decision procedures]({{ site.baseurl }}{% link out/Decidable.md %})
- [Relations: Inductive definition of relations]({{ site.baseurl }}{% link out/plta/Relations.md %})
- [Equality: Equality and equational reasoning]({{ site.baseurl }}{% link out/plta/Equality.md %})
- [Isomorphism: Isomorphism and embedding]({{ site.baseurl }}{% link out/plta/Isomorphism.md %})
- [Connectives: Conjunction, disjunction, and implication]({{ site.baseurl }}{% link out/plta/Connectives.md %})
- [Negation: Negation, with intuitionistic and classical Logic]({{ site.baseurl }}{% link out/plta/Negation.md %})
- [Quantifiers: Universals and existentials]({{ site.baseurl }}{% link out/plta/Quantifiers.md %})
- [Lists: Lists and higher-order functions]({{ site.baseurl }}{% link out/plta/Lists.md %})
- [Decidable: Booleans and decision procedures]({{ site.baseurl }}{% link out/plta/Decidable.md %})
## Part 2: Programming Language Foundations
(This part is not yet ready for review.)
- [Lambda: Lambda: Introduction to Lambda Calculus]({{ site.baseurl }}{% link out/Lambda.md %})
- [LambdaProp: Properties of Simply-Typed Lambda Calculus]({{ site.baseurl }}{% link out/LambdaProp.md %})
- [DeBruijn: Inherently typed De Bruijn representation]({{ site.baseurl }}{% link out/DeBruijn.md %})
- [Extensions: Extensions to simply-typed lambda calculus]({{ site.baseurl }}{% link out/Extensions.md %})
- [Inference: Bidirectional type inference]({{ site.baseurl }}{% link out/Inference.md %})
- [Untyped: Untyped lambda calculus with full normalisation]({{ site.baseurl }}{% link out/Untyped.md %})
- [Lambda: Lambda: Introduction to Lambda Calculus]({{ site.baseurl }}{% link out/plta/Lambda.md %})
- [LambdaProp: Properties of Simply-Typed Lambda Calculus]({{ site.baseurl }}{% link out/plta/LambdaProp.md %})
- [DeBruijn: Inherently typed De Bruijn representation]({{ site.baseurl }}{% link out/plta/DeBruijn.md %})
- [Extensions: Extensions to simply-typed lambda calculus]({{ site.baseurl }}{% link out/plta/Extensions.md %})
- [Inference: Bidirectional type inference]({{ site.baseurl }}{% link out/plta/Inference.md %})
- [Untyped: Untyped lambda calculus with full normalisation]({{ site.baseurl }}{% link out/plta/Untyped.md %})
## Backmatter
- [Acknowledgements]({{ site.baseurl }}{% link out/Acknowledgements.md %})
- [Fonts: Test page for fonts]({{ site.baseurl }}{% link out/Fonts.md %})
- [Acknowledgements]({{ site.baseurl }}{% link out/plta/Acknowledgements.md %})
- [Fonts: Test page for fonts]({{ site.baseurl }}{% link out/plta/Fonts.md %})
[sf]: https://softwarefoundations.cis.upenn.edu/
[wen]: https://github.com/wenkokke

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Acknowledgements/
---
\begin{code}
module plta.Acknowledgements where
\end{code}
Thank you to the following.
To the inventors of Agda, for giving us a new playground.

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Connectives/
---
\begin{code}
module plta.Connectives where
\end{code}
This chapter introduces the basic logical connectives, by observing
a correspondence between connectives of logic and data types,
a principle known as *Propositions as Types*.
@ -21,8 +25,8 @@ a principle known as *Propositions as Types*.
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)
open Eq.≡-Reasoning
open import Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open Isomorphism.≃-Reasoning
open import plta.Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open plta.Isomorphism.≃-Reasoning
open import Data.Nat using (; zero; suc; _+_; _*_)
open import Data.Nat.Properties.Simple using (+-suc)
open import Function using (_∘_)
@ -820,4 +824,3 @@ This chapter uses the following unicode.
₁ U+2081 SUBSCRIPT ONE (\_1)
₂ U+2082 SUBSCRIPT TWO (\_2)
⇔ U+21D4 LEFT RIGHT DOUBLE ARROW (\<=>)

View file

@ -4,12 +4,12 @@ layout : page
permalink : /DeBruijn/
---
## Imports
\begin{code}
module DeBruijn where
module plta.DeBruijn where
\end{code}
## Imports
\begin{code}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)
@ -476,5 +476,3 @@ normalise (suc g) L with progress L
... | step {M} L⟶M with normalise g M
... | normal h M⟶*N = normal (suc h) (L ⟶⟨ L⟶M ⟩ M⟶*N)
\end{code}

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Decidable/
---
\begin{code}
module plta.Decidable where
\end{code}
We have a choice as to how to represent relations:
as an inductive data type of *evidence* that the relation holds,
or as a function that *computes* whether the relation holds.
@ -563,4 +567,3 @@ import Relation.Nullary.Sum using (_⊎-dec_)
## Unicode
ᵇ U+1D47 MODIFIER LETTER SMALL B (\^b)

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Equality/
---
\begin{code}
module plta.Equality where
\end{code}
Much of our reasoning has involved equality. Given two terms `M`
and `N`, both of type `A`, we write `M ≡ N` to assert that `M` and `N`
are interchangeable. So far we have treated equality as a primitive,

View file

@ -4,12 +4,13 @@ layout : page
permalink : /Extensions/
---
## Imports
\begin{code}
module Extensions where
module plta.Extensions where
\end{code}
## Imports
\begin{code}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)
@ -600,5 +601,3 @@ normalise (suc g) L with progress L
... | step {M} L⟶M with normalise g M
... | normal h M⟶*N = normal (suc h) (L ⟶⟨ L⟶M ⟩ M⟶*N)
\end{code}

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Fonts/
---
\begin{code}
module plta.Fonts where
\end{code}
Test page for fonts.
Agda:
@ -55,4 +59,3 @@ Indented code:
------------
⌊⌋⌈⌉
----

View file

@ -4,12 +4,13 @@ layout : page
permalink : /Inference/
---
## Imports
\begin{code}
module Inference where
module plta.Inference where
\end{code}
## Imports
\begin{code}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong; cong₂; _≢_)
@ -24,8 +25,7 @@ open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Function using (_∘_)
open import Relation.Nullary using (¬_; Dec; yes; no)
open import Relation.Nullary.Negation using (¬?)
open import DeBruijn using (Type; `; _⇒_)
import DeBruijn as DB
open import plta.DeBruijn as DB using (Type; `; _⇒_)
pattern [_] w = w ∷ []
pattern [_,_] w x = w ∷ x ∷ []
@ -426,5 +426,3 @@ _ = refl
_ : ∥ ⊢fourCh ∥⁺ ≡ DB.fourCh
_ = refl
\end{code}

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Isomorphism/
---
\begin{code}
module plta.Isomorphism where
\end{code}
This section introduces isomorphism as a way of asserting that two
types are equal, and embedding as a way of asserting that one type is
smaller than another. We apply isomorphisms in the next chapter

View file

@ -4,6 +4,11 @@ layout : page
permalink : /Lambda/
---
\begin{code}
module plta.Lambda where
\end{code}
[Parts of this chapter take their text from chapter _Stlc_
of _Software Foundations_ (_Programming Language Foundations_).
Those parts will be revised.]
@ -48,8 +53,6 @@ four.
## Imports
\begin{code}
module Lambda where
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
open import Data.String using (String; _≟_)
open import Data.Nat using (; zero; suc)

View file

@ -4,6 +4,11 @@ layout : page
permalink : /LambdaProp/
---
\begin{code}
module plta.LambdaProp where
\end{code}
[Parts of this chapter take their text from chapter _Stlc_
of _Software Foundations_ (_Programming Language Foundations_).
Those parts will be revised.]
@ -25,8 +30,6 @@ types without needing to develop a separate inductive definition of the
## Imports
\begin{code}
module LambdaProp where
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
open import Data.String using (String; _≟_)
open import Data.Nat using (; zero; suc)
@ -37,7 +40,7 @@ open import Data.Product
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Relation.Nullary using (¬_; Dec; yes; no)
open import Function using (_∘_)
open import Lambda
open import plta.Lambda
\end{code}
@ -822,5 +825,3 @@ false, give a counterexample.
- Progress
- Preservation

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Lists/
---
\begin{code}
module plta.Lists where
\end{code}
This chapter discusses the list data type. It gives further examples
of many of the techniques we have developed so far, and provides
examples of polymorphic types and higher-order functions.
@ -19,7 +23,7 @@ open import Data.Nat.Properties using
(+-assoc; +-identityˡ; +-identityʳ; *-assoc; *-identityˡ; *-identityʳ)
open import Relation.Nullary using (¬_)
open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩)
open import Isomorphism using (_≃_)
open import plta.Isomorphism using (_≃_)
open import Function using (_∘_)
open import Level using (Level)
\end{code}

View file

@ -7,6 +7,10 @@ permalink : /Modules/
** Turn this into a Setoid example. Copy equivalence relation and setoid
from the standard library. **
\begin{code}
module plta.Modules where
\end{code}
This chapter introduces modules as a way of structuring proofs,
and proves some general results which will be useful later.
@ -17,18 +21,15 @@ import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)
open Eq.≡-Reasoning
open import Data.Nat using (; zero; suc; _+_; _*_; _∸_; _≤_; s≤s; z≤n)
-- open import Data.Nat.Properties using
-- (+-assoc; +-identityˡ; +-identityʳ; *-assoc; *-identityˡ; *-identityʳ)
open import Relation.Nullary using (¬_)
open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩)
open import Isomorphism using (_≃_)
open import plta.Isomorphism using (_≃_)
open import Function using (_∘_)
open import Level using (Level)
open import Data.Maybe using (Maybe; just; nothing)
open import Data.List using (List; []; _∷_; _++_; map; foldr; downFrom)
open import Data.List.All using (All; []; _∷_)
open import Data.List.Any using (Any; here; there)
-- open import Data.List.Any.Membership.Propositional using (_∈_)
\end{code}
We assume [extensionality][extensionality].

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Naturals/
---
\begin{code}
module plta.Naturals where
\end{code}
The night sky holds more stars than I can count, though fewer than five
thousand are visible to the naked eye. The observable universe
contains about seventy sextillion stars.
@ -265,7 +269,7 @@ specifies operators to support reasoning about equivalence, and adds
all the names specified in the `using` clause into the current scope.
In this case, the names added are `begin_`, `_≡⟨⟩_`, and `_∎`. We
will see how these are used below. We take all these as givens for now,
but will see how they are defined in Chapter [Equality]({{ site.baseurl }}{% link out/Equality.md %}).
but will see how they are defined in Chapter [Equality](Equality).
Agda uses underbars to indicate where terms appear in infix or mixfix
operators. Thus, `_≡_` and `_≡⟨⟩_` are infix (each operator is written
@ -894,5 +898,3 @@ In place of left, right, up, and down keys, one may also use control characters.
We write `^B` to stand for control-B, and similarly. One can also navigate
left and write by typing the digits that appear in the displayed list.

View file

@ -4,13 +4,17 @@ layout : page
permalink : /Negation/
---
\begin{code}
module plta.Negation where
\end{code}
This chapter introduces negation, and discusses intuitionistic
and classical logic.
## Imports
\begin{code}
open import Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open import plta.Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Data.Nat using (; zero; suc)
open import Data.Empty using (⊥; ⊥-elim)

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Preface/
---
\begin{code}
module plta.Preface where
\end{code}
This book is an introduction to programming language theory, written
in Agda. The authors are [Wen Kokke][wen] and [Philip Wadler][phil].
@ -88,4 +92,3 @@ preparing an Agda file that solves the exercise. Sometimes it is up to you to
work out the type of the identifier, but sometimes we give it in the exercise.
In some cases the type is bound to an identifier with a capital in its
name, where the identifier you are to define has a small letter instead.

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Properties/
---
\begin{code}
module plta.Properties where
\end{code}
Now that we've defined the naturals and operations upon them, our next
step is to learn how to prove properties that they satisfy. As hinted
by their name, properties of *inductive datatypes* are proved by

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Quantifiers/
---
\begin{code}
module plta.Quantifiers where
\end{code}
This chapter introduces universal and existential quantification.
## Imports
@ -12,8 +16,8 @@ This chapter introduces universal and existential quantification.
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)
open Eq.≡-Reasoning
open import Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open Isomorphism.≃-Reasoning
open import plta.Isomorphism using (_≃_; ≃-sym; ≃-trans; _≲_)
open plta.Isomorphism.≃-Reasoning
open import Data.Nat using (; zero; suc; _+_; _*_)
open import Data.Nat.Properties.Simple using (+-suc)
open import Relation.Nullary using (¬_)

View file

@ -4,10 +4,13 @@ layout : page
permalink : /Relations/
---
\begin{code}
module plta.Relations where
\end{code}
After having defined operations such as addition and multiplication,
the next step is to define relations, such as *less than or equal*.
## Imports
\begin{code}

View file

@ -4,6 +4,10 @@ layout : page
permalink : /Untyped/
---
\begin{code}
module plta.Untyped where
\end{code}
This chapter considers a system that varies, in interesting ways,
what has gone earlier. The lambda calculus in this section is
untyped rather than simply-typed; uses terms that are inherently-scoped
@ -13,10 +17,6 @@ call-by-value order of reduction.
## Imports
\begin{code}
module Untyped where
\end{code}
\begin{code}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; trans; cong)