src/Pure/sign.ML
changeset 583 550292083e66
parent 573 2fa5ef27bd0a
child 620 f787eb061618
equal deleted inserted replaced
582:8f1f1fab70ad 583:550292083e66
    24     val subsig: sg * sg -> bool
    24     val subsig: sg * sg -> bool
    25     val eq_sg: sg * sg -> bool
    25     val eq_sg: sg * sg -> bool
    26     val is_draft: sg -> bool
    26     val is_draft: sg -> bool
    27     val const_type: sg -> string -> typ option
    27     val const_type: sg -> string -> typ option
    28     val classes: sg -> class list
    28     val classes: sg -> class list
    29     val subsort: sg -> sort * sort -> bool      (* FIXME move? *)
    29     val subsort: sg -> sort * sort -> bool
    30     val norm_sort: sg -> sort -> sort           (* FIXME move? *)
    30     val norm_sort: sg -> sort -> sort
    31     val print_sg: sg -> unit
    31     val print_sg: sg -> unit
    32     val pretty_sg: sg -> Pretty.T
    32     val pretty_sg: sg -> Pretty.T
    33     val pprint_sg: sg -> pprint_args -> unit
    33     val pprint_sg: sg -> pprint_args -> unit
    34     val pretty_term: sg -> term -> Pretty.T
    34     val pretty_term: sg -> term -> Pretty.T
    35     val pretty_typ: sg -> typ -> Pretty.T
    35     val pretty_typ: sg -> typ -> Pretty.T
   241     | errs => raise_type (cat_lines errs) [] [norm_tm])
   241     | errs => raise_type (cat_lines errs) [] [norm_tm])
   242   end;
   242   end;
   243 
   243 
   244 
   244 
   245 
   245 
   246 (** infer_types **)         (*exception ERROR*)   (* FIXME check *)
   246 (** infer_types **)         (*exception ERROR*)
   247 
   247 
   248 fun infer_types sg types sorts (t, T) =
   248 fun infer_types sg types sorts (t, T) =
   249   let
   249   let
   250     val Sg {tsig, ...} = sg;
   250     val Sg {tsig, ...} = sg;
   251     val show_typ = string_of_typ sg;
   251     val show_typ = string_of_typ sg;
   277 
   277 
   278 (* fake newstyle interfaces *) (* FIXME -> type.ML *)
   278 (* fake newstyle interfaces *) (* FIXME -> type.ML *)
   279 
   279 
   280 fun ext_tsig_classes tsig classes =
   280 fun ext_tsig_classes tsig classes =
   281   extend_tsig tsig (classes, [], [], []);
   281   extend_tsig tsig (classes, [], [], []);
   282 
       
   283 fun ext_tsig_types tsig types =
       
   284   extend_tsig tsig ([], [], map (fn (t, n) => ([t], n)) types, []);
       
   285 
   282 
   286 (* FIXME varify_typ, rem_sorts; norm_typ (?) *)
   283 (* FIXME varify_typ, rem_sorts; norm_typ (?) *)
   287 fun ext_tsig_abbrs tsig abbrs = Type.ext_tsig_abbrs tsig
   284 fun ext_tsig_abbrs tsig abbrs = Type.ext_tsig_abbrs tsig
   288   (map (fn (t, vs, rhs) => (t, (map (rpair 0) vs, varifyT rhs))) abbrs);
   285   (map (fn (t, vs, rhs) => (t, (map (rpair 0) vs, varifyT rhs))) abbrs);
   289 
   286