(svar-map-truncate-by-var-decls x var-decls acc) → new-x
Function:
(defun svar-map-truncate-by-var-decls (x var-decls acc) (declare (xargs :guard (and (svar-map-p x) (var-decl-map-p var-decls) (svex-alist-p acc)))) (let ((__function__ 'svar-map-truncate-by-var-decls)) (declare (ignorable __function__)) (b* (((when (atom x)) (svex-alist-fix acc)) ((unless (mbt (and (consp (car x)) (svar-p (caar x))))) (svar-map-truncate-by-var-decls (cdr x) var-decls acc)) ((cons delay-var var) (car x)) (wire (cdr (hons-get (svar-fix var) (var-decl-map-fix var-decls)))) ((unless wire) (svar-map-truncate-by-var-decls (cdr x) var-decls acc)) ((wire wire)) (acc (cons (cons delay-var (svcall zerox (svex-quote (2vec wire.width)) (svex-var var))) (svex-alist-fix acc)))) (svar-map-truncate-by-var-decls (cdr x) var-decls acc))))
Theorem:
(defthm svex-alist-p-of-svar-map-truncate-by-var-decls (b* ((new-x (svar-map-truncate-by-var-decls x var-decls acc))) (svex-alist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vars-of-svar-map-truncate-by-var-decls (b* ((?new-x (svar-map-truncate-by-var-decls x var-decls acc))) (implies (and (svarlist-addr-p (alist-vals (svar-map-fix x))) (svarlist-addr-p (svex-alist-vars acc))) (svarlist-addr-p (svex-alist-vars new-x)))))
Theorem:
(defthm keys-of-svar-map-truncate-by-var-decls (b* ((?new-x (svar-map-truncate-by-var-decls x var-decls acc))) (implies (and (svarlist-addr-p (alist-keys (svar-map-fix x))) (svarlist-addr-p (svex-alist-keys acc))) (svarlist-addr-p (svex-alist-keys new-x)))))
Theorem:
(defthm svar-map-truncate-by-var-decls-of-svar-map-fix-x (equal (svar-map-truncate-by-var-decls (svar-map-fix x) var-decls acc) (svar-map-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svar-map-truncate-by-var-decls-svar-map-equiv-congruence-on-x (implies (svar-map-equiv x x-equiv) (equal (svar-map-truncate-by-var-decls x var-decls acc) (svar-map-truncate-by-var-decls x-equiv var-decls acc))) :rule-classes :congruence)
Theorem:
(defthm svar-map-truncate-by-var-decls-of-var-decl-map-fix-var-decls (equal (svar-map-truncate-by-var-decls x (var-decl-map-fix var-decls) acc) (svar-map-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svar-map-truncate-by-var-decls-var-decl-map-equiv-congruence-on-var-decls (implies (var-decl-map-equiv var-decls var-decls-equiv) (equal (svar-map-truncate-by-var-decls x var-decls acc) (svar-map-truncate-by-var-decls x var-decls-equiv acc))) :rule-classes :congruence)
Theorem:
(defthm svar-map-truncate-by-var-decls-of-svex-alist-fix-acc (equal (svar-map-truncate-by-var-decls x var-decls (svex-alist-fix acc)) (svar-map-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svar-map-truncate-by-var-decls-svex-alist-equiv-congruence-on-acc (implies (svex-alist-equiv acc acc-equiv) (equal (svar-map-truncate-by-var-decls x var-decls acc) (svar-map-truncate-by-var-decls x var-decls acc-equiv))) :rule-classes :congruence)