(svexlist-nth n x) → elt
Function:
(defun svexlist-nth (n x) (declare (xargs :guard (and (natp n) (svexlist-p x)))) (let ((__function__ 'svexlist-nth)) (declare (ignorable __function__)) (mbe :logic (if (< (nfix n) (len x)) (svex-fix (nth n x)) (svex-x)) :exec (or (nth n x) (svex-x)))))
Theorem:
(defthm svex-p-of-svexlist-nth (b* ((elt (svexlist-nth n x))) (svex-p elt)) :rule-classes :rewrite)
Theorem:
(defthm svexlist-nth-out-of-bounds (implies (<= (len x) (nfix n)) (equal (svexlist-nth n x) (svex-x))))
Theorem:
(defthm svexlist-nth-in-of-bounds (implies (< (nfix n) (len x)) (equal (svexlist-nth n x) (svex-fix (nth n x)))))
Theorem:
(defthm svexlist-nth-of-nfix-n (equal (svexlist-nth (nfix n) x) (svexlist-nth n x)))
Theorem:
(defthm svexlist-nth-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (svexlist-nth n x) (svexlist-nth n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm svexlist-nth-of-svexlist-fix-x (equal (svexlist-nth n (svexlist-fix x)) (svexlist-nth n x)))
Theorem:
(defthm svexlist-nth-svexlist-equiv-congruence-on-x (implies (svexlist-equiv x x-equiv) (equal (svexlist-nth n x) (svexlist-nth n x-equiv))) :rule-classes :congruence)