lean4-htt/tests/lean/run/rb_map1.lean
Leonardo de Moura 414bdc1abb refactor(library): move 'meta' to 'init' folder
Motivation: tactic framework should be always available.
2016-06-06 19:08:07 -07:00

40 lines
693 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.

import system.IO
section
open nat_map
vm_eval size (insert (insert (mk nat) 10 20) 10 21)
meta_definition m := (insert (insert (insert (mk nat) 10 20) 5 50) 10 21)
vm_eval find m 10
vm_eval find m 5
vm_eval find m 8
vm_eval contains m 5
vm_eval contains m 8
open list
meta_definition m2 := of_list [((1:nat), "one"), (2, "two"), (3, "three")]
vm_eval size m2
vm_eval find m2 1
vm_eval find m2 4
vm_eval find m2 3
vm_eval do pp m2, put_str "\n"
vm_eval m2
end
section
open rb_map
-- Mapping from (nat × nat) → nat
meta_definition m3 := insert (insert (mk (nat × nat) nat) (1, 2) 3) (2, 2) 4
vm_eval find m3 (1, 2)
vm_eval find m3 (2, 1)
vm_eval find m3 (2, 2)
vm_eval pp m3
end