src/Pure/Isar/locale.ML
changeset 18617 8928e8722301
parent 18569 cf0edebe540c
child 18671 621efeed255b
equal deleted inserted replaced
18616:cf5d07758d3f 18617:8928e8722301
    42   (* Abstract interface to locales *)
    42   (* Abstract interface to locales *)
    43   type locale
    43   type locale
    44   val intern: theory -> xstring -> string
    44   val intern: theory -> xstring -> string
    45   val extern: theory -> string -> xstring
    45   val extern: theory -> string -> xstring
    46   val the_locale: theory -> string -> locale
    46   val the_locale: theory -> string -> locale
    47 
    47   val init: string -> theory -> Proof.context
    48   (* Processing of locale statements *)
    48 
       
    49   (* Processing of locale statements *)  (* FIXME export more abstract version *)
    49   val read_context_statement: xstring option -> Element.context element list ->
    50   val read_context_statement: xstring option -> Element.context element list ->
    50     (string * (string list * string list)) list list -> ProofContext.context ->
    51     (string * (string list * string list)) list list -> Proof.context ->
    51     string option * (cterm list * cterm list) * ProofContext.context * ProofContext.context *
    52     string option * (cterm list * cterm list) * Proof.context * Proof.context *
    52       (term * (term list * term list)) list list
    53       (term * (term list * term list)) list list
    53   val cert_context_statement: string option -> Element.context_i element list ->
    54   val cert_context_statement: string option -> Element.context_i element list ->
    54     (term * (term list * term list)) list list -> ProofContext.context ->
    55     (term * (term list * term list)) list list -> Proof.context ->
    55     string option * (cterm list * cterm list) * ProofContext.context * ProofContext.context *
    56     string option * (cterm list * cterm list) * Proof.context * Proof.context *
    56       (term * (term list * term list)) list list
    57       (term * (term list * term list)) list list
    57 
    58 
    58   (* Diagnostic functions *)
    59   (* Diagnostic functions *)
    59   val print_locales: theory -> unit
    60   val print_locales: theory -> unit
    60   val print_locale: theory -> bool -> expr -> Element.context list -> unit
    61   val print_locale: theory -> bool -> expr -> Element.context list -> unit
    61   val print_global_registrations: bool -> string -> theory -> unit
    62   val print_global_registrations: bool -> string -> theory -> unit
    62   val print_local_registrations': bool -> string -> ProofContext.context -> unit
    63   val print_local_registrations': bool -> string -> Proof.context -> unit
    63   val print_local_registrations: bool -> string -> ProofContext.context -> unit
    64   val print_local_registrations: bool -> string -> Proof.context -> unit
    64 
    65 
    65   val add_locale_context: bool -> bstring -> expr -> Element.context list -> theory
    66   val add_locale_context: bool -> bstring -> expr -> Element.context list -> theory
    66     -> ((Element.context_i list list * Element.context_i list list)
    67     -> ((Element.context_i list list * Element.context_i list list)
    67          * ProofContext.context) * theory
    68          * Proof.context) * theory
    68   val add_locale_context_i: bool -> bstring -> expr -> Element.context_i list -> theory
    69   val add_locale_context_i: bool -> bstring -> expr -> Element.context_i list -> theory
    69     -> ((Element.context_i list list * Element.context_i list list)
    70     -> ((Element.context_i list list * Element.context_i list list)
    70          * ProofContext.context) * theory
    71          * Proof.context) * theory
    71   val add_locale: bool -> bstring -> expr -> Element.context list -> theory -> theory
    72   val add_locale: bool -> bstring -> expr -> Element.context list -> theory -> theory
    72   val add_locale_i: bool -> bstring -> expr -> Element.context_i list -> theory -> theory
    73   val add_locale_i: bool -> bstring -> expr -> Element.context_i list -> theory -> theory
    73 
    74 
    74   (* Storing results *)
    75   (* Storing results *)
    75   val smart_note_thmss: string -> string option ->
    76   val smart_note_thmss: string -> string option ->
    76     ((bstring * theory attribute list) * (thm list * theory attribute list) list) list ->
    77     ((bstring * theory attribute list) * (thm list * theory attribute list) list) list ->
    77     theory -> (bstring * thm list) list * theory
    78     theory -> (bstring * thm list) list * theory
    78   val note_thmss: string -> xstring ->
    79   val note_thmss: string -> xstring ->
    79     ((bstring * Attrib.src list) * (thmref * Attrib.src list) list) list ->
    80     ((bstring * Attrib.src list) * (thmref * Attrib.src list) list) list ->
    80     theory -> (bstring * thm list) list * (theory * ProofContext.context)
    81     theory -> (bstring * thm list) list * (theory * Proof.context)
    81   val note_thmss_i: string -> string ->
    82   val note_thmss_i: string -> string ->
    82     ((bstring * Attrib.src list) * (thm list * Attrib.src list) list) list ->
    83     ((bstring * Attrib.src list) * (thm list * Attrib.src list) list) list ->
    83     theory -> (bstring * thm list) list * (theory * ProofContext.context)
    84     theory -> (bstring * thm list) list * (theory * Proof.context)
    84 
    85 
    85   val theorem: string -> Method.text option -> (thm list list -> theory -> theory) ->
    86   val theorem: string -> Method.text option -> (thm list list -> theory -> theory) ->
    86     string * Attrib.src list -> Element.context element list ->
    87     string * Attrib.src list -> Element.context element list ->
    87     ((string * Attrib.src list) * (string * (string list * string list)) list) list ->
    88     ((string * Attrib.src list) * (string * (string list * string list)) list) list ->
    88     theory -> Proof.state
    89     theory -> Proof.state
  1351 fun read_context import body ctxt = #1 (gen_context true [] import (map Elem body) [] ctxt);
  1352 fun read_context import body ctxt = #1 (gen_context true [] import (map Elem body) [] ctxt);
  1352 fun cert_context import body ctxt = #1 (gen_context_i true [] import (map Elem body) [] ctxt);
  1353 fun cert_context import body ctxt = #1 (gen_context_i true [] import (map Elem body) [] ctxt);
  1353 
  1354 
  1354 val read_context_statement = gen_statement intern gen_context;
  1355 val read_context_statement = gen_statement intern gen_context;
  1355 val cert_context_statement = gen_statement (K I) gen_context_i;
  1356 val cert_context_statement = gen_statement (K I) gen_context_i;
       
  1357 
       
  1358 fun init loc thy = #3 (cert_context_statement (SOME loc) [] [] (ProofContext.init thy));
  1356 
  1359 
  1357 end;
  1360 end;
  1358 
  1361 
  1359 
  1362 
  1360 (* print locale *)
  1363 (* print locale *)