src/Pure/Syntax/syn_ext.ML
author wenzelm
Sat Apr 16 18:58:30 2005 +0200 (2005-04-16)
changeset 15754 f867c48de2e1
parent 15570 8d8c70b41bab
child 15835 fdf678bec567
permissions -rw-r--r--
added stamp_trfun, mk_trfun, eq_trfun;
wenzelm@240
     1
(*  Title:      Pure/Syntax/syn_ext.ML
wenzelm@240
     2
    ID:         $Id$
wenzelm@911
     3
    Author:     Markus Wenzel and Carsten Clasohm, TU Muenchen
wenzelm@240
     4
wenzelm@240
     5
Syntax extension (internal interface).
wenzelm@240
     6
*)
wenzelm@240
     7
wenzelm@240
     8
signature SYN_EXT0 =
wenzelm@4050
     9
sig
wenzelm@6760
    10
  val dddot_indexname: indexname
wenzelm@6760
    11
  val constrainC: string
wenzelm@240
    12
  val typeT: typ
wenzelm@5690
    13
  val max_pri: int
wenzelm@15754
    14
  val stamp_trfun: stamp -> string * 'a -> string * ('a * stamp)
wenzelm@15754
    15
  val mk_trfun: string * 'a -> string * ('a * stamp)
wenzelm@15754
    16
  val eq_trfun: ('a * stamp) * ('a * stamp) -> bool
wenzelm@4050
    17
end;
wenzelm@240
    18
wenzelm@240
    19
signature SYN_EXT =
wenzelm@4050
    20
sig
wenzelm@240
    21
  include SYN_EXT0
paulson@1510
    22
  val logic: string
paulson@1510
    23
  val args: string
paulson@1510
    24
  val cargs: string
paulson@1510
    25
  val any: string
paulson@1510
    26
  val sprop: string
paulson@1510
    27
  val typ_to_nonterm: typ -> string
paulson@1510
    28
  datatype xsymb =
paulson@1510
    29
    Delim of string |
paulson@1510
    30
    Argument of string * int |
paulson@1510
    31
    Space of string |
paulson@1510
    32
    Bg of int | Brk of int | En
paulson@1510
    33
  datatype xprod = XProd of string * xsymb list * string * int
paulson@1510
    34
  val chain_pri: int
wenzelm@4701
    35
  val delims_of: xprod list -> string list list
paulson@1510
    36
  datatype mfix = Mfix of string * typ * string * int list * int
paulson@1510
    37
  datatype syn_ext =
paulson@1510
    38
    SynExt of {
paulson@1510
    39
      xprods: xprod list,
paulson@1510
    40
      consts: string list,
wenzelm@2913
    41
      prmodes: string list,
wenzelm@15754
    42
      parse_ast_translation: (string * ((Ast.ast list -> Ast.ast) * stamp)) list,
paulson@1510
    43
      parse_rules: (Ast.ast * Ast.ast) list,
wenzelm@15754
    44
      parse_translation: (string * ((term list -> term) * stamp)) list,
wenzelm@15754
    45
      print_translation: (string * ((bool -> typ -> term list -> term) * stamp)) list,
paulson@1510
    46
      print_rules: (Ast.ast * Ast.ast) list,
wenzelm@15754
    47
      print_ast_translation: (string * ((Ast.ast list -> Ast.ast) * stamp)) list,
wenzelm@6322
    48
      token_translation: (string * string * (string -> string * real)) list}
wenzelm@4054
    49
  val mfix_args: string -> int
wenzelm@12865
    50
  val escape_mfix: string -> string
wenzelm@14903
    51
  val syn_ext': bool -> (string -> bool) -> mfix list ->
wenzelm@15754
    52
    string list -> (string * ((Ast.ast list -> Ast.ast) * stamp)) list *
wenzelm@15754
    53
    (string * ((term list -> term) * stamp)) list *
wenzelm@15754
    54
    (string * ((bool -> typ -> term list -> term) * stamp)) list *
wenzelm@15754
    55
    (string * ((Ast.ast list -> Ast.ast) * stamp)) list
wenzelm@6322
    56
    -> (string * string * (string -> string * real)) list
paulson@1510
    57
    -> (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
wenzelm@14903
    58
  val syn_ext: mfix list -> string list ->
wenzelm@15754
    59
    (string * ((Ast.ast list -> Ast.ast) * stamp)) list *
wenzelm@15754
    60
    (string * ((term list -> term) * stamp)) list *
wenzelm@15754
    61
    (string * ((bool -> typ -> term list -> term) * stamp)) list *
wenzelm@15754
    62
    (string * ((Ast.ast list -> Ast.ast) * stamp)) list
wenzelm@6322
    63
    -> (string * string * (string -> string * real)) list
paulson@1510
    64
    -> (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
wenzelm@14903
    65
  val syn_ext_const_names: string list -> syn_ext
wenzelm@14903
    66
  val syn_ext_rules: (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
wenzelm@14903
    67
  val syn_ext_trfuns:
wenzelm@15754
    68
    (string * ((Ast.ast list -> Ast.ast) * stamp)) list *
wenzelm@15754
    69
    (string * ((term list -> term) * stamp)) list *
wenzelm@15754
    70
    (string * ((bool -> typ -> term list -> term) * stamp)) list *
wenzelm@15754
    71
    (string * ((Ast.ast list -> Ast.ast) * stamp)) list -> syn_ext
wenzelm@14903
    72
  val syn_ext_tokentrfuns: (string * string * (string -> string * real)) list -> syn_ext
paulson@1510
    73
  val pure_ext: syn_ext
wenzelm@4050
    74
end;
wenzelm@240
    75
wenzelm@15754
    76
structure SynExt: SYN_EXT =
wenzelm@240
    77
struct
wenzelm@240
    78
wenzelm@2694
    79
wenzelm@240
    80
(** misc definitions **)
wenzelm@240
    81
wenzelm@7472
    82
val dddot_indexname = ("dddot", 0);
wenzelm@6760
    83
val constrainC = "_constrain";
wenzelm@6760
    84
wenzelm@6760
    85
wenzelm@240
    86
(* syntactic categories *)
wenzelm@240
    87
wenzelm@240
    88
val logic = "logic";
wenzelm@240
    89
val logicT = Type (logic, []);
wenzelm@240
    90
wenzelm@240
    91
val args = "args";
clasohm@1178
    92
val cargs = "cargs";
wenzelm@240
    93
clasohm@330
    94
val typeT = Type ("type", []);
wenzelm@240
    95
clasohm@764
    96
val sprop = "#prop";
clasohm@764
    97
val spropT = Type (sprop, []);
wenzelm@240
    98
clasohm@764
    99
val any = "any";
clasohm@624
   100
val anyT = Type (any, []);
clasohm@624
   101
wenzelm@780
   102
wenzelm@240
   103
wenzelm@240
   104
(** datatype xprod **)
wenzelm@240
   105
wenzelm@240
   106
(*Delim s: delimiter s
wenzelm@240
   107
  Argument (s, p): nonterminal s requiring priority >= p, or valued token
wenzelm@240
   108
  Space s: some white space for printing
wenzelm@240
   109
  Bg, Brk, En: blocks and breaks for pretty printing*)
wenzelm@240
   110
wenzelm@240
   111
datatype xsymb =
wenzelm@240
   112
  Delim of string |
wenzelm@240
   113
  Argument of string * int |
wenzelm@240
   114
  Space of string |
wenzelm@240
   115
  Bg of int | Brk of int | En;
wenzelm@240
   116
wenzelm@12513
   117
fun is_delim (Delim _) = true
wenzelm@12513
   118
  | is_delim _ = false;
wenzelm@12513
   119
wenzelm@12513
   120
fun is_terminal (Delim _) = true
wenzelm@12513
   121
  | is_terminal (Argument (s, _)) = Lexicon.is_terminal s
wenzelm@12513
   122
  | is_terminal _ = false;
wenzelm@12513
   123
wenzelm@12513
   124
fun is_argument (Argument _) = true
wenzelm@12513
   125
  | is_argument _ = false;
wenzelm@12513
   126
wenzelm@12513
   127
fun is_index (Argument ("index", _)) = true
wenzelm@12513
   128
  | is_index _ = false;
wenzelm@12513
   129
wenzelm@12513
   130
val index = Argument ("index", 1000);
wenzelm@12513
   131
wenzelm@240
   132
wenzelm@240
   133
(*XProd (lhs, syms, c, p):
wenzelm@240
   134
    lhs: name of nonterminal on the lhs of the production
wenzelm@240
   135
    syms: list of symbols on the rhs of the production
wenzelm@240
   136
    c: head of parse tree
wenzelm@240
   137
    p: priority of this production*)
wenzelm@240
   138
wenzelm@240
   139
datatype xprod = XProd of string * xsymb list * string * int;
wenzelm@240
   140
wenzelm@240
   141
val max_pri = 1000;   (*maximum legal priority*)
wenzelm@240
   142
val chain_pri = ~1;   (*dummy for chain productions*)
wenzelm@240
   143
wenzelm@240
   144
wenzelm@240
   145
(* delims_of *)
wenzelm@240
   146
wenzelm@240
   147
fun delims_of xprods =
wenzelm@240
   148
  let
skalberg@15531
   149
    fun del_of (Delim s) = SOME s
skalberg@15531
   150
      | del_of _ = NONE;
wenzelm@240
   151
wenzelm@240
   152
    fun dels_of (XProd (_, xsymbs, _, _)) =
skalberg@15570
   153
      List.mapPartial del_of xsymbs;
wenzelm@240
   154
  in
skalberg@15570
   155
    map Symbol.explode (distinct (List.concat (map dels_of xprods)))
wenzelm@240
   156
  end;
wenzelm@240
   157
wenzelm@240
   158
wenzelm@240
   159
wenzelm@240
   160
(** datatype mfix **)
wenzelm@240
   161
wenzelm@240
   162
(*Mfix (sy, ty, c, ps, p):
wenzelm@240
   163
    sy: rhs of production as symbolic string
wenzelm@240
   164
    ty: type description of production
wenzelm@240
   165
    c: head of parse tree
wenzelm@240
   166
    ps: priorities of arguments in sy
wenzelm@240
   167
    p: priority of production*)
wenzelm@240
   168
wenzelm@240
   169
datatype mfix = Mfix of string * typ * string * int list * int;
wenzelm@240
   170
wenzelm@12513
   171
fun err_in_mfix msg (Mfix (sy, _, const, _, _)) =
wenzelm@12513
   172
  error ((if msg = "" then "" else msg ^ "\n") ^
wenzelm@12513
   173
    "in mixfix annotation " ^ quote sy ^ " for " ^ quote const);
wenzelm@12513
   174
wenzelm@240
   175
wenzelm@240
   176
(* typ_to_nonterm *)
wenzelm@240
   177
clasohm@865
   178
fun typ_to_nt _ (Type (c, _)) = c
clasohm@865
   179
  | typ_to_nt default _ = default;
clasohm@865
   180
clasohm@764
   181
(*get nonterminal for rhs*)
clasohm@865
   182
val typ_to_nonterm = typ_to_nt any;
wenzelm@240
   183
clasohm@764
   184
(*get nonterminal for lhs*)
clasohm@865
   185
val typ_to_nonterm1 = typ_to_nt logic;
wenzelm@240
   186
wenzelm@240
   187
wenzelm@12513
   188
(* read_mixfix *)
wenzelm@4050
   189
wenzelm@4050
   190
local
wenzelm@12513
   191
  fun is_meta c = c mem ["(", ")", "/", "_", "\\<index>"];
wenzelm@4050
   192
wenzelm@4701
   193
  val scan_delim_char =
wenzelm@4701
   194
    $$ "'" |-- Scan.one ((not o Symbol.is_blank) andf Symbol.not_eof) ||
wenzelm@4701
   195
    Scan.one ((not o is_meta) andf (not o Symbol.is_blank) andf Symbol.not_eof);
wenzelm@4050
   196
wenzelm@14819
   197
  fun read_int ["0", "0"] = ~1
wenzelm@14819
   198
    | read_int cs = #1 (Library.read_int cs);
wenzelm@14819
   199
wenzelm@4050
   200
  val scan_sym =
wenzelm@4050
   201
    $$ "_" >> K (Argument ("", 0)) ||
wenzelm@12513
   202
    $$ "\\<index>" >> K index ||
wenzelm@14819
   203
    $$ "(" |-- Scan.any Symbol.is_digit >> (Bg o read_int) ||
wenzelm@4050
   204
    $$ ")" >> K En ||
wenzelm@4050
   205
    $$ "/" -- $$ "/" >> K (Brk ~1) ||
wenzelm@4701
   206
    $$ "/" |-- Scan.any Symbol.is_blank >> (Brk o length) ||
wenzelm@4701
   207
    Scan.any1 Symbol.is_blank >> (Space o implode) ||
wenzelm@4701
   208
    Scan.repeat1 scan_delim_char >> (Delim o implode);
wenzelm@4050
   209
wenzelm@4050
   210
  val scan_symb =
skalberg@15531
   211
    scan_sym >> SOME ||
skalberg@15531
   212
    $$ "'" -- Scan.one Symbol.is_blank >> K NONE;
wenzelm@4050
   213
wenzelm@4701
   214
  val scan_symbs = Scan.repeat scan_symb --| Scan.ahead (Scan.one (not_equal "'"));
skalberg@15570
   215
  val read_symbs = List.mapPartial I o valOf o Scan.read Symbol.stopper scan_symbs;
wenzelm@12513
   216
wenzelm@12513
   217
  fun unique_index xsymbs =
skalberg@15570
   218
    if length (List.filter is_index xsymbs) <= 1 then xsymbs
wenzelm@12513
   219
    else error "Duplicate index arguments (\\<index>)";
wenzelm@4050
   220
in
wenzelm@12513
   221
  val read_mixfix = unique_index o read_symbs o Symbol.explode;
skalberg@15570
   222
  val mfix_args = length o List.filter is_argument o read_mixfix;
wenzelm@12865
   223
  val escape_mfix = implode o map (fn s => if is_meta s then "'" ^ s else s) o Symbol.explode;
wenzelm@4050
   224
end;
wenzelm@4050
   225
wenzelm@4050
   226
wenzelm@240
   227
(* mfix_to_xprod *)
wenzelm@240
   228
wenzelm@14903
   229
fun mfix_to_xprod convert is_logtype (mfix as Mfix (sy, typ, const, pris, pri)) =
wenzelm@240
   230
  let
wenzelm@240
   231
    fun check_pri p =
wenzelm@240
   232
      if p >= 0 andalso p <= max_pri then ()
wenzelm@12513
   233
      else err_in_mfix ("Precedence out of range: " ^ string_of_int p) mfix;
wenzelm@240
   234
wenzelm@240
   235
    fun blocks_ok [] 0 = true
wenzelm@240
   236
      | blocks_ok [] _ = false
wenzelm@240
   237
      | blocks_ok (Bg _ :: syms) n = blocks_ok syms (n + 1)
wenzelm@240
   238
      | blocks_ok (En :: _) 0 = false
wenzelm@240
   239
      | blocks_ok (En :: syms) n = blocks_ok syms (n - 1)
wenzelm@240
   240
      | blocks_ok (_ :: syms) n = blocks_ok syms n;
wenzelm@240
   241
wenzelm@240
   242
    fun check_blocks syms =
wenzelm@240
   243
      if blocks_ok syms 0 then ()
wenzelm@12513
   244
      else err_in_mfix "Unbalanced block parentheses" mfix;
wenzelm@240
   245
wenzelm@240
   246
wenzelm@240
   247
    val cons_fst = apfst o cons;
wenzelm@240
   248
wenzelm@240
   249
    fun add_args [] ty [] = ([], typ_to_nonterm1 ty)
wenzelm@12513
   250
      | add_args [] _ _ = err_in_mfix "Too many precedences" mfix
wenzelm@12513
   251
      | add_args ((arg as Argument ("index", _)) :: syms) ty ps =
wenzelm@12513
   252
          cons_fst arg (add_args syms ty ps)
wenzelm@240
   253
      | add_args (Argument _ :: syms) (Type ("fun", [ty, tys])) [] =
wenzelm@240
   254
          cons_fst (Argument (typ_to_nonterm ty, 0)) (add_args syms tys [])
wenzelm@240
   255
      | add_args (Argument _ :: syms) (Type ("fun", [ty, tys])) (p :: ps) =
wenzelm@240
   256
          cons_fst (Argument (typ_to_nonterm ty, p)) (add_args syms tys ps)
wenzelm@240
   257
      | add_args (Argument _ :: _) _ _ =
wenzelm@12513
   258
          err_in_mfix "More arguments than in corresponding type" mfix
wenzelm@240
   259
      | add_args (sym :: syms) ty ps = cons_fst sym (add_args syms ty ps);
wenzelm@240
   260
wenzelm@240
   261
    fun rem_pri (Argument (s, _)) = Argument (s, chain_pri)
wenzelm@240
   262
      | rem_pri sym = sym;
wenzelm@240
   263
wenzelm@4054
   264
    fun logify_types copy_prod (a as (Argument (s, p))) =
wenzelm@14903
   265
          if s <> "prop" andalso is_logtype s then Argument (logic, p) else a
wenzelm@4054
   266
      | logify_types _ a = a;
wenzelm@240
   267
wenzelm@2364
   268
wenzelm@12513
   269
    val raw_symbs = read_mixfix sy handle ERROR => err_in_mfix "" mfix;
skalberg@15570
   270
    val args = List.filter (fn Argument _ => true | _ => false) raw_symbs;
wenzelm@12513
   271
    val (const', typ', parse_rules) =
wenzelm@12513
   272
      if not (exists is_index args) then (const, typ, [])
wenzelm@12513
   273
      else
wenzelm@12513
   274
        let
wenzelm@14697
   275
          val indexed_const = if const <> "" then "_indexed_" ^ const
wenzelm@12513
   276
            else err_in_mfix "Missing constant name for indexed syntax" mfix;
wenzelm@14697
   277
          val rangeT = Term.range_type typ handle Match =>
wenzelm@12513
   278
            err_in_mfix "Missing structure argument for indexed syntax" mfix;
wenzelm@12513
   279
wenzelm@14697
   280
          val xs = map Ast.Variable (Term.invent_names [] "xa" (length args - 1));
wenzelm@14697
   281
          val (xs1, xs2) = Library.splitAt (Library.find_index is_index args, xs);
wenzelm@12513
   282
          val i = Ast.Variable "i";
wenzelm@14697
   283
          val lhs = Ast.mk_appl (Ast.Constant indexed_const)
wenzelm@14697
   284
            (xs1 @ [Ast.mk_appl (Ast.Constant "_index") [i]] @ xs2);
wenzelm@14697
   285
          val rhs = Ast.mk_appl (Ast.Constant const) (i :: xs);
wenzelm@14697
   286
        in (indexed_const, rangeT, [(lhs, rhs)]) end;
wenzelm@12513
   287
wenzelm@12513
   288
    val (symbs, lhs) = add_args raw_symbs typ' pris;
wenzelm@12513
   289
wenzelm@2364
   290
    val copy_prod =
wenzelm@2364
   291
      lhs mem ["prop", "logic"]
wenzelm@2364
   292
        andalso const <> ""
wenzelm@2364
   293
        andalso not (null symbs)
wenzelm@2364
   294
        andalso not (exists is_delim symbs);
wenzelm@2364
   295
    val lhs' =
wenzelm@2364
   296
      if convert andalso not copy_prod then
wenzelm@14903
   297
       (if lhs = "prop" then sprop else if is_logtype lhs then logic else lhs)
wenzelm@2364
   298
      else lhs;
wenzelm@4054
   299
    val symbs' = map (logify_types copy_prod) symbs;
wenzelm@12513
   300
    val xprod = XProd (lhs', symbs', const', pri);
wenzelm@240
   301
skalberg@15570
   302
    val _ = (List.app check_pri pris; check_pri pri; check_blocks symbs');
wenzelm@12513
   303
    val xprod' =
wenzelm@12513
   304
      if Lexicon.is_terminal lhs' then err_in_mfix ("Illegal lhs: " ^ lhs') mfix
wenzelm@12513
   305
      else if const <> "" then xprod
skalberg@15570
   306
      else if length (List.filter is_argument symbs') <> 1 then
wenzelm@12513
   307
        err_in_mfix "Copy production must have exactly one argument" mfix
wenzelm@12513
   308
      else if exists is_terminal symbs' then xprod
wenzelm@12513
   309
      else XProd (lhs', map rem_pri symbs', "", chain_pri);
wenzelm@12513
   310
wenzelm@12513
   311
  in (xprod', parse_rules) end;
wenzelm@12513
   312
wenzelm@240
   313
wenzelm@240
   314
wenzelm@240
   315
(** datatype syn_ext **)
wenzelm@240
   316
wenzelm@240
   317
datatype syn_ext =
wenzelm@240
   318
  SynExt of {
wenzelm@240
   319
    xprods: xprod list,
wenzelm@240
   320
    consts: string list,
wenzelm@2913
   321
    prmodes: string list,
wenzelm@15754
   322
    parse_ast_translation: (string * ((Ast.ast list -> Ast.ast) * stamp)) list,
paulson@1510
   323
    parse_rules: (Ast.ast * Ast.ast) list,
wenzelm@15754
   324
    parse_translation: (string * ((term list -> term) * stamp)) list,
wenzelm@15754
   325
    print_translation: (string * ((bool -> typ -> term list -> term) * stamp)) list,
paulson@1510
   326
    print_rules: (Ast.ast * Ast.ast) list,
wenzelm@15754
   327
    print_ast_translation: (string * ((Ast.ast list -> Ast.ast) * stamp)) list,
wenzelm@15754
   328
    token_translation: (string * string * (string -> string * real)) list};
wenzelm@240
   329
wenzelm@240
   330
wenzelm@240
   331
(* syn_ext *)
wenzelm@240
   332
wenzelm@14903
   333
fun syn_ext' convert is_logtype mfixes consts trfuns tokentrfuns (parse_rules, print_rules) =
wenzelm@240
   334
  let
wenzelm@240
   335
    val (parse_ast_translation, parse_translation, print_translation,
wenzelm@240
   336
      print_ast_translation) = trfuns;
wenzelm@240
   337
wenzelm@14903
   338
    val (xprods, parse_rules') = map (mfix_to_xprod convert is_logtype) mfixes
skalberg@15570
   339
      |> split_list |> apsnd (rev o List.concat);
wenzelm@12513
   340
    val mfix_consts = distinct (map (fn Mfix x => #3 x) mfixes @ map (fn XProd x => #3 x) xprods);
wenzelm@240
   341
  in
wenzelm@240
   342
    SynExt {
clasohm@624
   343
      xprods = xprods,
wenzelm@11546
   344
      consts = consts union_string mfix_consts,
wenzelm@2913
   345
      prmodes = distinct (map (fn (m, _, _) => m) tokentrfuns),
wenzelm@240
   346
      parse_ast_translation = parse_ast_translation,
wenzelm@12513
   347
      parse_rules = parse_rules' @ parse_rules,
wenzelm@240
   348
      parse_translation = parse_translation,
wenzelm@240
   349
      print_translation = print_translation,
wenzelm@12513
   350
      print_rules = map swap parse_rules' @ print_rules,
wenzelm@2694
   351
      print_ast_translation = print_ast_translation,
wenzelm@2694
   352
      token_translation = tokentrfuns}
wenzelm@240
   353
  end;
wenzelm@240
   354
wenzelm@2382
   355
wenzelm@14903
   356
val syn_ext = syn_ext' true (K false);
wenzelm@555
   357
wenzelm@14903
   358
fun syn_ext_const_names cs = syn_ext [] cs ([], [], [], []) [] ([], []);
wenzelm@14903
   359
fun syn_ext_rules rules = syn_ext [] [] ([], [], [], []) [] rules;
wenzelm@14903
   360
fun syn_ext_trfuns trfuns = syn_ext [] [] trfuns [] ([], []);
wenzelm@14903
   361
fun syn_ext_tokentrfuns trfuns = syn_ext [] [] ([], [], [], []) trfuns ([], []);
wenzelm@2382
   362
wenzelm@15754
   363
fun stamp_trfun s (c, f) = (c, (f, s));
wenzelm@15754
   364
fun mk_trfun tr = stamp_trfun (stamp ()) tr;
wenzelm@15754
   365
fun eq_trfun ((_, s1:stamp), (_, s2)) = s1 = s2;
wenzelm@15754
   366
wenzelm@240
   367
clasohm@764
   368
(* pure_ext *)
wenzelm@240
   369
wenzelm@14903
   370
val pure_ext = syn_ext' false (K false)
clasohm@764
   371
  [Mfix ("_", spropT --> propT, "", [0], 0),
clasohm@764
   372
   Mfix ("_", logicT --> anyT, "", [0], 0),
clasohm@764
   373
   Mfix ("_", spropT --> anyT, "", [0], 0),
clasohm@764
   374
   Mfix ("'(_')", logicT --> logicT, "", [0], max_pri),
clasohm@764
   375
   Mfix ("'(_')", spropT --> spropT, "", [0], max_pri),
clasohm@764
   376
   Mfix ("_::_",  [logicT, typeT] ---> logicT, "_constrain", [4, 0], 3),
clasohm@764
   377
   Mfix ("_::_",  [spropT, typeT] ---> spropT, "_constrain", [4, 0], 3)]
clasohm@764
   378
  []
clasohm@764
   379
  ([], [], [], [])
wenzelm@2694
   380
  []
clasohm@764
   381
  ([], []);
wenzelm@240
   382
wenzelm@240
   383
end;