lean2/tests/lean/tactic2.lean
Leonardo de Moura ce1213a020 feat(frontends/lean): use '(* ... *)' instead of '(** ... **)' for script code blocks
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 10:32:47 -08:00

38 lines
No EOL
876 B
Text

(* import("tactic.lua") *)
Variables p q r : Bool
Theorem T1 : p => q => p /\ q :=
Discharge (fun H1,
Discharge (fun H2,
let H1 : p := _,
H2 : q := _
in Conj H1 H2
)).
exact -- solve first metavar
done
exact -- solve second metavar
done
(*
simple_tac = Repeat(imp_tac() ^ conj_tac() ^ assumption_tac())
*)
Theorem T2 : p => q => p /\ q /\ p := _.
simple_tac
done
Show Environment 1
Theorem T3 : p => p /\ q => r => q /\ r /\ p := _.
(* Repeat(OrElse(imp_tac(), conj_tac(), conj_hyp_tac(), assumption_tac())) *)
done
-- Display proof term generated by previous tac
Show Environment 1
Theorem T4 : p => p /\ q => r => q /\ r /\ p := _.
Repeat (OrElse (apply Discharge) (apply Conj) conj_hyp exact)
done
-- Display proof term generated by previous tac --
Show Environment 1