src/Pure/drule.ML
changeset 11 d0e17c42dbb4
parent 0 a5a9c433f639
child 67 8380bc0adde7
equal deleted inserted replaced
10:e37080f41102 11:d0e17c42dbb4
     4     Copyright   1993  University of Cambridge
     4     Copyright   1993  University of Cambridge
     5 
     5 
     6 Derived rules and other operations on theorems and theories
     6 Derived rules and other operations on theorems and theories
     7 *)
     7 *)
     8 
     8 
     9 infix 0 RS RSN RL RLN COMP;
     9 infix 0 RS RSN RL RLN MRS MRL COMP;
    10 
    10 
    11 signature DRULE =
    11 signature DRULE =
    12   sig
    12   sig
    13   structure Thm : THM
    13   structure Thm : THM
    14   local open Thm  in
    14   local open Thm  in
    29   val forall_elim_list: Sign.cterm list -> thm -> thm
    29   val forall_elim_list: Sign.cterm list -> thm -> thm
    30   val forall_elim_var: int -> thm -> thm
    30   val forall_elim_var: int -> thm -> thm
    31   val forall_elim_vars: int -> thm -> thm
    31   val forall_elim_vars: int -> thm -> thm
    32   val implies_elim_list: thm -> thm list -> thm
    32   val implies_elim_list: thm -> thm list -> thm
    33   val implies_intr_list: Sign.cterm list -> thm -> thm
    33   val implies_intr_list: Sign.cterm list -> thm -> thm
       
    34   val MRL: thm list list * thm list -> thm list
       
    35   val MRS: thm list * thm -> thm
    34   val print_cterm: Sign.cterm -> unit
    36   val print_cterm: Sign.cterm -> unit
    35   val print_ctyp: Sign.ctyp -> unit
    37   val print_ctyp: Sign.ctyp -> unit
    36   val print_goals: int -> thm -> unit
    38   val print_goals: int -> thm -> unit
    37   val print_sg: Sign.sg -> unit
    39   val print_sg: Sign.sg -> unit
    38   val print_theory: theory -> unit
    40   val print_theory: theory -> unit
   189       fun resb thb = Sequence.list_of_s (resolve thb) handle THM _ => []
   191       fun resb thb = Sequence.list_of_s (resolve thb) handle THM _ => []
   190   in  flat (map resb thbs)  end;
   192   in  flat (map resb thbs)  end;
   191 
   193 
   192 fun thas RL thbs = thas RLN (1,thbs);
   194 fun thas RL thbs = thas RLN (1,thbs);
   193 
   195 
       
   196 (*Resolve a list of rules against bottom_rl from right to left;
       
   197   makes proof trees*)
       
   198 fun rls MRS bottom_rl = 
       
   199   let fun rs_aux i [] = bottom_rl
       
   200 	| rs_aux i (rl::rls) = rl RSN (i, rs_aux (i+1) rls)
       
   201   in  rs_aux 1 rls  end;
       
   202 
       
   203 (*As above, but for rule lists*)
       
   204 fun rlss MRL bottom_rls = 
       
   205   let fun rs_aux i [] = bottom_rls
       
   206 	| rs_aux i (rls::rlss) = rls RLN (i, rs_aux (i+1) rlss)
       
   207   in  rs_aux 1 rlss  end;
       
   208 
   194 (*compose Q and [...,Qi,Q(i+1),...]==>R to [...,Q(i+1),...]==>R 
   209 (*compose Q and [...,Qi,Q(i+1),...]==>R to [...,Q(i+1),...]==>R 
   195   with no lifting or renaming!  Q may contain ==> or meta-quants
   210   with no lifting or renaming!  Q may contain ==> or meta-quants
   196   ALWAYS deletes premise i *)
   211   ALWAYS deletes premise i *)
   197 fun compose(tha,i,thb) = 
   212 fun compose(tha,i,thb) = 
   198     Sequence.list_of_s (bicompose false (false,tha,0) i thb);
   213     Sequence.list_of_s (bicompose false (false,tha,0) i thb);