Apply one select operation to the result of another.
(svex-selects-merge outer inner) → composition
Function:
(defun svex-selects-merge (outer inner) (declare (xargs :guard (and (svex-select-p outer) (svex-select-p inner)))) (let ((__function__ 'svex-selects-merge)) (declare (ignorable __function__)) (svex-select-case outer :var (svex-select-fix inner) :part (change-svex-select-part outer :subexp (svex-selects-merge outer.subexp inner)))))
Theorem:
(defthm svex-select-p-of-svex-selects-merge (b* ((composition (svex-selects-merge outer inner))) (svex-select-p composition)) :rule-classes :rewrite)
Theorem:
(defthm svex-select->width-of-svex-select-merge (implies (equal (svex-select-inner-width outer) (svex-select->width inner)) (equal (svex-select->width (svex-selects-merge outer inner)) (svex-select->width outer))))
Theorem:
(defthm svex-selects-merge-is-svex-compose (b* nil (b* ((inner-var (svex-select-inner-var outer))) (implies (and (not (member inner-var (svexlist-vars (svex-select->indices outer)))) (equal (svex-select-inner-width outer) (svex-select->width inner))) (equal (svex-eval (svex-select-to-svex (svex-selects-merge outer inner)) env) (svex-eval (svex-select-to-svex outer) (cons (cons inner-var (svex-eval (svex-select-to-svex inner) env)) env)))))))
Theorem:
(defthm svex-select->indices-of-svex-selects-merge (b* ((?composition (svex-selects-merge outer inner))) (equal (svex-select->indices composition) (append (svex-select->indices outer) (svex-select->indices inner)))))
Theorem:
(defthm svex-selects-merge-of-svex-select-fix-outer (equal (svex-selects-merge (svex-select-fix outer) inner) (svex-selects-merge outer inner)))
Theorem:
(defthm svex-selects-merge-svex-select-equiv-congruence-on-outer (implies (svex-select-equiv outer outer-equiv) (equal (svex-selects-merge outer inner) (svex-selects-merge outer-equiv inner))) :rule-classes :congruence)
Theorem:
(defthm svex-selects-merge-of-svex-select-fix-inner (equal (svex-selects-merge outer (svex-select-fix inner)) (svex-selects-merge outer inner)))
Theorem:
(defthm svex-selects-merge-svex-select-equiv-congruence-on-inner (implies (svex-select-equiv inner inner-equiv) (equal (svex-selects-merge outer inner) (svex-selects-merge outer inner-equiv))) :rule-classes :congruence)