Anqur
This project is evolved from Guest0x0 with cubical features removed. It serves as a demo for elaboration of inductive types, pattern matching, and indexed types.
I will also be testing ideas on induction-recursion and induction-induction of simpler indexed types in this project.
v0.5
Ported latest code from Aya with a new coverage checking algorithm which deals with nested pattern matching better. Error report is implemented! Thanks to the new coverage checking algorithm, it becomes much easier.
The previous example will cause:
Missing: ImmutableVector[(zero, zero), (zero, succ zero), (zero, succ (succ ...))]
v0.4
Implemented a coverage checker. The following code:
def plus-bad (a : Nat) (b : Nat) : Nat
| (succ a) b => succ (plus a b)
Will cause:
Missing pattern >:)
It is too difficult to implement proper error reporting, so I'll leave it to readers :) in case you are really curious, you may check out the coverage checker in Aya.
v0.3
Implements unfold properly. The following code (with the old code):
print : Nat => plus two two
Prints
succ (succ (succ (succ (zero))))
Awesome. Total lines of Java code (excluding blank/comments): 864
v0.2
Implement pattern matching functions and recursive functions. No termination and coverage check yet. Reduction of pattern matching is still a work-in-progress. The syntax is kinda Lean-flavored:
def plus (a : Nat) (b : Nat) : Nat
| zero b => b
| (succ a) b => succ (plus a b)
v0.1
Initial version with simplest parameterized inductive types:
data Unit | unit
def myYolife : Unit => unit
data Nat
| zero
| succ (n : Nat)
def two : Nat => succ (succ zero)
print : Nat => two
data List (A : U)
| nil
| cons (x : A) (xs : List A)
def lengthTwo (A : U) (a : A) : List A => cons A a (cons A a (nil A))
print : List Nat => lengthTwo Nat two
Total lines of Java code: 745. Please wait, patterns are on the way.