Add a binding obligation hypothesis to a context.
The hypothesis is added at the end, because its well-formedness may depend on the preceding hypotheses.
Function:
(defun context-add-binding (bind ctxt) (declare (xargs :guard (and (bindingp bind) (contextp ctxt)))) (let ((__function__ 'context-add-binding)) (declare (ignorable __function__)) (change-context ctxt :obligation-hyps (append (context->obligation-hyps ctxt) (list (obligation-hyp-binding bind))))))
Theorem:
(defthm contextp-of-context-add-binding (b* ((new-ctxt (context-add-binding bind ctxt))) (contextp new-ctxt)) :rule-classes :rewrite)
Theorem:
(defthm context-add-binding-of-binding-fix-bind (equal (context-add-binding (binding-fix bind) ctxt) (context-add-binding bind ctxt)))
Theorem:
(defthm context-add-binding-binding-equiv-congruence-on-bind (implies (binding-equiv bind bind-equiv) (equal (context-add-binding bind ctxt) (context-add-binding bind-equiv ctxt))) :rule-classes :congruence)
Theorem:
(defthm context-add-binding-of-context-fix-ctxt (equal (context-add-binding bind (context-fix ctxt)) (context-add-binding bind ctxt)))
Theorem:
(defthm context-add-binding-context-equiv-congruence-on-ctxt (implies (context-equiv ctxt ctxt-equiv) (equal (context-add-binding bind ctxt) (context-add-binding bind ctxt-equiv))) :rule-classes :congruence)