• 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
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
        • Bigmem-asymmetric
        • Bigmem
          • Bigmem-concrete-stobj
          • Get-mem-aux
          • Get-mem
          • Xor-mem-region
            • Init-mem-region
        • 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
    • Bigmem

    Xor-mem-region

    Signature
    (xor-mem-region n sum mem) → mem
    Arguments
    mem — Guard (memp mem).

    Definitions and Theorems

    Function: xor-mem-region

    (defun xor-mem-region (n sum mem)
      (declare (xargs :stobjs (mem)))
      (declare (type (unsigned-byte 50) n)
               (type (unsigned-byte 8) sum))
      (declare (xargs :guard (memp mem)))
      (let ((__function__ 'xor-mem-region))
        (declare (ignorable __function__))
        (if (mbe :logic (zp n) :exec (= n 0))
            mem
          (b* ((val (the (unsigned-byte 8)
                         (read-mem n mem)))
               (xor-sum (logxor (the (unsigned-byte 8) val)
                                (the (unsigned-byte 8) sum))))
            (xor-mem-region (the (unsigned-byte 50) (1- n))
                            (the (unsigned-byte 8) xor-sum)
                            mem)))))