Fixing function for matchresult structures.
(matchresult-fix x) → new-x
Function:
(defun matchresult-fix$inline (x) (declare (xargs :guard (matchresult-p x))) (let ((__function__ 'matchresult-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((loc (maybe-natp-fix (std::da-nth 0 x))) (len (nfix (std::da-nth 1 x))) (str (acl2::str-fix (std::da-nth 2 x))) (backrefs (backref-alist-fix (std::da-nth 3 x)))) (list loc len str backrefs)) :exec x)))
Theorem:
(defthm matchresult-p-of-matchresult-fix (b* ((new-x (matchresult-fix$inline x))) (matchresult-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm matchresult-fix-when-matchresult-p (implies (matchresult-p x) (equal (matchresult-fix x) x)))
Function:
(defun matchresult-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (matchresult-p acl2::x) (matchresult-p acl2::y)))) (equal (matchresult-fix acl2::x) (matchresult-fix acl2::y)))
Theorem:
(defthm matchresult-equiv-is-an-equivalence (and (booleanp (matchresult-equiv x y)) (matchresult-equiv x x) (implies (matchresult-equiv x y) (matchresult-equiv y x)) (implies (and (matchresult-equiv x y) (matchresult-equiv y z)) (matchresult-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm matchresult-equiv-implies-equal-matchresult-fix-1 (implies (matchresult-equiv acl2::x x-equiv) (equal (matchresult-fix acl2::x) (matchresult-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm matchresult-fix-under-matchresult-equiv (matchresult-equiv (matchresult-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-matchresult-fix-1-forward-to-matchresult-equiv (implies (equal (matchresult-fix acl2::x) acl2::y) (matchresult-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-matchresult-fix-2-forward-to-matchresult-equiv (implies (equal acl2::x (matchresult-fix acl2::y)) (matchresult-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm matchresult-equiv-of-matchresult-fix-1-forward (implies (matchresult-equiv (matchresult-fix acl2::x) acl2::y) (matchresult-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm matchresult-equiv-of-matchresult-fix-2-forward (implies (matchresult-equiv acl2::x (matchresult-fix acl2::y)) (matchresult-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)