Fixing function for pflat structures.
Function:
(defun pflat-fix$inline (x) (declare (xargs :guard (pflat-p x))) (let ((acl2::__function__ 'pflat-fix)) (declare (ignorable acl2::__function__)) (mbe :logic (b* ((width (acl2::pos-fix (std::prod-car x))) (what (std::prod-cdr x))) (std::prod-cons width what)) :exec x)))
Theorem:
(defthm pflat-p-of-pflat-fix (b* ((new-x (pflat-fix$inline x))) (pflat-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm pflat-fix-when-pflat-p (implies (pflat-p x) (equal (pflat-fix x) x)))
Function:
(defun pflat-equiv$inline (x y) (declare (xargs :guard (and (pflat-p x) (pflat-p y)))) (equal (pflat-fix x) (pflat-fix y)))
Theorem:
(defthm pflat-equiv-is-an-equivalence (and (booleanp (pflat-equiv x y)) (pflat-equiv x x) (implies (pflat-equiv x y) (pflat-equiv y x)) (implies (and (pflat-equiv x y) (pflat-equiv y z)) (pflat-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm pflat-equiv-implies-equal-pflat-fix-1 (implies (pflat-equiv x x-equiv) (equal (pflat-fix x) (pflat-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm pflat-fix-under-pflat-equiv (pflat-equiv (pflat-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-pflat-fix-1-forward-to-pflat-equiv (implies (equal (pflat-fix x) y) (pflat-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-pflat-fix-2-forward-to-pflat-equiv (implies (equal x (pflat-fix y)) (pflat-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm pflat-equiv-of-pflat-fix-1-forward (implies (pflat-equiv (pflat-fix x) y) (pflat-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm pflat-equiv-of-pflat-fix-2-forward (implies (pflat-equiv x (pflat-fix y)) (pflat-equiv x y)) :rule-classes :forward-chaining)