src/Pure/Isar/proof_context.ML
changeset 12147 64e69a8a945f
parent 12130 30d9143aff7e
child 12213 264f17d14ad9
equal deleted inserted replaced
12146:8e02a45f77e2 12147:64e69a8a945f
    47   val find_free: term -> string -> term option
    47   val find_free: term -> string -> term option
    48   val export: bool -> context -> context -> thm -> thm Seq.seq
    48   val export: bool -> context -> context -> thm -> thm Seq.seq
    49   val drop_schematic: indexname * term option -> indexname * term option
    49   val drop_schematic: indexname * term option -> indexname * term option
    50   val add_binds: (indexname * string option) list -> context -> context
    50   val add_binds: (indexname * string option) list -> context -> context
    51   val add_binds_i: (indexname * term option) list -> context -> context
    51   val add_binds_i: (indexname * term option) list -> context -> context
    52   val auto_bind_goal: term -> context -> context
    52   val auto_bind_goal: term list -> context -> context
    53   val auto_bind_facts: string -> term list -> context -> context
    53   val auto_bind_facts: term list -> context -> context
    54   val match_bind: bool -> (string list * string) list -> context -> context
    54   val match_bind: bool -> (string list * string) list -> context -> context
    55   val match_bind_i: bool -> (term list * term) list -> context -> context
    55   val match_bind_i: bool -> (term list * term) list -> context -> context
    56   val read_propp: context * (string * (string list * string list)) list list
    56   val read_propp: context * (string * (string list * string list)) list list
    57     -> context * (term * (term list * term list)) list list
    57     -> context * (term * (term list * term list)) list list
    58   val cert_propp: context * (term * (term list * term list)) list list
    58   val cert_propp: context * (term * (term list * term list)) list list
   805   | drop_schematic b = b;
   805   | drop_schematic b = b;
   806 
   806 
   807 val add_binds = gen_binds read_term;
   807 val add_binds = gen_binds read_term;
   808 val add_binds_i = gen_binds cert_term;
   808 val add_binds_i = gen_binds cert_term;
   809 
   809 
   810 fun auto_bind_goal t ctxt =
   810 fun auto_bind f ts ctxt = ctxt |> add_binds_i (map drop_schematic (f (sign_of ctxt) ts));
   811   ctxt |> add_binds_i (map drop_schematic (AutoBind.goal (sign_of ctxt) t));
   811 val auto_bind_goal = auto_bind AutoBind.goal;
   812 
   812 val auto_bind_facts = auto_bind AutoBind.facts;
   813 fun auto_bind_facts name ts ctxt =
       
   814   ctxt |> add_binds_i (map drop_schematic (AutoBind.facts (sign_of ctxt) name ts));
       
   815 
   813 
   816 end;
   814 end;
   817 
   815 
   818 
   816 
   819 (* match_bind(_i) *)
   817 (* match_bind(_i) *)
  1011     val asms = map (Tactic.norm_hhf o Thm.assume) cprops;
  1009     val asms = map (Tactic.norm_hhf o Thm.assume) cprops;
  1012 
  1010 
  1013     val ths = map (fn th => ([th], [])) asms;
  1011     val ths = map (fn th => ([th], [])) asms;
  1014     val (ctxt', [(_, thms)]) =
  1012     val (ctxt', [(_, thms)]) =
  1015       ctxt
  1013       ctxt
  1016       |> auto_bind_facts name props
  1014       |> auto_bind_facts props
  1017       |> have_thmss [((name, attrs), ths)];
  1015       |> have_thmss [((name, attrs), ths)];
  1018   in (ctxt', (cprops, (name, asms), (name, thms))) end;
  1016   in (ctxt', (cprops, (name, asms), (name, thms))) end;
  1019 
  1017 
  1020 fun gen_assms prepp exp args ctxt =
  1018 fun gen_assms prepp exp args ctxt =
  1021   let
  1019   let