lean4-htt/tests/lean/run/apply4.lean
Leonardo de Moura 6a0f11f705 feat(library/tactic/tactic_state,library/init/meta/tactic): add mk_meta_univ, mk_meta_var, mk_const
This commit also changes the semantics of the unify tactic.
It fails if the arguments are not unifiable.
2016-06-18 11:12:51 -07:00

42 lines
840 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.

open tactic bool
constant foo {A : Type} [inhabited A] (a b : A) : a = default A → a = b
example (a b : nat) : a = 0 → a = b :=
by do
intro "H",
apply (expr.const "foo" [level.of_nat 1]),
trace_state,
assumption
definition ex : inhabited (nat × nat × bool) :=
by apply_instance
set_option pp.all true
print ex
set_option pp.all false
example (a b : nat) : a = 0 → a = b :=
by do
intro "H",
apply_core (expr.const "foo" [level.of_nat 1]) transparency.semireducible tt ff,
trace_state,
a ← get_local "a",
trace_state,
mk_app ("inhabited" <.> "mk") [a] >>= exact,
trace "--------",
trace_state,
assumption
print "----------------"
set_option pp.all true
example (a b : nat) : a = 0 → a = b :=
by do
intro "H",
foo ← mk_const "foo",
trace_expr foo,
apply foo,
trace_state,
assumption