(string-literal-fix x) is a usual ACL2::fty list fixing function.
(string-literal-fix x) → fty::newx
In the logic, we apply string-literal-char-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun string-literal-fix$inline (x) (declare (xargs :guard (string-literalp x))) (let ((__function__ 'string-literal-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (string-literal-char-fix (car x)) (string-literal-fix (cdr x)))) :exec x)))
Theorem:
(defthm string-literalp-of-string-literal-fix (b* ((fty::newx (string-literal-fix$inline x))) (string-literalp fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm string-literal-fix-when-string-literalp (implies (string-literalp x) (equal (string-literal-fix x) x)))
Function:
(defun string-literal-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (string-literalp acl2::x) (string-literalp acl2::y)))) (equal (string-literal-fix acl2::x) (string-literal-fix acl2::y)))
Theorem:
(defthm string-literal-equiv-is-an-equivalence (and (booleanp (string-literal-equiv x y)) (string-literal-equiv x x) (implies (string-literal-equiv x y) (string-literal-equiv y x)) (implies (and (string-literal-equiv x y) (string-literal-equiv y z)) (string-literal-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm string-literal-equiv-implies-equal-string-literal-fix-1 (implies (string-literal-equiv acl2::x x-equiv) (equal (string-literal-fix acl2::x) (string-literal-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm string-literal-fix-under-string-literal-equiv (string-literal-equiv (string-literal-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-string-literal-fix-1-forward-to-string-literal-equiv (implies (equal (string-literal-fix acl2::x) acl2::y) (string-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-string-literal-fix-2-forward-to-string-literal-equiv (implies (equal acl2::x (string-literal-fix acl2::y)) (string-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-literal-equiv-of-string-literal-fix-1-forward (implies (string-literal-equiv (string-literal-fix acl2::x) acl2::y) (string-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-literal-equiv-of-string-literal-fix-2-forward (implies (string-literal-equiv acl2::x (string-literal-fix acl2::y)) (string-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-string-literal-fix-x-under-string-literal-char-equiv (string-literal-char-equiv (car (string-literal-fix acl2::x)) (car acl2::x)))
Theorem:
(defthm car-string-literal-equiv-congruence-on-x-under-string-literal-char-equiv (implies (string-literal-equiv acl2::x x-equiv) (string-literal-char-equiv (car acl2::x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-string-literal-fix-x-under-string-literal-equiv (string-literal-equiv (cdr (string-literal-fix acl2::x)) (cdr acl2::x)))
Theorem:
(defthm cdr-string-literal-equiv-congruence-on-x-under-string-literal-equiv (implies (string-literal-equiv acl2::x x-equiv) (string-literal-equiv (cdr acl2::x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-string-literal-char-fix-x-under-string-literal-equiv (string-literal-equiv (cons (string-literal-char-fix acl2::x) acl2::y) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-string-literal-char-equiv-congruence-on-x-under-string-literal-equiv (implies (string-literal-char-equiv acl2::x x-equiv) (string-literal-equiv (cons acl2::x acl2::y) (cons x-equiv acl2::y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-string-literal-fix-y-under-string-literal-equiv (string-literal-equiv (cons acl2::x (string-literal-fix acl2::y)) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-string-literal-equiv-congruence-on-y-under-string-literal-equiv (implies (string-literal-equiv acl2::y y-equiv) (string-literal-equiv (cons acl2::x acl2::y) (cons acl2::x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-string-literal-fix (equal (consp (string-literal-fix acl2::x)) (consp acl2::x)))
Theorem:
(defthm string-literal-fix-under-iff (iff (string-literal-fix acl2::x) (consp acl2::x)))
Theorem:
(defthm string-literal-fix-of-cons (equal (string-literal-fix (cons a x)) (cons (string-literal-char-fix a) (string-literal-fix x))))
Theorem:
(defthm len-of-string-literal-fix (equal (len (string-literal-fix acl2::x)) (len acl2::x)))
Theorem:
(defthm string-literal-fix-of-append (equal (string-literal-fix (append std::a std::b)) (append (string-literal-fix std::a) (string-literal-fix std::b))))
Theorem:
(defthm string-literal-fix-of-repeat (equal (string-literal-fix (repeat acl2::n acl2::x)) (repeat acl2::n (string-literal-char-fix acl2::x))))
Theorem:
(defthm list-equiv-refines-string-literal-equiv (implies (list-equiv acl2::x acl2::y) (string-literal-equiv acl2::x acl2::y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-string-literal-fix (equal (nth acl2::n (string-literal-fix acl2::x)) (if (< (nfix acl2::n) (len acl2::x)) (string-literal-char-fix (nth acl2::n acl2::x)) nil)))
Theorem:
(defthm string-literal-equiv-implies-string-literal-equiv-append-1 (implies (string-literal-equiv acl2::x fty::x-equiv) (string-literal-equiv (append acl2::x acl2::y) (append fty::x-equiv acl2::y))) :rule-classes (:congruence))
Theorem:
(defthm string-literal-equiv-implies-string-literal-equiv-append-2 (implies (string-literal-equiv acl2::y fty::y-equiv) (string-literal-equiv (append acl2::x acl2::y) (append acl2::x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm string-literal-equiv-implies-string-literal-equiv-nthcdr-2 (implies (string-literal-equiv acl2::l l-equiv) (string-literal-equiv (nthcdr acl2::n acl2::l) (nthcdr acl2::n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm string-literal-equiv-implies-string-literal-equiv-take-2 (implies (string-literal-equiv acl2::l l-equiv) (string-literal-equiv (take acl2::n acl2::l) (take acl2::n l-equiv))) :rule-classes (:congruence))