• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
      • Axe
      • Execloader
        • Elf-reader
          • Elf64_sym
          • Elf32_sym
          • Elf-header
          • Elf-section-header
            • Elf-section-header-fix
              • Make-elf-section-header
              • Elf-section-header-equiv
              • Elf-section-header-p
              • Change-elf-section-header
              • Elf-section-header->name-str
              • Elf-section-header->addralign
              • Elf-section-header->offset
              • Elf-section-header->flags
              • Elf-section-header->entsize
              • Elf-section-header->type
              • Elf-section-header->size
              • Elf-section-header->name
              • Elf-section-header->link
              • Elf-section-header->info
              • Elf-section-header->addr
            • Elf64-segment-header
            • Elf32-segment-header
            • Elf_bits32
            • Elf_bits8
            • Elf_bits64
            • Elf_bits16
            • Section-info
            • Read-section-headers
            • Read-segment-headers-64
            • Read-segment-headers-32
            • Read-section-names
            • Elf64_sym-info
            • Elf32_sym-info
            • Read-elf-header
            • Parse-symtab-entries
            • Populate-elf-contents
            • Is-elf-content-p
            • Get-string-section-data
            • Get-section-info1
            • Set-elf-stobj-fields
            • Get-named-section-headers
            • Elf-read-mem-null-term
            • Get-section-info
            • Get-symtab-entries
            • Find-label-address-from-elf-symtab-info
            • Section-names
            • Populate-elf
            • Get-label-addresses
            • Elf-read-string-null-term
            • Get-label-address
            • Good-elf-p
            • Elf64_sym-equiv-under-mask
            • Elf64-segment-headers
            • Elf32_sym-equiv-under-mask
            • Elf32-segment-headers
            • Section-info-list
            • Elf64_sym-info-list
            • Elf32_sym-info-list
            • Elf-section-headers
            • Elf64_sym-debug
            • Elf32_sym-debug
          • Mach-o-reader
          • Merge-first-split-bytes
          • Split-bytes
          • Take-till-zero
          • Charlist->bytes
          • Merge-bytes
          • Bytes->charlist
          • String->bytes
          • Bytes->string
      • Math
      • Testing-utilities
    • Elf-section-header

    Elf-section-header-fix

    Fixing function for elf-section-header structures.

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

    Definitions and Theorems

    Function: elf-section-header-fix$inline

    (defun elf-section-header-fix$inline (x)
      (declare (xargs :guard (elf-section-header-p x)))
      (let ((__function__ 'elf-section-header-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((name-str (acl2::str-fix (cdr (std::da-nth 0 x))))
                  (name (nfix (cdr (std::da-nth 1 x))))
                  (type (nfix (cdr (std::da-nth 2 x))))
                  (flags (nfix (cdr (std::da-nth 3 x))))
                  (addr (nfix (cdr (std::da-nth 4 x))))
                  (offset (nfix (cdr (std::da-nth 5 x))))
                  (size (nfix (cdr (std::da-nth 6 x))))
                  (link (nfix (cdr (std::da-nth 7 x))))
                  (info (nfix (cdr (std::da-nth 8 x))))
                  (addralign (nfix (cdr (std::da-nth 9 x))))
                  (entsize (nfix (cdr (std::da-nth 10 x)))))
               (list (cons 'name-str name-str)
                     (cons 'name name)
                     (cons 'type type)
                     (cons 'flags flags)
                     (cons 'addr addr)
                     (cons 'offset offset)
                     (cons 'size size)
                     (cons 'link link)
                     (cons 'info info)
                     (cons 'addralign addralign)
                     (cons 'entsize entsize)))
             :exec x)))

    Theorem: elf-section-header-p-of-elf-section-header-fix

    (defthm elf-section-header-p-of-elf-section-header-fix
      (b* ((new-x (elf-section-header-fix$inline x)))
        (elf-section-header-p new-x))
      :rule-classes :rewrite)

    Theorem: elf-section-header-fix-when-elf-section-header-p

    (defthm elf-section-header-fix-when-elf-section-header-p
      (implies (elf-section-header-p x)
               (equal (elf-section-header-fix x) x)))

    Function: elf-section-header-equiv$inline

    (defun elf-section-header-equiv$inline (x y)
      (declare (xargs :guard (and (elf-section-header-p x)
                                  (elf-section-header-p y))))
      (equal (elf-section-header-fix x)
             (elf-section-header-fix y)))

    Theorem: elf-section-header-equiv-is-an-equivalence

    (defthm elf-section-header-equiv-is-an-equivalence
      (and (booleanp (elf-section-header-equiv x y))
           (elf-section-header-equiv x x)
           (implies (elf-section-header-equiv x y)
                    (elf-section-header-equiv y x))
           (implies (and (elf-section-header-equiv x y)
                         (elf-section-header-equiv y z))
                    (elf-section-header-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: elf-section-header-equiv-implies-equal-elf-section-header-fix-1

    (defthm
        elf-section-header-equiv-implies-equal-elf-section-header-fix-1
      (implies (elf-section-header-equiv x x-equiv)
               (equal (elf-section-header-fix x)
                      (elf-section-header-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: elf-section-header-fix-under-elf-section-header-equiv

    (defthm elf-section-header-fix-under-elf-section-header-equiv
      (elf-section-header-equiv (elf-section-header-fix x)
                                x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-elf-section-header-fix-1-forward-to-elf-section-header-equiv

    (defthm
     equal-of-elf-section-header-fix-1-forward-to-elf-section-header-equiv
     (implies (equal (elf-section-header-fix x) y)
              (elf-section-header-equiv x y))
     :rule-classes :forward-chaining)

    Theorem: equal-of-elf-section-header-fix-2-forward-to-elf-section-header-equiv

    (defthm
     equal-of-elf-section-header-fix-2-forward-to-elf-section-header-equiv
     (implies (equal x (elf-section-header-fix y))
              (elf-section-header-equiv x y))
     :rule-classes :forward-chaining)

    Theorem: elf-section-header-equiv-of-elf-section-header-fix-1-forward

    (defthm elf-section-header-equiv-of-elf-section-header-fix-1-forward
      (implies (elf-section-header-equiv (elf-section-header-fix x)
                                         y)
               (elf-section-header-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: elf-section-header-equiv-of-elf-section-header-fix-2-forward

    (defthm elf-section-header-equiv-of-elf-section-header-fix-2-forward
      (implies (elf-section-header-equiv x (elf-section-header-fix y))
               (elf-section-header-equiv x y))
      :rule-classes :forward-chaining)