Fixing function for stringlit structures.
(stringlit-fix x) → new-x
Function:
(defun stringlit-fix$inline (x) (declare (xargs :guard (stringlitp x))) (let ((__function__ 'stringlit-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((prefix? (eprefix-option-fix (cdr (std::da-nth 0 x)))) (schars (s-char-list-fix (cdr (std::da-nth 1 x))))) (list (cons 'prefix? prefix?) (cons 'schars schars))) :exec x)))
Theorem:
(defthm stringlitp-of-stringlit-fix (b* ((new-x (stringlit-fix$inline x))) (stringlitp new-x)) :rule-classes :rewrite)
Theorem:
(defthm stringlit-fix-when-stringlitp (implies (stringlitp x) (equal (stringlit-fix x) x)))
Function:
(defun stringlit-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (stringlitp acl2::x) (stringlitp acl2::y)))) (equal (stringlit-fix acl2::x) (stringlit-fix acl2::y)))
Theorem:
(defthm stringlit-equiv-is-an-equivalence (and (booleanp (stringlit-equiv x y)) (stringlit-equiv x x) (implies (stringlit-equiv x y) (stringlit-equiv y x)) (implies (and (stringlit-equiv x y) (stringlit-equiv y z)) (stringlit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm stringlit-equiv-implies-equal-stringlit-fix-1 (implies (stringlit-equiv acl2::x x-equiv) (equal (stringlit-fix acl2::x) (stringlit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm stringlit-fix-under-stringlit-equiv (stringlit-equiv (stringlit-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-stringlit-fix-1-forward-to-stringlit-equiv (implies (equal (stringlit-fix acl2::x) acl2::y) (stringlit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-stringlit-fix-2-forward-to-stringlit-equiv (implies (equal acl2::x (stringlit-fix acl2::y)) (stringlit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stringlit-equiv-of-stringlit-fix-1-forward (implies (stringlit-equiv (stringlit-fix acl2::x) acl2::y) (stringlit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stringlit-equiv-of-stringlit-fix-2-forward (implies (stringlit-equiv acl2::x (stringlit-fix acl2::y)) (stringlit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)