Skip to content

Commit 130763e

Browse files
proof relevant parse 2
1 parent a9f7918 commit 130763e

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

Katydid/Conal/Calculus.lean

+26-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ open String
1111
-- Print Parse
1212
-- set_option pp.all true
1313
open List
14-
def a_or_b := (char 'a' ⋃ char 'b')
15-
#print a_or_b
16-
def a_or_b_parse_a := a_or_b (toList "a")
17-
-- #eval a_or_b_parse_a
1814

19-
def p : a_or_b (toList "a") -> Nat := by
15+
def example_of_proof_relevant_parse : (char 'a' ⋃ char 'b') (toList "a") -> Nat := by
2016
intro x
2117
cases x with
2218
| inl xa =>
@@ -30,6 +26,31 @@ def p : a_or_b (toList "a") -> Nat := by
3026
| mk eq =>
3127
contradiction
3228

29+
def example_of_proof_relevant_parse2 : (char 'a', (char 'b' ⋃ char 'c')) (toList "ab") -> Nat := by
30+
intro x1
31+
simp at x1
32+
cases x1 with
33+
| mk x1 x2 =>
34+
cases x2 with
35+
| mk x2 x3 =>
36+
cases x3 with
37+
| mk x3 x4 =>
38+
cases x3 with
39+
| mk x3 =>
40+
cases x4 with
41+
| mk x4 x5 =>
42+
cases x4 with
43+
| inl x4 =>
44+
cases x4 with
45+
| mk x4 =>
46+
subst_vars
47+
exact 0
48+
| inr x4 =>
49+
cases x4 with
50+
| mk x4 =>
51+
subst_vars
52+
contradiction
53+
3354
-- ν⇃ : Lang → Set ℓ -- “nullable”
3455
-- ν⇃ P = P []
3556
def ν (P : Lang α) : Type u := -- backslash nu

0 commit comments

Comments
 (0)