lean2/tests/lean/cast3.lean
Leonardo de Moura 00e89190c2 refactor(library/cast): use .lean file instead of .cpp file to define casting library
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-23 22:04:19 -08:00

24 lines
494 B
Text

Import "cast.lean"
Variables A A' B B' : Type
Variable x : A
Eval cast (Refl A) x
Eval x = (cast (Refl A) x)
Variable b : B
Definition f (x : A) : B := b
Axiom H : (A -> B) = (A' -> B)
Variable a' : A'
Eval (cast H f) a'
Axiom H2 : (A -> B) = (A' -> B')
Definition g (x : B') : Nat := 0
Eval g ((cast H2 f) a')
Check g ((cast H2 f) a')
Eval (cast H2 f) a'
Variables A1 A2 A3 : Type
Axiom Ha : A1 = A2
Axiom Hb : A2 = A3
Variable a : A1
Eval (cast Hb (cast Ha a))
Check (cast Hb (cast Ha a))