test(tests/lean/run): add basic pattern matching compilation test

This commit is contained in:
Leonardo de Moura 2015-01-02 22:22:20 -08:00
parent 4781fc8365
commit 92b6c06a21
2 changed files with 13 additions and 0 deletions

5
tests/lean/run/eq2.lean Normal file
View file

@ -0,0 +1,5 @@
definition symm {A : Type} : Π {a b : A}, a = b → b = a,
symm rfl := rfl
definition trans {A : Type} : Π {a b c : A}, a = b → b = c → a = c,
trans rfl rfl := rfl

8
tests/lean/run/eq3.lean Normal file
View file

@ -0,0 +1,8 @@
import data.vector
open nat vector
definition swap {A : Type} : Π {n}, vector A (succ (succ n)) → vector A (succ (succ n)),
swap (a :: b :: vs) := b :: a :: vs
example (n : nat) (a b : num) (v : vector num n) : swap (a :: b :: v) = b :: a :: v :=
rfl