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