equal
deleted
inserted
replaced
28 val declare_typ: typ -> Proof.context -> Proof.context |
28 val declare_typ: typ -> Proof.context -> Proof.context |
29 val declare_prf: Proofterm.proof -> Proof.context -> Proof.context |
29 val declare_prf: Proofterm.proof -> Proof.context -> Proof.context |
30 val declare_thm: thm -> Proof.context -> Proof.context |
30 val declare_thm: thm -> Proof.context -> Proof.context |
31 val thm_context: thm -> Proof.context |
31 val thm_context: thm -> Proof.context |
32 val variant_frees: Proof.context -> term list -> (string * 'a) list -> (string * 'a) list |
32 val variant_frees: Proof.context -> term list -> (string * 'a) list -> (string * 'a) list |
33 val add_binds: (indexname * term option) list -> Proof.context -> Proof.context |
33 val bind_term: indexname * term option -> Proof.context -> Proof.context |
34 val expand_binds: Proof.context -> term -> term |
34 val expand_binds: Proof.context -> term -> term |
35 val lookup_const: Proof.context -> string -> string option |
35 val lookup_const: Proof.context -> string -> string option |
36 val is_const: Proof.context -> string -> bool |
36 val is_const: Proof.context -> string -> bool |
37 val declare_const: string * string -> Proof.context -> Proof.context |
37 val declare_const: string * string -> Proof.context -> Proof.context |
38 val add_fixes: string list -> Proof.context -> string list * Proof.context |
38 val add_fixes: string list -> Proof.context -> string list * Proof.context |
248 |
248 |
249 |
249 |
250 |
250 |
251 (** term bindings **) |
251 (** term bindings **) |
252 |
252 |
253 fun add_bind (xi, NONE) = map_binds (Vartab.delete_safe xi) |
253 fun bind_term (xi, NONE) = map_binds (Vartab.delete_safe xi) |
254 | add_bind ((x, i), SOME t) = |
254 | bind_term ((x, i), SOME t) = |
255 let |
255 let |
256 val u = Term.close_schematic_term t; |
256 val u = Term.close_schematic_term t; |
257 val U = Term.fastype_of u; |
257 val U = Term.fastype_of u; |
258 in declare_term u #> map_binds (Vartab.update ((x, i), (U, u))) end; |
258 in declare_term u #> map_binds (Vartab.update ((x, i), (U, u))) end; |
259 |
|
260 val add_binds = fold add_bind; |
|
261 |
259 |
262 fun expand_binds ctxt = |
260 fun expand_binds ctxt = |
263 let |
261 let |
264 val binds = binds_of ctxt; |
262 val binds = binds_of ctxt; |
265 val get = fn Var (xi, _) => Vartab.lookup binds xi | _ => NONE; |
263 val get = fn Var (xi, _) => Vartab.lookup binds xi | _ => NONE; |
484 fun focus_subgoal i st = |
482 fun focus_subgoal i st = |
485 let |
483 let |
486 val all_vars = Thm.fold_terms Term.add_vars st []; |
484 val all_vars = Thm.fold_terms Term.add_vars st []; |
487 val no_binds = map (fn (xi, _) => (xi, NONE)) all_vars; |
485 val no_binds = map (fn (xi, _) => (xi, NONE)) all_vars; |
488 in |
486 in |
489 add_binds no_binds #> |
487 fold bind_term no_binds #> |
490 fold (declare_constraints o Var) all_vars #> |
488 fold (declare_constraints o Var) all_vars #> |
491 focus (Thm.cprem_of st i) |
489 focus (Thm.cprem_of st i) |
492 end; |
490 end; |
493 |
491 |
494 |
492 |