Lex exactly 4 hexadecimal digits.
(lex-repetition-4-hex-digits input) → (mv trees rest-input)
This is used to lex a 16-bit number expressed in hex.
Function:
(defun lex-repetition-4-hex-digits (input) (declare (xargs :guard (nat-listp input))) (let ((__function__ 'lex-repetition-4-hex-digits)) (declare (ignorable __function__)) (b* (((mv tree-digit1 input-after-digit1) (lex-hex-digit input)) ((when (reserrp tree-digit1)) (mv tree-digit1 (acl2::nat-list-fix input))) ((mv tree-digit2 input-after-digit2) (lex-hex-digit input-after-digit1)) ((when (reserrp tree-digit2)) (mv tree-digit2 (acl2::nat-list-fix input))) ((mv tree-digit3 input-after-digit3) (lex-hex-digit input-after-digit2)) ((when (reserrp tree-digit3)) (mv tree-digit3 (acl2::nat-list-fix input))) ((mv tree-digit4 input-after-digit4) (lex-hex-digit input-after-digit3)) ((when (reserrp tree-digit4)) (mv tree-digit4 (acl2::nat-list-fix input)))) (mv (list tree-digit1 tree-digit2 tree-digit3 tree-digit4) input-after-digit4))))
Theorem:
(defthm tree-list-resultp-of-lex-repetition-4-hex-digits.trees (b* (((mv ?trees ?rest-input) (lex-repetition-4-hex-digits input))) (abnf::tree-list-resultp trees)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-repetition-4-hex-digits.rest-input (b* (((mv ?trees ?rest-input) (lex-repetition-4-hex-digits input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-repetition-4-hex-digits-< (b* (((mv ?trees ?rest-input) (lex-repetition-4-hex-digits input))) (implies (not (reserrp trees)) (< (len rest-input) (len input)))) :rule-classes :linear)
Theorem:
(defthm lex-repetition-4-hex-digits-of-nat-list-fix-input (equal (lex-repetition-4-hex-digits (acl2::nat-list-fix input)) (lex-repetition-4-hex-digits input)))
Theorem:
(defthm lex-repetition-4-hex-digits-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (lex-repetition-4-hex-digits input) (lex-repetition-4-hex-digits input-equiv))) :rule-classes :congruence)