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