src/Pure/type.ML
changeset 7069 f54023a6c7e2
parent 5345 d7927fc7170d
child 7247 aad87acc8fa3
equal deleted inserted replaced
7068:d396d8b935f1 7069:f54023a6c7e2
    16 
    16 
    17   (*type signatures*)
    17   (*type signatures*)
    18   type type_sig
    18   type type_sig
    19   val rep_tsig: type_sig ->
    19   val rep_tsig: type_sig ->
    20     {classes: class list,
    20     {classes: class list,
    21      classrel: (class * class list) list,
    21      classrel: Sorts.classrel,
    22      default: sort,
    22      default: sort,
    23      tycons: (string * int) list,
    23      tycons: int Symtab.table,
    24      abbrs: (string * (string list * typ)) list,
    24      abbrs: (string list * typ) Symtab.table,
    25      arities: (string * (class * sort list) list) list}
    25      arities: Sorts.arities}
    26   val defaultS: type_sig -> sort
    26   val defaultS: type_sig -> sort
    27   val logical_types: type_sig -> string list
    27   val logical_types: type_sig -> string list
    28 
    28 
    29   val subsort: type_sig -> sort * sort -> bool
    29   val subsort: type_sig -> sort * sort -> bool
    30   val eq_sort: type_sig -> sort * sort -> bool
    30   val eq_sort: type_sig -> sort * sort -> bool
    42   val merge_tsigs: type_sig * type_sig -> type_sig
    42   val merge_tsigs: type_sig * type_sig -> type_sig
    43 
    43 
    44   val typ_errors: type_sig -> typ * string list -> string list
    44   val typ_errors: type_sig -> typ * string list -> string list
    45   val cert_typ: type_sig -> typ -> typ
    45   val cert_typ: type_sig -> typ -> typ
    46   val norm_typ: type_sig -> typ -> typ
    46   val norm_typ: type_sig -> typ -> typ
       
    47   val norm_term: type_sig -> term -> term
    47 
    48 
    48   val inst_term_tvars: type_sig * (indexname * typ) list -> term -> term
    49   val inst_term_tvars: type_sig * (indexname * typ) list -> term -> term
    49 
    50 
    50   (*type matching*)
    51   (*type matching*)
    51   exception TYPE_MATCH
    52   exception TYPE_MATCH
   164 *)
   165 *)
   165 
   166 
   166 datatype type_sig =
   167 datatype type_sig =
   167   TySg of {
   168   TySg of {
   168     classes: class list,
   169     classes: class list,
   169     classrel: (class * class list) list,
   170     classrel: Sorts.classrel,
   170     default: sort,
   171     default: sort,
   171     tycons: (string * int) list,
   172     tycons: int Symtab.table,
   172     abbrs: (string * (string list * typ)) list,
   173     abbrs: (string list * typ) Symtab.table,
   173     arities: (string * (class * sort list) list) list};
   174     arities: Sorts.arities};
   174 
   175 
   175 fun rep_tsig (TySg comps) = comps;
   176 fun rep_tsig (TySg comps) = comps;
   176 
   177 
   177 fun defaultS (TySg {default, ...}) = default;
   178 fun defaultS (TySg {default, ...}) = default;
   178 
   179 
   179 fun logical_types (TySg {classrel, arities, tycons, ...}) =
   180 fun logical_types (TySg {classrel, arities, tycons, ...}) =
   180   let
   181   let
   181     fun log_class c = Sorts.class_le classrel (c, logicC);
   182     fun log_class c = Sorts.class_le classrel (c, logicC);
   182     fun log_type t = exists (log_class o #1) (assocs arities t);
   183     fun log_type t = exists (log_class o #1) (Symtab.lookup_multi (arities, t));
   183   in
   184   in filter log_type (Symtab.keys tycons) end;
   184     filter log_type (map #1 tycons)
       
   185   end;
       
   186 
   185 
   187 
   186 
   188 (* sorts *)
   187 (* sorts *)
   189 
   188 
   190 (* FIXME declared!? *)
   189 (* FIXME declared!? *)
   226 (* FIXME err_undcl_class! *)
   225 (* FIXME err_undcl_class! *)
   227 (* 'leq' checks the partial order on classes according to the
   226 (* 'leq' checks the partial order on classes according to the
   228    statements in the association list 'a' (i.e. 'classrel')
   227    statements in the association list 'a' (i.e. 'classrel')
   229 *)
   228 *)
   230 
   229 
   231 fun less a (C, D) = case assoc (a, C) of
   230 fun less a (C, D) = case Symtab.lookup (a, C) of
   232      Some ss => D mem_string ss
   231      Some ss => D mem_string ss
   233    | None => err_undcl_class C;
   232    | None => err_undcl_class C;
   234 
   233 
   235 fun leq a (C, D)  =  C = D orelse less a (C, D);
   234 fun leq a (C, D)  =  C = D orelse less a (C, D);
   236 
   235 
   264 (*Instantiation of type variables in terms *)
   263 (*Instantiation of type variables in terms *)
   265 fun inst_term_tvars (_,[]) t = t
   264 fun inst_term_tvars (_,[]) t = t
   266   | inst_term_tvars arg    t = map_term_types (inst_typ_tvars arg) t;
   265   | inst_term_tvars arg    t = map_term_types (inst_typ_tvars arg) t;
   267 
   266 
   268 
   267 
   269 (* norm_typ *)
   268 (* norm_typ, norm_term *)
   270 
   269 
   271 (*expand abbreviations and normalize sorts*)
   270 (*expand abbreviations and normalize sorts*)
   272 fun norm_typ (tsig as TySg {abbrs, ...}) ty =
   271 fun norm_typ (tsig as TySg {abbrs, ...}) ty =
   273   let
   272   let
   274     val idx = maxidx_of_typ ty + 1;
   273     val idx = maxidx_of_typ ty + 1;
   275 
   274 
   276     fun norm (Type (a, Ts)) =
   275     fun norm (Type (a, Ts)) =
   277           (case assoc (abbrs, a) of
   276           (case Symtab.lookup (abbrs, a) of
   278             Some (vs, U) => norm (inst_typ (map (rpair idx) vs ~~ Ts) (incr_tvar idx U))
   277             Some (vs, U) => norm (inst_typ (map (rpair idx) vs ~~ Ts) (incr_tvar idx U))
   279           | None => Type (a, map norm Ts))
   278           | None => Type (a, map norm Ts))
   280       | norm (TFree (x, S)) = TFree (x, norm_sort tsig S)
   279       | norm (TFree (x, S)) = TFree (x, norm_sort tsig S)
   281       | norm (TVar (xi, S)) = TVar (xi, norm_sort tsig S);
   280       | norm (TVar (xi, S)) = TVar (xi, norm_sort tsig S);
   282   in
   281 
   283     norm ty
   282     val ty' = norm ty;
   284   end;
   283   in if ty = ty' then ty else ty' end;  (*dumb tuning to avoid copying*)
   285 
   284 
   286 
   285 fun norm_term tsig t =
       
   286   let val t' = map_term_types (norm_typ tsig) t
       
   287   in if t = t' then t else t' end;  (*dumb tuning to avoid copying*)
   287 
   288 
   288 
   289 
   289 
   290 
   290 (** build type signatures **)
   291 (** build type signatures **)
   291 
   292 
   292 fun make_tsig (classes, classrel, default, tycons, abbrs, arities) =
   293 fun make_tsig (classes, classrel, default, tycons, abbrs, arities) =
   293   TySg {classes = classes, classrel = classrel, default = default,
   294   TySg {classes = classes, classrel = classrel, default = default,
   294     tycons = tycons, abbrs = abbrs, arities = arities};
   295     tycons = tycons, abbrs = abbrs, arities = arities};
   295 
   296 
   296 val tsig0 = make_tsig ([], [], [], [], [], []);
   297 val tsig0 = make_tsig ([], Symtab.empty, [], Symtab.empty, Symtab.empty, Symtab.empty);
   297 
   298 
   298 
   299 
   299 
   300 
   300 
   301 
   301 (* typ_errors *)
   302 (* typ_errors *)
   302 
   303 
   303 (*check validity of (not necessarily normal) type; accumulate error messages*)
   304 (*check validity of (not necessarily normal) type; accumulate error messages*)
   304 
   305 
   305 fun typ_errors tsig (typ, errors) =
   306 fun typ_errors tsig (typ, errors) =
   306   let
   307   let
   307     val TySg {classes, tycons, abbrs, ...} = tsig;
   308     val {classes, tycons, abbrs, ...} = rep_tsig tsig;
   308 
   309 
   309     fun class_err (errs, c) =
   310     fun class_err (errs, c) =
   310       if c mem_string classes then errs
   311       if c mem_string classes then errs
   311       else undcl_class c ins_string errs;
   312       else undcl_class c ins_string errs;
   312 
   313 
   313     val sort_err = foldl class_err;
   314     val sort_err = foldl class_err;
   314 
   315 
   315     fun typ_errs (Type (c, Us), errs) =
   316     fun typ_errs (errs, Type (c, Us)) =
   316           let
   317           let
   317             val errs' = foldr typ_errs (Us, errs);
   318             val errs' = foldl typ_errs (errs, Us);
   318             fun nargs n =
   319             fun nargs n =
   319               if n = length Us then errs'
   320               if n = length Us then errs'
   320               else ("Wrong number of arguments: " ^ quote c) ins_string errs';
   321               else ("Wrong number of arguments: " ^ quote c) ins_string errs';
   321           in
   322           in
   322             (case assoc (tycons, c) of
   323             (case Symtab.lookup (tycons, c) of
   323               Some n => nargs n
   324               Some n => nargs n
   324             | None =>
   325             | None =>
   325                 (case assoc (abbrs, c) of
   326                 (case Symtab.lookup (abbrs, c) of
   326                   Some (vs, _) => nargs (length vs)
   327                   Some (vs, _) => nargs (length vs)
   327                 | None => undcl_type c ins_string errs))
   328                 | None => undcl_type c ins_string errs))
   328           end
   329           end
   329     | typ_errs (TFree (_, S), errs) = sort_err (errs, S)
   330     | typ_errs (errs, TFree (_, S)) = sort_err (errs, S)
   330     | typ_errs (TVar ((x, i), S), errs) =
   331     | typ_errs (errs, TVar ((x, i), S)) =
   331         if i < 0 then
   332         if i < 0 then
   332           ("Negative index for TVar " ^ quote x) ins_string sort_err (errs, S)
   333           ("Negative index for TVar " ^ quote x) ins_string sort_err (errs, S)
   333         else sort_err (errs, S);
   334         else sort_err (errs, S);
   334   in
   335   in typ_errs (errors, typ) end;
   335     typ_errs (typ, errors)
       
   336   end;
       
   337 
   336 
   338 
   337 
   339 (* cert_typ *)
   338 (* cert_typ *)
   340 
   339 
   341 (*check and normalize typ wrt. tsig*)           (*exception TYPE*)
   340 (*check and normalize typ wrt. tsig*)           (*exception TYPE*)
   360 
   359 
   361 
   360 
   362 (* merge classrel *)
   361 (* merge classrel *)
   363 
   362 
   364 fun merge_classrel (classrel1, classrel2) =
   363 fun merge_classrel (classrel1, classrel2) =
   365   let val classrel = transitive_closure (assoc_union (classrel1, classrel2))
   364   let
       
   365     val classrel = transitive_closure (assoc_union (Symtab.dest classrel1, Symtab.dest classrel2))
   366   in
   366   in
   367     if exists (op mem_string) classrel then
   367     if exists (op mem_string) classrel then
   368       error ("Cyclic class structure!")   (* FIXME improve msg, raise TERM *)
   368       error ("Cyclic class structure!")   (* FIXME improve msg, raise TERM *)
   369     else classrel
   369     else Symtab.make classrel
   370   end;
   370   end;
   371 
   371 
   372 
   372 
   373 (* coregularity *)
   373 (* coregularity *)
   374 
   374 
   408 
   408 
   409 (* 'merge_arities' builds the union of two 'arities' lists;
   409 (* 'merge_arities' builds the union of two 'arities' lists;
   410    it only checks the two restriction conditions and inserts afterwards
   410    it only checks the two restriction conditions and inserts afterwards
   411    all elements of the second list into the first one *)
   411    all elements of the second list into the first one *)
   412 
   412 
   413 fun merge_arities classrel =
   413 fun merge_arities_aux classrel =
   414   let fun test_ar t (ars1, sw) = add_arity classrel ars1 (t,sw);
   414   let fun test_ar t (ars1, sw) = add_arity classrel ars1 (t,sw);
   415 
   415 
   416       fun merge_c (arities1, (c as (t, ars2))) = case assoc (arities1, t) of
   416       fun merge_c (arities1, (c as (t, ars2))) = case assoc (arities1, t) of
   417           Some(ars1) =>
   417           Some(ars1) =>
   418             let val ars = foldl (test_ar t) (ars1, ars2)
   418             let val ars = foldl (test_ar t) (ars1, ars2)
   419             in overwrite (arities1, (t,ars)) end
   419             in overwrite (arities1, (t,ars)) end
   420         | None => c::arities1
   420         | None => c::arities1
   421   in foldl merge_c end;
   421   in foldl merge_c end;
   422 
   422 
       
   423 fun merge_arities classrel (a1, a2) =
       
   424   Symtab.make (merge_arities_aux classrel (Symtab.dest a1, Symtab.dest a2));
       
   425 
   423 fun add_tycons (tycons, tn as (t,n)) =
   426 fun add_tycons (tycons, tn as (t,n)) =
   424   (case assoc (tycons, t) of
   427   (case Symtab.lookup (tycons, t) of
   425     Some m => if m = n then tycons else varying_decls t
   428     Some m => if m = n then tycons else varying_decls t
   426   | None => tn :: tycons);
   429   | None => Symtab.update (tn, tycons));
   427 
   430 
   428 fun merge_abbrs (abbrs1, abbrs2) =
   431 fun merge_abbrs abbrs =
   429   let val abbrs = abbrs1 union abbrs2 in
   432   Symtab.merge (op =) abbrs handle Symtab.DUPS dups => raise TERM (dup_tyabbrs dups, []);
   430     (case gen_duplicates eq_fst abbrs of
       
   431       [] => abbrs
       
   432     | dups => raise TERM (dup_tyabbrs (map fst dups), []))
       
   433   end;
       
   434 
   433 
   435 
   434 
   436 (* 'merge_tsigs' takes the above declared functions to merge two type
   435 (* 'merge_tsigs' takes the above declared functions to merge two type
   437   signatures *)
   436   signatures *)
   438 
   437 
   440                      tycons=tycons1, arities=arities1, abbrs=abbrs1},
   439                      tycons=tycons1, arities=arities1, abbrs=abbrs1},
   441                 TySg{classes=classes2, default=default2, classrel=classrel2,
   440                 TySg{classes=classes2, default=default2, classrel=classrel2,
   442                      tycons=tycons2, arities=arities2, abbrs=abbrs2}) =
   441                      tycons=tycons2, arities=arities2, abbrs=abbrs2}) =
   443   let val classes' = classes1 union_string classes2;
   442   let val classes' = classes1 union_string classes2;
   444       val classrel' = merge_classrel (classrel1, classrel2);
   443       val classrel' = merge_classrel (classrel1, classrel2);
   445       val tycons' = foldl add_tycons (tycons1, tycons2)
   444       val tycons' = foldl add_tycons (tycons1, Symtab.dest tycons2)
   446       val arities' = merge_arities classrel' (arities1, arities2);
   445       val arities' = merge_arities classrel' (arities1, arities2);
   447       val default' = Sorts.norm_sort classrel' (default1 @ default2);
   446       val default' = Sorts.norm_sort classrel' (default1 @ default2);
   448       val abbrs' = merge_abbrs(abbrs1, abbrs2);
   447       val abbrs' = merge_abbrs(abbrs1, abbrs2);
   449   in make_tsig(classes', classrel', default', tycons', abbrs', arities') end;
   448   in make_tsig(classes', classrel', default', tycons', abbrs', arities') end;
   450 
   449 
   469 
   468 
   470 fun add_classrel classes (classrel, (s, ges)) =
   469 fun add_classrel classes (classrel, (s, ges)) =
   471   let
   470   let
   472     fun upd (classrel, s') =
   471     fun upd (classrel, s') =
   473       if s' mem_string classes then
   472       if s' mem_string classes then
   474         let val ges' = the (assoc (classrel, s))
   473         let val ges' = the (Symtab.lookup (classrel, s))
   475         in case assoc (classrel, s') of
   474         in case Symtab.lookup (classrel, s') of
   476              Some sups => if s mem_string sups
   475              Some sups => if s mem_string sups
   477                            then error(" Cycle :" ^ s^" <= "^ s'^" <= "^ s )
   476                            then error(" Cycle :" ^ s^" <= "^ s'^" <= "^ s )
   478                            else overwrite
   477                            else Symtab.update ((s, sups union_string ges'), classrel)
   479                                   (classrel, (s, sups union_string ges'))
       
   480            | None => classrel
   478            | None => classrel
   481         end
   479         end
   482       else err_undcl_class s'
   480       else err_undcl_class s'
   483   in foldl upd (classrel @ [(s, ges)], ges) end;
   481   in foldl upd (Symtab.update ((s, ges), classrel), ges) end;
   484 
   482 
   485 
   483 
   486 (* 'extend_classes' inserts all new classes into the corresponding
   484 (* 'extend_classes' inserts all new classes into the corresponding
   487    lists ('classes', 'classrel') if possible *)
   485    lists ('classes', 'classrel') if possible *)
   488 
   486 
   510   let
   508   let
   511     val TySg {classes, classrel, default, tycons, abbrs, arities} = tsig;
   509     val TySg {classes, classrel, default, tycons, abbrs, arities} = tsig;
   512 
   510 
   513     (* FIXME clean! *)
   511     (* FIXME clean! *)
   514     val classrel' =
   512     val classrel' =
   515       merge_classrel (classrel, map (fn (c1, c2) => (c1, [c2])) pairs);
   513       merge_classrel (classrel, Symtab.make (map (fn (c1, c2) => (c1, [c2])) pairs));
   516   in
   514   in
   517     make_tsig (classes, classrel', default, tycons, abbrs, arities)
   515     make_tsig (classes, classrel', default, tycons, abbrs, arities)
   518   end;
   516   end;
   519 
   517 
   520 
   518 
   529 
   527 
   530 fun ext_tsig_types (TySg {classes, classrel, default, tycons, abbrs, arities}) ts =
   528 fun ext_tsig_types (TySg {classes, classrel, default, tycons, abbrs, arities}) ts =
   531   let
   529   let
   532     fun check_type (c, n) =
   530     fun check_type (c, n) =
   533       if n < 0 then err_neg_args c
   531       if n < 0 then err_neg_args c
   534       else if is_some (assoc (tycons, c)) then err_dup_tycon c
   532       else if is_some (Symtab.lookup (tycons, c)) then err_dup_tycon c
   535       else if is_some (assoc (abbrs, c)) then error (ty_confl c)
   533       else if is_some (Symtab.lookup (abbrs, c)) then error (ty_confl c)
   536       else ();
   534       else ();
   537   in
   535   in
   538     seq check_type ts;
   536     seq check_type ts;
   539     make_tsig (classes, classrel, default, ts @ tycons, abbrs,
   537     make_tsig (classes, classrel, default, Symtab.extend (tycons, ts), abbrs,
   540       map (rpair [] o #1) ts @ arities)
   538       Symtab.extend (arities, map (rpair [] o #1) ts))
   541   end;
   539   end;
   542 
   540 
   543 
   541 
   544 
   542 
   545 (** add type abbreviations **)
   543 (** add type abbreviations **)
   558       (case gen_rems (op =) (rhs_vs, lhs_vs) of
   556       (case gen_rems (op =) (rhs_vs, lhs_vs) of
   559         [] => []
   557         [] => []
   560       | vs => ["Extra variables on rhs: " ^ commas_quote vs]);
   558       | vs => ["Extra variables on rhs: " ^ commas_quote vs]);
   561 
   559 
   562     val tycon_confl =
   560     val tycon_confl =
   563       if is_none (assoc (tycons, a)) then []
   561       if is_none (Symtab.lookup (tycons, a)) then []
   564       else [ty_confl a];
   562       else [ty_confl a];
   565 
   563 
   566     val dup_abbr =
   564     val dup_abbr =
   567       if is_none (assoc (abbrs, a)) then []
   565       if is_none (Symtab.lookup (abbrs, a)) then []
   568       else ["Duplicate declaration of abbreviation"];
   566       else ["Duplicate declaration of abbreviation"];
   569   in
   567   in
   570     dup_lhs_vars @ extra_rhs_vars @ tycon_confl @ dup_abbr @
   568     dup_lhs_vars @ extra_rhs_vars @ tycon_confl @ dup_abbr @
   571       typ_errors tsig (rhs, [])
   569       typ_errors tsig (rhs, [])
   572   end;
   570   end;
   583     (case abbr_errors tsig abbr of
   581     (case abbr_errors tsig abbr of
   584       [] => abbr
   582       [] => abbr
   585     | msgs => err msgs)
   583     | msgs => err msgs)
   586   end;
   584   end;
   587 
   585 
   588 fun add_abbr (tsig as TySg{classes,classrel,default,tycons,arities,abbrs},
   586 fun add_abbr (tsig as TySg{classes,classrel,default,tycons,arities,abbrs}, abbr) =
   589               abbr) =
   587   make_tsig (classes,classrel,default,tycons, Symtab.update (prep_abbr tsig abbr, abbrs), arities);
   590   make_tsig
       
   591     (classes,classrel,default,tycons, prep_abbr tsig abbr :: abbrs, arities);
       
   592 
   588 
   593 fun ext_tsig_abbrs tsig raw_abbrs = foldl add_abbr (tsig, raw_abbrs);
   589 fun ext_tsig_abbrs tsig raw_abbrs = foldl add_abbr (tsig, raw_abbrs);
   594 
   590 
   595 
   591 
   596 
   592 
   605    the 'arities' association list of the given type signatrure  *)
   601    the 'arities' association list of the given type signatrure  *)
   606 
   602 
   607 fun coregular (classes, classrel, tycons) =
   603 fun coregular (classes, classrel, tycons) =
   608   let fun ex C = if C mem_string classes then () else err_undcl_class(C);
   604   let fun ex C = if C mem_string classes then () else err_undcl_class(C);
   609 
   605 
   610       fun addar(arities, (t, (w, C))) = case assoc(tycons, t) of
   606       fun addar(arities, (t, (w, C))) = case Symtab.lookup (tycons, t) of
   611             Some(n) => if n <> length w then varying_decls(t) else
   607             Some(n) => if n <> length w then varying_decls(t) else
   612                      ((seq o seq) ex w; ex C;
   608                      ((seq o seq) ex w; ex C;
   613                       let val ars = the (assoc(arities, t))
   609                       let val ars = the (Symtab.lookup (arities, t))
   614                           val ars' = add_arity classrel ars (t,(C,w))
   610                           val ars' = add_arity classrel ars (t,(C,w))
   615                       in overwrite(arities, (t,ars')) end)
   611                       in Symtab.update ((t,ars'), arities) end)
   616           | None => error (undcl_type t);
   612           | None => error (undcl_type t);
   617 
   613 
   618   in addar end;
   614   in addar end;
   619 
   615 
   620 
   616 
   626    this means, if there exists a declaration t:(Ss)C and there is
   622    this means, if there exists a declaration t:(Ss)C and there is
   627    no declaration t:(Ss')D with C <=D then the declaration holds
   623    no declaration t:(Ss')D with C <=D then the declaration holds
   628    for all range classes more general than C *)
   624    for all range classes more general than C *)
   629 
   625 
   630 fun close classrel arities =
   626 fun close classrel arities =
   631   let fun check sl (l, (s, dom)) = case assoc (classrel, s) of
   627   let fun check sl (l, (s, dom)) = case Symtab.lookup (classrel, s) of
   632           Some sups =>
   628           Some sups =>
   633             let fun close_sup (l, sup) =
   629             let fun close_sup (l, sup) =
   634                   if exists (fn s'' => less classrel (s, s'') andalso
   630                   if exists (fn s'' => less classrel (s, s'') andalso
   635                                        leq classrel (s'', sup)) sl
   631                                        leq classrel (s'', sup)) sl
   636                   then l
   632                   then l
   653     val arities1 =
   649     val arities1 =
   654       List.concat
   650       List.concat
   655           (map (fn (t, ss, cs) => map (fn c => (t, (ss, c))) cs) sarities);
   651           (map (fn (t, ss, cs) => map (fn c => (t, (ss, c))) cs) sarities);
   656     val arities2 = foldl (coregular (classes, classrel, tycons))
   652     val arities2 = foldl (coregular (classes, classrel, tycons))
   657                          (arities, norm_domain classrel arities1)
   653                          (arities, norm_domain classrel arities1)
   658       |> close classrel;
   654       |> Symtab.dest |> close classrel |> Symtab.make;
   659   in
   655   in
   660     make_tsig (classes, classrel, default, tycons, abbrs, arities2)
   656     make_tsig (classes, classrel, default, tycons, abbrs, arities2)
   661   end;
   657   end;
   662 
   658 
   663 
   659