lean2/tests/lean/tactic2.lean

30 lines
688 B
Text
Raw Normal View History

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
)).
assumption (* solve first metavar *)
done
apply assumption_tac (* solve second metavar *)
done
(**
simple_tac = REPEAT(imp_tac() ^ conj_tac() ^ assumption_tac())
**)
Theorem T2 : p => q => p /\ q /\ p := _.
apply simple_tac
done
Show Environment 1
Theorem T3 : p => p /\ q => r => q /\ r /\ p := _.
apply (** REPEAT(ORELSE(imp_tac, conj_tac, conj_hyp_tac, assumption_tac)) **)
done
(* Display proof term generated by previous tac *)
Show Environment 1