Add a toplevel object to context.
Function:
(defun context-add-toplevel (new-top ctxt) (declare (xargs :guard (and (toplevelp new-top) (contextp ctxt)))) (let ((__function__ 'context-add-toplevel)) (declare (ignorable __function__)) (change-context ctxt :tops (append (context->tops ctxt) (list new-top)))))
Theorem:
(defthm contextp-of-context-add-toplevel (b* ((new-ctxt (context-add-toplevel new-top ctxt))) (contextp new-ctxt)) :rule-classes :rewrite)
Theorem:
(defthm context-add-toplevel-of-toplevel-fix-new-top (equal (context-add-toplevel (toplevel-fix new-top) ctxt) (context-add-toplevel new-top ctxt)))
Theorem:
(defthm context-add-toplevel-toplevel-equiv-congruence-on-new-top (implies (toplevel-equiv new-top new-top-equiv) (equal (context-add-toplevel new-top ctxt) (context-add-toplevel new-top-equiv ctxt))) :rule-classes :congruence)
Theorem:
(defthm context-add-toplevel-of-context-fix-ctxt (equal (context-add-toplevel new-top (context-fix ctxt)) (context-add-toplevel new-top ctxt)))
Theorem:
(defthm context-add-toplevel-context-equiv-congruence-on-ctxt (implies (context-equiv ctxt ctxt-equiv) (equal (context-add-toplevel new-top ctxt) (context-add-toplevel new-top ctxt-equiv))) :rule-classes :congruence)