Fixing function for escape-sequence structures.
(escape-sequence-fix x) → new-x
Function:
(defun escape-sequence-fix$inline (x) (declare (xargs :guard (escape-sequence-p x))) (let ((__function__ 'escape-sequence-fix)) (declare (ignorable __function__)) (mbe :logic (case (escape-sequence-kind x) (:b (cons :b (list))) (:t (cons :t (list))) (:n (cons :n (list))) (:f (cons :f (list))) (:r (cons :r (list))) (:double-quote (cons :double-quote (list))) (:single-quote (cons :single-quote (list))) (:backslash (cons :backslash (list))) (:octal (b* ((value (acl2::ubyte8-fix (std::da-nth 0 (cdr x))))) (cons :octal (list value))))) :exec x)))
Theorem:
(defthm escape-sequence-p-of-escape-sequence-fix (b* ((new-x (escape-sequence-fix$inline x))) (escape-sequence-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm escape-sequence-fix-when-escape-sequence-p (implies (escape-sequence-p x) (equal (escape-sequence-fix x) x)))
Function:
(defun escape-sequence-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (escape-sequence-p acl2::x) (escape-sequence-p acl2::y)))) (equal (escape-sequence-fix acl2::x) (escape-sequence-fix acl2::y)))
Theorem:
(defthm escape-sequence-equiv-is-an-equivalence (and (booleanp (escape-sequence-equiv x y)) (escape-sequence-equiv x x) (implies (escape-sequence-equiv x y) (escape-sequence-equiv y x)) (implies (and (escape-sequence-equiv x y) (escape-sequence-equiv y z)) (escape-sequence-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm escape-sequence-equiv-implies-equal-escape-sequence-fix-1 (implies (escape-sequence-equiv acl2::x x-equiv) (equal (escape-sequence-fix acl2::x) (escape-sequence-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm escape-sequence-fix-under-escape-sequence-equiv (escape-sequence-equiv (escape-sequence-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-escape-sequence-fix-1-forward-to-escape-sequence-equiv (implies (equal (escape-sequence-fix acl2::x) acl2::y) (escape-sequence-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-escape-sequence-fix-2-forward-to-escape-sequence-equiv (implies (equal acl2::x (escape-sequence-fix acl2::y)) (escape-sequence-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm escape-sequence-equiv-of-escape-sequence-fix-1-forward (implies (escape-sequence-equiv (escape-sequence-fix acl2::x) acl2::y) (escape-sequence-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm escape-sequence-equiv-of-escape-sequence-fix-2-forward (implies (escape-sequence-equiv acl2::x (escape-sequence-fix acl2::y)) (escape-sequence-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm escape-sequence-kind$inline-of-escape-sequence-fix-x (equal (escape-sequence-kind$inline (escape-sequence-fix x)) (escape-sequence-kind$inline x)))
Theorem:
(defthm escape-sequence-kind$inline-escape-sequence-equiv-congruence-on-x (implies (escape-sequence-equiv x x-equiv) (equal (escape-sequence-kind$inline x) (escape-sequence-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-escape-sequence-fix (consp (escape-sequence-fix x)) :rule-classes :type-prescription)