renamed subclass to classrel;
authorwenzelm
Wed Apr 16 18:23:25 1997 +0200 (1997-04-16)
changeset 2963f3b5af1c5a67
parent 2962 97ae96c72d8c
child 2964 557a11310988
renamed subclass to classrel;
tune type checking error msgs;
src/Pure/sign.ML
     1.1 --- a/src/Pure/sign.ML	Wed Apr 16 18:22:10 1997 +0200
     1.2 +++ b/src/Pure/sign.ML	Wed Apr 16 18:23:25 1997 +0200
     1.3 @@ -161,7 +161,7 @@
     1.4    let
     1.5      fun prt_typ syn ty = Pretty.quote (Syntax.pretty_typ syn ty);
     1.6  
     1.7 -    fun pretty_subclass (cl, cls) = Pretty.block
     1.8 +    fun pretty_classrel (cl, cls) = Pretty.block
     1.9        (Pretty.str (cl ^ " <") :: Pretty.brk 1 ::
    1.10          Pretty.commas (map Pretty.str cls));
    1.11  
    1.12 @@ -188,13 +188,13 @@
    1.13  
    1.14  
    1.15      val Sg {tsig, const_tab, syn, stamps} = sg;
    1.16 -    val {classes, subclass, default, tycons, abbrs, arities} =
    1.17 +    val {classes, classrel, default, tycons, abbrs, arities} =
    1.18        Type.rep_tsig tsig;
    1.19    in
    1.20      Pretty.writeln (Pretty.strs ("stamps:" :: stamp_names stamps));
    1.21      Pretty.writeln (Pretty.strs ("classes:" :: classes));
    1.22 -    Pretty.writeln (Pretty.big_list "subclass:"
    1.23 -                      (map pretty_subclass subclass));
    1.24 +    Pretty.writeln (Pretty.big_list "classrel:"
    1.25 +                      (map pretty_classrel classrel));
    1.26      Pretty.writeln (pretty_default default);
    1.27      Pretty.writeln (Pretty.big_list "types:" (map pretty_ty tycons));
    1.28      Pretty.writeln (Pretty.big_list "abbrs:" (map (pretty_abbr syn) abbrs));
    1.29 @@ -316,17 +316,20 @@
    1.30    end;
    1.31  
    1.32  
    1.33 -(*Package error messages from type checking*)
    1.34 +(*package error messages from type checking*)
    1.35  fun exn_type_msg sg (msg, Ts, ts) =
    1.36 -    let val show_typ = string_of_typ sg
    1.37 -	val show_term = string_of_term sg
    1.38 -	fun term_err [] = ""
    1.39 -	  | term_err [t] = "\nInvolving this term:\n" ^ show_term t
    1.40 -	  | term_err ts =
    1.41 -	    "\nInvolving these terms:\n" ^ cat_lines (map show_term ts);
    1.42 -    in  "\nType checking error: " ^ msg ^ "\n" ^
    1.43 -	cat_lines (map show_typ Ts) ^ term_err ts ^ "\n"
    1.44 -    end; 
    1.45 +  let
    1.46 +    val show_typ = string_of_typ sg;
    1.47 +    val show_term = set_ap Syntax.show_brackets true (string_of_term sg);
    1.48 +
    1.49 +    fun term_err [] = ""
    1.50 +      | term_err [t] = "\n\nInvolving this term:\n" ^ show_term t
    1.51 +      | term_err ts =
    1.52 +          "\n\nInvolving these terms:\n" ^ cat_lines (map show_term ts);
    1.53 +  in
    1.54 +    "\nType checking error: " ^ msg ^ "\n" ^
    1.55 +      cat_lines (map show_typ Ts) ^ term_err ts ^ "\n"
    1.56 +  end;
    1.57  
    1.58  
    1.59  
    1.60 @@ -506,10 +509,10 @@
    1.61    end;
    1.62  
    1.63  
    1.64 -(* add to subclass relation *)
    1.65 +(* add to classrel *)
    1.66  
    1.67  fun ext_classrel (syn, tsig, ctab) pairs =
    1.68 -  (syn, Type.ext_tsig_subclass tsig pairs, ctab);
    1.69 +  (syn, Type.ext_tsig_classrel tsig pairs, ctab);
    1.70  
    1.71  
    1.72  (* add to syntax *)