src/Pure/facts.ML
changeset 49747 2cf86639b77e
parent 48992 0518bf89c777
child 49887 1a173b2503c0
equal deleted inserted replaced
49746:5073cb632b6c 49747:2cf86639b77e
    30   val dest_static: T list -> T -> (string * thm list) list
    30   val dest_static: T list -> T -> (string * thm list) list
    31   val extern_static: Proof.context -> T list -> T -> (xstring * thm list) list
    31   val extern_static: Proof.context -> T list -> T -> (xstring * thm list) list
    32   val props: T -> thm list
    32   val props: T -> thm list
    33   val could_unify: T -> term -> thm list
    33   val could_unify: T -> term -> thm list
    34   val merge: T * T -> T
    34   val merge: T * T -> T
    35   val add_global: Context.generic -> binding * thm list -> T -> string * T
    35   val add_static: Context.generic -> {strict: bool, index: bool} ->
    36   val add_local: Context.generic -> bool -> binding * thm list -> T -> string * T
    36     binding * thm list -> T -> string * T
    37   val add_dynamic: Context.generic -> binding * (Context.generic -> thm list) -> T -> string * T
    37   val add_dynamic: Context.generic -> binding * (Context.generic -> thm list) -> T -> string * T
    38   val del: string -> T -> T
    38   val del: string -> T -> T
    39   val hide: bool -> string -> T -> T
    39   val hide: bool -> string -> T -> T
    40 end;
    40 end;
    41 
    41 
   186   in make_facts facts' props' end;
   186   in make_facts facts' props' end;
   187 
   187 
   188 
   188 
   189 (* add static entries *)
   189 (* add static entries *)
   190 
   190 
   191 local
   191 fun add_static context {strict, index} (b, ths) (Facts {facts, props}) =
   192 
       
   193 fun add context strict do_props (b, ths) (Facts {facts, props}) =
       
   194   let
   192   let
   195     val (name, facts') =
   193     val (name, facts') =
   196       if Binding.is_empty b then ("", facts)
   194       if Binding.is_empty b then ("", facts)
   197       else Name_Space.define context strict (b, Static ths) facts;
   195       else Name_Space.define context strict (b, Static ths) facts;
   198     val props' =
   196     val props' = props
   199       if do_props
   197       |> index ? fold (fn th => Net.insert_term (K false) (Thm.full_prop_of th, th)) ths;
   200       then fold (fn th => Net.insert_term (K false) (Thm.full_prop_of th, th)) ths props
       
   201       else props;
       
   202   in (name, make_facts facts' props') end;
   198   in (name, make_facts facts' props') end;
   203 
       
   204 in
       
   205 
       
   206 fun add_global context = add context true false;
       
   207 fun add_local context = add context false;
       
   208 
       
   209 end;
       
   210 
   199 
   211 
   200 
   212 (* add dynamic entries *)
   201 (* add dynamic entries *)
   213 
   202 
   214 fun add_dynamic context (b, f) (Facts {facts, props}) =
   203 fun add_dynamic context (b, f) (Facts {facts, props}) =