restored Id to String

This commit is contained in:
wadler 2017-06-20 20:56:44 +01:00
parent d01c597043
commit c1c997589d
2 changed files with 9 additions and 10 deletions

View file

@ -36,7 +36,7 @@ standard library, wherever they overlap.
open import Data.Nat using () open import Data.Nat using ()
open import Data.Empty using (⊥; ⊥-elim) open import Data.Empty using (⊥; ⊥-elim)
open import Data.Maybe using (Maybe; just; nothing) open import Data.Maybe using (Maybe; just; nothing)
-- open import Data.String using (String) open import Data.String using (String)
open import Relation.Nullary using (¬_; Dec; yes; no) open import Relation.Nullary using (¬_; Dec; yes; no)
open import Relation.Binary.PropositionalEquality open import Relation.Binary.PropositionalEquality
using (_≡_; refl; _≢_; trans; sym) using (_≡_; refl; _≢_; trans; sym)
@ -54,8 +54,7 @@ we repeat its definition here.
\begin{code} \begin{code}
data Id : Set where data Id : Set where
-- id : String → Id id : String → Id
id : → Id
\end{code} \end{code}
We recall a standard fact of logic. We recall a standard fact of logic.
@ -70,7 +69,7 @@ by deciding equality on the underlying strings.
\begin{code} \begin{code}
_≟_ : (x y : Id) → Dec (x ≡ y) _≟_ : (x y : Id) → Dec (x ≡ y)
id x ≟ id y with x Data.Nat.≟ y -- x Data.String.≟ y id x ≟ id y with x Data.String.≟ y
id x ≟ id y | yes refl = yes refl id x ≟ id y | yes refl = yes refl
id x ≟ id y | no x≢y = no (contrapositive id-inj x≢y) id x ≟ id y | no x≢y = no (contrapositive id-inj x≢y)
where where
@ -82,9 +81,9 @@ We define some identifiers for future use.
\begin{code} \begin{code}
x y z : Id x y z : Id
x = id 0 -- "x" x = id "x"
y = id 1 -- "y" y = id "y"
z = id 2 -- "z" z = id "z"
\end{code} \end{code}
## Total Maps ## Total Maps

View file

@ -45,9 +45,9 @@ data Term : Set where
Some examples. Some examples.
\begin{code} \begin{code}
f x y : Id f x y : Id
f = id 0 -- "f" f = id "f"
x = id 1 -- "x" x = id "x"
y = id 2 -- "y" y = id "y"
I[𝔹] I[𝔹⇒𝔹] K[𝔹][𝔹] not[𝔹] : Term I[𝔹] I[𝔹⇒𝔹] K[𝔹][𝔹] not[𝔹] : Term
I[𝔹] = (λᵀ x ∈ 𝔹 ⇒ (varᵀ x)) I[𝔹] = (λᵀ x ∈ 𝔹 ⇒ (varᵀ x))