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