Fixing function for mach-o-section-header structures.
(mach-o-section-header-fix x) → new-x
Function:
(defun mach-o-section-header-fix$inline (x) (declare (xargs :guard (mach-o-section-header-p x))) (let ((__function__ 'mach-o-section-header-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((sectname (acl2::str-fix (cdr (std::da-nth 0 x)))) (segname (acl2::str-fix (cdr (std::da-nth 1 x)))) (addr (nfix (cdr (std::da-nth 2 x)))) (size (nfix (cdr (std::da-nth 3 x)))) (offset (nfix (cdr (std::da-nth 4 x)))) (align (nfix (cdr (std::da-nth 5 x)))) (reloff (nfix (cdr (std::da-nth 6 x)))) (nreloc (nfix (cdr (std::da-nth 7 x)))) (flags (nfix (cdr (std::da-nth 8 x)))) (reserved1 (nfix (cdr (std::da-nth 9 x)))) (reserved2 (nfix (cdr (std::da-nth 10 x)))) (reserved3 (nfix (cdr (std::da-nth 11 x))))) (list (cons 'sectname sectname) (cons 'segname segname) (cons 'addr addr) (cons 'size size) (cons 'offset offset) (cons 'align align) (cons 'reloff reloff) (cons 'nreloc nreloc) (cons 'flags flags) (cons 'reserved1 reserved1) (cons 'reserved2 reserved2) (cons 'reserved3 reserved3))) :exec x)))
Theorem:
(defthm mach-o-section-header-p-of-mach-o-section-header-fix (b* ((new-x (mach-o-section-header-fix$inline x))) (mach-o-section-header-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm mach-o-section-header-fix-when-mach-o-section-header-p (implies (mach-o-section-header-p x) (equal (mach-o-section-header-fix x) x)))
Function:
(defun mach-o-section-header-equiv$inline (x y) (declare (xargs :guard (and (mach-o-section-header-p x) (mach-o-section-header-p y)))) (equal (mach-o-section-header-fix x) (mach-o-section-header-fix y)))
Theorem:
(defthm mach-o-section-header-equiv-is-an-equivalence (and (booleanp (mach-o-section-header-equiv x y)) (mach-o-section-header-equiv x x) (implies (mach-o-section-header-equiv x y) (mach-o-section-header-equiv y x)) (implies (and (mach-o-section-header-equiv x y) (mach-o-section-header-equiv y z)) (mach-o-section-header-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm mach-o-section-header-equiv-implies-equal-mach-o-section-header-fix-1 (implies (mach-o-section-header-equiv x x-equiv) (equal (mach-o-section-header-fix x) (mach-o-section-header-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm mach-o-section-header-fix-under-mach-o-section-header-equiv (mach-o-section-header-equiv (mach-o-section-header-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-mach-o-section-header-fix-1-forward-to-mach-o-section-header-equiv (implies (equal (mach-o-section-header-fix x) y) (mach-o-section-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-mach-o-section-header-fix-2-forward-to-mach-o-section-header-equiv (implies (equal x (mach-o-section-header-fix y)) (mach-o-section-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm mach-o-section-header-equiv-of-mach-o-section-header-fix-1-forward (implies (mach-o-section-header-equiv (mach-o-section-header-fix x) y) (mach-o-section-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm mach-o-section-header-equiv-of-mach-o-section-header-fix-2-forward (implies (mach-o-section-header-equiv x (mach-o-section-header-fix y)) (mach-o-section-header-equiv x y)) :rule-classes :forward-chaining)