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