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