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