Fixing function for oct-escape structures.
(oct-escape-fix x) → new-x
Function:
(defun oct-escape-fix$inline (x) (declare (xargs :guard (oct-escapep x))) (let ((__function__ 'oct-escape-fix)) (declare (ignorable __function__)) (mbe :logic (case (oct-escape-kind x) (:one (b* ((digit (str::oct-digit-char-fix (std::da-nth 0 (cdr x))))) (cons :one (list digit)))) (:two (b* ((digit1 (str::oct-digit-char-fix (std::da-nth 0 (cdr x)))) (digit2 (str::oct-digit-char-fix (std::da-nth 1 (cdr x))))) (cons :two (list digit1 digit2)))) (:three (b* ((digit1 (str::oct-digit-char-fix (std::da-nth 0 (cdr x)))) (digit2 (str::oct-digit-char-fix (std::da-nth 1 (cdr x)))) (digit3 (str::oct-digit-char-fix (std::da-nth 2 (cdr x))))) (cons :three (list digit1 digit2 digit3))))) :exec x)))
Theorem:
(defthm oct-escapep-of-oct-escape-fix (b* ((new-x (oct-escape-fix$inline x))) (oct-escapep new-x)) :rule-classes :rewrite)
Theorem:
(defthm oct-escape-fix-when-oct-escapep (implies (oct-escapep x) (equal (oct-escape-fix x) x)))
Function:
(defun oct-escape-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (oct-escapep acl2::x) (oct-escapep acl2::y)))) (equal (oct-escape-fix acl2::x) (oct-escape-fix acl2::y)))
Theorem:
(defthm oct-escape-equiv-is-an-equivalence (and (booleanp (oct-escape-equiv x y)) (oct-escape-equiv x x) (implies (oct-escape-equiv x y) (oct-escape-equiv y x)) (implies (and (oct-escape-equiv x y) (oct-escape-equiv y z)) (oct-escape-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm oct-escape-equiv-implies-equal-oct-escape-fix-1 (implies (oct-escape-equiv acl2::x x-equiv) (equal (oct-escape-fix acl2::x) (oct-escape-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm oct-escape-fix-under-oct-escape-equiv (oct-escape-equiv (oct-escape-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-oct-escape-fix-1-forward-to-oct-escape-equiv (implies (equal (oct-escape-fix acl2::x) acl2::y) (oct-escape-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-oct-escape-fix-2-forward-to-oct-escape-equiv (implies (equal acl2::x (oct-escape-fix acl2::y)) (oct-escape-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-escape-equiv-of-oct-escape-fix-1-forward (implies (oct-escape-equiv (oct-escape-fix acl2::x) acl2::y) (oct-escape-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-escape-equiv-of-oct-escape-fix-2-forward (implies (oct-escape-equiv acl2::x (oct-escape-fix acl2::y)) (oct-escape-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-escape-kind$inline-of-oct-escape-fix-x (equal (oct-escape-kind$inline (oct-escape-fix x)) (oct-escape-kind$inline x)))
Theorem:
(defthm oct-escape-kind$inline-oct-escape-equiv-congruence-on-x (implies (oct-escape-equiv x x-equiv) (equal (oct-escape-kind$inline x) (oct-escape-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-oct-escape-fix (consp (oct-escape-fix x)) :rule-classes :type-prescription)