Parse a repetition
(parse-*wsp/vchar input) → (mv error? trees rest-input)
Function:
(defun parse-*wsp/vchar (input) (declare (xargs :guard (nat-listp input))) (seq-backtrack input ((tree := (parse-wsp/vchar input)) (trees := (parse-*wsp/vchar input)) (return (cons tree trees))) ((return-raw (mv nil nil (nat-list-fix input))))))
Theorem:
(defthm not-of-parse-*wsp/vchar.error? (b* (((mv ?error? ?trees ?rest-input) (parse-*wsp/vchar input))) (not error?)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-*wsp/vchar.trees (b* (((mv ?error? ?trees ?rest-input) (parse-*wsp/vchar input))) (tree-listp trees)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-*wsp/vchar.rest-input (b* (((mv ?error? ?trees ?rest-input) (parse-*wsp/vchar input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-*wsp/vchar-linear (b* (((mv ?error? ?trees ?rest-input) (parse-*wsp/vchar input))) (<= (len rest-input) (len input))) :rule-classes :linear)
Theorem:
(defthm parse-*wsp/vchar-of-nat-list-fix-input (equal (parse-*wsp/vchar (nat-list-fix input)) (parse-*wsp/vchar input)))
Theorem:
(defthm parse-*wsp/vchar-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-*wsp/vchar input) (parse-*wsp/vchar input-equiv))) :rule-classes :congruence)