diff -r 76cdc8f562fc -r d7944bdf7b3f CookBook/Tactical.thy --- a/CookBook/Tactical.thy Wed Mar 04 13:15:29 2009 +0000 +++ b/CookBook/Tactical.thy Wed Mar 04 13:50:47 2009 +0000 @@ -1,6 +1,5 @@ theory Tactical imports Base FirstSteps -uses "infix_conv.ML" begin chapter {* Tactical Reasoning\label{chp:tactical} *} @@ -479,21 +478,10 @@ takes an additional number as argument that makes explicit which premise should be instantiated. - To improve readability of the theorems we produce below, we shall use - the following function -*} - -ML{*fun no_vars ctxt thm = -let - val ((_, [thm']), _) = Variable.import_thms true [thm] ctxt -in - thm' -end*} - -text {* - that transform the schematic variables of a theorem into free variables. - Using this function for the first @{ML RS}-expression above would produce - the more readable result: + To improve readability of the theorems we produce below, we shall use the + function @{ML no_vars} from Section~\ref{sec:printing}, which transforms + schematic variables into free ones. Using this function for the first @{ML + RS}-expression above produces the more readable result: @{ML_response_fake [display,gray] "no_vars @{context} (@{thm disjI1} RS @{thm conjI})" "\P; Q\ \ (P \ Qa) \ Q"} @@ -1018,7 +1006,7 @@ *} -section {* Simplifier Tactics (TBD) *} +section {* Simplifier Tactics *} text {* A lot of convenience in the reasoning with Isabelle derives from its @@ -1188,9 +1176,11 @@ @{ML_response_fake [display,gray] "print_parts @{context} ss1" "Simplification rules: - ??.unknown: ?A1 - ?B1 \ ?C1 \ ?A1 - ?B1 \ (?A1 - ?C1) + ??.unknown: A - B \ C \ A - B \ (A - C) Congruences rules:"} + (FIXME: Why does it print out ??.unknown) + Adding the congruence rule @{thm [source] UN_cong} *} @@ -1202,10 +1192,9 @@ @{ML_response_fake [display,gray] "print_parts @{context} ss2" "Simplification rules: - ??.unknown: ?A1 - ?B1 \ ?C1 \ ?A1 - ?B1 \ (?A1 - ?C1) + ??.unknown: A - B \ C \ A - B \ (A - C) Congruences rules: - UNION: \?A1 = ?B1; \x. x \ ?B1 \ ?C1 x = ?D1 x\ \ - \x\?A1. ?C1 x \ \x\?B1. ?D1 x"} + UNION: \A = B; \x. x \ B \ C x = D x\ \ \x\A. C x \ \x\B. D x"} Notice that we had to add these lemmas as meta-equations. The @{ML empty_ss} expects this form of the simplification and congruence rules. However, even @@ -1240,14 +1229,14 @@ @{ML_response_fake [display,gray] "print_parts @{context} HOL_ss" "Simplification rules: - Pure.triv_forall_equality: (\x. PROP ?V) \ PROP ?V - HOL.the_eq_trivial: THE x. x = ?y \ ?y - HOL.the_sym_eq_trivial: THE y. ?y = y \ ?y + Pure.triv_forall_equality: (\x. PROP V) \ PROP V + HOL.the_eq_trivial: THE x. x = y \ y + HOL.the_sym_eq_trivial: THE ya. y = ya \ y \ Congruences rules: HOL.simp_implies: \ - \ (PROP ?P =simp=> PROP ?Q) \ (PROP ?P' =simp=> PROP ?Q') - op -->: \?P \ ?P'; ?P' \ ?Q \ ?Q'\ \ ?P \ ?Q \ ?P' \ ?Q'"} + \ (PROP P =simp=> PROP Q) \ (PROP P' =simp=> PROP Q') + op -->: \P \ P'; P' \ Q \ Q'\ \ P \ Q \ P' \ Q'"} The main point of these simpsets is that they are small enough to