lean4-htt/tests/lean/1369.lean
Leonardo de Moura c35108cf0d fix(library/tactic): fixes #1369
- `eval_expr` instantiate assigned metavariables occuring in the input
  expression.
- Rename pp.instantiate_goal_mvars to pp.instantiate_mvars
- `format_expr` also instantiates assigned metavariables before pretty printing
  when pp.instantiate_mvars is set to true.
2017-02-10 15:58:27 -08:00

41 lines
715 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 nat
open tactic
meta def match_le (e : expr) : tactic (expr × expr) :=
match expr.is_le e with
| (some r) := return r
| none := tactic.fail "expression is not a leq"
end
meta def nat_lit_le : tactic unit := do
(base_e, bound_e) ← tactic.target >>= match_le,
base ← tactic.eval_expr base_e,
skip
example : 17 ≤ 555555 :=
begin
nat_lit_le,
admit
end
example : { k : // k ≤ 555555 } :=
begin
refine subtype.tag _ _,
exact 17,
target >>= trace,
trace_state,
nat_lit_le,
admit
end
set_option pp.instantiate_mvars false
example : { k : // k ≤ 555555 } :=
begin
refine subtype.tag _ _,
exact 17,
target >>= trace,
trace_state,
nat_lit_le,
admit
end