Parse a repetition
(parse-alt-rest input) → (mv error? trees rest-input)
The linear rule below is used in the guard verification proof.
Function:
(defun parse-alt-rest (input) (declare (xargs :guard (nat-listp input))) (seq-backtrack input ((tree :s= (parse-alt-rest-comp input)) (trees := (parse-alt-rest input)) (return (cons tree trees))) ((return-raw (mv nil nil (nat-list-fix input))))))
Theorem:
(defthm len-of-parse-alt-rest-linear-1 (<= (len (mv-nth 2 (parse-alt-rest input))) (len input)) :rule-classes :linear)