src/Pure/Syntax/mixfix.ML
changeset 2696 a41b9ee247ec
parent 2677 d73a46247a4a
child 2767 e1d15eabb64d
equal deleted inserted replaced
2695:871b69a4b78f 2696:a41b9ee247ec
   103       end;
   103       end;
   104 
   104 
   105     val mfix = mapfilter mfix_of type_decls;
   105     val mfix = mapfilter mfix_of type_decls;
   106     val xconsts = map name_of type_decls;
   106     val xconsts = map name_of type_decls;
   107   in
   107   in
   108     syn_ext logtypes mfix xconsts ([], [], [], []) ([], [])
   108     syn_ext logtypes mfix xconsts ([], [], [], []) [] ([], [])
   109   end;
   109   end;
   110 
   110 
   111 
   111 
   112 (* syn_ext_consts *)
   112 (* syn_ext_consts *)
   113 
   113 
   144     val xconsts = map name_of const_decls;
   144     val xconsts = map name_of const_decls;
   145     val binders = mapfilter binder const_decls;
   145     val binders = mapfilter binder const_decls;
   146     val binder_trs = map mk_binder_tr binders;
   146     val binder_trs = map mk_binder_tr binders;
   147     val binder_trs' = map (apsnd fix_tr' o mk_binder_tr' o swap) binders;
   147     val binder_trs' = map (apsnd fix_tr' o mk_binder_tr' o swap) binders;
   148   in
   148   in
   149     syn_ext logtypes mfix xconsts ([], binder_trs, binder_trs', []) ([], [])
   149     syn_ext logtypes mfix xconsts ([], binder_trs, binder_trs', []) [] ([], [])
   150   end;
   150   end;
   151 
   151 
   152 
   152 
   153 
   153 
   154 (** Pure syntax **)
   154 (** Pure syntax **)
   157   map (fn t => (t, 0, NoSyn))
   157   map (fn t => (t, 0, NoSyn))
   158     (terminals @ [logic, "type", "types", "sort", "classes", args, cargs,
   158     (terminals @ [logic, "type", "types", "sort", "classes", args, cargs,
   159       "pttrn", "idt", "idts", "aprop", "asms", any, sprop, "dummy"]);
   159       "pttrn", "idt", "idts", "aprop", "asms", any, sprop, "dummy"]);
   160 
   160 
   161 val pure_syntax =
   161 val pure_syntax =
   162  [("_lambda",   "[idts, 'a] => logic",            Mixfix ("(3%_./ _)", [], 0)),
   162  [("_lambda",      "[idts, 'a] => logic",           Mixfix ("(3%_./ _)", [], 0)),
   163   ("_abs",      "'a",                             NoSyn),
   163   ("_abs",         "'a",                            NoSyn),
   164   ("",          "'a => " ^ args,                  Delimfix "_"),
   164   ("",             "'a => " ^ args,                 Delimfix "_"),
   165   ("_args",     "['a, " ^ args ^ "] => " ^ args,  Delimfix "_,/ _"),
   165   ("_args",        "['a, " ^ args ^ "] => " ^ args, Delimfix "_,/ _"),
   166   ("",          "id => idt",                      Delimfix "_"),
   166   ("",             "id => idt",                     Delimfix "_"),
   167   ("_idtyp",    "[id, type] => idt",              Mixfix ("_::_", [], 0)),
   167   ("_idtyp",       "[id, type] => idt",             Mixfix ("_::_", [], 0)),
   168   ("",          "idt => idt",                     Delimfix "'(_')"),
   168   ("",             "idt => idt",                    Delimfix "'(_')"),
   169   ("",          "idt => pttrn",                   Delimfix "_"),
   169   ("",             "idt => pttrn",                  Delimfix "_"),
   170   ("",          "pttrn => idts",                  Delimfix "_"),
   170   ("",             "pttrn => idts",                 Delimfix "_"),
   171   ("_idts",     "[pttrn, idts] => idts",          Mixfix ("_/ _", [1, 0], 0)),
   171   ("_idts",        "[pttrn, idts] => idts",         Mixfix ("_/ _", [1, 0], 0)),
   172   ("",          "id => aprop",                    Delimfix "_"),
   172   ("",             "id => aprop",                   Delimfix "_"),
   173   ("",          "var => aprop",                   Delimfix "_"),
   173   ("",             "var => aprop",                  Delimfix "_"),
   174   ("_aprop",    "aprop => prop",                  Delimfix "PROP _"),
   174   ("_aprop",       "aprop => prop",                 Delimfix "PROP _"),
   175   ("",          "prop => asms",                   Delimfix "_"),
   175   ("",             "prop => asms",                  Delimfix "_"),
   176   ("_asms",     "[prop, asms] => asms",           Delimfix "_;/ _"),
   176   ("_asms",        "[prop, asms] => asms",          Delimfix "_;/ _"),
   177   ("_bigimpl",  "[asms, prop] => prop",           Mixfix ("((3[| _ |])/ ==> _)", [0, 1], 1)),
   177   ("_bigimpl",     "[asms, prop] => prop",          Mixfix ("((3[| _ |])/ ==> _)", [0, 1], 1)),
   178   ("_ofclass",  "[type, logic] => prop",          Delimfix "(1OFCLASS/(1'(_,/ _')))"),
   178   ("_ofclass",     "[type, logic] => prop",         Delimfix "(1OFCLASS/(1'(_,/ _')))"),
   179   ("_K",        "'a",                             NoSyn),
   179   ("_mk_ofclass",  "_",                             NoSyn),
   180   ("",          "id => logic",                    Delimfix "_"),
   180   ("_mk_ofclassS", "_",                             NoSyn),
   181   ("",          "var => logic",                   Delimfix "_")];
   181   ("_K",           "_",                             NoSyn),
       
   182   ("",             "id => logic",                   Delimfix "_"),
       
   183   ("",             "var => logic",                  Delimfix "_")];
   182 
   184 
   183 val pure_appl_syntax =
   185 val pure_appl_syntax =
   184  [("_appl",     "[('b => 'a), args] => logic",    Mixfix ("(1_/(1'(_')))", [max_pri, 0], max_pri)),
   186  [("_appl", "[('b => 'a), args] => logic", Mixfix ("(1_/(1'(_')))", [max_pri, 0], max_pri)),
   185   ("_appl",     "[('b => 'a), args] => aprop",    Mixfix ("(1_/(1'(_')))", [max_pri, 0], max_pri))];
   187   ("_appl", "[('b => 'a), args] => aprop", Mixfix ("(1_/(1'(_')))", [max_pri, 0], max_pri))];
   186 
   188 
   187 val pure_applC_syntax =
   189 val pure_applC_syntax =
   188  [("",           "'a => cargs",                   Delimfix "_"),
   190  [("",       "'a => cargs",                  Delimfix "_"),
   189   ("_cargs",     "['a, cargs] => cargs",          Mixfix ("_/ _", [max_pri, max_pri], max_pri)),
   191   ("_cargs", "['a, cargs] => cargs",         Mixfix ("_/ _", [max_pri, max_pri], max_pri)),
   190   ("_applC",     "[('b => 'a), cargs] => logic",  Mixfix ("(1_/ _)", [max_pri, max_pri], max_pri - 1)),
   192   ("_applC", "[('b => 'a), cargs] => logic", Mixfix ("(1_/ _)", [max_pri, max_pri], max_pri - 1)),
   191   ("_applC",     "[('b => 'a), cargs] => aprop",  Mixfix ("(1_/ _)", [max_pri, max_pri], max_pri - 1))];
   193   ("_applC", "[('b => 'a), cargs] => aprop", Mixfix ("(1_/ _)", [max_pri, max_pri], max_pri - 1))];
   192 
   194 
   193 val pure_sym_syntax =
   195 val pure_sym_syntax =
   194  [("fun",      "[type, type] => type",            Mixfix ("(_/ \\<Rightarrow> _)", [1, 0], 0)),
   196  [("fun",      "[type, type] => type",  Mixfix ("(_/ \\<Rightarrow> _)", [1, 0], 0)),
   195   ("_bracket", "[types, type] => type",           Mixfix ("([_]/ \\<Rightarrow> _)", [0, 0], 0)),
   197   ("_bracket", "[types, type] => type", Mixfix ("([_]/ \\<Rightarrow> _)", [0, 0], 0)),
   196   ("_lambda",  "[idts, 'a] => logic",             Mixfix ("(3\\<lambda>_./ _)", [], 0)),
   198   ("_lambda",  "[idts, 'a] => logic",   Mixfix ("(3\\<lambda>_./ _)", [], 0)),
   197   ("==>",      "[prop, prop] => prop",            InfixrName ("\\<Midarrow>\\<Rightarrow>", 1)),
   199   ("==>",      "[prop, prop] => prop",  InfixrName ("\\<Midarrow>\\<Rightarrow>", 1)),
   198   ("_bigimpl", "[asms, prop] => prop",            Mixfix ("((3\\<lbrakk>_\\<rbrakk>)/ \\<Midarrow>\\<Rightarrow> _)", [0, 1], 1)),
   200   ("_bigimpl", "[asms, prop] => prop",  Mixfix ("((3\\<lbrakk>_\\<rbrakk>)/ \\<Midarrow>\\<Rightarrow> _)", [0, 1], 1)),
   199   ("==",       "['a::{}, 'a] => prop",            InfixrName ("\\<equiv>", 2)),
   201   ("==",       "['a::{}, 'a] => prop",  InfixrName ("\\<equiv>", 2)),
   200   ("!!",       "[idts, prop] => prop",            Mixfix ("(3\\<And>_./ _)", [0, 0], 0))];
   202   ("!!",       "[idts, prop] => prop",  Mixfix ("(3\\<And>_./ _)", [0, 0], 0))];
   201 
   203 
   202 end;
   204 end;