lean4-htt/old_tests/tests/lean/run/using_smt3.lean
2018-04-10 12:56:55 -07:00

18 lines
566 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
lemma ex1 : let x := 1 in ∀ y, x = y → y = 1 :=
by using_smt $ smt_tactic.intros >> get_local `x >>= (fun a, trace a)
open tactic_result
meta def fail_if_success {α : Type} (t : smt_tactic α) : smt_tactic unit :=
⟨λ ss ts, match t.run ss ts with
| success _ _ := failed ts
| exception _ _ _ := success ((), ss) ts
end⟩
def my_smt_config : smt_config :=
{ pre_cfg := { zeta := tt } }
lemma ex2 : let x := 1 in ∀ y, x = y → y = 1 :=
by using_smt_with my_smt_config $ smt_tactic.intros >> fail_if_success (get_local `x) >> return ()