(svex-alist-truncate-by-var-decls x var-decls acc) → new-x
Function:
(defun svex-alist-truncate-by-var-decls (x var-decls acc) (declare (xargs :guard (and (svex-alist-p x) (var-decl-map-p var-decls) (svex-alist-p acc)))) (let ((__function__ 'svex-alist-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))))) (svex-alist-truncate-by-var-decls (cdr x) var-decls acc)) ((cons var val) (car x)) (wire (cdr (hons-get var (var-decl-map-fix var-decls)))) ((unless wire) (svex-alist-truncate-by-var-decls (cdr x) var-decls acc)) ((wire wire)) (acc (cons (cons var (svex-concat wire.width val 0)) (svex-alist-fix acc)))) (svex-alist-truncate-by-var-decls (cdr x) var-decls acc))))
Theorem:
(defthm svex-alist-p-of-svex-alist-truncate-by-var-decls (b* ((new-x (svex-alist-truncate-by-var-decls x var-decls acc))) (svex-alist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vars-of-svex-alist-truncate-by-var-decls (b* ((?new-x (svex-alist-truncate-by-var-decls x var-decls acc))) (implies (and (svarlist-addr-p (svex-alist-vars x)) (svarlist-addr-p (svex-alist-vars acc))) (svarlist-addr-p (svex-alist-vars new-x)))))
Theorem:
(defthm keys-of-svex-alist-truncate-by-var-decls (b* ((?new-x (svex-alist-truncate-by-var-decls x var-decls acc))) (implies (and (not (svex-lookup v x)) (not (svex-lookup v acc))) (not (svex-lookup v new-x)))))
Theorem:
(defthm no-duplicate-keys-of-svex-alist-truncate-by-var-decls (b* ((?new-x (svex-alist-truncate-by-var-decls x var-decls acc))) (implies (and (no-duplicatesp-equal (svex-alist-keys acc)) (no-duplicatesp-equal (svex-alist-keys x)) (not (intersectp-equal (svex-alist-keys x) (svex-alist-keys acc)))) (no-duplicatesp-equal (svex-alist-keys new-x)))))
Theorem:
(defthm svex-alist-truncate-by-var-decls-of-svex-alist-fix-x (equal (svex-alist-truncate-by-var-decls (svex-alist-fix x) var-decls acc) (svex-alist-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svex-alist-truncate-by-var-decls-svex-alist-equiv-congruence-on-x (implies (svex-alist-equiv x x-equiv) (equal (svex-alist-truncate-by-var-decls x var-decls acc) (svex-alist-truncate-by-var-decls x-equiv var-decls acc))) :rule-classes :congruence)
Theorem:
(defthm svex-alist-truncate-by-var-decls-of-var-decl-map-fix-var-decls (equal (svex-alist-truncate-by-var-decls x (var-decl-map-fix var-decls) acc) (svex-alist-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svex-alist-truncate-by-var-decls-var-decl-map-equiv-congruence-on-var-decls (implies (var-decl-map-equiv var-decls var-decls-equiv) (equal (svex-alist-truncate-by-var-decls x var-decls acc) (svex-alist-truncate-by-var-decls x var-decls-equiv acc))) :rule-classes :congruence)
Theorem:
(defthm svex-alist-truncate-by-var-decls-of-svex-alist-fix-acc (equal (svex-alist-truncate-by-var-decls x var-decls (svex-alist-fix acc)) (svex-alist-truncate-by-var-decls x var-decls acc)))
Theorem:
(defthm svex-alist-truncate-by-var-decls-svex-alist-equiv-congruence-on-acc (implies (svex-alist-equiv acc acc-equiv) (equal (svex-alist-truncate-by-var-decls x var-decls acc) (svex-alist-truncate-by-var-decls x var-decls acc-equiv))) :rule-classes :congruence)