Parse a repetition.
(parse-repetition input) → (mv error? tree? rest-input)
The linear rules below are used in the guard verification proof.
Function:
(defun parse-repetition (input) (declare (xargs :guard (nat-listp input))) (seq input (tree-repeat := (parse-?repeat input)) (tree-element := (parse-element input)) (return (make-tree-nonleaf :rulename? *repetition* :branches (list (list tree-repeat) (list tree-element))))))
Theorem:
(defthm len-of-parse-repetition-linear-1 (<= (len (mv-nth 2 (parse-repetition input))) (len input)) :rule-classes :linear)
Theorem:
(defthm len-of-parse-repetition-linear-2 (implies (not (mv-nth 0 (parse-repetition input))) (< (len (mv-nth 2 (parse-repetition input))) (len input))) :rule-classes :linear)