src/Pure/display.ML
changeset 51510 b4f7e6734acc
parent 51509 22fd3605c7a2
child 51582 a6b1f63ae1cb
equal deleted inserted replaced
51509:22fd3605c7a2 51510:b4f7e6734acc
   120     fun prt_const (c, ty) = [Pretty.mark_str c, Pretty.str " ::", Pretty.brk 1, prt_typ_no_tvars ty];
   120     fun prt_const (c, ty) = [Pretty.mark_str c, Pretty.str " ::", Pretty.brk 1, prt_typ_no_tvars ty];
   121     val prt_const' = Defs.pretty_const ctxt;
   121     val prt_const' = Defs.pretty_const ctxt;
   122 
   122 
   123     fun pretty_classrel (c, []) = prt_cls c
   123     fun pretty_classrel (c, []) = prt_cls c
   124       | pretty_classrel (c, cs) = Pretty.block
   124       | pretty_classrel (c, cs) = Pretty.block
   125           (prt_cls c :: Pretty.str " <" :: Pretty.brk 1 ::
   125           (prt_cls c :: Pretty.str " <" :: Pretty.brk 1 :: Pretty.commas (map prt_cls cs));
   126             Pretty.commas (map prt_cls cs));
       
   127 
   126 
   128     fun pretty_default S = Pretty.block
   127     fun pretty_default S = Pretty.block
   129       [Pretty.str "default sort:", Pretty.brk 1, prt_sort S];
   128       [Pretty.str "default sort:", Pretty.brk 1, prt_sort S];
   130 
   129 
   131     val tfrees = map (fn v => TFree (v, []));
   130     val tfrees = map (fn v => TFree (v, []));
   165     val consts = Sign.consts_of thy;
   164     val consts = Sign.consts_of thy;
   166     val {constants, constraints} = Consts.dest consts;
   165     val {constants, constraints} = Consts.dest consts;
   167     val extern_const = Name_Space.extern ctxt (#1 constants);
   166     val extern_const = Name_Space.extern ctxt (#1 constants);
   168     val {classes, default, types, ...} = Type.rep_tsig tsig;
   167     val {classes, default, types, ...} = Type.rep_tsig tsig;
   169     val (class_space, class_algebra) = classes;
   168     val (class_space, class_algebra) = classes;
   170     val class_ord = string_ord o pairself (Name_Space.extern ctxt class_space);
       
   171     val classes = Sorts.classes_of class_algebra;
   169     val classes = Sorts.classes_of class_algebra;
   172     val arities = Sorts.arities_of class_algebra;
   170     val arities = Sorts.arities_of class_algebra;
   173 
   171 
   174     val clsses =
   172     val clsses =
   175       Name_Space.dest_table ctxt (class_space,
   173       Name_Space.dest_table ctxt (class_space,
   176         Symtab.make (map (fn ((c, _), cs) => (c, sort class_ord cs)) (Graph.dest classes)));
   174         Symtab.make (map (fn ((c, _), cs) => (c, Sign.minimize_sort thy cs)) (Graph.dest classes)));
   177     val tdecls = Name_Space.dest_table ctxt types;
   175     val tdecls = Name_Space.dest_table ctxt types;
   178     val arties = Name_Space.dest_table ctxt (Type.type_space tsig, arities);
   176     val arties = Name_Space.dest_table ctxt (Type.type_space tsig, arities);
   179 
   177 
   180     fun prune_const c = not verbose andalso Consts.is_concealed consts c;
   178     fun prune_const c = not verbose andalso Consts.is_concealed consts c;
   181     val cnsts = Name_Space.extern_table ctxt (#1 constants,
   179     val cnsts = Name_Space.extern_table ctxt (#1 constants,