lean4-htt/tests/lean/run/252.lean
Daniel Selsam a9b01991c2 feat(frontends/lean/inductive_cmd): new frontend for the inductive cmd
Conflicts:
	src/frontends/lean/CMakeLists.txt
	src/frontends/lean/structure_cmd.h
2016-08-17 07:34:03 -07:00

15 lines
319 B
Text

open nat
inductive tree (A : Type)
| leaf : A → tree
| node : tree → tree → tree
check tree.node
definition size {A : Type} (t : tree A) : nat :=
tree.rec (λ a, 1) (λ t₁ t₂ n₁ n₂, n₁ + n₂) t
check size
eval size (tree.node (tree.node (tree.leaf 0) (tree.leaf 1))
(tree.leaf 0))