src/Provers/clasimp.ML
changeset 51717 9e7d1c139569
parent 51703 f2e92fc0c8aa
child 54742 7a86358a3c0b
equal deleted inserted replaced
51709:19b47bfac6ef 51717:9e7d1c139569
    42 structure Blast = Data.Blast;
    42 structure Blast = Data.Blast;
    43 
    43 
    44 
    44 
    45 (* simp as classical wrapper *)
    45 (* simp as classical wrapper *)
    46 
    46 
    47 fun clasimp f name tac ctxt = f (ctxt, (name, CHANGED o tac (simpset_of ctxt)));
    47 (* FIXME !? *)
       
    48 fun clasimp f name tac ctxt = f (ctxt, (name, fn _ => CHANGED o tac ctxt));
    48 
    49 
    49 (*Add a simpset to the claset!*)
    50 (*Add a simpset to the claset!*)
    50 (*Caution: only one simpset added can be added by each of addSss and addss*)
    51 (*Caution: only one simpset added can be added by each of addSss and addss*)
    51 val addSss = clasimp Classical.addSafter "safe_asm_full_simp_tac" Simplifier.safe_asm_full_simp_tac;
    52 val addSss = clasimp Classical.addSafter "safe_asm_full_simp_tac" Simplifier.safe_asm_full_simp_tac;
    52 val addss = clasimp Classical.addbefore "asm_full_simp_tac" Simplifier.asm_full_simp_tac;
    53 val addss = clasimp Classical.addbefore "asm_full_simp_tac" Simplifier.asm_full_simp_tac;
   109 
   110 
   110 
   111 
   111 (* tactics *)
   112 (* tactics *)
   112 
   113 
   113 fun clarsimp_tac ctxt =
   114 fun clarsimp_tac ctxt =
   114   Simplifier.safe_asm_full_simp_tac (simpset_of ctxt) THEN_ALL_NEW
   115   Simplifier.safe_asm_full_simp_tac ctxt THEN_ALL_NEW
   115   Classical.clarify_tac (addSss ctxt);
   116   Classical.clarify_tac (addSss ctxt);
   116 
   117 
   117 
   118 
   118 (* auto_tac *)
   119 (* auto_tac *)
   119 
   120 
   143     val main_tac =
   144     val main_tac =
   144       Blast.depth_tac ctxt m  (* fast but can't use wrappers *)
   145       Blast.depth_tac ctxt m  (* fast but can't use wrappers *)
   145       ORELSE'
   146       ORELSE'
   146       (CHANGED o nodup_depth_tac (addss ctxt) n);  (* slower but more general *)
   147       (CHANGED o nodup_depth_tac (addss ctxt) n);  (* slower but more general *)
   147   in
   148   in
   148     PARALLEL_GOALS (ALLGOALS (Simplifier.asm_full_simp_tac (simpset_of ctxt))) THEN
   149     PARALLEL_GOALS (ALLGOALS (Simplifier.asm_full_simp_tac ctxt)) THEN
   149     TRY (Classical.safe_tac ctxt) THEN
   150     TRY (Classical.safe_tac ctxt) THEN
   150     REPEAT_DETERM (FIRSTGOAL main_tac) THEN
   151     REPEAT_DETERM (FIRSTGOAL main_tac) THEN
   151     TRY (Classical.safe_tac (addSss ctxt)) THEN
   152     TRY (Classical.safe_tac (addSss ctxt)) THEN
   152     prune_params_tac
   153     prune_params_tac
   153   end;
   154   end;
   160 (* aimed to solve the given subgoal totally, using whatever tools possible *)
   161 (* aimed to solve the given subgoal totally, using whatever tools possible *)
   161 fun force_tac ctxt =
   162 fun force_tac ctxt =
   162   let val ctxt' = addss ctxt in
   163   let val ctxt' = addss ctxt in
   163     SELECT_GOAL
   164     SELECT_GOAL
   164      (Classical.clarify_tac ctxt' 1 THEN
   165      (Classical.clarify_tac ctxt' 1 THEN
   165       IF_UNSOLVED (Simplifier.asm_full_simp_tac (simpset_of ctxt) 1) THEN
   166       IF_UNSOLVED (Simplifier.asm_full_simp_tac ctxt 1) THEN
   166       ALLGOALS (Classical.first_best_tac ctxt'))
   167       ALLGOALS (Classical.first_best_tac ctxt'))
   167   end;
   168   end;
   168 
   169 
   169 
   170 
   170 (* basic combinations *)
   171 (* basic combinations *)