Position of element
(pos e x) → *
We use this function to get the byte located at a memory
address; thus, in our use case,
Function:
(defun pos (e x) (declare (xargs :guard (true-listp x))) (let ((__function__ 'pos)) (declare (ignorable __function__)) (pos-1 e x 0)))
Theorem:
(defthm member-p-pos-non-nil (implies (member-p e x) (and (integerp (pos e x)) (<= 0 (pos e x)))) :rule-classes :type-prescription)
Theorem:
(defthm member-p-pos-value (implies (member-p e x) (< (pos e x) (len x))) :rule-classes :linear)
Theorem:
(defthm not-member-p-pos-nil (implies (equal (member-p e x) nil) (equal (pos e x) nil)))
Theorem:
(defthm nth-pos-of-list-first (implies (and (syntaxp (not (and (consp xs) (eq (car xs) 'addr-range)))) (equal index (car xs)) (consp xs)) (equal (pos index xs) 0)))