src/Pure/Syntax/syn_ext.ML
author wenzelm
Wed Jan 30 14:05:29 2002 +0100 (2002-01-30)
changeset 12865 6b3484b8d572
parent 12785 27debaf2112d
child 14647 3f9d3d5cd0cd
permissions -rw-r--r--
escape_mfix;
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@12785
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
wenzelm@240
     5
wenzelm@240
     6
Syntax extension (internal interface).
wenzelm@240
     7
*)
wenzelm@240
     8
wenzelm@240
     9
signature SYN_EXT0 =
wenzelm@4050
    10
sig
wenzelm@6760
    11
  val dddot_indexname: indexname
wenzelm@6760
    12
  val constrainC: string
wenzelm@240
    13
  val typeT: typ
wenzelm@5690
    14
  val max_pri: int
wenzelm@4050
    15
end;
wenzelm@240
    16
wenzelm@240
    17
signature SYN_EXT =
wenzelm@4050
    18
sig
wenzelm@240
    19
  include SYN_EXT0
paulson@1510
    20
  val logic: string
paulson@1510
    21
  val args: string
paulson@1510
    22
  val cargs: string
paulson@1510
    23
  val any: string
paulson@1510
    24
  val sprop: string
paulson@1510
    25
  val typ_to_nonterm: typ -> string
paulson@1510
    26
  datatype xsymb =
paulson@1510
    27
    Delim of string |
paulson@1510
    28
    Argument of string * int |
paulson@1510
    29
    Space of string |
paulson@1510
    30
    Bg of int | Brk of int | En
paulson@1510
    31
  datatype xprod = XProd of string * xsymb list * string * int
paulson@1510
    32
  val chain_pri: int
wenzelm@4701
    33
  val delims_of: xprod list -> string list list
paulson@1510
    34
  datatype mfix = Mfix of string * typ * string * int list * int
paulson@1510
    35
  datatype syn_ext =
paulson@1510
    36
    SynExt of {
paulson@1510
    37
      logtypes: string list,
paulson@1510
    38
      xprods: xprod list,
paulson@1510
    39
      consts: string list,
wenzelm@2913
    40
      prmodes: string list,
paulson@1510
    41
      parse_ast_translation: (string * (Ast.ast list -> Ast.ast)) list,
paulson@1510
    42
      parse_rules: (Ast.ast * Ast.ast) list,
paulson@1510
    43
      parse_translation: (string * (term list -> term)) list,
wenzelm@4146
    44
      print_translation: (string * (bool -> typ -> term list -> term)) list,
paulson@1510
    45
      print_rules: (Ast.ast * Ast.ast) list,
wenzelm@2694
    46
      print_ast_translation: (string * (Ast.ast list -> Ast.ast)) list,
wenzelm@6322
    47
      token_translation: (string * string * (string -> string * real)) list}
wenzelm@4054
    48
  val mfix_args: string -> int
wenzelm@12865
    49
  val escape_mfix: string -> string
paulson@1510
    50
  val mk_syn_ext: bool -> string list -> mfix list ->
paulson@1510
    51
    string list -> (string * (Ast.ast list -> Ast.ast)) list *
paulson@1510
    52
    (string * (term list -> term)) list *
wenzelm@4146
    53
    (string * (bool -> typ -> term list -> term)) list * (string * (Ast.ast list -> Ast.ast)) list
wenzelm@6322
    54
    -> (string * string * (string -> string * real)) list
paulson@1510
    55
    -> (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
paulson@1510
    56
  val syn_ext: string list -> mfix list -> string list ->
paulson@1510
    57
    (string * (Ast.ast list -> Ast.ast)) list * (string * (term list -> term)) list *
wenzelm@4146
    58
    (string * (bool -> typ -> term list -> term)) list * (string * (Ast.ast list -> Ast.ast)) list
wenzelm@6322
    59
    -> (string * string * (string -> string * real)) list
paulson@1510
    60
    -> (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
paulson@1510
    61
  val syn_ext_logtypes: string list -> syn_ext
paulson@1510
    62
  val syn_ext_const_names: string list -> string list -> syn_ext
paulson@1510
    63
  val syn_ext_rules: string list -> (Ast.ast * Ast.ast) list * (Ast.ast * Ast.ast) list -> syn_ext
wenzelm@4146
    64
  val fix_tr': (term list -> term) -> bool -> typ -> term list -> term
paulson@1510
    65
  val syn_ext_trfuns: string list ->
paulson@1510
    66
    (string * (Ast.ast list -> Ast.ast)) list * (string * (term list -> term)) list *
paulson@1510
    67
    (string * (term list -> term)) list * (string * (Ast.ast list -> Ast.ast)) list
paulson@1510
    68
    -> syn_ext
wenzelm@4146
    69
  val syn_ext_trfunsT: string list ->
wenzelm@4146
    70
    (string * (bool -> typ -> term list -> term)) list -> syn_ext
wenzelm@2694
    71
  val syn_ext_tokentrfuns: string list
wenzelm@6322
    72
    -> (string * string * (string -> string * real)) list -> syn_ext
paulson@1510
    73
  val pure_ext: syn_ext
wenzelm@4050
    74
end;
wenzelm@240
    75
paulson@1510
    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
wenzelm@240
   149
    fun del_of (Delim s) = Some s
wenzelm@240
   150
      | del_of _ = None;
wenzelm@240
   151
wenzelm@240
   152
    fun dels_of (XProd (_, xsymbs, _, _)) =
wenzelm@240
   153
      mapfilter del_of xsymbs;
wenzelm@240
   154
  in
wenzelm@4701
   155
    map Symbol.explode (distinct (flat (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@4050
   197
  val scan_sym =
wenzelm@4050
   198
    $$ "_" >> K (Argument ("", 0)) ||
wenzelm@12513
   199
    $$ "\\<index>" >> K index ||
wenzelm@4701
   200
    $$ "(" |-- Scan.any Symbol.is_digit >> (Bg o #1 o Term.read_int) ||
wenzelm@4050
   201
    $$ ")" >> K En ||
wenzelm@4050
   202
    $$ "/" -- $$ "/" >> K (Brk ~1) ||
wenzelm@4701
   203
    $$ "/" |-- Scan.any Symbol.is_blank >> (Brk o length) ||
wenzelm@4701
   204
    Scan.any1 Symbol.is_blank >> (Space o implode) ||
wenzelm@4701
   205
    Scan.repeat1 scan_delim_char >> (Delim o implode);
wenzelm@4050
   206
wenzelm@4050
   207
  val scan_symb =
wenzelm@4050
   208
    scan_sym >> Some ||
wenzelm@4701
   209
    $$ "'" -- Scan.one Symbol.is_blank >> K None;
wenzelm@4050
   210
wenzelm@4701
   211
  val scan_symbs = Scan.repeat scan_symb --| Scan.ahead (Scan.one (not_equal "'"));
wenzelm@5870
   212
  val read_symbs = mapfilter I o the o Scan.read Symbol.stopper scan_symbs;
wenzelm@12513
   213
wenzelm@12513
   214
  fun unique_index xsymbs =
wenzelm@12513
   215
    if length (filter is_index xsymbs) <= 1 then xsymbs
wenzelm@12513
   216
    else error "Duplicate index arguments (\\<index>)";
wenzelm@4050
   217
in
wenzelm@12513
   218
  val read_mixfix = unique_index o read_symbs o Symbol.explode;
wenzelm@12513
   219
  val mfix_args = length o filter is_argument o read_mixfix;
wenzelm@12865
   220
  val escape_mfix = implode o map (fn s => if is_meta s then "'" ^ s else s) o Symbol.explode;
wenzelm@4050
   221
end;
wenzelm@4050
   222
wenzelm@4050
   223
wenzelm@240
   224
(* mfix_to_xprod *)
wenzelm@240
   225
wenzelm@12513
   226
fun mfix_to_xprod convert logtypes (mfix as Mfix (sy, typ, const, pris, pri)) =
wenzelm@240
   227
  let
wenzelm@240
   228
    fun check_pri p =
wenzelm@240
   229
      if p >= 0 andalso p <= max_pri then ()
wenzelm@12513
   230
      else err_in_mfix ("Precedence out of range: " ^ string_of_int p) mfix;
wenzelm@240
   231
wenzelm@240
   232
    fun blocks_ok [] 0 = true
wenzelm@240
   233
      | blocks_ok [] _ = false
wenzelm@240
   234
      | blocks_ok (Bg _ :: syms) n = blocks_ok syms (n + 1)
wenzelm@240
   235
      | blocks_ok (En :: _) 0 = false
wenzelm@240
   236
      | blocks_ok (En :: syms) n = blocks_ok syms (n - 1)
wenzelm@240
   237
      | blocks_ok (_ :: syms) n = blocks_ok syms n;
wenzelm@240
   238
wenzelm@240
   239
    fun check_blocks syms =
wenzelm@240
   240
      if blocks_ok syms 0 then ()
wenzelm@12513
   241
      else err_in_mfix "Unbalanced block parentheses" mfix;
wenzelm@240
   242
wenzelm@240
   243
wenzelm@240
   244
    val cons_fst = apfst o cons;
wenzelm@240
   245
wenzelm@240
   246
    fun add_args [] ty [] = ([], typ_to_nonterm1 ty)
wenzelm@12513
   247
      | add_args [] _ _ = err_in_mfix "Too many precedences" mfix
wenzelm@12513
   248
      | add_args ((arg as Argument ("index", _)) :: syms) ty ps =
wenzelm@12513
   249
          cons_fst arg (add_args syms ty ps)
wenzelm@240
   250
      | add_args (Argument _ :: syms) (Type ("fun", [ty, tys])) [] =
wenzelm@240
   251
          cons_fst (Argument (typ_to_nonterm ty, 0)) (add_args syms tys [])
wenzelm@240
   252
      | add_args (Argument _ :: syms) (Type ("fun", [ty, tys])) (p :: ps) =
wenzelm@240
   253
          cons_fst (Argument (typ_to_nonterm ty, p)) (add_args syms tys ps)
wenzelm@240
   254
      | add_args (Argument _ :: _) _ _ =
wenzelm@12513
   255
          err_in_mfix "More arguments than in corresponding type" mfix
wenzelm@240
   256
      | add_args (sym :: syms) ty ps = cons_fst sym (add_args syms ty ps);
wenzelm@240
   257
wenzelm@240
   258
    fun rem_pri (Argument (s, _)) = Argument (s, chain_pri)
wenzelm@240
   259
      | rem_pri sym = sym;
wenzelm@240
   260
wenzelm@4054
   261
    fun logify_types copy_prod (a as (Argument (s, p))) =
wenzelm@4054
   262
          if s mem logtypes then Argument (logic, p) else a
wenzelm@4054
   263
      | logify_types _ a = a;
wenzelm@240
   264
wenzelm@2364
   265
wenzelm@12513
   266
    val raw_symbs = read_mixfix sy handle ERROR => err_in_mfix "" mfix;
wenzelm@12513
   267
    val args = filter (fn Argument _ => true | _ => false) raw_symbs;
wenzelm@12513
   268
    val (const', typ', parse_rules) =
wenzelm@12513
   269
      if not (exists is_index args) then (const, typ, [])
wenzelm@12513
   270
      else
wenzelm@12513
   271
        let
wenzelm@12513
   272
          val c = if const <> "" then "_indexed_" ^ const
wenzelm@12513
   273
            else err_in_mfix "Missing constant name for indexed syntax" mfix;
wenzelm@12513
   274
          val T = Term.range_type typ handle Match =>
wenzelm@12513
   275
            err_in_mfix "Missing structure argument for indexed syntax" mfix;
wenzelm@12513
   276
wenzelm@12513
   277
          val xs = map Ast.Variable (Term.invent_names [] "x" (length args - 1));
wenzelm@12513
   278
          val i = Ast.Variable "i";
wenzelm@12513
   279
          val n = Library.find_index is_index args;
wenzelm@12513
   280
          val lhs = Ast.mk_appl (Ast.Constant c) (take (n, xs) @ [i] @ drop (n, xs));
wenzelm@12513
   281
          val rhs = Ast.mk_appl (Ast.Constant const) (Ast.Appl [Ast.Constant "_struct", i] :: xs);
wenzelm@12513
   282
        in (c, T, [(lhs, rhs)]) end;
wenzelm@12513
   283
wenzelm@12513
   284
    val (symbs, lhs) = add_args raw_symbs typ' pris;
wenzelm@12513
   285
wenzelm@2364
   286
    val copy_prod =
wenzelm@2364
   287
      lhs mem ["prop", "logic"]
wenzelm@2364
   288
        andalso const <> ""
wenzelm@2364
   289
        andalso not (null symbs)
wenzelm@2364
   290
        andalso not (exists is_delim symbs);
wenzelm@2364
   291
    val lhs' =
wenzelm@2364
   292
      if convert andalso not copy_prod then
wenzelm@2364
   293
       (if lhs mem logtypes then logic
wenzelm@2364
   294
        else if lhs = "prop" then sprop else lhs)
wenzelm@2364
   295
      else lhs;
wenzelm@4054
   296
    val symbs' = map (logify_types copy_prod) symbs;
wenzelm@12513
   297
    val xprod = XProd (lhs', symbs', const', pri);
wenzelm@240
   298
wenzelm@12513
   299
    val _ = (seq check_pri pris; check_pri pri; check_blocks symbs');
wenzelm@12513
   300
    val xprod' =
wenzelm@12513
   301
      if Lexicon.is_terminal lhs' then err_in_mfix ("Illegal lhs: " ^ lhs') mfix
wenzelm@12513
   302
      else if const <> "" then xprod
wenzelm@12513
   303
      else if length (filter is_argument symbs') <> 1 then
wenzelm@12513
   304
        err_in_mfix "Copy production must have exactly one argument" mfix
wenzelm@12513
   305
      else if exists is_terminal symbs' then xprod
wenzelm@12513
   306
      else XProd (lhs', map rem_pri symbs', "", chain_pri);
wenzelm@12513
   307
wenzelm@12513
   308
  in (xprod', parse_rules) end;
wenzelm@12513
   309
wenzelm@240
   310
wenzelm@240
   311
wenzelm@240
   312
(** datatype syn_ext **)
wenzelm@240
   313
wenzelm@240
   314
datatype syn_ext =
wenzelm@240
   315
  SynExt of {
clasohm@764
   316
    logtypes: string list,
wenzelm@240
   317
    xprods: xprod list,
wenzelm@240
   318
    consts: string list,
wenzelm@2913
   319
    prmodes: string list,
paulson@1510
   320
    parse_ast_translation: (string * (Ast.ast list -> Ast.ast)) list,
paulson@1510
   321
    parse_rules: (Ast.ast * Ast.ast) list,
wenzelm@240
   322
    parse_translation: (string * (term list -> term)) list,
wenzelm@4146
   323
    print_translation: (string * (bool -> typ -> term list -> term)) list,
paulson@1510
   324
    print_rules: (Ast.ast * Ast.ast) list,
wenzelm@2694
   325
    print_ast_translation: (string * (Ast.ast list -> Ast.ast)) list,
wenzelm@6322
   326
    token_translation: (string * string * (string -> string * real)) list}
wenzelm@240
   327
wenzelm@240
   328
wenzelm@240
   329
(* syn_ext *)
wenzelm@240
   330
wenzelm@12513
   331
fun mk_syn_ext convert logtypes mfixes consts trfuns tokentrfuns (parse_rules, print_rules) =
wenzelm@240
   332
  let
wenzelm@240
   333
    val (parse_ast_translation, parse_translation, print_translation,
wenzelm@240
   334
      print_ast_translation) = trfuns;
clasohm@764
   335
    val logtypes' = logtypes \ "prop";
wenzelm@240
   336
wenzelm@12513
   337
    val (xprods, parse_rules') = map (mfix_to_xprod convert logtypes') mfixes
wenzelm@12513
   338
      |> split_list |> apsnd (rev o flat);
wenzelm@12513
   339
    val mfix_consts = distinct (map (fn Mfix x => #3 x) mfixes @ map (fn XProd x => #3 x) xprods);
wenzelm@240
   340
  in
wenzelm@240
   341
    SynExt {
clasohm@764
   342
      logtypes = logtypes',
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
clasohm@764
   356
val syn_ext = mk_syn_ext true;
wenzelm@240
   357
clasohm@764
   358
fun syn_ext_logtypes logtypes =
wenzelm@2694
   359
  syn_ext logtypes [] [] ([], [], [], []) [] ([], []);
clasohm@764
   360
clasohm@764
   361
fun syn_ext_const_names logtypes cs =
wenzelm@2694
   362
  syn_ext logtypes [] cs ([], [], [], []) [] ([], []);
wenzelm@555
   363
clasohm@764
   364
fun syn_ext_rules logtypes rules =
wenzelm@2694
   365
  syn_ext logtypes [] [] ([], [], [], []) [] rules;
clasohm@764
   366
wenzelm@4146
   367
fun fix_tr' f _ _ ts = f ts;
wenzelm@2382
   368
wenzelm@2382
   369
fun syn_ext_trfuns logtypes (atrs, trs, tr's, atr's) =
wenzelm@2694
   370
  syn_ext logtypes [] [] (atrs, trs, map (apsnd fix_tr') tr's, atr's) [] ([], []);
wenzelm@2382
   371
wenzelm@2382
   372
fun syn_ext_trfunsT logtypes tr's =
wenzelm@2694
   373
  syn_ext logtypes [] [] ([], [], tr's, []) [] ([], []);
wenzelm@2694
   374
wenzelm@2694
   375
fun syn_ext_tokentrfuns logtypes tokentrfuns =
wenzelm@2694
   376
  syn_ext logtypes [] [] ([], [], [], []) tokentrfuns ([], []);
wenzelm@2382
   377
wenzelm@240
   378
clasohm@764
   379
(* pure_ext *)
wenzelm@240
   380
clasohm@764
   381
val pure_ext = mk_syn_ext false []
clasohm@764
   382
  [Mfix ("_", spropT --> propT, "", [0], 0),
clasohm@764
   383
   Mfix ("_", logicT --> anyT, "", [0], 0),
clasohm@764
   384
   Mfix ("_", spropT --> anyT, "", [0], 0),
clasohm@764
   385
   Mfix ("'(_')", logicT --> logicT, "", [0], max_pri),
clasohm@764
   386
   Mfix ("'(_')", spropT --> spropT, "", [0], max_pri),
clasohm@764
   387
   Mfix ("_::_",  [logicT, typeT] ---> logicT, "_constrain", [4, 0], 3),
clasohm@764
   388
   Mfix ("_::_",  [spropT, typeT] ---> spropT, "_constrain", [4, 0], 3)]
clasohm@764
   389
  []
clasohm@764
   390
  ([], [], [], [])
wenzelm@2694
   391
  []
clasohm@764
   392
  ([], []);
wenzelm@240
   393
wenzelm@240
   394
end;