2014-01-05 18:32:47 +00:00
|
|
|
(* import("tactic.lua") *)
|
2014-01-05 20:05:08 +00:00
|
|
|
variables p q r : Bool
|
2013-11-29 05:48:30 +00:00
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
theorem T1 : p → q → p /\ q :=
|
|
|
|
(fun H1 H2,
|
|
|
|
let H1 : p := _,
|
|
|
|
H2 : q := _
|
2014-01-09 16:33:52 +00:00
|
|
|
in and_intro H1 H2
|
2014-01-08 08:38:39 +00:00
|
|
|
).
|
2014-01-05 16:52:46 +00:00
|
|
|
exact -- solve first metavar
|
2013-11-29 05:48:30 +00:00
|
|
|
done
|
2014-01-05 16:52:46 +00:00
|
|
|
exact -- solve second metavar
|
2013-11-29 05:48:30 +00:00
|
|
|
done
|
|
|
|
|
2014-01-05 18:32:47 +00:00
|
|
|
(*
|
2014-01-08 08:38:39 +00:00
|
|
|
simple_tac = Repeat(conj_tac() ^ assumption_tac())
|
2014-01-05 18:32:47 +00:00
|
|
|
*)
|
2013-11-29 05:48:30 +00:00
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
theorem T2 : p → q → p /\ q /\ p := _.
|
2013-12-26 23:54:53 +00:00
|
|
|
simple_tac
|
2013-11-29 05:48:30 +00:00
|
|
|
done
|
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
print environment 1
|
2013-11-29 05:48:30 +00:00
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
theorem T3 : p → p /\ q → r → q /\ r /\ p := _.
|
|
|
|
(* Repeat(OrElse(conj_tac(), conj_hyp_tac(), assumption_tac())) *)
|
2013-12-26 23:54:53 +00:00
|
|
|
done
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
-- Display proof term generated by previous tac
|
2014-01-05 20:05:08 +00:00
|
|
|
print environment 1
|
2013-12-26 23:54:53 +00:00
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
theorem T4 : p → p /\ q → r → q /\ r /\ p := _.
|
2014-01-09 16:33:52 +00:00
|
|
|
Repeat (OrElse (apply and_intro) conj_hyp exact)
|
2013-11-29 05:48:30 +00:00
|
|
|
done
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
-- Display proof term generated by previous tac --
|
2014-01-05 20:05:08 +00:00
|
|
|
print environment 1
|