Fixing function for decl structures.
Function:
(defun decl-fix$inline (x) (declare (xargs :guard (decl-p x))) (let ((acl2::__function__ 'decl-fix)) (declare (ignorable acl2::__function__)) (mbe :logic (b* ((name (symbol-fix (cdr (std::da-nth 0 x)))) (type (hint-pair-fix (cdr (std::da-nth 1 x))))) (let ((type (decl->type-reqfix type))) (list (cons 'name name) (cons 'type type)))) :exec x)))
Theorem:
(defthm decl-p-of-decl-fix (b* ((new-x (decl-fix$inline x))) (decl-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm decl-fix-when-decl-p (implies (decl-p x) (equal (decl-fix x) x)))
Function:
(defun decl-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (decl-p acl2::x) (decl-p acl2::y)))) (equal (decl-fix acl2::x) (decl-fix acl2::y)))
Theorem:
(defthm decl-equiv-is-an-equivalence (and (booleanp (decl-equiv x y)) (decl-equiv x x) (implies (decl-equiv x y) (decl-equiv y x)) (implies (and (decl-equiv x y) (decl-equiv y z)) (decl-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm decl-equiv-implies-equal-decl-fix-1 (implies (decl-equiv acl2::x x-equiv) (equal (decl-fix acl2::x) (decl-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm decl-fix-under-decl-equiv (decl-equiv (decl-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-decl-fix-1-forward-to-decl-equiv (implies (equal (decl-fix acl2::x) acl2::y) (decl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-decl-fix-2-forward-to-decl-equiv (implies (equal acl2::x (decl-fix acl2::y)) (decl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm decl-equiv-of-decl-fix-1-forward (implies (decl-equiv (decl-fix acl2::x) acl2::y) (decl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm decl-equiv-of-decl-fix-2-forward (implies (decl-equiv acl2::x (decl-fix acl2::y)) (decl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)