2014-01-01 21:52:25 +00:00
|
|
|
Import Int.
|
2013-09-06 18:02:00 +00:00
|
|
|
|
2014-01-05 19:03:35 +00:00
|
|
|
print
|
2013-09-06 18:02:00 +00:00
|
|
|
let b := true,
|
|
|
|
a : Int := b
|
|
|
|
in a
|
|
|
|
|
|
|
|
Variable vector : Type -> Nat -> Type
|
|
|
|
Variable const {A : Type} (n : Nat) (a : A) : vector A n
|
|
|
|
|
|
|
|
Check
|
|
|
|
let a := 10,
|
|
|
|
v1 := const a true,
|
|
|
|
v2 := v1
|
|
|
|
in v2
|
|
|
|
|
2014-01-05 19:03:35 +00:00
|
|
|
print
|
2013-09-06 18:02:00 +00:00
|
|
|
let a := 10,
|
|
|
|
v1 : vector Bool a := const a true,
|
|
|
|
v2 : vector Bool a := v1
|
|
|
|
in v2
|
|
|
|
|
|
|
|
Check
|
|
|
|
let a := 10,
|
|
|
|
v1 : vector Bool a := const a true,
|
|
|
|
v2 : vector Bool a := v1
|
|
|
|
in v2
|
|
|
|
|
|
|
|
Check
|
|
|
|
let a := 10,
|
|
|
|
v1 : vector Bool a := const a true,
|
|
|
|
v2 : vector Int a := v1
|
|
|
|
in v2
|
|
|
|
|
|
|
|
Variable foo : (vector Bool 10) -> (vector Int 10)
|
|
|
|
Coercion foo
|
|
|
|
|
|
|
|
Check
|
|
|
|
let a := 10,
|
|
|
|
v1 : vector Bool a := const a true,
|
|
|
|
v2 : vector Int a := v1
|
|
|
|
in v2
|
|
|
|
|
2013-12-19 05:18:45 +00:00
|
|
|
SetOption pp::coercion true
|
2013-09-06 18:02:00 +00:00
|
|
|
|
2014-01-05 19:03:35 +00:00
|
|
|
print
|
2013-09-06 18:02:00 +00:00
|
|
|
let a := 10,
|
|
|
|
v1 : vector Bool a := const a true,
|
|
|
|
v2 : vector Int a := v1
|
|
|
|
in v2
|