Parse a decimal numeric value notation.
(parse-dec-val input) → (mv error? tree? rest-input)
Function:
(defun parse-dec-val (input) (declare (xargs :guard (nat-listp input))) (seq input (tree := (parse-ichar #\d input)) (trees := (parse-1*digit input)) (tree-rest := (parse-dec-val-rest input)) (return (make-tree-nonleaf :rulename? *dec-val* :branches (list (list tree) trees (list tree-rest))))))
Theorem:
(defthm maybe-msgp-of-parse-dec-val.error? (b* (((mv ?error? ?tree? ?rest-input) (parse-dec-val input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-dec-val.tree? (b* (((mv ?error? ?tree? ?rest-input) (parse-dec-val input))) (and (tree-optionp tree?) (implies (not error?) (treep tree?)) (implies error? (not tree?)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-dec-val.rest-input (b* (((mv ?error? ?tree? ?rest-input) (parse-dec-val input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-dec-val-linear (b* (((mv ?error? ?tree? ?rest-input) (parse-dec-val input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-dec-val-of-nat-list-fix-input (equal (parse-dec-val (nat-list-fix input)) (parse-dec-val input)))
Theorem:
(defthm parse-dec-val-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-dec-val input) (parse-dec-val input-equiv))) :rule-classes :congruence)