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