Parse a rule.
(parse-rule input) → (mv error? tree? rest-input)
Function:
(defun parse-rule (input) (declare (xargs :guard (nat-listp input))) (seq input (tree1 := (parse-rulename input)) (tree2 := (parse-defined-as input)) (tree3 := (parse-elements input)) (tree4 := (parse-cnl input)) (return (make-tree-nonleaf :rulename? *rule* :branches (list (list tree1) (list tree2) (list tree3) (list tree4))))))
Theorem:
(defthm maybe-msgp-of-parse-rule.error? (b* (((mv ?error? ?tree? ?rest-input) (parse-rule input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-rule.tree? (b* (((mv ?error? ?tree? ?rest-input) (parse-rule input))) (and (tree-optionp tree?) (implies (not error?) (treep tree?)) (implies error? (not tree?)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-rule.rest-input (b* (((mv ?error? ?tree? ?rest-input) (parse-rule input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-rule-linear (b* (((mv ?error? ?tree? ?rest-input) (parse-rule input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-rule-of-nat-list-fix-input (equal (parse-rule (nat-list-fix input)) (parse-rule input)))
Theorem:
(defthm parse-rule-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-rule input) (parse-rule input-equiv))) :rule-classes :congruence)