(lex-group-address-char input) → (mv tree rest-input)
Function:
(defun lex-group-address-char (input) (declare (xargs :guard (nat-listp input))) (let ((__function__ 'lex-group-address-char)) (declare (ignorable __function__)) (b* (((mv first-nat input-after-first-nat) (abnf::parse-next input)) ((when (reserrp first-nat)) (mv (reserrf-push first-nat) (nat-list-fix input))) ((unless (address-char-nat-p first-nat)) (mv (reserrf "not a valid address char") (nat-list-fix input)))) (mv (abnf::tree-leafterm (list first-nat)) input-after-first-nat))))
Theorem:
(defthm tree-resultp-of-lex-group-address-char.tree (b* (((mv ?tree ?rest-input) (lex-group-address-char input))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-group-address-char.rest-input (b* (((mv ?tree ?rest-input) (lex-group-address-char input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-group-address-char-< (b* (((mv ?tree ?rest-input) (lex-group-address-char input))) (implies (not (reserrp tree)) (< (len rest-input) (len input)))) :rule-classes :linear)
Theorem:
(defthm lex-group-address-char-of-nat-list-fix-input (equal (lex-group-address-char (nat-list-fix input)) (lex-group-address-char input)))
Theorem:
(defthm lex-group-address-char-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (lex-group-address-char input) (lex-group-address-char input-equiv))) :rule-classes :congruence)