src/FOLP/classical.ML
author wenzelm
Mon, 24 Oct 2016 11:42:39 +0200
changeset 64367 a424f2737646
parent 61268 abe08fb15a12
permissions -rw-r--r--
updated for release;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37744
3daaf23b9ab4 tuned titles
haftmann
parents: 35762
diff changeset
     1
(*  Title:      FOLP/classical.ML
1459
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
Like Provers/classical but modified because match_tac is unsuitable for
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
proof objects.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
Theorem prover for classical reasoning, including predicate calculus, set
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
theory, etc.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
Rules must be classified as intr, elim, safe, hazardous.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
A rule is unsafe unless it can be applied blindly without harmful results.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
For a rule to be safe, its premises and conclusion should be logically
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
equivalent.  There should be no variables in the premises that are not in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
the conclusion.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
signature CLASSICAL_DATA =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
  sig
1459
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    21
  val mp: thm                   (* [| P-->Q;  P |] ==> Q *)
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    22
  val not_elim: thm             (* [| ~P;  P |] ==> R *)
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    23
  val swap: thm                 (* ~P ==> (~Q ==> P) ==> Q *)
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    24
  val sizef : thm -> int        (* size function for BEST_FIRST *)
60754
02924903a6fd prefer tactics with explicit context;
wenzelm
parents: 59498
diff changeset
    25
  val hyp_subst_tacs: Proof.context -> (int -> tactic) list
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
(*Higher precedence than := facilitates use of references*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
infix 4 addSIs addSEs addSDs addIs addEs addDs;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
signature CLASSICAL =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
  sig
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
  type claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
  val empty_cs: claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
  val addDs : claset * thm list -> claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
  val addEs : claset * thm list -> claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
  val addIs : claset * thm list -> claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
  val addSDs: claset * thm list -> claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
  val addSEs: claset * thm list -> claset
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
  val addSIs: claset * thm list -> claset
42439
9efdd0af15ac eliminated Display.string_of_thm_without_context;
wenzelm
parents: 37744
diff changeset
    42
  val print_cs: Proof.context -> claset -> unit
4653
d60f76680bf4 renamed rep_claset to rep_cs
oheimb
parents: 4440
diff changeset
    43
  val rep_cs: claset -> 
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
      {safeIs: thm list, safeEs: thm list, hazIs: thm list, hazEs: thm list, 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
       safe0_brls:(bool*thm)list, safep_brls: (bool*thm)list,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
       haz_brls: (bool*thm)list}
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    47
  val best_tac : Proof.context -> claset -> int -> tactic
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    48
  val contr_tac : Proof.context -> int -> tactic
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    49
  val fast_tac : Proof.context -> claset -> int -> tactic
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    50
  val inst_step_tac : Proof.context -> int -> tactic
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
  val joinrules : thm list * thm list -> (bool * thm) list
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    52
  val mp_tac: Proof.context -> int -> tactic
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    53
  val safe_tac : Proof.context -> claset -> tactic
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    54
  val safe_step_tac : Proof.context -> claset -> int -> tactic
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    55
  val slow_step_tac : Proof.context -> claset -> int -> tactic
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    56
  val step_tac : Proof.context -> claset -> int -> tactic
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
  val swapify : thm list -> thm list
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    58
  val swap_res_tac : Proof.context -> thm list -> int -> tactic
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
    59
  val uniq_mp_tac: Proof.context -> int -> tactic
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
42799
4e33894aec6d modernized functor names;
wenzelm
parents: 42439
diff changeset
    63
functor Classical(Data: CLASSICAL_DATA): CLASSICAL = 
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
local open Data in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
(** Useful tactics for classical reasoning **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
val imp_elim = make_elim mp;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
(*Solve goal that assumes both P and ~P. *)
60754
02924903a6fd prefer tactics with explicit context;
wenzelm
parents: 59498
diff changeset
    73
fun contr_tac ctxt = eresolve_tac ctxt [not_elim] THEN'  assume_tac ctxt;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
(*Finds P-->Q and P in the assumptions, replaces implication by Q *)
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58963
diff changeset
    76
fun mp_tac ctxt i = eresolve_tac ctxt ([not_elim,imp_elim]) i  THEN  assume_tac ctxt i;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
(*Like mp_tac but instantiates no variables*)
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    79
fun uniq_mp_tac ctxt i = ematch_tac ctxt ([not_elim,imp_elim]) i  THEN  uniq_assume_tac ctxt i;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
(*Creates rules to eliminate ~A, from rules to introduce A*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
fun swapify intrs = intrs RLN (2, [swap]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
(*Uses introduction rules in the normal way, or on negated assumptions,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
  trying rules in order. *)
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    86
fun swap_res_tac ctxt rls = 
60754
02924903a6fd prefer tactics with explicit context;
wenzelm
parents: 59498
diff changeset
    87
    let fun tacf rl = resolve_tac ctxt [rl] ORELSE' eresolve_tac ctxt [rl RSN (2, swap)]
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
    88
    in  assume_tac ctxt ORELSE' contr_tac ctxt ORELSE' FIRST' (map tacf rls)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
    end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
(*** Classical rule sets ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
datatype claset =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
 CS of {safeIs: thm list,
1459
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    96
        safeEs: thm list,
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    97
        hazIs: thm list,
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    98
        hazEs: thm list,
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
    99
        (*the following are computed from the above*)
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
   100
        safe0_brls: (bool*thm)list,
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
   101
        safep_brls: (bool*thm)list,
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
   102
        haz_brls: (bool*thm)list};
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
  
4653
d60f76680bf4 renamed rep_claset to rep_cs
oheimb
parents: 4440
diff changeset
   104
fun rep_cs (CS x) = x;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
(*For use with biresolve_tac.  Combines intrs with swap to catch negated
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
  assumptions.  Also pairs elims with true. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
fun joinrules (intrs,elims) =  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
  map (pair true) (elims @ swapify intrs)  @  map (pair false) intrs;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
(*Note that allE precedes exI in haz_brls*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
fun make_cs {safeIs,safeEs,hazIs,hazEs} =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
  let val (safe0_brls, safep_brls) = (*0 subgoals vs 1 or more*)
17496
26535df536ae slight adaptions to library changes
haftmann
parents: 15570
diff changeset
   114
          List.partition (curry (op =) 0 o subgoals_of_brl) 
4440
9ed4098074bc adapted to new sort function;
wenzelm
parents: 1459
diff changeset
   115
             (sort (make_ord lessb) (joinrules(safeIs, safeEs)))
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
  in CS{safeIs=safeIs, safeEs=safeEs, hazIs=hazIs, hazEs=hazEs,
1459
d12da312eff4 expanded tabs
clasohm
parents: 469
diff changeset
   117
        safe0_brls=safe0_brls, safep_brls=safep_brls,
4440
9ed4098074bc adapted to new sort function;
wenzelm
parents: 1459
diff changeset
   118
        haz_brls = sort (make_ord lessb) (joinrules(hazIs, hazEs))}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
(*** Manipulation of clasets ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
val empty_cs = make_cs{safeIs=[], safeEs=[], hazIs=[], hazEs=[]};
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
42439
9efdd0af15ac eliminated Display.string_of_thm_without_context;
wenzelm
parents: 37744
diff changeset
   125
fun print_cs ctxt (CS{safeIs,safeEs,hazIs,hazEs,...}) =
32091
30e2ffbba718 proper context for Display.pretty_thm etc. or old-style versions Display.pretty_thm_global, Display.pretty_thm_without_context etc.;
wenzelm
parents: 26928
diff changeset
   126
  writeln (cat_lines
61268
abe08fb15a12 moved remaining display.ML to more_thm.ML;
wenzelm
parents: 60754
diff changeset
   127
   (["Introduction rules"] @ map (Thm.string_of_thm ctxt) hazIs @
abe08fb15a12 moved remaining display.ML to more_thm.ML;
wenzelm
parents: 60754
diff changeset
   128
    ["Safe introduction rules"] @ map (Thm.string_of_thm ctxt) safeIs @
abe08fb15a12 moved remaining display.ML to more_thm.ML;
wenzelm
parents: 60754
diff changeset
   129
    ["Elimination rules"] @ map (Thm.string_of_thm ctxt) hazEs @
abe08fb15a12 moved remaining display.ML to more_thm.ML;
wenzelm
parents: 60754
diff changeset
   130
    ["Safe elimination rules"] @ map (Thm.string_of_thm ctxt) safeEs));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
fun (CS{safeIs,safeEs,hazIs,hazEs,...}) addSIs ths =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
  make_cs {safeIs=ths@safeIs, safeEs=safeEs, hazIs=hazIs, hazEs=hazEs};
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
fun (CS{safeIs,safeEs,hazIs,hazEs,...}) addSEs ths =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
  make_cs {safeIs=safeIs, safeEs=ths@safeEs, hazIs=hazIs, hazEs=hazEs};
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
fun cs addSDs ths = cs addSEs (map make_elim ths);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
fun (CS{safeIs,safeEs,hazIs,hazEs,...}) addIs ths =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
  make_cs {safeIs=safeIs, safeEs=safeEs, hazIs=ths@hazIs, hazEs=hazEs};
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
fun (CS{safeIs,safeEs,hazIs,hazEs,...}) addEs ths =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
  make_cs {safeIs=safeIs, safeEs=safeEs, hazIs=hazIs, hazEs=ths@hazEs};
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
fun cs addDs ths = cs addEs (map make_elim ths);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
(*** Simple tactics for theorem proving ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
(*Attack subgoals using safe inferences*)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   151
fun safe_step_tac ctxt (CS{safe0_brls,safep_brls,...}) = 
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
   152
  FIRST' [uniq_assume_tac ctxt,
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   153
          uniq_mp_tac ctxt,
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58963
diff changeset
   154
          biresolve_tac ctxt safe0_brls,
60754
02924903a6fd prefer tactics with explicit context;
wenzelm
parents: 59498
diff changeset
   155
          FIRST' (hyp_subst_tacs ctxt),
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58963
diff changeset
   156
          biresolve_tac ctxt safep_brls] ;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
(*Repeatedly attack subgoals using safe inferences*)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   159
fun safe_tac ctxt cs = DETERM (REPEAT_FIRST (safe_step_tac ctxt cs));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
(*These steps could instantiate variables and are therefore unsafe.*)
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
   162
fun inst_step_tac ctxt = assume_tac ctxt APPEND' contr_tac ctxt;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
(*Single step for the prover.  FAILS unless it makes progress. *)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   165
fun step_tac ctxt (cs as (CS{haz_brls,...})) i = 
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   166
  FIRST [safe_tac ctxt cs,
58963
26bf09b95dda proper context for assume_tac (atac remains as fall-back without context);
wenzelm
parents: 58957
diff changeset
   167
         inst_step_tac ctxt i,
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58963
diff changeset
   168
         biresolve_tac ctxt haz_brls i];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
(*** The following tactics all fail unless they solve one goal ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
(*Dumb but fast*)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   173
fun fast_tac ctxt cs = SELECT_GOAL (DEPTH_SOLVE (step_tac ctxt cs 1));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
(*Slower but smarter than fast_tac*)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   176
fun best_tac ctxt cs = 
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   177
  SELECT_GOAL (BEST_FIRST (has_fewer_prems 1, sizef) (step_tac ctxt cs 1));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
(*Using a "safe" rule to instantiate variables is unsafe.  This tactic
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
  allows backtracking from "safe" rules to "unsafe" rules here.*)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 42799
diff changeset
   181
fun slow_step_tac ctxt (cs as (CS{haz_brls,...})) i = 
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58963
diff changeset
   182
    safe_tac ctxt cs ORELSE (assume_tac ctxt i APPEND biresolve_tac ctxt haz_brls i);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
end; 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
end;