src/HOL/Tools/Function/size.ML
changeset 33339 d41f77196338
parent 33056 791a4655cae3
child 33522 737589bb9bb8
equal deleted inserted replaced
33338:de76079f973a 33339:d41f77196338
   113         val t =
   113         val t =
   114           if null ts andalso (not b orelse not (exists (is_poly thy) cargs'))
   114           if null ts andalso (not b orelse not (exists (is_poly thy) cargs'))
   115           then HOLogic.zero
   115           then HOLogic.zero
   116           else foldl1 plus (ts @ [HOLogic.Suc_zero])
   116           else foldl1 plus (ts @ [HOLogic.Suc_zero])
   117       in
   117       in
   118         List.foldr (fn (T, t') => Abs ("x", T, t')) t (Ts @ replicate k HOLogic.natT)
   118         fold_rev (fn T => fn t' => Abs ("x", T, t')) (Ts @ replicate k HOLogic.natT) t
   119       end;
   119       end;
   120 
   120 
   121     val fs = maps (fn (_, (name, _, constrs)) =>
   121     val fs = maps (fn (_, (name, _, constrs)) =>
   122       map (size_of_constr true param_size) (constrs ~~ constrs_of thy name)) descr;
   122       map (size_of_constr true param_size) (constrs ~~ constrs_of thy name)) descr;
   123     val fs' = maps (fn (n, (name, _, constrs)) =>
   123     val fs' = maps (fn (n, (name, _, constrs)) =>