Skip to content

Commit 810829a

Browse files
committed
Add a simple example
1 parent 8d5729a commit 810829a

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Minimal/Examples.lean

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import Minimal.Calculus
2+
3+
open Term
4+
open OptionalAttr
5+
open Reduce
6+
7+
-- ⟦ a ↦ ⟦ ⟧ ⟧.a
8+
def example1 : Term :=
9+
dot
10+
(obj
11+
(Bindings.cons
12+
"a"
13+
(by simp)
14+
(attached (obj (Bindings.nil)))
15+
Bindings.nil))
16+
"a"
17+
18+
-- ⟦ ⟧
19+
def example1' : Term := obj Bindings.nil
20+
21+
-- ⟦ a ↦ ⟦ ⟧ ⟧.a ⇝ ⟦ ⟧
22+
def test1_red1 : example1 ⇝ example1' := by
23+
rw [example1, example1']
24+
exact (dot_c
25+
(obj Bindings.nil)
26+
"a"
27+
(Bindings.cons
28+
"a"
29+
(by simp)
30+
(attached (obj (Bindings.nil)))
31+
Bindings.nil)
32+
(by simp)
33+
(by simp [lookup]))
34+
35+
-- ⟦ a ↦ ⟦ ⟧ ⟧.a ⇝* ⟦ ⟧
36+
def test1 : example1 ⇝* example1' := ReflTransGen.head
37+
test1_red1
38+
ReflTransGen.refl

0 commit comments

Comments
 (0)