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