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