• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • 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
        • Implemented-opcodes
        • To-do
        • Proof-utilities
        • Peripherals
        • Model-validation
        • Modelcalls
        • Concrete-simulation-examples
          • Fibonacci32-cosim
          • Fibonacci-cosim
            • X86isa-one-fib-cosim
            • Run-x86isa-fib
            • Check-fib-output
            • Fib
            • Factorial-cosim
            • Nop-cosim
            • Datacopy-cosim
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Fibonacci-cosim

    Fib

    Signature
    (fib n) → *
    Arguments
    n — Guard (natp n).

    Definitions and Theorems

    Function: fib

    (defun fib (n)
      (declare (xargs :guard (natp n)))
      (declare (xargs :guard (natp n)))
      (let ((__function__ 'fib))
        (declare (ignorable __function__))
        (cond ((zp n) 0)
              ((eql n 1) 1)
              (t (+ (fib (- n 1)) (fib (- n 2)))))))