lean2/tests/lean/tst1.lean.expected.out
Leonardo de Moura 4ba097a141 feat(frontends/lean): use lowercase commands, replace 'endscope' and 'endnamespace' with 'end'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 13:06:36 -08:00

48 lines
1.5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Set: pp::colors
Set: pp::unicode
Assumed: N
Assumed: lt
Assumed: zero
Assumed: one
Assumed: two
Assumed: three
Assumed: two_lt_three
Defined: vector
Defined: const
Defined: update
Defined: select
Defined: map
variable one : N
variable two : N
variable three : N
infix 50 < : lt
axiom two_lt_three : two < three
definition vector (A : Type) (n : N) : Type := Π (i : N), i < n → A
definition const {A : Type} (n : N) (d : A) : vector A n := λ (i : N) (H : i < n), d
definition update {A : Type} {n : N} (v : vector A n) (i : N) (d : A) : vector A n :=
λ (j : N) (H : j < n), if (j = i) d (v j H)
definition select {A : Type} {n : N} (v : vector A n) (i : N) (H : i < n) : A := v i H
definition map {A B C : Type} {n : N} (f : A → B → C) (v1 : vector A n) (v2 : vector B n) : vector C n :=
λ (i : N) (H : i < n), f (v1 i H) (v2 i H)
select (update (const three ⊥) two ) two two_lt_three : Bool
if (two == two)
update (const three ⊥) two : vector Bool three
--------
@select : Π (A : Type) (n : N) (v : vector A n) (i : N), i < n → A
map type --->
@map : Π (A B C : Type) (n : N), (A → B → C) → vector A n → vector B n → vector C n
map normal form -->
λ (A B C : Type)
(n : N)
(f : A → B → C)
(v1 : Π (i : N), i < n → A)
(v2 : Π (i : N), i < n → B)
(i : N)
(H : i < n),
f (v1 i H) (v2 i H)
update normal form -->
λ (A : Type) (n : N) (v : Π (i : N), i < n → A) (i : N) (d : A) (j : N) (H : j < n), if (j == i) d (v j H)