src/Pure/Isar/class.ML
changeset 55304 55ac31bc08a4
parent 54883 dd04a8b654fc
child 55763 4b3907cb5654
equal deleted inserted replaced
55303:35354009ca25 55304:55ac31bc08a4
   526   let
   526   let
   527     val {arities = (tycos, vs, sort), params} = the_instantiation lthy;
   527     val {arities = (tycos, vs, sort), params} = the_instantiation lthy;
   528     fun pr_arity tyco = Syntax.pretty_arity lthy (tyco, map snd vs, sort);
   528     fun pr_arity tyco = Syntax.pretty_arity lthy (tyco, map snd vs, sort);
   529     fun pr_param ((c, _), (v, ty)) =
   529     fun pr_param ((c, _), (v, ty)) =
   530       Pretty.block (Pretty.breaks
   530       Pretty.block (Pretty.breaks
   531         [Pretty.str v, Pretty.str "==", Pretty.str (Proof_Context.extern_const lthy c),
   531         [Pretty.str v, Pretty.str "==", Proof_Context.pretty_const lthy c,
   532           Pretty.str "::", Syntax.pretty_typ lthy ty]);
   532           Pretty.str "::", Syntax.pretty_typ lthy ty]);
   533   in Pretty.command "instantiation" :: map pr_arity tycos @ map pr_param params end;
   533   in Pretty.command "instantiation" :: map pr_arity tycos @ map pr_param params end;
   534 
   534 
   535 fun conclude lthy =
   535 fun conclude lthy =
   536   let
   536   let
   537     val (tycos, vs, sort) = #arities (the_instantiation lthy);
   537     val (tycos, vs, sort) = #arities (the_instantiation lthy);
   538     val thy = Proof_Context.theory_of lthy;
   538     val thy = Proof_Context.theory_of lthy;
   539     val _ = tycos |> List.app (fn tyco =>
   539     val _ = tycos |> List.app (fn tyco =>
   540       if Sign.of_sort thy (Type (tyco, map TFree vs), sort) then ()
   540       if Sign.of_sort thy (Type (tyco, map TFree vs), sort) then ()
   541       else error ("Missing instance proof for type " ^ quote (Proof_Context.extern_type lthy tyco)));
   541       else error ("Missing instance proof for type " ^ quote (Proof_Context.markup_type lthy tyco)));
   542   in lthy end;
   542   in lthy end;
   543 
   543 
   544 fun instantiation (tycos, vs, sort) thy =
   544 fun instantiation (tycos, vs, sort) thy =
   545   let
   545   let
   546     val naming = Sign.naming_of thy;
   546     val naming = Sign.naming_of thy;