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