src/Pure/tactic.ML
changeset 11671 994dc2efff55
parent 10817 083d4a6734b4
child 11762 7aa0702d3340
equal deleted inserted replaced
11670:59f79df42d1f 11671:994dc2efff55
     7 *)
     7 *)
     8 
     8 
     9 signature TACTIC =
     9 signature TACTIC =
    10   sig
    10   sig
    11   val ares_tac          : thm list -> int -> tactic
    11   val ares_tac          : thm list -> int -> tactic
    12   val asm_rewrite_goal_tac:
    12   val asm_rewrite_goal_tac: bool*bool*bool ->
    13     bool*bool*bool -> (meta_simpset -> tactic) -> meta_simpset -> int -> tactic
    13     (MetaSimplifier.meta_simpset -> tactic) -> MetaSimplifier.meta_simpset -> int -> tactic
    14   val assume_tac        : int -> tactic
    14   val assume_tac        : int -> tactic
    15   val atac      : int ->tactic
    15   val atac      : int ->tactic
    16   val bimatch_from_nets_tac:
    16   val bimatch_from_nets_tac:
    17       (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net -> int -> tactic
    17       (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net -> int -> tactic
    18   val bimatch_tac       : (bool*thm)list -> int -> tactic
    18   val bimatch_tac       : (bool*thm)list -> int -> tactic
    81   val rename_tac        : string -> int -> tactic
    81   val rename_tac        : string -> int -> tactic
    82   val rename_last_tac   : string -> string list -> int -> tactic
    82   val rename_last_tac   : string -> string list -> int -> tactic
    83   val resolve_from_net_tac      : (int*thm) Net.net -> int -> tactic
    83   val resolve_from_net_tac      : (int*thm) Net.net -> int -> tactic
    84   val resolve_tac       : thm list -> int -> tactic
    84   val resolve_tac       : thm list -> int -> tactic
    85   val res_inst_tac      : (string*string)list -> thm -> int -> tactic
    85   val res_inst_tac      : (string*string)list -> thm -> int -> tactic
       
    86   val full_rewrite_cterm : thm list -> cterm -> cterm
    86   val rewrite_goal_tac  : thm list -> int -> tactic
    87   val rewrite_goal_tac  : thm list -> int -> tactic
    87   val rewrite_goals_rule: thm list -> thm -> thm
    88   val rewrite_goals_rule: thm list -> thm -> thm
    88   val rewrite_rule      : thm list -> thm -> thm
    89   val rewrite_rule      : thm list -> thm -> thm
    89   val rewrite_goals_tac : thm list -> tactic
    90   val rewrite_goals_tac : thm list -> tactic
    90   val rewrite_tac       : thm list -> tactic
    91   val rewrite_tac       : thm list -> tactic
   481 
   482 
   482 fun result1 tacf mss thm =
   483 fun result1 tacf mss thm =
   483   apsome fst (Seq.pull (tacf mss thm));
   484   apsome fst (Seq.pull (tacf mss thm));
   484 
   485 
   485 val simple_prover =
   486 val simple_prover =
   486   result1 (fn mss => ALLGOALS (resolve_tac (prems_of_mss mss)));
   487   result1 (fn mss => ALLGOALS (resolve_tac (MetaSimplifier.prems_of_mss mss)));
   487 
   488 
       
   489 val full_rewrite_cterm = MetaSimplifier.full_rewrite_cterm_aux simple_prover;
   488 val rewrite_rule = MetaSimplifier.rewrite_rule_aux simple_prover;
   490 val rewrite_rule = MetaSimplifier.rewrite_rule_aux simple_prover;
   489 val rewrite_goals_rule = MetaSimplifier.rewrite_goals_rule_aux simple_prover;
   491 val rewrite_goals_rule = MetaSimplifier.rewrite_goals_rule_aux simple_prover;
   490 
   492 
   491 
   493 
   492 (*Rewrite subgoal i only.  SELECT_GOAL avoids inefficiencies in goals_conv.*)
   494 (*Rewrite subgoal i only.  SELECT_GOAL avoids inefficiencies in goals_conv.*)
   493 fun asm_rewrite_goal_tac mode prover_tac mss =
   495 fun asm_rewrite_goal_tac mode prover_tac mss =
   494       SELECT_GOAL
   496   SELECT_GOAL
   495         (PRIMITIVE
   497     (PRIMITIVE (MetaSimplifier.rewrite_goal_rule mode (result1 prover_tac) mss 1));
   496            (rewrite_goal_rule mode (result1 prover_tac) mss 1));
       
   497 
   498 
   498 fun rewrite_goal_tac rews =
   499 fun rewrite_goal_tac rews =
   499   asm_rewrite_goal_tac (true, false, false) (K no_tac) (MetaSimplifier.mss_of rews);
   500   asm_rewrite_goal_tac (true, false, false) (K no_tac) (MetaSimplifier.mss_of rews);
   500 
   501 
   501 (*Rewrite throughout proof state. *)
   502 (*Rewrite throughout proof state. *)