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