(lhs-fix x) is a usual fty list fixing function.
In the logic, we apply lhrange-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 lhs-fix$inline (x) (declare (xargs :guard (lhs-p x))) (let ((__function__ 'lhs-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (lhrange-fix (car x)) (lhs-fix (cdr x)))) :exec x)))
Theorem:
(defthm lhs-p-of-lhs-fix (b* ((fty::newx (lhs-fix$inline x))) (lhs-p fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm lhs-fix-when-lhs-p (implies (lhs-p x) (equal (lhs-fix x) x)))
Function:
(defun lhs-equiv$inline (x y) (declare (xargs :guard (and (lhs-p x) (lhs-p y)))) (equal (lhs-fix x) (lhs-fix y)))
Theorem:
(defthm lhs-equiv-is-an-equivalence (and (booleanp (lhs-equiv x y)) (lhs-equiv x x) (implies (lhs-equiv x y) (lhs-equiv y x)) (implies (and (lhs-equiv x y) (lhs-equiv y z)) (lhs-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm lhs-equiv-implies-equal-lhs-fix-1 (implies (lhs-equiv x x-equiv) (equal (lhs-fix x) (lhs-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm lhs-fix-under-lhs-equiv (lhs-equiv (lhs-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-lhs-fix-1-forward-to-lhs-equiv (implies (equal (lhs-fix x) y) (lhs-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-lhs-fix-2-forward-to-lhs-equiv (implies (equal x (lhs-fix y)) (lhs-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhs-equiv-of-lhs-fix-1-forward (implies (lhs-equiv (lhs-fix x) y) (lhs-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhs-equiv-of-lhs-fix-2-forward (implies (lhs-equiv x (lhs-fix y)) (lhs-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-lhs-fix-x-under-lhrange-equiv (lhrange-equiv (car (lhs-fix x)) (car x)))
Theorem:
(defthm car-lhs-equiv-congruence-on-x-under-lhrange-equiv (implies (lhs-equiv x x-equiv) (lhrange-equiv (car x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-lhs-fix-x-under-lhs-equiv (lhs-equiv (cdr (lhs-fix x)) (cdr x)))
Theorem:
(defthm cdr-lhs-equiv-congruence-on-x-under-lhs-equiv (implies (lhs-equiv x x-equiv) (lhs-equiv (cdr x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-lhrange-fix-x-under-lhs-equiv (lhs-equiv (cons (lhrange-fix x) y) (cons x y)))
Theorem:
(defthm cons-lhrange-equiv-congruence-on-x-under-lhs-equiv (implies (lhrange-equiv x x-equiv) (lhs-equiv (cons x y) (cons x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-lhs-fix-y-under-lhs-equiv (lhs-equiv (cons x (lhs-fix y)) (cons x y)))
Theorem:
(defthm cons-lhs-equiv-congruence-on-y-under-lhs-equiv (implies (lhs-equiv y y-equiv) (lhs-equiv (cons x y) (cons x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-lhs-fix (equal (consp (lhs-fix x)) (consp x)))
Theorem:
(defthm lhs-fix-under-iff (iff (lhs-fix x) (consp x)))
Theorem:
(defthm lhs-fix-of-cons (equal (lhs-fix (cons a x)) (cons (lhrange-fix a) (lhs-fix x))))
Theorem:
(defthm len-of-lhs-fix (equal (len (lhs-fix x)) (len x)))
Theorem:
(defthm lhs-fix-of-append (equal (lhs-fix (append std::a std::b)) (append (lhs-fix std::a) (lhs-fix std::b))))
Theorem:
(defthm lhs-fix-of-repeat (equal (lhs-fix (repeat acl2::n x)) (repeat acl2::n (lhrange-fix x))))
Theorem:
(defthm list-equiv-refines-lhs-equiv (implies (list-equiv x y) (lhs-equiv x y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-lhs-fix (equal (nth acl2::n (lhs-fix x)) (if (< (nfix acl2::n) (len x)) (lhrange-fix (nth acl2::n x)) nil)))
Theorem:
(defthm lhs-equiv-implies-lhs-equiv-append-1 (implies (lhs-equiv x fty::x-equiv) (lhs-equiv (append x y) (append fty::x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm lhs-equiv-implies-lhs-equiv-append-2 (implies (lhs-equiv y fty::y-equiv) (lhs-equiv (append x y) (append x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm lhs-equiv-implies-lhs-equiv-nthcdr-2 (implies (lhs-equiv acl2::l l-equiv) (lhs-equiv (nthcdr acl2::n acl2::l) (nthcdr acl2::n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm lhs-equiv-implies-lhs-equiv-take-2 (implies (lhs-equiv acl2::l l-equiv) (lhs-equiv (take acl2::n acl2::l) (take acl2::n l-equiv))) :rule-classes (:congruence))