src/Pure/Isar/named_target.ML
author haftmann
Mon, 06 Feb 2017 20:56:34 +0100
changeset 64990 c6a7de505796
parent 63402 f199837304d7
child 66259 b5279a21e658
permissions -rw-r--r--
more explicit errors in pathological cases
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41959
b460124855b8 tuned headers;
wenzelm
parents: 41585
diff changeset
     1
(*  Title:      Pure/Isar/named_target.ML
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
30437
910a7aeb8dec more precise treatment of qualified bindings;
wenzelm
parents: 30364
diff changeset
     3
    Author:     Florian Haftmann, TU Muenchen
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
     4
47066
8a6124d09ff5 basic support for nested contexts including bundles;
wenzelm
parents: 47061
diff changeset
     5
Targets for theory, locale, class -- at the bottom the nested structure.
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
     6
*)
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
     7
38350
480b2de9927c renamed Theory_Target to the more appropriate Named_Target
haftmann
parents: 38349
diff changeset
     8
signature NAMED_TARGET =
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
     9
sig
52140
88a69da5d3fa tuned structure
haftmann
parents: 52103
diff changeset
    10
  val is_theory: local_theory -> bool
57182
79d43c510b84 less baroque interface
haftmann
parents: 57181
diff changeset
    11
  val locale_of: local_theory -> string option
57195
ec0e10f11276 recovered level-free fishing for locale, accidentally lost in dce365931721
haftmann
parents: 57193
diff changeset
    12
  val bottom_locale_of: local_theory -> string option
57182
79d43c510b84 less baroque interface
haftmann
parents: 57181
diff changeset
    13
  val class_of: local_theory -> string option
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
    14
  val init: (local_theory -> local_theory) option -> string -> theory -> local_theory
38388
94d5624dd1f7 Named_Target.theory_init
haftmann
parents: 38381
diff changeset
    15
  val theory_init: theory -> local_theory
58665
50b229a5a097 tuned signature;
wenzelm
parents: 57485
diff changeset
    16
  val theory_map: (local_theory -> local_theory) -> theory -> theory
57483
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
    17
  val begin: xstring * Position.T -> theory -> local_theory
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
    18
  val exit: local_theory -> theory
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
    19
  val switch: (xstring * Position.T) option -> Context.generic ->
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
    20
    (local_theory -> Context.generic) * local_theory
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
    21
end;
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
    22
38350
480b2de9927c renamed Theory_Target to the more appropriate Named_Target
haftmann
parents: 38349
diff changeset
    23
structure Named_Target: NAMED_TARGET =
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
    24
struct
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
    25
21006
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    26
(* context data *)
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    27
33519
e31a85f92ce9 adapted Generic_Data, Proof_Data;
wenzelm
parents: 33466
diff changeset
    28
structure Data = Proof_Data
21006
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    29
(
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    30
  type T = (string * bool) option;
38391
ba1cc1815ce1 named target is optional; explicit Name_Target.reinit
haftmann
parents: 38389
diff changeset
    31
  fun init _ = NONE;
21006
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    32
);
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    33
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    34
val get_bottom_data = Data.get;
57195
ec0e10f11276 recovered level-free fishing for locale, accidentally lost in dce365931721
haftmann
parents: 57193
diff changeset
    35
ec0e10f11276 recovered level-free fishing for locale, accidentally lost in dce365931721
haftmann
parents: 57193
diff changeset
    36
fun get_data lthy =
57177
dce365931721 sharpened criterion: bare named target is only at the bottom level
haftmann
parents: 57176
diff changeset
    37
  if Local_Theory.level lthy = 1
57195
ec0e10f11276 recovered level-free fishing for locale, accidentally lost in dce365931721
haftmann
parents: 57193
diff changeset
    38
  then get_bottom_data lthy
57177
dce365931721 sharpened criterion: bare named target is only at the bottom level
haftmann
parents: 57176
diff changeset
    39
  else NONE;
21006
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    40
57185
haftmann
parents: 57184
diff changeset
    41
fun is_theory lthy =
63268
wenzelm
parents: 62514
diff changeset
    42
  (case get_data lthy of
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    43
    SOME ("", _) => true
63268
wenzelm
parents: 62514
diff changeset
    44
  | _ => false);
52140
88a69da5d3fa tuned structure
haftmann
parents: 52103
diff changeset
    45
57484
cc309f3c0490 restore exactly named target, prevent non-named targets to participate in the ad-hoc switch game
haftmann
parents: 57483
diff changeset
    46
fun target_of lthy =
63268
wenzelm
parents: 62514
diff changeset
    47
  (case get_data lthy of
57484
cc309f3c0490 restore exactly named target, prevent non-named targets to participate in the ad-hoc switch game
haftmann
parents: 57483
diff changeset
    48
    NONE => error "Not in a named target"
63268
wenzelm
parents: 62514
diff changeset
    49
  | SOME (target, _) => target);
57484
cc309f3c0490 restore exactly named target, prevent non-named targets to participate in the ad-hoc switch game
haftmann
parents: 57483
diff changeset
    50
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    51
fun locale_name_of NONE = NONE
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    52
  | locale_name_of (SOME ("", _)) = NONE
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    53
  | locale_name_of (SOME (locale, _)) = SOME locale;
57195
ec0e10f11276 recovered level-free fishing for locale, accidentally lost in dce365931721
haftmann
parents: 57193
diff changeset
    54
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    55
val locale_of = locale_name_of o get_data;
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    56
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    57
val bottom_locale_of = locale_name_of o get_bottom_data;
57182
79d43c510b84 less baroque interface
haftmann
parents: 57181
diff changeset
    58
79d43c510b84 less baroque interface
haftmann
parents: 57181
diff changeset
    59
fun class_of lthy =
63268
wenzelm
parents: 62514
diff changeset
    60
  (case get_data lthy of
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    61
    SOME (class, true) => SOME class
63268
wenzelm
parents: 62514
diff changeset
    62
  | _ => NONE);
57182
79d43c510b84 less baroque interface
haftmann
parents: 57181
diff changeset
    63
21006
ac2732072403 added peek;
wenzelm
parents: 20984
diff changeset
    64
61777
f9e05eab6e3c tuned sections
haftmann
parents: 60344
diff changeset
    65
(* operations *)
38318
1fade69519ab different foundations for different targets; simplified syntax handling of abbreviations
haftmann
parents: 38314
diff changeset
    66
57074
9a631586e3e5 tuned names
haftmann
parents: 57073
diff changeset
    67
fun locale_foundation locale (((b, U), mx), (b_def, rhs)) params =
47289
wenzelm
parents: 47288
diff changeset
    68
  Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
57074
9a631586e3e5 tuned names
haftmann
parents: 57073
diff changeset
    69
  #-> (fn (lhs, def) => Generic_Target.locale_const locale Syntax.mode_default ((b, mx), lhs)
47282
57d486231c92 more general standard_declaration;
wenzelm
parents: 47279
diff changeset
    70
    #> pair (lhs, def));
38318
1fade69519ab different foundations for different targets; simplified syntax handling of abbreviations
haftmann
parents: 38314
diff changeset
    71
57074
9a631586e3e5 tuned names
haftmann
parents: 57073
diff changeset
    72
fun class_foundation class (((b, U), mx), (b_def, rhs)) params =
47289
wenzelm
parents: 47288
diff changeset
    73
  Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
57074
9a631586e3e5 tuned names
haftmann
parents: 57073
diff changeset
    74
  #-> (fn (lhs, def) => Class.const class ((b, mx), lhs) params
47282
57d486231c92 more general standard_declaration;
wenzelm
parents: 47279
diff changeset
    75
    #> pair (lhs, def));
38318
1fade69519ab different foundations for different targets; simplified syntax handling of abbreviations
haftmann
parents: 38314
diff changeset
    76
60341
fcbd7f0c52c3 clearly separated target primitives (target_foo) from self-contained target operations (foo)
haftmann
parents: 60244
diff changeset
    77
fun foundation ("", _) = Generic_Target.theory_target_foundation
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    78
  | foundation (locale, false) = locale_foundation locale
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    79
  | foundation (class, true) = class_foundation class;
38303
ad4b59e9d0f9 factored out foundation of `define` into separate function
haftmann
parents: 38302
diff changeset
    80
60341
fcbd7f0c52c3 clearly separated target primitives (target_foo) from self-contained target operations (foo)
haftmann
parents: 60244
diff changeset
    81
fun notes ("", _) = Generic_Target.theory_target_notes
fcbd7f0c52c3 clearly separated target primitives (target_foo) from self-contained target operations (foo)
haftmann
parents: 60244
diff changeset
    82
  | notes (locale, _) = Generic_Target.locale_target_notes locale;
38308
0e4649095739 try to uniformly follow define/note/abbrev/declaration order as close as possible
haftmann
parents: 38307
diff changeset
    83
60344
a40369ea3ba5 self-contained formulation of abbrev for named targets
haftmann
parents: 60341
diff changeset
    84
fun abbrev ("", _) = Generic_Target.theory_abbrev
a40369ea3ba5 self-contained formulation of abbrev for named targets
haftmann
parents: 60341
diff changeset
    85
  | abbrev (locale, false) = Generic_Target.locale_abbrev locale
a40369ea3ba5 self-contained formulation of abbrev for named targets
haftmann
parents: 60341
diff changeset
    86
  | abbrev (class, true) = Class.abbrev class;
38308
0e4649095739 try to uniformly follow define/note/abbrev/declaration order as close as possible
haftmann
parents: 38307
diff changeset
    87
62239
wenzelm
parents: 61890
diff changeset
    88
fun declaration ("", _) _ decl = Generic_Target.theory_declaration decl
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    89
  | declaration (locale, _) flags decl = Generic_Target.locale_declaration locale flags decl;
47246
2bbab021c0e6 clarified Named_Target.target_declaration: propagate through other levels as well;
wenzelm
parents: 47081
diff changeset
    90
61890
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    91
fun theory_registration ("", _) = Generic_Target.theory_registration
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    92
  | theory_registration _ = (fn _ => error "Not possible in theory target");
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    93
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    94
fun locale_dependency ("", false) = (fn _ => error "Not possible in locale target")
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    95
  | locale_dependency ("", true) = (fn _ => error "Not possible in class target")
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
    96
  | locale_dependency (locale, _) = Generic_Target.locale_dependency locale;
56723
a8f71445c265 subscription as target-specific implementation device
haftmann
parents: 56056
diff changeset
    97
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
    98
fun pretty (target, is_class) ctxt =
60244
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
    99
  if target = "" then
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   100
    [Pretty.block [Pretty.keyword1 "theory", Pretty.brk 1,
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   101
      Pretty.str (Context.theory_name (Proof_Context.theory_of ctxt))]]
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   102
  else if is_class then Class.pretty_specification (Proof_Context.theory_of ctxt) target
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   103
  else
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   104
    (* FIXME pretty locale content *)
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   105
    let
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   106
      val target_name = [Pretty.keyword1 "locale", Pretty.brk 1, Locale.pretty_name ctxt target];
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   107
      val fixes =
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   108
        map (fn (x, T) => (Binding.name x, SOME T, NoSyn))
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   109
          (#1 (Proof_Context.inferred_fixes ctxt));
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   110
      val assumes =
63352
4eaf35781b23 tuned signature;
wenzelm
parents: 63268
diff changeset
   111
        map (fn A => (Binding.empty_atts, [(Thm.term_of A, [])]))
60244
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   112
          (Assumption.all_assms_of ctxt);
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   113
      val elems =
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   114
        (if null fixes then [] else [Element.Fixes fixes]) @
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   115
        (if null assumes then [] else [Element.Assumes assumes]);
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   116
    in
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   117
      if null elems then [Pretty.block target_name]
39639
haftmann
parents: 39557
diff changeset
   118
      else [Pretty.block (Pretty.fbreaks (Pretty.block (target_name @ [Pretty.str " ="]) ::
60244
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   119
        map (Pretty.chunks o Element.pretty_ctxt ctxt) elems))]
523ec7e4b022 tuned output;
wenzelm
parents: 59880
diff changeset
   120
    end;
38308
0e4649095739 try to uniformly follow define/note/abbrev/declaration order as close as possible
haftmann
parents: 38307
diff changeset
   121
0e4649095739 try to uniformly follow define/note/abbrev/declaration order as close as possible
haftmann
parents: 38307
diff changeset
   122
38378
haftmann
parents: 38350
diff changeset
   123
(* init *)
25291
870455627720 misc cleanup of init functions;
wenzelm
parents: 25269
diff changeset
   124
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   125
fun make_name_data _ "" = ("", false)
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   126
  | make_name_data thy target =
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   127
      if Locale.defined thy target
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   128
      then (target, Class.is_class thy target)
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   129
      else error ("No such locale: " ^ quote target);
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   130
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   131
fun init_context ("", _) = Proof_Context.init_global
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   132
  | init_context (locale, false) = Locale.init locale
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   133
  | init_context (class, true) = Class.init class;
25269
f9090ae5cec9 clarified theory target interface
haftmann
parents: 25240
diff changeset
   134
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
   135
fun init before_exit target thy =
39639
haftmann
parents: 39557
diff changeset
   136
  let
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   137
    val name_data = make_name_data thy target;
59880
30687c3f2b10 clarified role of naming for background theory: transform_binding (e.g. for "concealed" flag) uses naming of hypothetical context;
wenzelm
parents: 59876
diff changeset
   138
    val background_naming =
59876
wenzelm
parents: 58665
diff changeset
   139
      Sign.naming_of thy |> Name_Space.mandatory_path (Long_Name.base_name target);
39639
haftmann
parents: 39557
diff changeset
   140
  in
haftmann
parents: 39557
diff changeset
   141
    thy
56056
4d46d53566e6 more efficient local theory operations, by imposing a linear change discipline on the main types/consts tables, in order to speed-up Proof_Context.transfer_syntax required for Local_Theory.raw_theory_result;
wenzelm
parents: 55763
diff changeset
   142
    |> Sign.change_begin
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   143
    |> init_context name_data
57485
b640e50c91a1 optional exit hook for theory-like targets
haftmann
parents: 57484
diff changeset
   144
    |> is_none before_exit ? Data.put (SOME name_data)
59880
30687c3f2b10 clarified role of naming for background theory: transform_binding (e.g. for "concealed" flag) uses naming of hypothetical context;
wenzelm
parents: 59876
diff changeset
   145
    |> Local_Theory.init background_naming
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   146
       {define = Generic_Target.define (foundation name_data),
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   147
        notes = Generic_Target.notes (notes name_data),
60344
a40369ea3ba5 self-contained formulation of abbrev for named targets
haftmann
parents: 60341
diff changeset
   148
        abbrev = abbrev name_data,
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   149
        declaration = declaration name_data,
61890
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
   150
        theory_registration = theory_registration name_data,
f6ded81f5690 abandoned attempt to unify sublocale and interpretation into global theories
haftmann
parents: 61777
diff changeset
   151
        locale_dependency = locale_dependency name_data,
57196
d9a18e44b80d tuned data structure
haftmann
parents: 57195
diff changeset
   152
        pretty = pretty name_data,
57485
b640e50c91a1 optional exit hook for theory-like targets
haftmann
parents: 57484
diff changeset
   153
        exit = the_default I before_exit
b640e50c91a1 optional exit hook for theory-like targets
haftmann
parents: 57484
diff changeset
   154
          #> Local_Theory.target_of #> Sign.change_end_local}
39639
haftmann
parents: 39557
diff changeset
   155
  end;
38247
12d3a5f04a72 unravelled target initialization code
haftmann
parents: 37314
diff changeset
   156
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
   157
val theory_init = init NONE "";
58665
50b229a5a097 tuned signature;
wenzelm
parents: 57485
diff changeset
   158
fun theory_map f = theory_init #> f #> Local_Theory.exit_global;
50b229a5a097 tuned signature;
wenzelm
parents: 57485
diff changeset
   159
57483
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   160
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   161
(* toplevel interaction *)
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   162
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   163
fun begin ("-", _) thy = theory_init thy
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
   164
  | begin target thy = init NONE (Locale.check thy target) thy;
57483
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   165
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   166
val exit = Local_Theory.assert_bottom true #> Local_Theory.exit_global;
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   167
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   168
fun switch NONE (Context.Theory thy) =
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   169
      (Context.Theory o exit, theory_init thy)
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   170
  | switch (SOME name) (Context.Theory thy) =
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   171
      (Context.Theory o exit, begin name thy)
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   172
  | switch NONE (Context.Proof lthy) =
62514
aae510e9a698 tuned signature;
wenzelm
parents: 62239
diff changeset
   173
      (Context.Proof o Local_Theory.reset, lthy)
57483
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   174
  | switch (SOME name) (Context.Proof lthy) =
63402
f199837304d7 tuned signature;
wenzelm
parents: 63352
diff changeset
   175
      (Context.Proof o init NONE (target_of lthy) o exit,
57483
950dc7446454 centralized (ad-hoc) switching of targets in named_target.ML
haftmann
parents: 57196
diff changeset
   176
        (begin name o exit o Local_Theory.assert_nonbrittle) lthy);
33282
c6364889fea5 misc tuning;
wenzelm
parents: 33173
diff changeset
   177
20894
784eefc906aa Common theory targets.
wenzelm
parents:
diff changeset
   178
end;