Fixing function for lhbit structures.
Function:
(defun lhbit-fix$inline (x) (declare (xargs :guard (lhbit-p x))) (let ((__function__ 'lhbit-fix)) (declare (ignorable __function__)) (mbe :logic (case (lhbit-kind x) (:z (cons :z (list))) (:var (b* ((name (svar-fix (std::prod-car (cdr x)))) (idx (nfix (std::prod-cdr (cdr x))))) (hons :var (std::prod-hons name idx))))) :exec x)))
Theorem:
(defthm lhbit-p-of-lhbit-fix (b* ((new-x (lhbit-fix$inline x))) (lhbit-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm lhbit-fix-when-lhbit-p (implies (lhbit-p x) (equal (lhbit-fix x) x)))
Function:
(defun lhbit-equiv$inline (x y) (declare (xargs :guard (and (lhbit-p x) (lhbit-p y)))) (equal (lhbit-fix x) (lhbit-fix y)))
Theorem:
(defthm lhbit-equiv-is-an-equivalence (and (booleanp (lhbit-equiv x y)) (lhbit-equiv x x) (implies (lhbit-equiv x y) (lhbit-equiv y x)) (implies (and (lhbit-equiv x y) (lhbit-equiv y z)) (lhbit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm lhbit-equiv-implies-equal-lhbit-fix-1 (implies (lhbit-equiv x x-equiv) (equal (lhbit-fix x) (lhbit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm lhbit-fix-under-lhbit-equiv (lhbit-equiv (lhbit-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-lhbit-fix-1-forward-to-lhbit-equiv (implies (equal (lhbit-fix x) y) (lhbit-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-lhbit-fix-2-forward-to-lhbit-equiv (implies (equal x (lhbit-fix y)) (lhbit-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhbit-equiv-of-lhbit-fix-1-forward (implies (lhbit-equiv (lhbit-fix x) y) (lhbit-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhbit-equiv-of-lhbit-fix-2-forward (implies (lhbit-equiv x (lhbit-fix y)) (lhbit-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhbit-kind$inline-of-lhbit-fix-x (equal (lhbit-kind$inline (lhbit-fix x)) (lhbit-kind$inline x)))
Theorem:
(defthm lhbit-kind$inline-lhbit-equiv-congruence-on-x (implies (lhbit-equiv x x-equiv) (equal (lhbit-kind$inline x) (lhbit-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-lhbit-fix (consp (lhbit-fix x)) :rule-classes :type-prescription)