Fixing function for oct-integer-literal structures.
(oct-integer-literal-fix x) → new-x
Function:
(defun oct-integer-literal-fix$inline (x) (declare (xargs :guard (oct-integer-literalp x))) (let ((__function__ 'oct-integer-literal-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((digits/uscores (octdig/uscore-list-fix (std::da-nth 0 (cdr x)))) (prefix-upcase-p (acl2::bool-fix (std::da-nth 1 (cdr x)))) (suffix? (optional-integer-type-suffix-fix (std::da-nth 2 (cdr x))))) (let ((digits/uscores (if (octdig/uscore-list-wfp digits/uscores) digits/uscores (list (octdig/uscore-digit (char-code #\0)) (octdig/uscore-digit (char-code #\0)))))) (cons :oct-integer-lit (list digits/uscores prefix-upcase-p suffix?)))) :exec x)))
Theorem:
(defthm oct-integer-literalp-of-oct-integer-literal-fix (b* ((new-x (oct-integer-literal-fix$inline x))) (oct-integer-literalp new-x)) :rule-classes :rewrite)
Theorem:
(defthm oct-integer-literal-fix-when-oct-integer-literalp (implies (oct-integer-literalp x) (equal (oct-integer-literal-fix x) x)))
Function:
(defun oct-integer-literal-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (oct-integer-literalp acl2::x) (oct-integer-literalp acl2::y)))) (equal (oct-integer-literal-fix acl2::x) (oct-integer-literal-fix acl2::y)))
Theorem:
(defthm oct-integer-literal-equiv-is-an-equivalence (and (booleanp (oct-integer-literal-equiv x y)) (oct-integer-literal-equiv x x) (implies (oct-integer-literal-equiv x y) (oct-integer-literal-equiv y x)) (implies (and (oct-integer-literal-equiv x y) (oct-integer-literal-equiv y z)) (oct-integer-literal-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm oct-integer-literal-equiv-implies-equal-oct-integer-literal-fix-1 (implies (oct-integer-literal-equiv acl2::x x-equiv) (equal (oct-integer-literal-fix acl2::x) (oct-integer-literal-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm oct-integer-literal-fix-under-oct-integer-literal-equiv (oct-integer-literal-equiv (oct-integer-literal-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-oct-integer-literal-fix-1-forward-to-oct-integer-literal-equiv (implies (equal (oct-integer-literal-fix acl2::x) acl2::y) (oct-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-oct-integer-literal-fix-2-forward-to-oct-integer-literal-equiv (implies (equal acl2::x (oct-integer-literal-fix acl2::y)) (oct-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-integer-literal-equiv-of-oct-integer-literal-fix-1-forward (implies (oct-integer-literal-equiv (oct-integer-literal-fix acl2::x) acl2::y) (oct-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-integer-literal-equiv-of-oct-integer-literal-fix-2-forward (implies (oct-integer-literal-equiv acl2::x (oct-integer-literal-fix acl2::y)) (oct-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)