Parse a repetition of one or more bits.
(parse-1*bit input) → (mv error? trees rest-input)
Function:
(defun parse-1*bit (input) (declare (xargs :guard (nat-listp input))) (seq input (tree := (parse-bit input)) (trees := (parse-*bit input)) (return (cons tree trees))))
Theorem:
(defthm maybe-msgp-of-parse-1*bit.error? (b* (((mv ?error? ?trees ?rest-input) (parse-1*bit input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-1*bit.trees (b* (((mv ?error? ?trees ?rest-input) (parse-1*bit input))) (and (tree-listp trees) (implies error? (not trees)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-1*bit.rest-input (b* (((mv ?error? ?trees ?rest-input) (parse-1*bit input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-1*bit-linear (b* (((mv ?error? ?trees ?rest-input) (parse-1*bit input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-1*bit-of-nat-list-fix-input (equal (parse-1*bit (nat-list-fix input)) (parse-1*bit input)))
Theorem:
(defthm parse-1*bit-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-1*bit input) (parse-1*bit input-equiv))) :rule-classes :congruence)