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