src/HOL/Tools/TFL/tfl.ML
changeset 33955 fff6f11b1f09
parent 33339 d41f77196338
child 35232 f588e1169c8b
equal deleted inserted replaced
33954:1bc3b688548c 33955:fff6f11b1f09
   191  *---------------------------------------------------------------------------*)
   191  *---------------------------------------------------------------------------*)
   192 
   192 
   193 fun mk_pat (c,l) =
   193 fun mk_pat (c,l) =
   194   let val L = length (binder_types (type_of c))
   194   let val L = length (binder_types (type_of c))
   195       fun build (prfx,tag,plist) =
   195       fun build (prfx,tag,plist) =
   196           let val args   = Library.take (L,plist)
   196           let val (args, plist') = chop L plist
   197               and plist' = Library.drop(L,plist)
       
   198           in (prfx,tag,list_comb(c,args)::plist') end
   197           in (prfx,tag,list_comb(c,args)::plist') end
   199   in map build l end;
   198   in map build l end;
   200 
   199 
   201 fun v_to_prfx (prfx, v::pats) = (v::prfx,pats)
   200 fun v_to_prfx (prfx, v::pats) = (v::prfx,pats)
   202   | v_to_prfx _ = raise TFL_ERR "mk_case" "v_to_prfx";
   201   | v_to_prfx _ = raise TFL_ERR "mk_case" "v_to_prfx";