Fixing function for mach-o-header structures.
(mach-o-header-fix x) → new-x
Function:
(defun mach-o-header-fix$inline (x) (declare (xargs :guard (mach-o-header-p x))) (let ((__function__ 'mach-o-header-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((magic (nfix (cdr (std::da-nth 0 x)))) (cputype (nfix (cdr (std::da-nth 1 x)))) (cpusubtype (nfix (cdr (std::da-nth 2 x)))) (filetype (nfix (cdr (std::da-nth 3 x)))) (ncmds (nfix (cdr (std::da-nth 4 x)))) (sizeofcmds (nfix (cdr (std::da-nth 5 x)))) (flags (nfix (cdr (std::da-nth 6 x)))) (reserved (acl2::maybe-natp-fix (cdr (std::da-nth 7 x))))) (list (cons 'magic magic) (cons 'cputype cputype) (cons 'cpusubtype cpusubtype) (cons 'filetype filetype) (cons 'ncmds ncmds) (cons 'sizeofcmds sizeofcmds) (cons 'flags flags) (cons 'reserved reserved))) :exec x)))
Theorem:
(defthm mach-o-header-p-of-mach-o-header-fix (b* ((new-x (mach-o-header-fix$inline x))) (mach-o-header-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm mach-o-header-fix-when-mach-o-header-p (implies (mach-o-header-p x) (equal (mach-o-header-fix x) x)))
Function:
(defun mach-o-header-equiv$inline (x y) (declare (xargs :guard (and (mach-o-header-p x) (mach-o-header-p y)))) (equal (mach-o-header-fix x) (mach-o-header-fix y)))
Theorem:
(defthm mach-o-header-equiv-is-an-equivalence (and (booleanp (mach-o-header-equiv x y)) (mach-o-header-equiv x x) (implies (mach-o-header-equiv x y) (mach-o-header-equiv y x)) (implies (and (mach-o-header-equiv x y) (mach-o-header-equiv y z)) (mach-o-header-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm mach-o-header-equiv-implies-equal-mach-o-header-fix-1 (implies (mach-o-header-equiv x x-equiv) (equal (mach-o-header-fix x) (mach-o-header-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm mach-o-header-fix-under-mach-o-header-equiv (mach-o-header-equiv (mach-o-header-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-mach-o-header-fix-1-forward-to-mach-o-header-equiv (implies (equal (mach-o-header-fix x) y) (mach-o-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-mach-o-header-fix-2-forward-to-mach-o-header-equiv (implies (equal x (mach-o-header-fix y)) (mach-o-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm mach-o-header-equiv-of-mach-o-header-fix-1-forward (implies (mach-o-header-equiv (mach-o-header-fix x) y) (mach-o-header-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm mach-o-header-equiv-of-mach-o-header-fix-2-forward (implies (mach-o-header-equiv x (mach-o-header-fix y)) (mach-o-header-equiv x y)) :rule-classes :forward-chaining)