src/Pure/tactic.ML
changeset 1975 eec67972b1bf
parent 1966 9e626f86e335
child 2029 2fa4c4b1a7fe
equal deleted inserted replaced
1974:b50f96543dec 1975:eec67972b1bf
    22   val build_net: thm list -> (int*thm) Net.net
    22   val build_net: thm list -> (int*thm) Net.net
    23   val build_netpair:    (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net ->
    23   val build_netpair:    (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net ->
    24       (bool*thm)list -> (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net
    24       (bool*thm)list -> (int*(bool*thm)) Net.net * (int*(bool*thm)) Net.net
    25   val compose_inst_tac: (string*string)list -> (bool*thm*int) -> int -> tactic
    25   val compose_inst_tac: (string*string)list -> (bool*thm*int) -> int -> tactic
    26   val compose_tac: (bool * thm * int) -> int -> tactic 
    26   val compose_tac: (bool * thm * int) -> int -> tactic 
    27   val cterm_lift_inst_rule:
       
    28       thm * int * (indexname*ctyp)list * (term*cterm)list  * thm -> thm
       
    29   val cut_facts_tac: thm list -> int -> tactic
    27   val cut_facts_tac: thm list -> int -> tactic
    30   val cut_inst_tac: (string*string)list -> thm -> int -> tactic   
    28   val cut_inst_tac: (string*string)list -> thm -> int -> tactic   
    31   val dmatch_tac: thm list -> int -> tactic
    29   val dmatch_tac: thm list -> int -> tactic
    32   val dresolve_tac: thm list -> int -> tactic
    30   val dresolve_tac: thm list -> int -> tactic
    33   val dres_inst_tac: (string*string)list -> thm -> int -> tactic   
    31   val dres_inst_tac: (string*string)list -> thm -> int -> tactic   
    77   val rtac: thm -> int -> tactic
    75   val rtac: thm -> int -> tactic
    78   val rule_by_tactic: tactic -> thm -> thm
    76   val rule_by_tactic: tactic -> thm -> thm
    79   val subgoal_tac: string -> int -> tactic
    77   val subgoal_tac: string -> int -> tactic
    80   val subgoals_tac: string list -> int -> tactic
    78   val subgoals_tac: string list -> int -> tactic
    81   val subgoals_of_brl: bool * thm -> int
    79   val subgoals_of_brl: bool * thm -> int
       
    80   val term_lift_inst_rule:
       
    81       thm * int * (indexname*typ)list * ((indexname*typ)*term)list  * thm
       
    82       -> thm
    82   val thin_tac: string -> int -> tactic
    83   val thin_tac: string -> int -> tactic
    83   val trace_goalno_tac: (int -> tactic) -> int -> tactic
    84   val trace_goalno_tac: (int -> tactic) -> int -> tactic
    84   end;
    85   end;
    85 
    86 
    86 
    87 
   202 
   203 
   203 (*Like lift_inst_rule but takes cterms, not strings.
   204 (*Like lift_inst_rule but takes cterms, not strings.
   204   The cterms must be functions of the parameters of the subgoal,
   205   The cterms must be functions of the parameters of the subgoal,
   205   i.e. they are assumed to be lifted already!
   206   i.e. they are assumed to be lifted already!
   206   Also: types of Vars must be fully instantiated already *)
   207   Also: types of Vars must be fully instantiated already *)
   207 fun cterm_lift_inst_rule (st, i, Tinsts, insts, rule) =
   208 fun term_lift_inst_rule (st, i, Tinsts, insts, rule) =
   208 let val {maxidx,sign,...} = rep_thm st
   209 let val {maxidx,sign,...} = rep_thm st
   209     val (_, _, Bi, _) = dest_state(st,i)
   210     val (_, _, Bi, _) = dest_state(st,i)
   210     val params = Logic.strip_params Bi          (*params of subgoal i*)
   211     val params = Logic.strip_params Bi          (*params of subgoal i*)
   211     val paramTs = map #2 params
   212     val paramTs = map #2 params
   212     and inc = maxidx+1
   213     and inc = maxidx+1
   213     fun liftvar (Var ((a,j), T)) =
   214     fun liftvar ((a,j), T) = Var((a, j+inc), paramTs---> incr_tvar inc T)
   214           cterm_of sign (Var((a, j+inc), paramTs---> incr_tvar inc T))
   215     (*lift only Var, not term, which must be lifted already*)
   215       | liftvar t = raise TERM("Variable expected", [t]);
   216     fun liftpair (v,t) = (cterm_of sign (liftvar v), cterm_of sign t)
   216     (*lift only Var, not cterm! Must to be lifted already*)
   217     fun liftTpair((a,i),T) = ((a,i+inc), ctyp_of sign (incr_tvar inc T))
   217     fun liftpair (v,ct) = (liftvar v, ct)
   218 in instantiate (map liftTpair Tinsts, map liftpair insts)
   218     fun lifttvar((a,i),ctyp) =
       
   219         let val {T,sign} = rep_ctyp ctyp
       
   220         in  ((a,i+inc), ctyp_of sign (incr_tvar inc T)) end
       
   221 in instantiate (map lifttvar Tinsts, map liftpair insts)
       
   222                (lift_rule (st,i) rule)
   219                (lift_rule (st,i) rule)
   223 end;
   220 end;
   224 
   221 
   225 (*** Resolve after lifting and instantation; may refer to parameters of the
   222 (*** Resolve after lifting and instantation; may refer to parameters of the
   226      subgoal.  Fails if "i" is out of range.  ***)
   223      subgoal.  Fails if "i" is out of range.  ***)