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