Get the branches field from a statement-if.
(statement-if->branches x) → branches
This is an ordinary field accessor created by fty::defprod.
Function:
(defun statement-if->branches$inline (x) (declare (xargs :guard (statementp x))) (declare (xargs :guard (equal (statement-kind x) :if))) (let ((__function__ 'statement-if->branches)) (declare (ignorable __function__)) (mbe :logic (b* ((x (and (equal (statement-kind x) :if) x)) (branches (branch-list-fix (std::da-nth 0 (cdr x)))) (else (statement-list-fix (std::da-nth 1 (cdr x))))) (if (consp branches) branches (list (branch-fix :irrelevant)))) :exec (std::da-nth 0 (cdr x)))))
Theorem:
(defthm branch-listp-of-statement-if->branches (b* ((branches (statement-if->branches$inline x))) (branch-listp branches)) :rule-classes :rewrite)
Theorem:
(defthm statement-if->branches$inline-of-statement-fix-x (equal (statement-if->branches$inline (statement-fix x)) (statement-if->branches$inline x)))
Theorem:
(defthm statement-if->branches$inline-statement-equiv-congruence-on-x (implies (statement-equiv x x-equiv) (equal (statement-if->branches$inline x) (statement-if->branches$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm statement-if->branches-when-wrong-kind (implies (not (equal (statement-kind x) :if)) (equal (statement-if->branches x) (b* ((x nil) (branches (branch-list-fix (std::da-nth 0 (cdr x)))) (else (statement-list-fix (std::da-nth 1 (cdr x))))) (if (consp branches) branches (list (branch-fix :irrelevant)))))))