• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
      • Bigmems
      • Builtins
      • Execloader
        • Elf-reader
        • Mach-o-reader
          • Read-load_commands
          • Read-section_data_sz_structures
          • Mach-o-section-header
          • 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
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Mach-o-reader

    Fill-data-common-section-bytes

    Signature
    (fill-data-common-section-bytes h-size 
                                    lc-size remaining-file mach-o state) 
     
      → 
    (mv err new-mach-o new-state)
    Arguments
    remaining-file — Guard (byte-listp remaining-file).
    Returns
    new-mach-o — Type (good-mach-o-p new-mach-o), given (good-mach-o-p mach-o).
    new-state — Type (state-p new-state), given (state-p state).

    Definitions and Theorems

    Function: fill-data-common-section-bytes

    (defun fill-data-common-section-bytes
           (h-size lc-size remaining-file mach-o state)
     (declare (xargs :stobjs (mach-o state)))
     (declare (type (unsigned-byte 64) h-size)
              (type (unsigned-byte 64) lc-size))
     (declare (xargs :guard (byte-listp remaining-file)))
     (let ((__function__ 'fill-data-common-section-bytes))
      (declare (ignorable __function__))
      (b*
       ((size (@data-common-section-size mach-o))
        (offset (@data-common-section-offset mach-o))
        (section (if (equal size 0)
                     nil
                   (if (not (natp (- offset (+ h-size lc-size))))
                       t
                     (take size
                           (nthcdr (- offset (+ h-size lc-size))
                                   remaining-file)))))
        ((when (not (byte-listp section)))
         (cw
          "EOF encountered unexpectedly. DATA::common section could not be read.~%")
         (mv t mach-o state))
        (mach-o (!data-common-section-bytes section mach-o)))
       (mv nil mach-o state))))

    Theorem: good-mach-o-p-of-fill-data-common-section-bytes.new-mach-o

    (defthm good-mach-o-p-of-fill-data-common-section-bytes.new-mach-o
      (implies (good-mach-o-p mach-o)
               (b* (((mv ?err ?new-mach-o ?new-state)
                     (fill-data-common-section-bytes
                          h-size
                          lc-size remaining-file mach-o state)))
                 (good-mach-o-p new-mach-o)))
      :rule-classes :rewrite)

    Theorem: state-p-of-fill-data-common-section-bytes.new-state

    (defthm state-p-of-fill-data-common-section-bytes.new-state
      (implies (state-p state)
               (b* (((mv ?err ?new-mach-o ?new-state)
                     (fill-data-common-section-bytes
                          h-size
                          lc-size remaining-file mach-o state)))
                 (state-p new-state)))
      :rule-classes :rewrite)