• 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
        • Implemented-opcodes
        • To-do
        • Proof-utilities
        • Peripherals
        • Model-validation
        • Modelcalls
        • Concrete-simulation-examples
          • Fibonacci32-cosim
            • X86isa-one-fib32-cosim
            • Check-fib32-output
              • Run-x86isa-fib32
              • Make-fib32-addr-alst
              • Fib32
            • Fibonacci-cosim
            • Factorial-cosim
            • Nop-cosim
            • Datacopy-cosim
          • 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
    • Fibonacci32-cosim

    Check-fib32-output

    Signature
    (check-fib32-output input halt-address x86) → *
    Arguments
    x86 — Output x86 State.

    Definitions and Theorems

    Function: check-fib32-output

    (defun check-fib32-output (input halt-address x86)
     (declare (xargs :stobjs (x86)))
     (declare (type (unsigned-byte 8) input)
              (type (signed-byte 48) halt-address))
     (let ((__function__ 'check-fib32-output))
      (declare (ignorable __function__))
      (cond
       ((or
          (fault x86)
          (not (equal (ms x86)
                      (cons (cons 'x86-fetch-decode-execute-halt
                                  (cons ':rip (cons halt-address 'nil)))
                            'nil))))
        (cw "~|(ms x86) = ~x0 (fault x86) = ~x1~%"
            (ms x86)
            (fault x86)))
       (t
        (let ((expected (fib32 input)))
         (cond
          ((equal (rgfi *eax* x86) expected)
           (prog2$
               (cw "~|(x86isa-fib ~x0) was correctly computed as ~x1.~%"
                   input expected)
               t))
          (t (prog2$ (cw "~|(x86isa-fib ~x0) = ~x1, but eax is ~x2.~%"
                         input expected (rgfi *eax* x86))
                     t))))))))