src/Pure/drule.ML
changeset 7898 d7e65a52acf9
parent 7636 102a4b6b83a6
child 8086 78e254305ae6
equal deleted inserted replaced
7897:7f18f5ffbb92 7898:d7e65a52acf9
   225     in  forall_intr_list
   225     in  forall_intr_list
   226          (map (cterm_of sign) (sort (make_ord atless) (term_frees prop)))
   226          (map (cterm_of sign) (sort (make_ord atless) (term_frees prop)))
   227          th
   227          th
   228     end;
   228     end;
   229 
   229 
   230 (*Replace outermost quantified variable by Var of given index.
   230 val forall_elim_var = PureThy.forall_elim_var;
   231     Could clash with Vars already present.*)
   231 val forall_elim_vars = PureThy.forall_elim_vars;
   232 fun forall_elim_var i th =
       
   233     let val {prop,sign,...} = rep_thm th
       
   234     in case prop of
       
   235           Const("all",_) $ Abs(a,T,_) =>
       
   236               forall_elim (cterm_of sign (Var((a,i), T)))  th
       
   237         | _ => raise THM("forall_elim_var", i, [th])
       
   238     end;
       
   239 
       
   240 (*Repeat forall_elim_var until all outer quantifiers are removed*)
       
   241 fun forall_elim_vars i th =
       
   242     forall_elim_vars i (forall_elim_var i th)
       
   243         handle THM _ => th;
       
   244 
   232 
   245 (*Specialization over a list of cterms*)
   233 (*Specialization over a list of cterms*)
   246 fun forall_elim_list cts th = foldr (uncurry forall_elim) (rev cts, th);
   234 fun forall_elim_list cts th = foldr (uncurry forall_elim) (rev cts, th);
   247 
   235 
   248 (* maps [A1,...,An], B   to   [| A1;...;An |] ==> B  *)
   236 (* maps [A1,...,An], B   to   [| A1;...;An |] ==> B  *)