lean2/tests/lean/tst1.lean.expected.out
Leonardo de Moura 2179e57db3 refactor(builtin): move if_then_else to its own module
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-09 14:08:39 -08:00

49 lines
1.6 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
Imported 'if_then_else'
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) then d else 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) then else ⊥
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) then d else v j H