src/HOL/Tools/SMT/z3_replay_methods.ML
changeset 59498 50b60f501b05
parent 59381 de4218223e00
child 59580 cbc38731d42f
equal deleted inserted replaced
59497:0c5cd369a643 59498:50b60f501b05
   307 
   307 
   308 
   308 
   309 (* congruence *)
   309 (* congruence *)
   310 
   310 
   311 fun ctac ctxt prems i st = st |> (
   311 fun ctac ctxt prems i st = st |> (
   312   resolve_tac (@{thm refl} :: prems) i
   312   resolve_tac ctxt (@{thm refl} :: prems) i
   313   ORELSE (cong_tac ctxt i THEN ctac ctxt prems (i + 1) THEN ctac ctxt prems i))
   313   ORELSE (cong_tac ctxt i THEN ctac ctxt prems (i + 1) THEN ctac ctxt prems i))
   314 
   314 
   315 fun cong_basic ctxt thms t =
   315 fun cong_basic ctxt thms t =
   316   let val st = Thm.trivial (certify_prop ctxt t)
   316   let val st = Thm.trivial (certify_prop ctxt t)
   317   in
   317   in
   326   by fast+}
   326   by fast+}
   327 
   327 
   328 fun cong_full ctxt thms t = prove ctxt t (fn ctxt' =>
   328 fun cong_full ctxt thms t = prove ctxt t (fn ctxt' =>
   329   Method.insert_tac thms
   329   Method.insert_tac thms
   330   THEN' (Classical.fast_tac ctxt'
   330   THEN' (Classical.fast_tac ctxt'
   331     ORELSE' dresolve_tac cong_dest_rules
   331     ORELSE' dresolve_tac ctxt cong_dest_rules
   332     THEN' Classical.fast_tac ctxt'))
   332     THEN' Classical.fast_tac ctxt'))
   333 
   333 
   334 fun cong ctxt thms = try_provers ctxt Z3_Proof.Monotonicity [
   334 fun cong ctxt thms = try_provers ctxt Z3_Proof.Monotonicity [
   335   ("basic", cong_basic ctxt thms),
   335   ("basic", cong_basic ctxt thms),
   336   ("full", cong_full ctxt thms)] thms
   336   ("full", cong_full ctxt thms)] thms
   344   "(!!x. (~ P x) = Q x) ==> (~ (EX x. P x)) = (ALL x. Q x)"
   344   "(!!x. (~ P x) = Q x) ==> (~ (EX x. P x)) = (ALL x. Q x)"
   345   "(!!x. (~ P x) = Q x) ==> (~ (ALL x. P x)) = (EX x. Q x)"
   345   "(!!x. (~ P x) = Q x) ==> (~ (ALL x. P x)) = (EX x. Q x)"
   346   by fast+}
   346   by fast+}
   347 
   347 
   348 fun quant_intro ctxt [thm] t =
   348 fun quant_intro ctxt [thm] t =
   349     prove ctxt t (K (REPEAT_ALL_NEW (resolve_tac (thm :: quant_intro_rules))))
   349     prove ctxt t (K (REPEAT_ALL_NEW (resolve_tac ctxt (thm :: quant_intro_rules))))
   350   | quant_intro ctxt thms t = replay_rule_error ctxt Z3_Proof.Quant_Intro thms t
   350   | quant_intro ctxt thms t = replay_rule_error ctxt Z3_Proof.Quant_Intro thms t
   351 
   351 
   352 
   352 
   353 (* distributivity of conjunctions and disjunctions *)
   353 (* distributivity of conjunctions and disjunctions *)
   354 
   354