Print an ACL2 octal digit character.
(print-oct-digit-achar achar pstate) → new-pstate
We turn the character into its code and print it. Note that we do not need the numeric value of the character; we just need to print the character itself.
This is essentially the same code as print-dec-digit-achar and print-hex-digit-achar, but it has a stronger guard than if we used a more general function to print an ACL2 character.
Function:
(defun print-oct-digit-achar (achar pstate) (declare (xargs :guard (and (oct-digit-char-p achar) (pristatep pstate)))) (let ((__function__ 'print-oct-digit-achar)) (declare (ignorable __function__)) (print-char (char-code achar) pstate)))
Theorem:
(defthm pristatep-of-print-oct-digit-achar (b* ((new-pstate (print-oct-digit-achar achar pstate))) (pristatep new-pstate)) :rule-classes :rewrite)
Theorem:
(defthm print-oct-digit-achar-of-pristate-fix-pstate (equal (print-oct-digit-achar achar (pristate-fix pstate)) (print-oct-digit-achar achar pstate)))
Theorem:
(defthm print-oct-digit-achar-pristate-equiv-congruence-on-pstate (implies (pristate-equiv pstate pstate-equiv) (equal (print-oct-digit-achar achar pstate) (print-oct-digit-achar achar pstate-equiv))) :rule-classes :congruence)