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