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