Push information about a variable and constant scope onto the scope stack of the top call of a dynamic environment.
(push-vcscope-dinfo scope env) → new-env
Function:
(defun push-vcscope-dinfo (scope env) (declare (xargs :guard (and (vcscope-dinfop scope) (denvp env)))) (let ((__function__ 'push-vcscope-dinfo)) (declare (ignorable __function__)) (b* ((calls (denv->call-stack env)) ((when (endp calls)) (reserrf :empty-call-stack)) (top-call (car calls)) (scopes (call-dinfo->scopes top-call)) (new-scopes (cons scope scopes)) (new-top-call (change-call-dinfo top-call :scopes new-scopes)) (new-calls (cons new-top-call (cdr calls))) (new-env (change-denv env :call-stack new-calls))) new-env)))
Theorem:
(defthm denv-resultp-of-push-vcscope-dinfo (b* ((new-env (push-vcscope-dinfo scope env))) (denv-resultp new-env)) :rule-classes :rewrite)
Theorem:
(defthm push-vcscope-dinfo-of-vcscope-dinfo-fix-scope (equal (push-vcscope-dinfo (vcscope-dinfo-fix scope) env) (push-vcscope-dinfo scope env)))
Theorem:
(defthm push-vcscope-dinfo-vcscope-dinfo-equiv-congruence-on-scope (implies (vcscope-dinfo-equiv scope scope-equiv) (equal (push-vcscope-dinfo scope env) (push-vcscope-dinfo scope-equiv env))) :rule-classes :congruence)
Theorem:
(defthm push-vcscope-dinfo-of-denv-fix-env (equal (push-vcscope-dinfo scope (denv-fix env)) (push-vcscope-dinfo scope env)))
Theorem:
(defthm push-vcscope-dinfo-denv-equiv-congruence-on-env (implies (denv-equiv env env-equiv) (equal (push-vcscope-dinfo scope env) (push-vcscope-dinfo scope env-equiv))) :rule-classes :congruence)