src/Pure/pure_thy.ML
changeset 80897 5328d67ec647
parent 80753 66893c47500d
child 80916 01b8c8d17f13
equal deleted inserted replaced
80896:d0d0d12cd4cc 80897:5328d67ec647
    53 
    53 
    54 val old_appl_syntax = Old_Appl_Syntax.get;
    54 val old_appl_syntax = Old_Appl_Syntax.get;
    55 
    55 
    56 val old_appl_syntax_setup =
    56 val old_appl_syntax_setup =
    57   Old_Appl_Syntax.put true #>
    57   Old_Appl_Syntax.put true #>
    58   Sign.syntax false Syntax.mode_default applC_syntax #>
    58   Sign.syntax_global false Syntax.mode_default applC_syntax #>
    59   Sign.syntax true Syntax.mode_default appl_syntax;
    59   Sign.syntax_global true Syntax.mode_default appl_syntax;
    60 
    60 
    61 
    61 
    62 (* main content *)
    62 (* main content *)
    63 
    63 
    64 val token_markers =
    64 val token_markers =
    85         "any", "prop'", "num_const", "float_const", "num_position",
    85         "any", "prop'", "num_const", "float_const", "num_position",
    86         "float_position", "index", "struct", "tid_position",
    86         "float_position", "index", "struct", "tid_position",
    87         "tvar_position", "id_position", "longid_position", "var_position",
    87         "tvar_position", "id_position", "longid_position", "var_position",
    88         "str_position", "string_position", "cartouche_position", "type_name",
    88         "str_position", "string_position", "cartouche_position", "type_name",
    89         "class_name"]))
    89         "class_name"]))
    90   #> Sign.syntax true Syntax.mode_default (map (fn x => (x, typ "'a", NoSyn)) token_markers)
    90   #> Sign.syntax_global true Syntax.mode_default (map (fn x => (x, typ "'a", NoSyn)) token_markers)
    91   #> Sign.syntax true Syntax.mode_default
    91   #> Sign.syntax_global true Syntax.mode_default
    92    [("",            typ "prop' \<Rightarrow> prop",               Mixfix.mixfix "_"),
    92    [("",            typ "prop' \<Rightarrow> prop",               Mixfix.mixfix "_"),
    93     ("",            typ "logic \<Rightarrow> any",                Mixfix.mixfix "_"),
    93     ("",            typ "logic \<Rightarrow> any",                Mixfix.mixfix "_"),
    94     ("",            typ "prop' \<Rightarrow> any",                Mixfix.mixfix "_"),
    94     ("",            typ "prop' \<Rightarrow> any",                Mixfix.mixfix "_"),
    95     ("",            typ "logic \<Rightarrow> logic",              Mixfix.mixfix "'(_')"),
    95     ("",            typ "logic \<Rightarrow> logic",              Mixfix.mixfix "'(_')"),
    96     ("",            typ "prop' \<Rightarrow> prop'",              Mixfix.mixfix "'(_')"),
    96     ("",            typ "prop' \<Rightarrow> prop'",              Mixfix.mixfix "'(_')"),
   182     ("_context_xconst", typ "longid_position \<Rightarrow> aprop", Mixfix.mixfix "XCONST _"),
   182     ("_context_xconst", typ "longid_position \<Rightarrow> aprop", Mixfix.mixfix "XCONST _"),
   183     (const "Pure.dummy_pattern", typ "aprop",          Mixfix.mixfix "'_"),
   183     (const "Pure.dummy_pattern", typ "aprop",          Mixfix.mixfix "'_"),
   184     ("_sort_constraint", typ "type \<Rightarrow> prop",           Mixfix.mixfix "(1SORT'_CONSTRAINT/(1'(_')))"),
   184     ("_sort_constraint", typ "type \<Rightarrow> prop",           Mixfix.mixfix "(1SORT'_CONSTRAINT/(1'(_')))"),
   185     (const "Pure.term", typ "logic \<Rightarrow> prop",           Mixfix.mixfix "TERM _"),
   185     (const "Pure.term", typ "logic \<Rightarrow> prop",           Mixfix.mixfix "TERM _"),
   186     (const "Pure.conjunction", typ "prop \<Rightarrow> prop \<Rightarrow> prop", infixr_ ("&&&", 2))]
   186     (const "Pure.conjunction", typ "prop \<Rightarrow> prop \<Rightarrow> prop", infixr_ ("&&&", 2))]
   187   #> Sign.syntax true Syntax.mode_default applC_syntax
   187   #> Sign.syntax_global true Syntax.mode_default applC_syntax
   188   #> Sign.syntax true (Print_Mode.ASCII, true)
   188   #> Sign.syntax_global true (Print_Mode.ASCII, true)
   189    [(tycon "fun",         typ "type \<Rightarrow> type \<Rightarrow> type",   mixfix ("(_/ => _)", [1, 0], 0)),
   189    [(tycon "fun",         typ "type \<Rightarrow> type \<Rightarrow> type",   mixfix ("(_/ => _)", [1, 0], 0)),
   190     ("_bracket",          typ "types \<Rightarrow> type \<Rightarrow> type",  mixfix ("([_]/ => _)", [0, 0], 0)),
   190     ("_bracket",          typ "types \<Rightarrow> type \<Rightarrow> type",  mixfix ("([_]/ => _)", [0, 0], 0)),
   191     ("_lambda",           typ "pttrns \<Rightarrow> 'a \<Rightarrow> logic",  mixfix ("(3%_./ _)", [0, 3], 3)),
   191     ("_lambda",           typ "pttrns \<Rightarrow> 'a \<Rightarrow> logic",  mixfix ("(3%_./ _)", [0, 3], 3)),
   192     (const "Pure.eq",     typ "'a \<Rightarrow> 'a \<Rightarrow> prop",       infix_ ("==", 2)),
   192     (const "Pure.eq",     typ "'a \<Rightarrow> 'a \<Rightarrow> prop",       infix_ ("==", 2)),
   193     (const "Pure.all_binder", typ "idts \<Rightarrow> prop \<Rightarrow> prop", mixfix ("(3!!_./ _)", [0, 0], 0)),
   193     (const "Pure.all_binder", typ "idts \<Rightarrow> prop \<Rightarrow> prop", mixfix ("(3!!_./ _)", [0, 0], 0)),
   194     (const "Pure.imp",    typ "prop \<Rightarrow> prop \<Rightarrow> prop",   infixr_ ("==>", 1)),
   194     (const "Pure.imp",    typ "prop \<Rightarrow> prop \<Rightarrow> prop",   infixr_ ("==>", 1)),
   195     ("_DDDOT",            typ "aprop",                  Mixfix.mixfix "..."),
   195     ("_DDDOT",            typ "aprop",                  Mixfix.mixfix "..."),
   196     ("_bigimpl",          typ "asms \<Rightarrow> prop \<Rightarrow> prop",   mixfix ("((3[| _ |])/ ==> _)", [0, 1], 1)),
   196     ("_bigimpl",          typ "asms \<Rightarrow> prop \<Rightarrow> prop",   mixfix ("((3[| _ |])/ ==> _)", [0, 1], 1)),
   197     ("_DDDOT",            typ "logic",                  Mixfix.mixfix "...")]
   197     ("_DDDOT",            typ "logic",                  Mixfix.mixfix "...")]
   198   #> Sign.syntax true ("", false)
   198   #> Sign.syntax_global true ("", false)
   199    [(const "Pure.prop", typ "prop \<Rightarrow> prop", mixfix ("_", [0], 0))]
   199    [(const "Pure.prop", typ "prop \<Rightarrow> prop", mixfix ("_", [0], 0))]
   200   #> Sign.add_consts
   200   #> Sign.add_consts
   201    [(qualify (Binding.make ("eq", \<^here>)), typ "'a \<Rightarrow> 'a \<Rightarrow> prop", infix_ ("\<equiv>", 2)),
   201    [(qualify (Binding.make ("eq", \<^here>)), typ "'a \<Rightarrow> 'a \<Rightarrow> prop", infix_ ("\<equiv>", 2)),
   202     (qualify (Binding.make ("imp", \<^here>)), typ "prop \<Rightarrow> prop \<Rightarrow> prop", infixr_ ("\<Longrightarrow>", 1)),
   202     (qualify (Binding.make ("imp", \<^here>)), typ "prop \<Rightarrow> prop \<Rightarrow> prop", infixr_ ("\<Longrightarrow>", 1)),
   203     (qualify (Binding.make ("all", \<^here>)), typ "('a \<Rightarrow> prop) \<Rightarrow> prop", binder ("\<And>", 0, 0)),
   203     (qualify (Binding.make ("all", \<^here>)), typ "('a \<Rightarrow> prop) \<Rightarrow> prop", binder ("\<And>", 0, 0)),