src/Provers/clasimp.ML
changeset 18630 69fe387b3b6e
parent 18529 540da2415751
child 18688 abf0f018b5ec
equal deleted inserted replaced
18629:bdf01da93ed4 18630:69fe387b3b6e
   152       handle THM _ => (delcs (cs, [zero_rotate (th RS Data.notE)])
   152       handle THM _ => (delcs (cs, [zero_rotate (th RS Data.notE)])
   153         handle THM _ => delcs (cs, [th])),
   153         handle THM _ => delcs (cs, [th])),
   154      delss (ss, [th]))
   154      delss (ss, [th]))
   155   end;
   155   end;
   156 
   156 
       
   157 fun modifier att (x, ths) =
       
   158   fst (Thm.applys_attributes [att] (x, rev ths));
       
   159 
       
   160 fun addXIs which = modifier (which (ContextRules.intro_query NONE));
       
   161 fun addXEs which = modifier (which (ContextRules.elim_query NONE));
       
   162 fun addXDs which = modifier (which (ContextRules.dest_query NONE));
       
   163 fun delXs which = modifier (which ContextRules.rule_del);
       
   164 
   157 in
   165 in
   158 
   166 
   159 val op addIffs =
   167 val op addIffs =
   160   Library.foldl 
   168   Library.foldl 
   161       (addIff (Classical.addSEs, Classical.addSIs)
   169       (addIff (Classical.addSEs, Classical.addSIs)
   166 fun AddIffs thms = change_clasimpset (fn css => css addIffs thms);
   174 fun AddIffs thms = change_clasimpset (fn css => css addIffs thms);
   167 fun DelIffs thms = change_clasimpset (fn css => css delIffs thms);
   175 fun DelIffs thms = change_clasimpset (fn css => css delIffs thms);
   168 
   176 
   169 fun addIffs_global (thy, ths) =
   177 fun addIffs_global (thy, ths) =
   170   Library.foldl (addIff
   178   Library.foldl (addIff
   171     (ContextRules.addXEs_global, ContextRules.addXIs_global)
   179     (addXEs Attrib.theory, addXIs Attrib.theory)
   172     (ContextRules.addXEs_global, ContextRules.addXIs_global) #1)
   180     (addXEs Attrib.theory, addXIs Attrib.theory) #1)
   173   ((thy, ()), ths) |> #1;
   181   ((thy, ()), ths) |> #1;
   174 
   182 
   175 fun addIffs_local (ctxt, ths) =
   183 fun addIffs_local (ctxt, ths) =
   176   Library.foldl (addIff
   184   Library.foldl (addIff
   177     (ContextRules.addXEs_local, ContextRules.addXIs_local)
   185     (addXEs Attrib.context, addXIs Attrib.context)
   178     (ContextRules.addXEs_local, ContextRules.addXIs_local) #1)
   186     (addXEs Attrib.context, addXIs Attrib.context) #1)
   179   ((ctxt, ()), ths) |> #1;
   187   ((ctxt, ()), ths) |> #1;
   180 
   188 
   181 fun delIffs_global (thy, ths) =
   189 fun delIffs_global (thy, ths) =
   182   Library.foldl (delIff ContextRules.delrules_global #1) ((thy, ()), ths) |> #1;
   190   Library.foldl (delIff (delXs Attrib.theory) #1) ((thy, ()), ths) |> #1;
   183 
   191 
   184 fun delIffs_local (ctxt, ths) =
   192 fun delIffs_local (ctxt, ths) =
   185   Library.foldl (delIff ContextRules.delrules_local #1) ((ctxt, ()), ths) |> #1;
   193   Library.foldl (delIff (delXs Attrib.context) #1) ((ctxt, ()), ths) |> #1;
   186 
   194 
   187 end;
   195 end;
   188 
   196 
   189 
   197 
   190 (* tacticals *)
   198 (* tacticals *)