Commit 130763e 1 parent a9f7918 commit 130763e Copy full SHA for 130763e
File tree 1 file changed +26
-5
lines changed
1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,8 @@ open String
11
11
-- Print Parse
12
12
-- set_option pp.all true
13
13
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
18
14
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
20
16
intro x
21
17
cases x with
22
18
| inl xa =>
@@ -30,6 +26,31 @@ def p : a_or_b (toList "a") -> Nat := by
30
26
| mk eq =>
31
27
contradiction
32
28
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
+
33
54
-- ν⇃ : Lang → Set ℓ -- “nullable”
34
55
-- ν⇃ P = P []
35
56
def ν (P : Lang α) : Type u := -- backslash nu
You can’t perform that action at this time.
0 commit comments