• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • 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
          • 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
            • Components-of-the-environment-field
              • Write-x86-file-des-logic
              • Write-x86-file-contents-logic
              • Read-x86-file-des-logic
              • Read-x86-file-contents-logic
              • Delete-x86-file-des-logic
              • Delete-x86-file-contents-logic
              • Pop-x86-oracle-logic
                • Write-x86-file-des
                • Write-x86-file-contents
                • Pop-x86-oracle
                • Env-read
                • Delete-x86-file-des
                • Delete-x86-file-contents
                • Env-write
                • Read-x86-file-des
                • Read-x86-file-contents
                • Env-write-logic
                • Env-read-logic
              • Reading-memory-as-strings-or-bytes
              • Converting-between-strings-and-bytes
              • Writing-strings-or-bytes-to-memory
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Components-of-the-environment-field

    Pop-x86-oracle-logic

    Signature
    (pop-x86-oracle-logic x86) → (mv * x86)

    Definitions and Theorems

    Function: pop-x86-oracle-logic

    (defun pop-x86-oracle-logic (x86)
     (declare (xargs :stobjs (x86)))
     (declare (xargs :guard t))
     (let ((__function__ 'pop-x86-oracle-logic))
      (declare (ignorable __function__))
      (b*
       ((rip (rip x86))
        (env (env-read x86))
        (oracle (cdr (assoc-equal :oracle env)))
        (vals (assoc-equal rip oracle))
        (lst (if (consp vals)
                 (if (consp (cdr vals)) (cdr vals) nil)
               nil))
        ((mv val x86)
         (if (atom lst)
             (let ((x86 (!ms (list :syscall-oracle-pop-empty rip)
                             x86)))
               (mv -1 x86))
          (let
           ((x86
             (env-write
               (acons
                    ':file-descriptors
                    (cdr (assoc-equal :file-descriptors env))
                    (acons ':file-contents
                           (cdr (assoc-equal :file-contents env))
                           (acons ':oracle
                                  (put-assoc-equal rip (cdr lst) oracle)
                                  nil)))
               x86)))
           (mv (car lst) x86)))))
       (mv val x86))))