src/Pure/pure_thy.ML
changeset 5280 6055775a151b
parent 5210 54aaa779b6b4
child 5328 ac539483ad09
equal deleted inserted replaced
5279:cba6a96f5812 5280:6055775a151b
    25   include BASIC_PURE_THY
    25   include BASIC_PURE_THY
    26   val thms_closure: theory -> xstring -> tthm list option
    26   val thms_closure: theory -> xstring -> tthm list option
    27   val get_tthm: theory -> xstring -> tthm
    27   val get_tthm: theory -> xstring -> tthm
    28   val get_tthms: theory -> xstring -> tthm list
    28   val get_tthms: theory -> xstring -> tthm list
    29   val thms_containing: theory -> string list -> (string * thm) list
    29   val thms_containing: theory -> string list -> (string * thm) list
       
    30   val store_tthm: (bstring * tthm) * theory attribute list -> theory -> theory * tthm
    30   val smart_store_thm: (bstring * thm) -> thm
    31   val smart_store_thm: (bstring * thm) -> thm
    31   val add_tthms: ((bstring * tthm) * theory attribute list) list -> theory -> theory
    32   val add_tthms: ((bstring * tthm) * theory attribute list) list -> theory -> theory
    32   val add_tthmss: ((bstring * tthm list) * theory attribute list) list -> theory -> theory
    33   val add_tthmss: ((bstring * tthm list) * theory attribute list) list -> theory -> theory
    33   val add_axioms: ((bstring * string) * theory attribute list) list -> theory -> theory
    34   val add_axioms: ((bstring * string) * theory attribute list) list -> theory -> theory
    34   val add_axioms_i: ((bstring * term) * theory attribute list) list -> theory -> theory
    35   val add_axioms_i: ((bstring * term) * theory attribute list) list -> theory -> theory
   242 
   243 
   243 
   244 
   244 (* add_tthms(s) *)
   245 (* add_tthms(s) *)
   245 
   246 
   246 fun add_tthmx app_name app_att ((bname, tthmx), atts) thy =
   247 fun add_tthmx app_name app_att ((bname, tthmx), atts) thy =
   247   let val (thy', tthmx') = app_att ((thy, tthmx), atts)
   248   let
   248   in enter_tthmx (Theory.sign_of thy') app_name (bname, tthmx'); thy' end;
   249     val (thy', tthmx') = app_att ((thy, tthmx), atts);
   249 
   250     val tthms'' = enter_tthmx (Theory.sign_of thy') app_name (bname, tthmx');
   250 val add_tthms = Theory.apply o map (add_tthmx name_single Attribute.apply);
   251   in (thy', tthms'') end;
   251 val add_tthmss = Theory.apply o map (add_tthmx name_multi Attribute.applys);
   252 
       
   253 val add_tthms =
       
   254   Theory.apply o map (fn th_atts => fst o add_tthmx name_single Attribute.apply th_atts);
       
   255 val add_tthmss =
       
   256   Theory.apply o map (fn th_atts => fst o add_tthmx name_multi Attribute.applys th_atts);
       
   257 
       
   258 
       
   259 (* store_tthm *)
       
   260 
       
   261 fun store_tthm th_atts thy =
       
   262   let val (thy', [th']) = add_tthmx name_single Attribute.apply th_atts thy
       
   263   in (thy', th') end;
   252 
   264 
   253 
   265 
   254 (* smart_store_thm *)
   266 (* smart_store_thm *)
   255 
   267 
   256 fun smart_store_thm (name, thm) =
   268 fun smart_store_thm (name, thm) =