src/Pure/theory.ML
changeset 74230 d637611b41bd
parent 74183 af81e4a307be
child 74232 1091880266e5
equal deleted inserted replaced
74229:76ac4dbb0a22 74230:d637611b41bd
   242     fun prep (item, args) =
   242     fun prep (item, args) =
   243       (case fold Term.add_tvarsT args [] of
   243       (case fold Term.add_tvarsT args [] of
   244         [] => (item, map Logic.varifyT_global args)
   244         [] => (item, map Logic.varifyT_global args)
   245       | vs => raise TYPE ("Illegal schematic type variable(s)", map TVar vs, []));
   245       | vs => raise TYPE ("Illegal schematic type variable(s)", map TVar vs, []));
   246 
   246 
   247     val lhs_vars = fold Term.add_tfreesT (snd lhs) [];
   247     val lhs_vars = fold Term_Subst.add_tfreesT (snd lhs) Term_Subst.TFrees.empty;
   248     val rhs_extras =
   248     val rhs_extras =
   249       fold (fn (_, args) => args |> (fold o Term.fold_atyps) (fn TFree v =>
   249       fold (fn (_, args) => args |> (fold o Term.fold_atyps) (fn TFree v =>
   250         if member (op =) lhs_vars v then I else insert (op =) v)) rhs [];
   250         if Term_Subst.TFrees.defined lhs_vars v then I else insert (op =) v)) rhs [];
   251     val _ =
   251     val _ =
   252       if null rhs_extras then ()
   252       if null rhs_extras then ()
   253       else error ("Specification depends on extra type variables: " ^
   253       else error ("Specification depends on extra type variables: " ^
   254         commas_quote (map (Syntax.string_of_typ ctxt o TFree) rhs_extras) ^
   254         commas_quote (map (Syntax.string_of_typ ctxt o TFree) rhs_extras) ^
   255         "\nThe error(s) above occurred in " ^ quote description);
   255         "\nThe error(s) above occurred in " ^ quote description);