• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
      • Axe
      • Execloader
        • Elf-reader
        • Mach-o-reader
          • Read-load_commands
          • Read-section_data_sz_structures
          • Mach-o-section-header
            • Mach-o-section-header-fix
              • Make-mach-o-section-header
              • Mach-o-section-header-equiv
              • Mach-o-section-header-p
              • Change-mach-o-section-header
              • Mach-o-section-header->segname
              • Mach-o-section-header->sectname
              • Mach-o-section-header->reserved3
              • Mach-o-section-header->reserved2
              • Mach-o-section-header->reserved1
              • Mach-o-section-header->reloff
              • Mach-o-section-header->offset
              • Mach-o-section-header->nreloc
              • Mach-o-section-header->size
              • Mach-o-section-header->flags
              • Mach-o-section-header->align
              • Mach-o-section-header->addr
            • Mach-o-header
            • Populate-mach-o-contents
            • Good-mach-o-p
            • Fill-data-segment-bytes
            • Fill-text-text-section-bytes
            • Fill-text-segment-bytes
            • Fill-text-cstring-section-bytes
            • Fill-text-const-section-bytes
            • Fill-data-dyld-section-bytes
            • Fill-data-data-section-bytes
            • Fill-data-const-section-bytes
            • Fill-data-common-section-bytes
            • Fill-data-bss-section-bytes
            • Read-mach_header
            • Populate-mach-o
            • Mach-o-section-headers
          • Merge-first-split-bytes
          • Split-bytes
          • Take-till-zero
          • Charlist->bytes
          • Merge-bytes
          • Bytes->charlist
          • String->bytes
          • Bytes->string
      • Math
      • Testing-utilities
    • Mach-o-section-header

    Mach-o-section-header-fix

    Fixing function for mach-o-section-header structures.

    Signature
    (mach-o-section-header-fix x) → new-x
    Arguments
    x — Guard (mach-o-section-header-p x).
    Returns
    new-x — Type (mach-o-section-header-p new-x).

    Definitions and Theorems

    Function: mach-o-section-header-fix$inline

    (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: mach-o-section-header-p-of-mach-o-section-header-fix

    (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: mach-o-section-header-fix-when-mach-o-section-header-p

    (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: mach-o-section-header-equiv$inline

    (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: mach-o-section-header-equiv-is-an-equivalence

    (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: mach-o-section-header-equiv-implies-equal-mach-o-section-header-fix-1

    (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: mach-o-section-header-fix-under-mach-o-section-header-equiv

    (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: equal-of-mach-o-section-header-fix-1-forward-to-mach-o-section-header-equiv

    (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: equal-of-mach-o-section-header-fix-2-forward-to-mach-o-section-header-equiv

    (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: mach-o-section-header-equiv-of-mach-o-section-header-fix-1-forward

    (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: mach-o-section-header-equiv-of-mach-o-section-header-fix-2-forward

    (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)