Fixing function for extdecl structures.
Function:
(defun extdecl-fix$inline (x) (declare (xargs :guard (extdeclp x))) (let ((__function__ 'extdecl-fix)) (declare (ignorable __function__)) (mbe :logic (case (extdecl-kind x) (:fundef (b* ((unwrap (fundef-fix (std::da-nth 0 (cdr x))))) (cons :fundef (list unwrap)))) (:decl (b* ((unwrap (decl-fix (std::da-nth 0 (cdr x))))) (cons :decl (list unwrap)))) (:empty (cons :empty (list))) (:asm (b* ((unwrap (asm-stmt-fix (std::da-nth 0 (cdr x))))) (cons :asm (list unwrap))))) :exec x)))
Theorem:
(defthm extdeclp-of-extdecl-fix (b* ((new-x (extdecl-fix$inline x))) (extdeclp new-x)) :rule-classes :rewrite)
Theorem:
(defthm extdecl-fix-when-extdeclp (implies (extdeclp x) (equal (extdecl-fix x) x)))
Function:
(defun extdecl-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (extdeclp acl2::x) (extdeclp acl2::y)))) (equal (extdecl-fix acl2::x) (extdecl-fix acl2::y)))
Theorem:
(defthm extdecl-equiv-is-an-equivalence (and (booleanp (extdecl-equiv x y)) (extdecl-equiv x x) (implies (extdecl-equiv x y) (extdecl-equiv y x)) (implies (and (extdecl-equiv x y) (extdecl-equiv y z)) (extdecl-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm extdecl-equiv-implies-equal-extdecl-fix-1 (implies (extdecl-equiv acl2::x x-equiv) (equal (extdecl-fix acl2::x) (extdecl-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm extdecl-fix-under-extdecl-equiv (extdecl-equiv (extdecl-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-extdecl-fix-1-forward-to-extdecl-equiv (implies (equal (extdecl-fix acl2::x) acl2::y) (extdecl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-extdecl-fix-2-forward-to-extdecl-equiv (implies (equal acl2::x (extdecl-fix acl2::y)) (extdecl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm extdecl-equiv-of-extdecl-fix-1-forward (implies (extdecl-equiv (extdecl-fix acl2::x) acl2::y) (extdecl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm extdecl-equiv-of-extdecl-fix-2-forward (implies (extdecl-equiv acl2::x (extdecl-fix acl2::y)) (extdecl-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm extdecl-kind$inline-of-extdecl-fix-x (equal (extdecl-kind$inline (extdecl-fix x)) (extdecl-kind$inline x)))
Theorem:
(defthm extdecl-kind$inline-extdecl-equiv-congruence-on-x (implies (extdecl-equiv x x-equiv) (equal (extdecl-kind$inline x) (extdecl-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-extdecl-fix (consp (extdecl-fix x)) :rule-classes :type-prescription)