src/Pure/Syntax/type_ext.ML
author wenzelm
Mon, 02 May 1994 12:34:56 +0200
changeset 347 cd41a57221d0
parent 330 2fda15dd1e0f
child 557 9d386e6c02b7
permissions -rw-r--r--
changed translation of type applications according to new grammar;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
     1
(*  Title:      Pure/Syntax/type_ext.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author:     Tobias Nipkow and Markus Wenzel, TU Muenchen
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
     5
The concrete syntax of types (used to bootstrap Pure).
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
     6
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
     7
TODO:
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
     8
  term_of_typ: prune sorts
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
signature TYPE_EXT0 =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
sig
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
  val typ_of_term: (indexname -> sort) -> term -> typ
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
signature TYPE_EXT =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
sig
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
  include TYPE_EXT0
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    19
  structure SynExt: SYN_EXT
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    20
  local open SynExt SynExt.Ast in
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
    val term_of_typ: bool -> typ -> term
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
    val tappl_ast_tr': ast * ast list -> ast
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    23
    val type_ext: syn_ext
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
  end
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    27
functor TypeExtFun(structure Lexicon: LEXICON and SynExt: SYN_EXT): TYPE_EXT =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    30
structure SynExt = SynExt;
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
    31
open Lexicon SynExt SynExt.Ast;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    34
(** typ_of_term **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
fun typ_of_term def_sort t =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
  let
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
    fun sort_err (xi as (x, i)) =
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    39
      error ("Inconsistent sort constraints for type variable " ^
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    40
        quote (if i < 0 then x else string_of_vname xi));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
    fun put_sort scs xi s =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
      (case assoc (scs, xi) of
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
        None => (xi, s) :: scs
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
      | Some s' =>  if s = s' then scs else sort_err xi);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    47
    fun insert x [] = [x: string]
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    48
      | insert x (lst as y :: ys) =
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    49
          if x > y then y :: insert x ys
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    50
          else if x = y then lst
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    51
          else x :: lst;
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    52
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    53
    fun classes (Const (c, _)) = [c]
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    54
      | classes (Free (c, _)) = [c]
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    55
      | classes (Const ("_classes", _) $ Const (c, _) $ cls) =
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    56
          insert c (classes cls)
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    57
      | classes (Const ("_classes", _) $ Free (c, _) $ cls) =
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    58
          insert c (classes cls)
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    59
      | classes tm = raise_term "typ_of_term: bad encoding of classes" [tm];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
    fun sort (Const ("_emptysort", _)) = []
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
      | sort (Const (s, _)) = [s]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
      | sort (Free (s, _)) = [s]
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    64
      | sort (Const ("_sort", _) $ cls) = classes cls
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    65
      | sort tm = raise_term "typ_of_term: bad encoding of sort" [tm];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
    fun typ (Free (x, _), scs) =
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
    68
          (if is_tid x then TFree (x, []) else Type (x, []), scs)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
      | typ (Var (xi, _), scs) = (TVar (xi, []), scs)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
      | typ (Const ("_ofsort", _) $ Free (x, _) $ st, scs) =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
          (TFree (x, []), put_sort scs (x, ~1) (sort st))
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
      | typ (Const ("_ofsort", _) $ Var (xi, _) $ st, scs) =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
          (TVar (xi, []), put_sort scs xi (sort st))
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
      | typ (Const (a, _), scs) = (Type (a, []), scs)
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    75
      | typ (tm as _ $ _, scs) =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
          let
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
            val (t, ts) = strip_comb tm;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
            val a =
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    79
              (case t of
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
                Const (x, _) => x
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
              | Free (x, _) => x
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    82
              | _ => raise_term "typ_of_term: bad type application" [tm]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
            val (tys, scs') = typs (ts, scs);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
          in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
            (Type (a, tys), scs')
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
          end
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    87
      | typ (tm, _) = raise_term "typ_of_term: bad encoding of typ" [tm]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
    and typs (t :: ts, scs) =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
          let
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
            val (ty, scs') = typ (t, scs);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
            val (tys, scs'') = typs (ts, scs');
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
          in (ty :: tys, scs'') end
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
      | typs ([], scs) = ([], scs);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
    val (ty, scs) = typ (t, []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
    fun get_sort xi =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
      (case assoc (scs, xi) of
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
        None => def_sort xi
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
      | Some s => s);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
    fun add_sorts (Type (a, tys)) = Type (a, map add_sorts tys)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
      | add_sorts (TVar (xi, _)) = TVar (xi, get_sort xi)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
      | add_sorts (TFree (x, _)) = TFree (x, get_sort (x, ~1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
  in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
    add_sorts ty
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
(** term_of_typ **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
fun term_of_typ show_sorts ty =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
  let
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
    fun const x = Const (x, dummyT);
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   117
    fun free x = Free (x, dummyT);
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   118
    fun var xi = Var (xi, dummyT);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
    fun classes [] = raise Match
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   121
      | classes [c] = free c
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   122
      | classes (c :: cs) = const "_classes" $ free c $ classes cs;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
    fun sort [] = const "_emptysort"
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   125
      | sort [s] = free s
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   126
      | sort ss = const "_sort" $ classes ss;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
    fun of_sort t ss =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
      if show_sorts then const "_ofsort" $ t $ sort ss else t;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   131
    fun term_of (Type (a, tys)) = list_comb (const a, map term_of tys)
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   132
      | term_of (TFree (x, ss)) = of_sort (free x) ss
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   133
      | term_of (TVar (xi, ss)) = of_sort (var xi) ss;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
  in
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   135
    term_of ty
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
(** the type syntax **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   142
(* parse ast translations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   144
fun tapp_ast_tr (*"_tapp"*) [ty, f] = Appl [f, ty]
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   145
  | tapp_ast_tr (*"_tapp"*) asts = raise_ast "tapp_ast_tr" asts;
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   146
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   147
fun tappl_ast_tr (*"_tappl"*) [ty, tys, f] =
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   148
      Appl (f :: ty :: unfold_ast "_types" tys)
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   149
  | tappl_ast_tr (*"_tappl"*) asts = raise_ast "tappl_ast_tr" asts;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
fun bracket_ast_tr (*"_bracket"*) [dom, cod] =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
      fold_ast_p "fun" (unfold_ast "_types" dom, cod)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
  | bracket_ast_tr (*"_bracket"*) asts = raise_ast "bracket_ast_tr" asts;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   156
(* print ast translations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
fun tappl_ast_tr' (f, []) = raise_ast "tappl_ast_tr'" [f]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
  | tappl_ast_tr' (f, [ty]) = Appl [Constant "_tapp", ty, f]
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   160
  | tappl_ast_tr' (f, ty :: tys) =
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   161
      Appl [Constant "_tappl", ty, fold_ast "_types" tys, f];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
fun fun_ast_tr' (*"fun"*) asts =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
  (case unfold_ast_p "fun" (Appl (Constant "fun" :: asts)) of
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   165
    (dom as _ :: _ :: _, cod)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
      => Appl [Constant "_bracket", fold_ast "_types" dom, cod]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
  | _ => raise Match);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
(* type_ext *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
val sortT = Type ("sort", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
val classesT = Type ("classes", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
val typesT = Type ("types", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   176
val type_ext = syn_ext
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   177
  [logic, "type"] [logic, "type"]
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   178
  [Mfix ("_",           tidT --> typeT,                "", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   179
   Mfix ("_",           tvarT --> typeT,               "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   180
   Mfix ("_",           idT --> typeT,                 "", [], max_pri),
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   181
   Mfix ("_::_",        [tidT, sortT] ---> typeT,      "_ofsort", [max_pri, 0], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   182
   Mfix ("_::_",        [tvarT, sortT] ---> typeT,     "_ofsort", [max_pri, 0], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   183
   Mfix ("_",           idT --> sortT,                 "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   184
   Mfix ("{}",          sortT,                         "_emptysort", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   185
   Mfix ("{_}",         classesT --> sortT,            "_sort", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   186
   Mfix ("_",           idT --> classesT,              "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   187
   Mfix ("_,_",         [idT, classesT] ---> classesT, "_classes", [], max_pri),
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   188
   Mfix ("_ _",         [typeT, idT] ---> typeT,       "_tapp", [max_pri, 0], max_pri),
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   189
   Mfix ("((1'(_,/ _'))_)", [typeT, typesT, idT] ---> typeT, "_tappl", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   190
   Mfix ("_",           typeT --> typesT,              "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   191
   Mfix ("_,/ _",       [typeT, typesT] ---> typesT,   "_types", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   192
   Mfix ("(_/ => _)",   [typeT, typeT] ---> typeT,     "fun", [1, 0], 0),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   193
   Mfix ("([_]/ => _)", [typesT, typeT] ---> typeT,    "_bracket", [0, 0], 0)]
258
e540b7d4ecb1 minor internal changes;
wenzelm
parents: 239
diff changeset
   194
  []
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   195
  ([("_tapp", tapp_ast_tr), ("_tappl", tappl_ast_tr), ("_bracket", bracket_ast_tr)],
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   196
   [],
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   197
   [],
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   198
   [("fun", fun_ast_tr')])
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   199
  ([], []);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203