Obtain the next natural number from the input.
(parse-next input) → (mv nat rest-input)
Function:
(defun parse-next (input) (declare (xargs :guard (nat-listp input))) (let ((__function__ 'parse-next)) (declare (ignorable __function__)) (if (consp input) (mv (lnfix (car input)) (nat-list-fix (cdr input))) (mv (reserrf :end-of-input) nil))))
Theorem:
(defthm nat-resultp-of-parse-next.nat (b* (((mv acl2::?nat ?rest-input) (parse-next input))) (nat-resultp nat)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-next.rest-input (b* (((mv acl2::?nat ?rest-input) (parse-next input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-next-<= (b* (((mv acl2::?nat ?rest-input) (parse-next input))) (<= (len rest-input) (len input))) :rule-classes :linear)
Theorem:
(defthm len-of-parse-next-< (b* (((mv acl2::?nat ?rest-input) (parse-next input))) (implies (not (reserrp nat)) (< (len rest-input) (len input)))) :rule-classes :linear)
Theorem:
(defthm parse-next-of-nat-list-fix-input (equal (parse-next (nat-list-fix input)) (parse-next input)))
Theorem:
(defthm parse-next-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-next input) (parse-next input-equiv))) :rule-classes :congruence)