Fixing function for lhatom structures.
Function:
(defun lhatom-fix$inline (x) (declare (xargs :guard (lhatom-p x))) (let ((__function__ 'lhatom-fix)) (declare (ignorable __function__)) (mbe :logic (case (lhatom-kind x) (:z ':z) (:var (b* ((name (svar-fix (if (or (atom x) (and (eq (car x) :var) (consp (cdr x)))) x (car x)))) (rsh (nfix (if (or (atom x) (and (eq (car x) :var) (consp (cdr x)))) 0 (cdr x))))) (if (and (eql 0 rsh) (not (eq name :z))) name (cons name rsh))))) :exec x)))
Theorem:
(defthm lhatom-p-of-lhatom-fix (b* ((new-x (lhatom-fix$inline x))) (lhatom-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm lhatom-fix-when-lhatom-p (implies (lhatom-p x) (equal (lhatom-fix x) x)))
Function:
(defun lhatom-equiv$inline (x y) (declare (xargs :guard (and (lhatom-p x) (lhatom-p y)))) (equal (lhatom-fix x) (lhatom-fix y)))
Theorem:
(defthm lhatom-equiv-is-an-equivalence (and (booleanp (lhatom-equiv x y)) (lhatom-equiv x x) (implies (lhatom-equiv x y) (lhatom-equiv y x)) (implies (and (lhatom-equiv x y) (lhatom-equiv y z)) (lhatom-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm lhatom-equiv-implies-equal-lhatom-fix-1 (implies (lhatom-equiv x x-equiv) (equal (lhatom-fix x) (lhatom-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm lhatom-fix-under-lhatom-equiv (lhatom-equiv (lhatom-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-lhatom-fix-1-forward-to-lhatom-equiv (implies (equal (lhatom-fix x) y) (lhatom-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-lhatom-fix-2-forward-to-lhatom-equiv (implies (equal x (lhatom-fix y)) (lhatom-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhatom-equiv-of-lhatom-fix-1-forward (implies (lhatom-equiv (lhatom-fix x) y) (lhatom-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhatom-equiv-of-lhatom-fix-2-forward (implies (lhatom-equiv x (lhatom-fix y)) (lhatom-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm lhatom-kind$inline-of-lhatom-fix-x (equal (lhatom-kind$inline (lhatom-fix x)) (lhatom-kind$inline x)))
Theorem:
(defthm lhatom-kind$inline-lhatom-equiv-congruence-on-x (implies (lhatom-equiv x x-equiv) (equal (lhatom-kind$inline x) (lhatom-kind$inline x-equiv))) :rule-classes :congruence)