• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
            • Rflags-reads-and-writes
            • General-sf-spec-fn
            • General-cf-spec-fn
            • General-pf-spec-fn
            • General-of-spec-fn
            • Zf-spec
            • Sbb-af-spec8
            • Sbb-af-spec64
            • Sbb-af-spec32
            • Sbb-af-spec16
            • Adc-af-spec8
            • Adc-af-spec64
            • Adc-af-spec32
            • Adc-af-spec16
            • Sub-af-spec8
            • Sub-af-spec64
              • Sub-af-spec32
              • Sub-af-spec16
              • Add-af-spec8
              • Add-af-spec64
              • Add-af-spec32
              • Add-af-spec16
              • Pf-spec64
              • Pf-spec32
              • Pf-spec16
              • Of-spec64
              • Sf-spec64
              • Sf-spec32
              • Sf-spec16
              • Pf-spec8
              • Of-spec8
              • Of-spec32
              • Of-spec16
              • Cf-spec8
              • Cf-spec64
              • Cf-spec32
              • Cf-spec16
              • Sf-spec8
            • Characterizing-undefined-behavior
            • Top-level-memory
            • App-view
            • X86-decoder
            • Physical-memory
            • Decoding-and-spec-utils
            • Instructions
            • Register-readers-and-writers
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rflag-specifications

    Sub-af-spec64

    Signature
    (sub-af-spec64 dst src) → *

    Definitions and Theorems

    Function: sub-af-spec64$inline

    (defun sub-af-spec64$inline (dst src)
      (declare (type (unsigned-byte 64) dst)
               (type (unsigned-byte 64) src))
      (b* (((the (unsigned-byte 4) dst-3-0)
            (mbe :logic (part-select dst :low 0 :width 4)
                 :exec (logand 15 dst)))
           ((the (unsigned-byte 4) src-3-0)
            (mbe :logic (part-select src :low 0 :width 4)
                 :exec (logand 15 src)))
           (sub (the (signed-byte 5)
                     (- (the (unsigned-byte 4) dst-3-0)
                        (the (unsigned-byte 4) src-3-0))))
           (af (the (unsigned-byte 1)
                    (bool->bit (< sub 0)))))
        af))

    Theorem: n01p-sub-af-spec64

    (defthm n01p-sub-af-spec64
     (unsigned-byte-p 1 (sub-af-spec64 dst src))
     :rule-classes
     (:rewrite
      (:type-prescription
         :corollary (bitp (sub-af-spec64 dst src))
         :hints
         (("Goal"
               :in-theory
               '(unsigned-byte-p integer-range-p natp bitp (:e expt)))))
      (:linear
       :corollary (and (<= 0 (sub-af-spec64 dst src))
                       (< (sub-af-spec64 dst src) 2))
       :hints
       (("Goal"
            :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))