src/Pure/theory.ML
changeset 16495 2e99aca906a7
parent 16443 82a116532e3e
child 16536 c5744af6b28a
equal deleted inserted replaced
16494:6961e8ab33e1 16495:2e99aca906a7
     7 
     7 
     8 signature BASIC_THEORY =
     8 signature BASIC_THEORY =
     9 sig
     9 sig
    10   type theory
    10   type theory
    11   type theory_ref
    11   type theory_ref
    12   val sign_of: theory -> theory    (*dummy*)
    12   val sign_of: theory -> theory    (*obsolete*)
    13   val rep_theory: theory ->
    13   val rep_theory: theory ->
    14    {axioms: term NameSpace.table,
    14    {axioms: term NameSpace.table,
    15     defs: Defs.graph,
    15     defs: Defs.graph,
    16     oracles: ((theory * Object.T -> term) * stamp) NameSpace.table}
    16     oracles: ((theory * Object.T -> term) * stamp) NameSpace.table}
    17   val parents_of: theory -> theory list
    17   val parents_of: theory -> theory list
    27 
    27 
    28 signature THEORY =
    28 signature THEORY =
    29 sig
    29 sig
    30   include BASIC_THEORY
    30   include BASIC_THEORY
    31   include SIGN_THEORY
    31   include SIGN_THEORY
       
    32   val begin_theory: string -> theory list -> theory
       
    33   val end_theory: theory -> theory
       
    34   val checkpoint: theory -> theory
       
    35   val copy: theory -> theory
    32   val init: theory -> theory
    36   val init: theory -> theory
    33   val axiom_space: theory -> NameSpace.T
    37   val axiom_space: theory -> NameSpace.T
    34   val oracle_space: theory -> NameSpace.T
    38   val oracle_space: theory -> NameSpace.T
    35   val axioms_of: theory -> (string * term) list
    39   val axioms_of: theory -> (string * term) list
    36   val all_axioms_of: theory -> (string * term) list
    40   val all_axioms_of: theory -> (string * term) list
    38   val deref: theory_ref -> theory
    42   val deref: theory_ref -> theory
    39   val merge: theory * theory -> theory                     (*exception TERM*)
    43   val merge: theory * theory -> theory                     (*exception TERM*)
    40   val merge_refs: theory_ref * theory_ref -> theory_ref    (*exception TERM*)
    44   val merge_refs: theory_ref * theory_ref -> theory_ref    (*exception TERM*)
    41   val requires: theory -> string -> string -> unit
    45   val requires: theory -> string -> string -> unit
    42   val assert_super: theory -> theory -> theory
    46   val assert_super: theory -> theory -> theory
    43   val copy: theory -> theory
       
    44   val checkpoint: theory -> theory
       
    45   val add_axioms: (bstring * string) list -> theory -> theory
    47   val add_axioms: (bstring * string) list -> theory -> theory
    46   val add_axioms_i: (bstring * term) list -> theory -> theory
    48   val add_axioms_i: (bstring * term) list -> theory -> theory
    47   val add_defs: bool -> (bstring * string) list -> theory -> theory
    49   val add_defs: bool -> (bstring * string) list -> theory -> theory
    48   val add_defs_i: bool -> (bstring * term) list -> theory -> theory
    50   val add_defs_i: bool -> (bstring * term) list -> theory -> theory
    49   val add_finals: bool -> string list -> theory -> theory
    51   val add_finals: bool -> string list -> theory -> theory
    50   val add_finals_i: bool -> term list -> theory -> theory
    52   val add_finals_i: bool -> term list -> theory -> theory
    51   val add_oracle: bstring * (theory * Object.T -> term) -> theory -> theory
    53   val add_oracle: bstring * (theory * Object.T -> term) -> theory -> theory
    52 end;
    54 end
    53 
    55 
    54 structure Theory: THEORY =
    56 structure Theory: THEORY =
    55 struct
    57 struct
    56 
    58 
    57 (** type theory **)
    59 (** type theory **)
    61 type theory = Context.theory;
    63 type theory = Context.theory;
    62 type theory_ref = Context.theory_ref;
    64 type theory_ref = Context.theory_ref;
    63 
    65 
    64 val eq_thy = Context.eq_thy;
    66 val eq_thy = Context.eq_thy;
    65 val subthy = Context.subthy;
    67 val subthy = Context.subthy;
    66 val copy = Context.copy_thy;
       
    67 val checkpoint = Context.checkpoint_thy;
       
    68 
    68 
    69 val parents_of = Context.parents_of;
    69 val parents_of = Context.parents_of;
    70 val ancestors_of = Context.ancestors_of;
    70 val ancestors_of = Context.ancestors_of;
    71 
    71 
    72 val self_ref = Context.self_ref;
    72 val self_ref = Context.self_ref;
    73 val deref = Context.deref;
    73 val deref = Context.deref;
    74 val merge = Context.merge;
    74 val merge = Context.merge;
    75 val merge_refs = Context.merge_refs;
    75 val merge_refs = Context.merge_refs;
       
    76 
       
    77 val begin_theory = Sign.local_path oo Context.begin_thy Sign.pp;
       
    78 val end_theory = Context.finish_thy;
       
    79 val checkpoint = Context.checkpoint_thy;
       
    80 val copy = Context.copy_thy;
    76 
    81 
    77 
    82 
    78 (* signature operations *)
    83 (* signature operations *)
    79 
    84 
    80 val sign_of = I;
    85 val sign_of = I;