forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get basic examples somewhat working.
There remains 2 issues: - the check for existing mutual equivalents of the nested appearance is not right. This will need more work - (not certain) instead of simply collecting necessary local variables from `loose_bvars`, we should also collect them in the type of the lvars associated, in a chain, similarly to `occursOrInType` in PR leanprover#3398 The generation of `SizeOf` is failing on a simple example, and more complex ones lead to a segfault, but this is a good step forward.
- Loading branch information
1 parent
a92dc00
commit 9d5f76f
Showing
2 changed files
with
66 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
inductive Foo (n : Nat) (T : Type) : Nat → Type | ||
| foo : Foo n T 0 | ||
--set_option autoImplicit false | ||
set_option genSizeOfSpec false | ||
|
||
inductive Foo (n : Nat) (T : Type) (k : Nat) : Nat → Type | ||
| foo : Nat → Foo n T k 0 | ||
|
||
inductive Bar : Type | ||
| bar : Foo n Bar 0 → Bar | ||
| bar : Foo n Bar k 0 → Bar | ||
|
||
#check Bar.rec | ||
/-Bar.rec.{u} {motive_1 : Bar → Sort u} {motive_2 : {n : Nat} → (a : Nat) → Foo n Bar a → Sort u} | ||
(bar : {n : Nat} → (a : Foo n Bar 0) → motive_2 0 a → motive_1 (Bar.bar a)) (foo : {n : Nat} → motive_2 0 Foo.foo) | ||
(t : Bar) : motive_1 t-/ | ||
|
||
-- inductive Test : Nat → Type | ||
-- | foo :{n : Nat} → List (Test n) → Test n.succ | ||
|
||
-- #check Test.rec | ||
|
||
-- inductive Regex : (α: Type u) -> Type (u + 1) where | ||
-- | emptyset : Regex α | ||
-- | emptystr : Regex α | ||
-- | char : α → Regex α | ||
-- | or : Regex α → Regex α → Regex α | ||
-- | concat : Regex α → Regex α → Regex α | ||
-- | star : Regex α → Regex α | ||
|
||
|
||
-- inductive Lang : {α : Type u} -> Regex α -> List α -> Type (u + 2) where | ||
-- | lang_emptyset (str : List α): | ||
-- False -> | ||
-- Lang Regex.emptyset str | ||
-- | lang_emptystr: | ||
-- Lang Regex.emptystr ([]: List α) | ||
-- | lang_char (c: α): | ||
-- Lang (Regex.char c) [c] | ||
-- | lang_or (str: List α) (r1 r2: Regex α): | ||
-- Lang r1 str ⊕ Lang r2 str -> | ||
-- Lang (Regex.or r1 r2) str |