src/Pure/theory.ML
changeset 6369 2be75edfe58c
parent 6311 15652e058e28
child 6546 995a66249a9b
equal deleted inserted replaced
6368:ba5e97a20b12 6369:2be75edfe58c
    82   val add_name: string -> theory -> theory
    82   val add_name: string -> theory -> theory
    83   val copy: theory -> theory
    83   val copy: theory -> theory
    84   val prep_ext: theory -> theory
    84   val prep_ext: theory -> theory
    85   val prep_ext_merge: theory list -> theory
    85   val prep_ext_merge: theory list -> theory
    86   val requires: theory -> string -> string -> unit
    86   val requires: theory -> string -> string -> unit
       
    87   val assert_super: theory -> theory -> theory
    87   val pre_pure: theory
    88   val pre_pure: theory
    88 end;
    89 end;
    89 
    90 
    90 signature PRIVATE_THEORY =
    91 signature PRIVATE_THEORY =
    91 sig
    92 sig
   129 
   130 
   130 (*compare theories*)
   131 (*compare theories*)
   131 val subthy = Sign.subsig o pairself sign_of;
   132 val subthy = Sign.subsig o pairself sign_of;
   132 val eq_thy = Sign.eq_sg o pairself sign_of;
   133 val eq_thy = Sign.eq_sg o pairself sign_of;
   133 
   134 
   134 (*check for some named theory*)
   135 (*check for some theory*)
   135 fun requires thy name what =
   136 fun requires thy name what =
   136   if exists (equal name) (Sign.stamp_names_of (sign_of thy)) then ()
   137   if exists (equal name) (Sign.stamp_names_of (sign_of thy)) then ()
   137   else error ("Require theory " ^ quote name ^ " as an ancestor for " ^ what);
   138   else error ("Require theory " ^ quote name ^ " as an ancestor for " ^ what);
       
   139 
       
   140 fun assert_super thy1 thy2 =
       
   141   if subthy (thy1, thy2) then thy2
       
   142   else raise THEORY ("Not a super theory", [thy1, thy2]);
   138 
   143 
   139 (*partial Pure theory*)
   144 (*partial Pure theory*)
   140 val pre_pure = make_theory Sign.pre_pure Symtab.empty Symtab.empty [] [];
   145 val pre_pure = make_theory Sign.pre_pure Symtab.empty Symtab.empty [] [];
   141 
   146 
   142 
   147