Fixing function for span structures.
Function:
(defun span-fix$inline (x) (declare (xargs :guard (spanp x))) (let ((__function__ 'span-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((start (position-fix (cdr (std::da-nth 0 x)))) (end (position-fix (cdr (std::da-nth 1 x))))) (list (cons 'start start) (cons 'end end))) :exec x)))
Theorem:
(defthm spanp-of-span-fix (b* ((new-x (span-fix$inline x))) (spanp new-x)) :rule-classes :rewrite)
Theorem:
(defthm span-fix-when-spanp (implies (spanp x) (equal (span-fix x) x)))
Function:
(defun span-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (spanp acl2::x) (spanp acl2::y)))) (equal (span-fix acl2::x) (span-fix acl2::y)))
Theorem:
(defthm span-equiv-is-an-equivalence (and (booleanp (span-equiv x y)) (span-equiv x x) (implies (span-equiv x y) (span-equiv y x)) (implies (and (span-equiv x y) (span-equiv y z)) (span-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm span-equiv-implies-equal-span-fix-1 (implies (span-equiv acl2::x x-equiv) (equal (span-fix acl2::x) (span-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm span-fix-under-span-equiv (span-equiv (span-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-span-fix-1-forward-to-span-equiv (implies (equal (span-fix acl2::x) acl2::y) (span-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-span-fix-2-forward-to-span-equiv (implies (equal acl2::x (span-fix acl2::y)) (span-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm span-equiv-of-span-fix-1-forward (implies (span-equiv (span-fix acl2::x) acl2::y) (span-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm span-equiv-of-span-fix-2-forward (implies (span-equiv acl2::x (span-fix acl2::y)) (span-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)