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