lean4-htt/tests/lean/sizeof.lean
Leonardo de Moura d6eb5a9ff2 feat: generate sizeOf equality lemmas for constructors
TODO: support for nested inductive types.
2021-01-21 17:44:15 -08:00

18 lines
465 B
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.

-- Recall that we do not generate code for `sizeOf` instances since they are only used for proving termination
#reduce sizeOf 10
#reduce sizeOf [1, 2]
#reduce sizeOf #[1, 2]
#reduce sizeOf (10 : UInt8)
#reduce sizeOf 'a'
#reduce sizeOf ['h', 'e', 'l', 'l', 'o']
#reduce sizeOf "abc"
#reduce sizeOf `abc
inductive InfTree (α : Type u)
| leaf (a : α)
| node (children : Nat → InfTree α)
#reduce sizeOf <| InfTree.leaf 10
#check @InfTree.node.sizeOf_spec