src/FOL/simpdata.ML
changeset 7355 4c43090659ca
parent 6391 0da748358eff
child 7570 a9391550eea1
equal deleted inserted replaced
7354:358b1c5391f0 7355:4c43090659ca
   125 
   125 
   126 (*** Classical laws ***)
   126 (*** Classical laws ***)
   127 
   127 
   128 fun prove_fun s = 
   128 fun prove_fun s = 
   129  (writeln s;  
   129  (writeln s;  
   130   prove_goal FOL.thy s
   130   prove_goal (the_context ()) s
   131    (fn prems => [ (cut_facts_tac prems 1), 
   131    (fn prems => [ (cut_facts_tac prems 1), 
   132                   (Cla.fast_tac FOL_cs 1) ]));
   132                   (Cla.fast_tac FOL_cs 1) ]));
   133 
   133 
   134 (*Avoids duplication of subgoals after expand_if, when the true and false 
   134 (*Avoids duplication of subgoals after expand_if, when the true and false 
   135   cases boil down to the same thing.*) 
   135   cases boil down to the same thing.*) 
   175 
   175 
   176 fun int_prove nm thm  = qed_goal nm IFOL.thy thm
   176 fun int_prove nm thm  = qed_goal nm IFOL.thy thm
   177     (fn prems => [ (cut_facts_tac prems 1), 
   177     (fn prems => [ (cut_facts_tac prems 1), 
   178                    (IntPr.fast_tac 1) ]);
   178                    (IntPr.fast_tac 1) ]);
   179 
   179 
   180 fun prove nm thm  = qed_goal nm FOL.thy thm (fn _ => [Blast_tac 1]);
   180 fun prove nm thm  = qed_goal nm (the_context ()) thm (fn _ => [Blast_tac 1]);
   181 
   181 
   182 int_prove "conj_commute" "P&Q <-> Q&P";
   182 int_prove "conj_commute" "P&Q <-> Q&P";
   183 int_prove "conj_left_commute" "P&(Q&R) <-> Q&(P&R)";
   183 int_prove "conj_left_commute" "P&(Q&R) <-> Q&(P&R)";
   184 val conj_comms = [conj_commute, conj_left_commute];
   184 val conj_comms = [conj_commute, conj_left_commute];
   185 
   185 
   240   val allI = allI
   240   val allI = allI
   241   val allE = allE
   241   val allE = allE
   242 end);
   242 end);
   243 
   243 
   244 local
   244 local
       
   245 
   245 val ex_pattern =
   246 val ex_pattern =
   246   read_cterm (Theory.sign_of FOL.thy) ("EX x. P(x) & Q(x)", FOLogic.oT)
   247   read_cterm (Theory.sign_of (the_context ())) ("EX x. P(x) & Q(x)", FOLogic.oT)
   247 
   248 
   248 val all_pattern =
   249 val all_pattern =
   249   read_cterm (Theory.sign_of FOL.thy) ("ALL x. P(x) & P'(x) --> Q(x)", FOLogic.oT)
   250   read_cterm (Theory.sign_of (the_context ())) ("ALL x. P(x) & P'(x) --> Q(x)", FOLogic.oT)
   250 
   251 
   251 in
   252 in
   252 val defEX_regroup =
   253 val defEX_regroup =
   253   mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex;
   254   mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex;
   254 val defALL_regroup =
   255 val defALL_regroup =
   346       "(~P <-> ~Q) <-> (P<->Q)"];
   347       "(~P <-> ~Q) <-> (P<->Q)"];
   347 
   348 
   348 (*classical simprules too*)
   349 (*classical simprules too*)
   349 val FOL_ss = IFOL_ss addsimps (cla_simps @ cla_ex_simps @ cla_all_simps);
   350 val FOL_ss = IFOL_ss addsimps (cla_simps @ cla_ex_simps @ cla_all_simps);
   350 
   351 
   351 simpset_ref() := FOL_ss;
   352 val simpsetup = [fn thy => (simpset_ref_of thy := FOL_ss; thy)];
   352 
       
   353 
   353 
   354 
   354 
   355 (*** integration of simplifier with classical reasoner ***)
   355 (*** integration of simplifier with classical reasoner ***)
   356 
   356 
   357 structure Clasimp = ClasimpFun
   357 structure Clasimp = ClasimpFun