Fixing function for theorem structures.
Function:
(defun theorem-fix$inline (x) (declare (xargs :guard (theoremp x))) (let ((__function__ 'theorem-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (identifier-fix (cdr (std::da-nth 0 x)))) (variables (typed-variable-list-fix (cdr (std::da-nth 1 x)))) (formula (expression-fix (cdr (std::da-nth 2 x))))) (list (cons 'name name) (cons 'variables variables) (cons 'formula formula))) :exec x)))
Theorem:
(defthm theoremp-of-theorem-fix (b* ((new-x (theorem-fix$inline x))) (theoremp new-x)) :rule-classes :rewrite)
Theorem:
(defthm theorem-fix-when-theoremp (implies (theoremp x) (equal (theorem-fix x) x)))
Function:
(defun theorem-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (theoremp acl2::x) (theoremp acl2::y)))) (equal (theorem-fix acl2::x) (theorem-fix acl2::y)))
Theorem:
(defthm theorem-equiv-is-an-equivalence (and (booleanp (theorem-equiv x y)) (theorem-equiv x x) (implies (theorem-equiv x y) (theorem-equiv y x)) (implies (and (theorem-equiv x y) (theorem-equiv y z)) (theorem-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm theorem-equiv-implies-equal-theorem-fix-1 (implies (theorem-equiv acl2::x x-equiv) (equal (theorem-fix acl2::x) (theorem-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm theorem-fix-under-theorem-equiv (theorem-equiv (theorem-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-theorem-fix-1-forward-to-theorem-equiv (implies (equal (theorem-fix acl2::x) acl2::y) (theorem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-theorem-fix-2-forward-to-theorem-equiv (implies (equal acl2::x (theorem-fix acl2::y)) (theorem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm theorem-equiv-of-theorem-fix-1-forward (implies (theorem-equiv (theorem-fix acl2::x) acl2::y) (theorem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm theorem-equiv-of-theorem-fix-2-forward (implies (theorem-equiv acl2::x (theorem-fix acl2::y)) (theorem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)