Fixing function for character-result structures.
(character-result-fix x) → new-x
Function:
(defun character-result-fix$inline (x) (declare (xargs :guard (character-resultp x))) (let ((__function__ 'character-result-fix)) (declare (ignorable __function__)) (mbe :logic (case (character-result-kind x) (:ok (b* ((get (char-fix x))) get)) (:err (b* ((get (fty::reserr-fix x))) get))) :exec x)))
Theorem:
(defthm character-resultp-of-character-result-fix (b* ((new-x (character-result-fix$inline x))) (character-resultp new-x)) :rule-classes :rewrite)
Theorem:
(defthm character-result-fix-when-character-resultp (implies (character-resultp x) (equal (character-result-fix x) x)))
Function:
(defun character-result-equiv$inline (x y) (declare (xargs :guard (and (character-resultp x) (character-resultp y)))) (equal (character-result-fix x) (character-result-fix y)))
Theorem:
(defthm character-result-equiv-is-an-equivalence (and (booleanp (character-result-equiv x y)) (character-result-equiv x x) (implies (character-result-equiv x y) (character-result-equiv y x)) (implies (and (character-result-equiv x y) (character-result-equiv y z)) (character-result-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm character-result-equiv-implies-equal-character-result-fix-1 (implies (character-result-equiv x x-equiv) (equal (character-result-fix x) (character-result-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm character-result-fix-under-character-result-equiv (character-result-equiv (character-result-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-character-result-fix-1-forward-to-character-result-equiv (implies (equal (character-result-fix x) y) (character-result-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-character-result-fix-2-forward-to-character-result-equiv (implies (equal x (character-result-fix y)) (character-result-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm character-result-equiv-of-character-result-fix-1-forward (implies (character-result-equiv (character-result-fix x) y) (character-result-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm character-result-equiv-of-character-result-fix-2-forward (implies (character-result-equiv x (character-result-fix y)) (character-result-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm character-result-kind$inline-of-character-result-fix-x (equal (character-result-kind$inline (character-result-fix x)) (character-result-kind$inline x)))
Theorem:
(defthm character-result-kind$inline-character-result-equiv-congruence-on-x (implies (character-result-equiv x x-equiv) (equal (character-result-kind$inline x) (character-result-kind$inline x-equiv))) :rule-classes :congruence)