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