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