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