src/Pure/Syntax/type_ext.ML
author wenzelm
Mon, 09 Nov 1998 15:42:08 +0100
changeset 5840 e2d2b896c717
parent 5690 4b056ee5435c
child 6901 5e20ddfdf3c7
permissions -rw-r--r--
Object logic specific operations.
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
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
     5
Utilities for input and output of types. Also the concrete syntax of
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
     6
types, which is used to bootstrap Pure.
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
signature TYPE_EXT0 =
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    10
sig
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    11
  val raw_term_sorts: term -> (indexname * sort) list
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    12
  val typ_of_term: (indexname -> sort) -> term -> typ
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    13
end;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
signature TYPE_EXT =
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    16
sig
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
  include TYPE_EXT0
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    18
  val term_of_sort: sort -> term
1511
09354d37a5ab Elimination of fully-functorial style.
paulson
parents: 764
diff changeset
    19
  val term_of_typ: bool -> typ -> term
09354d37a5ab Elimination of fully-functorial style.
paulson
parents: 764
diff changeset
    20
  val tappl_ast_tr': Ast.ast * Ast.ast list -> Ast.ast
09354d37a5ab Elimination of fully-functorial style.
paulson
parents: 764
diff changeset
    21
  val type_ext: SynExt.syn_ext
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    22
end;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
1511
09354d37a5ab Elimination of fully-functorial style.
paulson
parents: 764
diff changeset
    24
structure TypeExt : TYPE_EXT =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
struct
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    26
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    27
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    28
(** input utils **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    30
(* raw_term_sorts *)
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    31
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    32
fun raw_term_sorts tm =
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    33
  let
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    34
    fun classes (Const (c, _)) = [c]
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    35
      | classes (Free (c, _)) = [c]
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    36
      | classes (Const ("_classes", _) $ Const (c, _) $ cs) = c :: classes cs
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    37
      | classes (Const ("_classes", _) $ Free (c, _) $ cs) = c :: classes cs
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    38
      | classes tm = raise TERM ("raw_term_sorts: bad encoding of classes", [tm]);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    40
    fun sort (Const ("_topsort", _)) = []
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    41
      | sort (Const (c, _)) = [c]
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    42
      | sort (Free (c, _)) = [c]
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    43
      | sort (Const ("_sort", _) $ cs) = classes cs
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    44
      | sort tm = raise TERM ("raw_term_sorts: bad encoding of sort", [tm]);
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    45
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    46
    fun add_env (Const ("_ofsort", _) $ Free (x, _) $ cs) env = ((x, ~1), sort cs) ins env
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    47
      | add_env (Const ("_ofsort", _) $ Var (xi, _) $ cs) env = (xi, sort cs) ins env
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    48
      | add_env (Abs (_, _, t)) env = add_env t env
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    49
      | add_env (t1 $ t2) env = add_env t1 (add_env t2 env)
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    50
      | add_env t env = env;
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    51
  in
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    52
    add_env tm []
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    53
  end;
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    54
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    55
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    56
(* typ_of_term *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    58
fun typ_of_term get_sort t =
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    59
  let
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    60
    fun typ_of (Free (x, _)) =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
    61
          if Lexicon.is_tid x then TFree (x, get_sort (x, ~1))
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    62
          else Type (x, [])
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    63
      | typ_of (Var (xi, _)) = TVar (xi, get_sort xi)
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    64
      | typ_of (Const ("_ofsort", _) $ Free (x, _) $ _) =
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    65
          TFree (x, get_sort (x, ~1))
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    66
      | typ_of (Const ("_ofsort", _) $ Var (xi, _) $ _) =
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    67
          TVar (xi, get_sort xi)
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    68
      | typ_of tm =
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
          let
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
            val (t, ts) = strip_comb tm;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
            val a =
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
    72
              (case t of
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
                Const (x, _) => x
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
              | Free (x, _) => x
3778
b70c41bc7491 fixed raw_term_sorts (again!);
wenzelm
parents: 2699
diff changeset
    75
              | _ => raise TERM ("typ_of_term: bad encoding of type", [tm]));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
          in
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    77
            Type (a, map typ_of ts)
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    78
          end;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
  in
557
9d386e6c02b7 added raw_term_sorts and changed typ_of_term accordingly (part of fix
wenzelm
parents: 347
diff changeset
    80
    typ_of t
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    85
(** output utils **)
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    86
2699
932fae4271d7 term_of_... now mark class, tfree, tvar;
wenzelm
parents: 2678
diff changeset
    87
(* term_of_sort *)
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    88
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    89
fun term_of_sort S =
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    90
  let
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
    91
    fun class c = Lexicon.const "_class" $ Lexicon.free c;
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    92
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    93
    fun classes [] = sys_error "term_of_sort"
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    94
      | classes [c] = class c
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
    95
      | classes (c :: cs) = Lexicon.const "_classes" $ class c $ classes cs;
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    96
  in
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    97
    (case S of
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
    98
      [] => Lexicon.const "_topsort"
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
    99
    | [c] => class c
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   100
    | cs => Lexicon.const "_sort" $ classes cs)
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   101
  end;
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   102
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   103
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   104
(* term_of_typ *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
fun term_of_typ show_sorts ty =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
  let
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   108
    fun of_sort t S =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   109
      if show_sorts then Lexicon.const "_ofsort" $ t $ term_of_sort S
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   110
      else t;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   112
    fun term_of (Type (a, Ts)) = list_comb (Lexicon.const a, map term_of Ts)
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   113
      | term_of (TFree (x, S)) = of_sort (Lexicon.const "_tfree" $ Lexicon.free x) S
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   114
      | term_of (TVar (xi, S)) = of_sort (Lexicon.const "_tvar" $ Lexicon.var xi) S;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
  in
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   116
    term_of ty
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
(** the type syntax **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   123
(* parse ast translations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   125
fun tapp_ast_tr (*"_tapp"*) [ty, f] = Ast.Appl [f, ty]
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   126
  | tapp_ast_tr (*"_tapp"*) asts = raise Ast.AST ("tapp_ast_tr", asts);
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   127
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   128
fun tappl_ast_tr (*"_tappl"*) [ty, tys, f] =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   129
      Ast.Appl (f :: ty :: Ast.unfold_ast "_types" tys)
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   130
  | tappl_ast_tr (*"_tappl"*) asts = raise Ast.AST ("tappl_ast_tr", asts);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
fun bracket_ast_tr (*"_bracket"*) [dom, cod] =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   133
      Ast.fold_ast_p "fun" (Ast.unfold_ast "_types" dom, cod)
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   134
  | bracket_ast_tr (*"_bracket"*) asts = raise Ast.AST ("bracket_ast_tr", asts);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   137
(* print ast translations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   139
fun tappl_ast_tr' (f, []) = raise Ast.AST ("tappl_ast_tr'", [f])
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   140
  | tappl_ast_tr' (f, [ty]) = Ast.Appl [Ast.Constant "_tapp", ty, f]
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   141
  | tappl_ast_tr' (f, ty :: tys) =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   142
      Ast.Appl [Ast.Constant "_tappl", ty, Ast.fold_ast "_types" tys, f];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
fun fun_ast_tr' (*"fun"*) asts =
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   145
  (case Ast.unfold_ast_p "fun" (Ast.Appl (Ast.Constant "fun" :: asts)) of
18
c9ec452ff08f lots of internal cleaning and tuning;
wenzelm
parents: 0
diff changeset
   146
    (dom as _ :: _ :: _, cod)
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   147
      => Ast.Appl [Ast.Constant "_bracket", Ast.fold_ast "_types" dom, cod]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
  | _ => raise Match);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
(* type_ext *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
val sortT = Type ("sort", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
val classesT = Type ("classes", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
val typesT = Type ("types", []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   157
local open Lexicon SynExt in
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   158
764
b60e77395d1a changed Pure's grammar and the way types are converted to nonterminals
clasohm
parents: 640
diff changeset
   159
val type_ext = mk_syn_ext false []
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   160
  [Mfix ("_",           tidT --> typeT,                "", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   161
   Mfix ("_",           tvarT --> typeT,               "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   162
   Mfix ("_",           idT --> typeT,                 "", [], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   163
   Mfix ("_",           longidT --> typeT,             "", [], max_pri),
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   164
   Mfix ("_::_",        [tidT, sortT] ---> typeT,      "_ofsort", [max_pri, 0], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   165
   Mfix ("_::_",        [tvarT, sortT] ---> typeT,     "_ofsort", [max_pri, 0], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   166
   Mfix ("_",           idT --> sortT,                 "", [], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   167
   Mfix ("_",           longidT --> sortT,             "", [], max_pri),
2584
b386951e15e6 improved comments;
wenzelm
parents: 2438
diff changeset
   168
   Mfix ("{}",          sortT,                         "_topsort", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   169
   Mfix ("{_}",         classesT --> sortT,            "_sort", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   170
   Mfix ("_",           idT --> classesT,              "", [], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   171
   Mfix ("_",           longidT --> classesT,          "", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   172
   Mfix ("_,_",         [idT, classesT] ---> classesT, "_classes", [], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   173
   Mfix ("_,_",         [longidT, 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
   174
   Mfix ("_ _",         [typeT, idT] ---> typeT,       "_tapp", [max_pri, 0], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   175
   Mfix ("_ _",         [typeT, longidT] ---> typeT,   "_tapp", [max_pri, 0], max_pri),
330
2fda15dd1e0f changed the way a grammar is generated to allow the new parser to work;
clasohm
parents: 258
diff changeset
   176
   Mfix ("((1'(_,/ _'))_)", [typeT, typesT, idT] ---> typeT, "_tappl", [], max_pri),
3829
d7333ef9e72c added longid syntax;
wenzelm
parents: 3778
diff changeset
   177
   Mfix ("((1'(_,/ _'))_)", [typeT, typesT, longidT] ---> typeT, "_tappl", [], max_pri),
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   178
   Mfix ("_",           typeT --> typesT,              "", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   179
   Mfix ("_,/ _",       [typeT, typesT] ---> typesT,   "_types", [], max_pri),
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   180
   Mfix ("(_/ => _)",   [typeT, typeT] ---> typeT,     "fun", [1, 0], 0),
624
33b9b5da3e6f made major changes to grammar;
clasohm
parents: 557
diff changeset
   181
   Mfix ("([_]/ => _)", [typesT, typeT] ---> typeT,    "_bracket", [0, 0], 0),
2678
d5fe793293ac added "_" syntax for dummyT;
wenzelm
parents: 2584
diff changeset
   182
   Mfix ("'(_')",       typeT --> typeT,               "", [0], max_pri),
d5fe793293ac added "_" syntax for dummyT;
wenzelm
parents: 2584
diff changeset
   183
   Mfix ("'_",          typeT,                         "dummy", [], max_pri)]
258
e540b7d4ecb1 minor internal changes;
wenzelm
parents: 239
diff changeset
   184
  []
347
cd41a57221d0 changed translation of type applications according to new grammar;
wenzelm
parents: 330
diff changeset
   185
  ([("_tapp", tapp_ast_tr), ("_tappl", tappl_ast_tr), ("_bracket", bracket_ast_tr)],
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   186
   [],
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   187
   [],
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   188
   [("fun", fun_ast_tr')])
2699
932fae4271d7 term_of_... now mark class, tfree, tvar;
wenzelm
parents: 2678
diff changeset
   189
  TokenTrans.token_translation
239
08b6e842ec16 minor internal changes;
wenzelm
parents: 18
diff changeset
   190
  ([], []);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
end;
5690
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   193
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   194
4b056ee5435c no open;
wenzelm
parents: 3829
diff changeset
   195
end;