src/Pure/theory.ML
changeset 19806 f860b7a98445
parent 19727 f5895f998402
child 20155 da0505518e69
equal deleted inserted replaced
19805:854404b8f738 19806:f860b7a98445
   238   let
   238   let
   239     val pp = Sign.pp thy;
   239     val pp = Sign.pp thy;
   240     val consts = Sign.consts_of thy;
   240     val consts = Sign.consts_of thy;
   241     fun prep const =
   241     fun prep const =
   242       let val Const (c, T) = Sign.no_vars pp (Const const)
   242       let val Const (c, T) = Sign.no_vars pp (Const const)
   243       in (c, Consts.typargs consts (c, Compress.typ thy (Type.varifyT T))) end;
   243       in (c, Consts.typargs consts (c, Compress.typ thy (Logic.varifyT T))) end;
   244 
   244 
   245     val lhs_vars = Term.add_tfreesT (#2 lhs) [];
   245     val lhs_vars = Term.add_tfreesT (#2 lhs) [];
   246     val rhs_extras = fold (#2 #> Term.fold_atyps (fn TFree v =>
   246     val rhs_extras = fold (#2 #> Term.fold_atyps (fn TFree v =>
   247       if member (op =) lhs_vars v then I else insert (op =) v | _ => I)) rhs [];
   247       if member (op =) lhs_vars v then I else insert (op =) v | _ => I)) rhs [];
   248     val _ =
   248     val _ =
   265   let
   265   let
   266     val declT =
   266     val declT =
   267       (case Sign.const_constraint thy c of
   267       (case Sign.const_constraint thy c of
   268         NONE => error ("Undeclared constant " ^ quote c)
   268         NONE => error ("Undeclared constant " ^ quote c)
   269       | SOME declT => declT);
   269       | SOME declT => declT);
   270     val T' = Type.varifyT T;
   270     val T' = Logic.varifyT T;
   271 
   271 
   272     fun message txt =
   272     fun message txt =
   273       [Pretty.block [Pretty.str "Specification of constant ",
   273       [Pretty.block [Pretty.str "Specification of constant ",
   274         Pretty.str c, Pretty.str " ::", Pretty.brk 1, Pretty.quote (Sign.pretty_typ thy T)],
   274         Pretty.str c, Pretty.str " ::", Pretty.brk 1, Pretty.quote (Sign.pretty_typ thy T)],
   275         Pretty.str txt] |> Pretty.chunks |> Pretty.string_of;
   275         Pretty.str txt] |> Pretty.chunks |> Pretty.string_of;