| author | wenzelm | 
| Wed, 01 Aug 2012 15:50:50 +0200 | |
| changeset 48635 | bfce940c6f38 | 
| parent 46483 | 10a9c31a22b4 | 
| child 49674 | dbadb4d03cbc | 
| permissions | -rw-r--r-- | 
| 3987 | 1  | 
(* Title: Pure/pure_thy.ML  | 
2  | 
Author: Markus Wenzel, TU Muenchen  | 
|
3  | 
||
| 
39557
 
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
 
wenzelm 
parents: 
39507 
diff
changeset
 | 
4  | 
Pure theory syntax and further logical content.  | 
| 3987 | 5  | 
*)  | 
6  | 
||
7  | 
signature PURE_THY =  | 
|
8  | 
sig  | 
|
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
9  | 
val old_appl_syntax: theory -> bool  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
10  | 
val old_appl_syntax_setup: theory -> theory  | 
| 3987 | 11  | 
end;  | 
12  | 
||
| 
39557
 
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
 
wenzelm 
parents: 
39507 
diff
changeset
 | 
13  | 
structure Pure_Thy: PURE_THY =  | 
| 3987 | 14  | 
struct  | 
15  | 
||
| 33384 | 16  | 
val typ = Simple_Syntax.read_typ;  | 
17  | 
val prop = Simple_Syntax.read_prop;  | 
|
| 
35429
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
18  | 
|
| 
42290
 
b1f544c84040
discontinued special treatment of structure Lexicon;
 
wenzelm 
parents: 
42288 
diff
changeset
 | 
19  | 
val tycon = Lexicon.mark_type;  | 
| 
 
b1f544c84040
discontinued special treatment of structure Lexicon;
 
wenzelm 
parents: 
42288 
diff
changeset
 | 
20  | 
val const = Lexicon.mark_const;  | 
| 24243 | 21  | 
|
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
22  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
23  | 
(* application syntax variants *)  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
24  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
25  | 
val appl_syntax =  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
26  | 
 [("_appl", typ "('b => 'a) => args => logic", Mixfix ("(1_/(1'(_')))", [1000, 0], 1000)),
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
27  | 
  ("_appl", typ "('b => 'a) => args => aprop", Mixfix ("(1_/(1'(_')))", [1000, 0], 1000))];
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
28  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
29  | 
val applC_syntax =  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
30  | 
 [("",       typ "'a => cargs",                  Delimfix "_"),
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
31  | 
  ("_cargs", typ "'a => cargs => cargs",         Mixfix ("_/ _", [1000, 1000], 1000)),
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
32  | 
  ("_applC", typ "('b => 'a) => cargs => logic", Mixfix ("(1_/ _)", [1000, 1000], 999)),
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
33  | 
  ("_applC", typ "('b => 'a) => cargs => aprop", Mixfix ("(1_/ _)", [1000, 1000], 999))];
 | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
34  | 
|
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
36744 
diff
changeset
 | 
35  | 
structure Old_Appl_Syntax = Theory_Data  | 
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
36  | 
(  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
37  | 
type T = bool;  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
38  | 
val empty = false;  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
39  | 
val extend = I;  | 
| 33522 | 40  | 
fun merge (b1, b2) : T =  | 
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
41  | 
if b1 = b2 then b1  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
42  | 
else error "Cannot merge theories with different application syntax";  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
43  | 
);  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
44  | 
|
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
36744 
diff
changeset
 | 
45  | 
val old_appl_syntax = Old_Appl_Syntax.get;  | 
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
46  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
47  | 
val old_appl_syntax_setup =  | 
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
36744 
diff
changeset
 | 
48  | 
Old_Appl_Syntax.put true #>  | 
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
49  | 
Sign.del_modesyntax_i Syntax.mode_default applC_syntax #>  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
50  | 
Sign.add_syntax_i appl_syntax;  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
51  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
52  | 
|
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
53  | 
(* main content *)  | 
| 
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
54  | 
|
| 26463 | 55  | 
val _ = Context.>> (Context.map_theory  | 
| 33365 | 56  | 
(Sign.map_naming (Name_Space.set_theory_name Context.PureN) #>  | 
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
36744 
diff
changeset
 | 
57  | 
Old_Appl_Syntax.put false #>  | 
| 
42375
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
58  | 
Sign.add_types_global  | 
| 
30344
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
59  | 
[(Binding.name "fun", 2, NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
60  | 
(Binding.name "prop", 0, NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
61  | 
(Binding.name "itself", 1, NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
62  | 
(Binding.name "dummy", 0, NoSyn)]  | 
| 
42375
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
63  | 
#> Sign.add_nonterminals_global (map Binding.name Syntax.basic_nonterms)  | 
| 42294 | 64  | 
#> Sign.add_syntax_i (map (fn x => (x, typ "'a", NoSyn)) Syntax.token_markers)  | 
| 26430 | 65  | 
#> Sign.add_syntax_i  | 
| 42294 | 66  | 
   [("",            typ "prop' => prop",               Delimfix "_"),
 | 
67  | 
    ("",            typ "logic => any",                Delimfix "_"),
 | 
|
68  | 
    ("",            typ "prop' => any",                Delimfix "_"),
 | 
|
69  | 
    ("",            typ "logic => logic",              Delimfix "'(_')"),
 | 
|
70  | 
    ("",            typ "prop' => prop'",              Delimfix "'(_')"),
 | 
|
71  | 
    ("_constrain",  typ "logic => type => logic",      Mixfix ("_::_", [4, 0], 3)),
 | 
|
72  | 
    ("_constrain",  typ "prop' => type => prop'",      Mixfix ("_::_", [4, 0], 3)),
 | 
|
73  | 
    ("",            typ "tid => type",                 Delimfix "_"),
 | 
|
| 
42263
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
74  | 
    ("",            typ "tvar => type",                Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
75  | 
    ("",            typ "type_name => type",           Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
76  | 
    ("_type_name",  typ "id => type_name",             Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
77  | 
    ("_type_name",  typ "longid => type_name",         Delimfix "_"),
 | 
| 
42297
 
140f283266b7
discontinued Syntax.max_pri, which is not really a symbolic parameter;
 
wenzelm 
parents: 
42296 
diff
changeset
 | 
78  | 
    ("_ofsort",     typ "tid => sort => type",         Mixfix ("_::_", [1000, 0], 1000)),
 | 
| 
 
140f283266b7
discontinued Syntax.max_pri, which is not really a symbolic parameter;
 
wenzelm 
parents: 
42296 
diff
changeset
 | 
79  | 
    ("_ofsort",     typ "tvar => sort => type",        Mixfix ("_::_", [1000, 0], 1000)),
 | 
| 
 
140f283266b7
discontinued Syntax.max_pri, which is not really a symbolic parameter;
 
wenzelm 
parents: 
42296 
diff
changeset
 | 
80  | 
    ("_dummy_ofsort", typ "sort => type",              Mixfix ("'_()::_", [0], 1000)),
 | 
| 
42263
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
81  | 
    ("",            typ "class_name => sort",          Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
82  | 
    ("_class_name", typ "id => class_name",            Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
83  | 
    ("_class_name", typ "longid => class_name",        Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
84  | 
    ("_topsort",    typ "sort",                        Delimfix "{}"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
85  | 
    ("_sort",       typ "classes => sort",             Delimfix "{_}"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
86  | 
    ("",            typ "class_name => classes",       Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
87  | 
    ("_classes",    typ "class_name => classes => classes", Delimfix "_,_"),
 | 
| 
42297
 
140f283266b7
discontinued Syntax.max_pri, which is not really a symbolic parameter;
 
wenzelm 
parents: 
42296 
diff
changeset
 | 
88  | 
    ("_tapp",       typ "type => type_name => type",   Mixfix ("_ _", [1000, 0], 1000)),
 | 
| 
42263
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
89  | 
    ("_tappl",      typ "type => types => type_name => type", Delimfix "((1'(_,/ _')) _)"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
90  | 
    ("",            typ "type => types",               Delimfix "_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
91  | 
    ("_types",      typ "type => types => types",      Delimfix "_,/ _"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
92  | 
    ("\\<^type>fun", typ "type => type => type",       Mixfix ("(_/ => _)", [1, 0], 0)),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
93  | 
    ("_bracket",    typ "types => type => type",       Mixfix ("([_]/ => _)", [0, 0], 0)),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
94  | 
    ("",            typ "type => type",                Delimfix "'(_')"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
95  | 
    ("\\<^type>dummy", typ "type",                     Delimfix "'_"),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
96  | 
    ("_type_prop",  typ "'a",                          NoSyn),
 | 
| 
 
49b1b8d0782f
type syntax as regular mixfix specification (type_ext for bootstrapping has been obsolete for many years);
 
wenzelm 
parents: 
42245 
diff
changeset
 | 
97  | 
    ("_lambda",     typ "pttrns => 'a => logic",       Mixfix ("(3%_./ _)", [0, 3], 3)),
 | 
| 26436 | 98  | 
    ("_abs",        typ "'a",                          NoSyn),
 | 
99  | 
    ("",            typ "'a => args",                  Delimfix "_"),
 | 
|
100  | 
    ("_args",       typ "'a => args => args",          Delimfix "_,/ _"),
 | 
|
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
101  | 
    ("",            typ "id_position => idt",          Delimfix "_"),
 | 
| 26436 | 102  | 
    ("_idtdummy",   typ "idt",                         Delimfix "'_"),
 | 
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
103  | 
    ("_idtyp",      typ "id_position => type => idt",  Mixfix ("_::_", [], 0)),
 | 
| 26436 | 104  | 
    ("_idtypdummy", typ "type => idt",                 Mixfix ("'_()::_", [], 0)),
 | 
105  | 
    ("",            typ "idt => idt",                  Delimfix "'(_')"),
 | 
|
106  | 
    ("",            typ "idt => idts",                 Delimfix "_"),
 | 
|
107  | 
    ("_idts",       typ "idt => idts => idts",         Mixfix ("_/ _", [1, 0], 0)),
 | 
|
108  | 
    ("",            typ "idt => pttrn",                Delimfix "_"),
 | 
|
109  | 
    ("",            typ "pttrn => pttrns",             Delimfix "_"),
 | 
|
110  | 
    ("_pttrns",     typ "pttrn => pttrns => pttrns",   Mixfix ("_/ _", [1, 0], 0)),
 | 
|
| 
28856
 
5e009a80fe6d
Pure syntax: more coherent treatment of aprop, permanent TERM and &&&;
 
wenzelm 
parents: 
28841 
diff
changeset
 | 
111  | 
    ("",            typ "aprop => aprop",              Delimfix "'(_')"),
 | 
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
112  | 
    ("",            typ "id_position => aprop",        Delimfix "_"),
 | 
| 
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
113  | 
    ("",            typ "longid_position => aprop",    Delimfix "_"),
 | 
| 26436 | 114  | 
    ("",            typ "var => aprop",                Delimfix "_"),
 | 
115  | 
    ("_DDDOT",      typ "aprop",                       Delimfix "..."),
 | 
|
116  | 
    ("_aprop",      typ "aprop => prop",               Delimfix "PROP _"),
 | 
|
117  | 
    ("_asm",        typ "prop => asms",                Delimfix "_"),
 | 
|
118  | 
    ("_asms",       typ "prop => asms => asms",        Delimfix "_;/ _"),
 | 
|
119  | 
    ("_bigimpl",    typ "asms => prop => prop",        Mixfix ("((3[| _ |])/ ==> _)", [0, 1], 1)),
 | 
|
120  | 
    ("_ofclass",    typ "type => logic => prop",       Delimfix "(1OFCLASS/(1'(_,/ _')))"),
 | 
|
121  | 
    ("_mk_ofclass", typ "dummy",                       NoSyn),
 | 
|
122  | 
    ("_TYPE",       typ "type => logic",               Delimfix "(1TYPE/(1'(_')))"),
 | 
|
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
123  | 
    ("",            typ "id_position => logic",        Delimfix "_"),
 | 
| 
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
124  | 
    ("",            typ "longid_position => logic",    Delimfix "_"),
 | 
| 26436 | 125  | 
    ("",            typ "var => logic",                Delimfix "_"),
 | 
126  | 
    ("_DDDOT",      typ "logic",                       Delimfix "..."),
 | 
|
| 
42057
 
3eba96ff3d3e
more selective strip_positions in case patterns -- reactivate translations based on "case _ of _" in HOL and special patterns in HOLCF;
 
wenzelm 
parents: 
42048 
diff
changeset
 | 
127  | 
    ("_strip_positions", typ "'a", NoSyn),
 | 
| 
46236
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
128  | 
    ("_position",   typ "num_token => num_position",   Delimfix "_"),
 | 
| 
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
129  | 
    ("_position",   typ "float_token => float_position", Delimfix "_"),
 | 
| 
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
130  | 
    ("_position",   typ "xnum_token => xnum_position", Delimfix "_"),
 | 
| 
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
131  | 
    ("_constify",   typ "num_position => num_const",   Delimfix "_"),
 | 
| 
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
132  | 
    ("_constify",   typ "float_position => float_const", Delimfix "_"),
 | 
| 
 
ae79f2978a67
position constraints for numerals enable PIDE markup;
 
wenzelm 
parents: 
45703 
diff
changeset
 | 
133  | 
    ("_constify",   typ "xnum_position => xnum_const", Delimfix "_"),
 | 
| 26436 | 134  | 
    ("_index",      typ "logic => index",              Delimfix "(00\\<^bsub>_\\<^esub>)"),
 | 
135  | 
    ("_indexdefault", typ "index",                     Delimfix ""),
 | 
|
136  | 
    ("_indexvar",   typ "index",                       Delimfix "'\\<index>"),
 | 
|
137  | 
    ("_struct",     typ "index => logic",              Mixfix ("\\<struct>_", [1000], 1000)),
 | 
|
| 
35145
 
f132a4fd8679
moved generic update_name to Pure syntax -- not specific to HOL/record;
 
wenzelm 
parents: 
35130 
diff
changeset
 | 
138  | 
    ("_update_name", typ "idt",                        NoSyn),
 | 
| 
42295
 
8fdbb3b10beb
moved CONST syntax/translations to their proper place;
 
wenzelm 
parents: 
42294 
diff
changeset
 | 
139  | 
    ("_constrainAbs", typ "'a",                        NoSyn),
 | 
| 
42410
 
16bc5564535f
less bulky "_position", for improved readability of parse trees;
 
wenzelm 
parents: 
42375 
diff
changeset
 | 
140  | 
    ("_position",   typ "id => id_position",           Delimfix "_"),
 | 
| 
 
16bc5564535f
less bulky "_position", for improved readability of parse trees;
 
wenzelm 
parents: 
42375 
diff
changeset
 | 
141  | 
    ("_position",   typ "longid => longid_position",   Delimfix "_"),
 | 
| 46483 | 142  | 
    ("_position",   typ "str_token => str_position",   Delimfix "_"),
 | 
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
143  | 
    ("_type_constraint_", typ "'a",                    NoSyn),
 | 
| 42296 | 144  | 
    ("_context_const", typ "id_position => logic",     Delimfix "CONST _"),
 | 
145  | 
    ("_context_const", typ "id_position => aprop",     Delimfix "CONST _"),
 | 
|
146  | 
    ("_context_const", typ "longid_position => logic", Delimfix "CONST _"),
 | 
|
147  | 
    ("_context_const", typ "longid_position => aprop", Delimfix "CONST _"),
 | 
|
148  | 
    ("_context_xconst", typ "id_position => logic",    Delimfix "XCONST _"),
 | 
|
149  | 
    ("_context_xconst", typ "id_position => aprop",    Delimfix "XCONST _"),
 | 
|
150  | 
    ("_context_xconst", typ "longid_position => logic", Delimfix "XCONST _"),
 | 
|
151  | 
    ("_context_xconst", typ "longid_position => aprop", Delimfix "XCONST _"),
 | 
|
| 35255 | 152  | 
(const "==>", typ "prop => prop => prop", Delimfix "op ==>"),  | 
153  | 
(const Term.dummy_patternN, typ "aprop", Delimfix "'_"),  | 
|
| 
28856
 
5e009a80fe6d
Pure syntax: more coherent treatment of aprop, permanent TERM and &&&;
 
wenzelm 
parents: 
28841 
diff
changeset
 | 
154  | 
    ("_sort_constraint", typ "type => prop",           Delimfix "(1SORT'_CONSTRAINT/(1'(_')))"),
 | 
| 35255 | 155  | 
(const "Pure.term", typ "logic => prop", Delimfix "TERM _"),  | 
156  | 
    (const "Pure.conjunction", typ "prop => prop => prop", Infixr ("&&&", 2))]
 | 
|
| 
26959
 
f8f2df3e4d83
theory Pure  provides regular application syntax by default;
 
wenzelm 
parents: 
26693 
diff
changeset
 | 
157  | 
#> Sign.add_syntax_i applC_syntax  | 
| 26430 | 158  | 
#> Sign.add_modesyntax_i (Symbol.xsymbolsN, true)  | 
| 
35429
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
159  | 
   [(tycon "fun",         typ "type => type => type",   Mixfix ("(_/ \\<Rightarrow> _)", [1, 0], 0)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
160  | 
    ("_bracket",          typ "types => type => type",  Mixfix ("([_]/ \\<Rightarrow> _)", [0, 0], 0)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
161  | 
    ("_ofsort",           typ "tid => sort => type",    Mixfix ("_\\<Colon>_", [1000, 0], 1000)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
162  | 
    ("_constrain",        typ "logic => type => logic", Mixfix ("_\\<Colon>_", [4, 0], 3)),
 | 
| 
42293
 
6cca0343ea48
renamed sprop "prop#" to "prop'" -- proper identifier;
 
wenzelm 
parents: 
42290 
diff
changeset
 | 
163  | 
    ("_constrain",        typ "prop' => type => prop'", Mixfix ("_\\<Colon>_", [4, 0], 3)),
 | 
| 
42048
 
afd11ca8e018
support for encoded positions (for id_position, longid_position) as pseudo type-constraints -- still inactive;
 
wenzelm 
parents: 
39557 
diff
changeset
 | 
164  | 
    ("_idtyp",            typ "id_position => type => idt", Mixfix ("_\\<Colon>_", [], 0)),
 | 
| 
35429
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
165  | 
    ("_idtypdummy",       typ "type => idt",            Mixfix ("'_()\\<Colon>_", [], 0)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
166  | 
    ("_lambda",           typ "pttrns => 'a => logic",  Mixfix ("(3\\<lambda>_./ _)", [0, 3], 3)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
167  | 
    (const "==",          typ "'a => 'a => prop",       Infixr ("\\<equiv>", 2)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
168  | 
    (const "all_binder",  typ "idts => prop => prop",   Mixfix ("(3\\<And>_./ _)", [0, 0], 0)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
169  | 
    (const "==>",         typ "prop => prop => prop",   Infixr ("\\<Longrightarrow>", 1)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
170  | 
    ("_DDDOT",            typ "aprop",                  Delimfix "\\<dots>"),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
171  | 
    ("_bigimpl",          typ "asms => prop => prop",   Mixfix ("((1\\<lbrakk>_\\<rbrakk>)/ \\<Longrightarrow> _)", [0, 1], 1)),
 | 
| 
 
afa8cf9e63d8
authentic syntax for classes and type constructors;
 
wenzelm 
parents: 
35262 
diff
changeset
 | 
172  | 
    ("_DDDOT",            typ "logic",                  Delimfix "\\<dots>")]
 | 
| 26430 | 173  | 
  #> Sign.add_modesyntax_i ("", false)
 | 
| 35255 | 174  | 
   [(const "prop", typ "prop => prop", Mixfix ("_", [0], 0))]
 | 
| 26430 | 175  | 
  #> Sign.add_modesyntax_i ("HTML", false)
 | 
| 24243 | 176  | 
   [("_lambda", typ "pttrns => 'a => logic", Mixfix ("(3\\<lambda>_./ _)", [0, 3], 3))]
 | 
| 26430 | 177  | 
#> Sign.add_consts_i  | 
| 35130 | 178  | 
   [(Binding.name "==", typ "'a => 'a => prop", Infixr ("==", 2)),
 | 
| 
30344
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
179  | 
    (Binding.name "==>", typ "prop => prop => prop", Mixfix ("(_/ ==> _)", [2, 1], 1)),
 | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
180  | 
    (Binding.name "all", typ "('a => prop) => prop", Binder ("!!", 0, 0)),
 | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
181  | 
(Binding.name "prop", typ "prop => prop", NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
182  | 
(Binding.name "TYPE", typ "'a itself", NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
183  | 
(Binding.name Term.dummy_patternN, typ "'a", Delimfix "'_")]  | 
| 
42375
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
184  | 
  #> Theory.add_deps_global "==" ("==", typ "'a => 'a => prop") []
 | 
| 
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
185  | 
  #> Theory.add_deps_global "==>" ("==>", typ "prop => prop => prop") []
 | 
| 
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
186  | 
  #> Theory.add_deps_global "all" ("all", typ "('a => prop) => prop") []
 | 
| 
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
187  | 
  #> Theory.add_deps_global "TYPE" ("TYPE", typ "'a itself") []
 | 
| 
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
188  | 
#> Theory.add_deps_global Term.dummy_patternN (Term.dummy_patternN, typ "'a") []  | 
| 42284 | 189  | 
#> Sign.add_trfuns Syntax_Trans.pure_trfuns  | 
| 26430 | 190  | 
#> Sign.local_path  | 
191  | 
#> Sign.add_consts_i  | 
|
| 
30344
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
192  | 
[(Binding.name "term", typ "'a => prop", NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
193  | 
(Binding.name "sort_constraint", typ "'a itself => prop", NoSyn),  | 
| 
 
10a67c5ddddb
more uniform handling of binding in targets and derived elements;
 
wenzelm 
parents: 
30337 
diff
changeset
 | 
194  | 
(Binding.name "conjunction", typ "prop => prop => prop", NoSyn)]  | 
| 
39557
 
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
 
wenzelm 
parents: 
39507 
diff
changeset
 | 
195  | 
#> (Global_Theory.add_defs false o map Thm.no_attributes)  | 
| 29579 | 196  | 
[(Binding.name "prop_def", prop "(CONST prop :: prop => prop) (A::prop) == A::prop"),  | 
197  | 
(Binding.name "term_def", prop "(CONST Pure.term :: 'a => prop) (x::'a) == (!!A::prop. A ==> A)"),  | 
|
198  | 
(Binding.name "sort_constraint_def",  | 
|
| 
28622
 
1a0b845855ac
added const sort_constraint with syntax SORT_CONSTRAINT -- logically vacous;
 
wenzelm 
parents: 
28076 
diff
changeset
 | 
199  | 
prop "(CONST Pure.sort_constraint :: 'a itself => prop) (CONST TYPE :: 'a itself) ==\  | 
| 
 
1a0b845855ac
added const sort_constraint with syntax SORT_CONSTRAINT -- logically vacous;
 
wenzelm 
parents: 
28076 
diff
changeset
 | 
200  | 
\ (CONST Pure.term :: 'a itself => prop) (CONST TYPE :: 'a itself)"),  | 
| 29579 | 201  | 
(Binding.name "conjunction_def", prop "(A &&& B) == (!!C::prop. (A ==> B ==> C) ==> C)")] #> snd  | 
| 
28622
 
1a0b845855ac
added const sort_constraint with syntax SORT_CONSTRAINT -- logically vacous;
 
wenzelm 
parents: 
28076 
diff
changeset
 | 
202  | 
#> Sign.hide_const false "Pure.term"  | 
| 
 
1a0b845855ac
added const sort_constraint with syntax SORT_CONSTRAINT -- logically vacous;
 
wenzelm 
parents: 
28076 
diff
changeset
 | 
203  | 
#> Sign.hide_const false "Pure.sort_constraint"  | 
| 26666 | 204  | 
#> Sign.hide_const false "Pure.conjunction"  | 
| 
39557
 
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
 
wenzelm 
parents: 
39507 
diff
changeset
 | 
205  | 
#> Global_Theory.add_thmss [((Binding.name "nothing", []), [])] #> snd  | 
| 
42375
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
206  | 
#> fold (fn (a, prop) =>  | 
| 
 
774df7c59508
report Name_Space.declare/define, relatively to context;
 
wenzelm 
parents: 
42297 
diff
changeset
 | 
207  | 
snd o Thm.add_axiom_global (Binding.name a, prop)) Proofterm.equality_axms));  | 
| 3987 | 208  | 
|
209  | 
end;  |