• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
      • Axe
      • Execloader
        • Elf-reader
          • Elf64_sym
          • Elf32_sym
          • Elf-header
            • Elf-header-fix
            • Make-elf-header
            • Elf-header-p
              • Change-elf-header
              • Elf-header-equiv
              • Elf-header->version
              • Elf-header->shstrndx
              • Elf-header->shentsize
              • Elf-header->phentsize
              • Elf-header->padding
              • Elf-header->magic
              • Elf-header->machine
              • Elf-header->identver
              • Elf-header->ehsize
              • Elf-header->dataenc
              • Elf-header->abiver
              • Elf-header->type
              • Elf-header->shoff
              • Elf-header->shnum
              • Elf-header->phoff
              • Elf-header->phnum
              • Elf-header->osabi
              • Elf-header->flags
              • Elf-header->entry
              • Elf-header->class
            • Elf-section-header
            • 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-header

    Elf-header-p

    Recognizer for elf-header structures.

    Signature
    (elf-header-p x) → *

    Definitions and Theorems

    Function: elf-header-p

    (defun elf-header-p (x)
     (declare (xargs :guard t))
     (let ((__function__ 'elf-header-p))
      (declare (ignorable __function__))
      (and
       (mbe :logic
            (and (alistp x)
                 (equal (strip-cars x)
                        '(magic class dataenc identver osabi
                                abiver padding type machine version
                                entry phoff shoff flags ehsize phentsize
                                phnum shentsize shnum shstrndx)))
            :exec (fty::alist-with-carsp
                       x
                       '(magic class dataenc identver osabi
                               abiver padding type machine version
                               entry phoff shoff flags ehsize phentsize
                               phnum shentsize shnum shstrndx)))
       (b* ((magic (cdr (std::da-nth 0 x)))
            (class (cdr (std::da-nth 1 x)))
            (dataenc (cdr (std::da-nth 2 x)))
            (identver (cdr (std::da-nth 3 x)))
            (osabi (cdr (std::da-nth 4 x)))
            (abiver (cdr (std::da-nth 5 x)))
            (padding (cdr (std::da-nth 6 x)))
            (type (cdr (std::da-nth 7 x)))
            (machine (cdr (std::da-nth 8 x)))
            (version (cdr (std::da-nth 9 x)))
            (entry (cdr (std::da-nth 10 x)))
            (phoff (cdr (std::da-nth 11 x)))
            (shoff (cdr (std::da-nth 12 x)))
            (flags (cdr (std::da-nth 13 x)))
            (ehsize (cdr (std::da-nth 14 x)))
            (phentsize (cdr (std::da-nth 15 x)))
            (phnum (cdr (std::da-nth 16 x)))
            (shentsize (cdr (std::da-nth 17 x)))
            (shnum (cdr (std::da-nth 18 x)))
            (shstrndx (cdr (std::da-nth 19 x))))
         (and (byte-listp magic)
              (natp class)
              (natp dataenc)
              (natp identver)
              (natp osabi)
              (natp abiver)
              (byte-listp padding)
              (natp type)
              (natp machine)
              (natp version)
              (natp entry)
              (natp phoff)
              (natp shoff)
              (natp flags)
              (natp ehsize)
              (natp phentsize)
              (natp phnum)
              (natp shentsize)
              (natp shnum)
              (natp shstrndx))))))

    Theorem: consp-when-elf-header-p

    (defthm consp-when-elf-header-p
      (implies (elf-header-p x) (consp x))
      :rule-classes :compound-recognizer)