• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
          • Defstobj
          • Defabsstobj
          • Stobj-table
          • Preservation-thms
          • Nested-stobjs
          • Defrstobj
          • With-global-stobj
          • User-stobjs-modified-warnings
          • Stobj-example-1
          • Defrstobj
          • Stobj-example-3
          • Stobj-example-1-proofs
          • With-local-stobj
          • Stobj-example-1-defuns
          • Declare-stobjs
          • Trans-eval-and-stobjs
          • With-local-state
          • Stobj-example-2
          • Stobj-example-1-implementation
          • Add-global-stobj
          • Swap-stobjs
          • Resize-list
          • Nth-aliases-table
          • Def-stobj-frame
          • Trans-eval-and-locally-bound-stobjs
          • Std/stobjs
            • Stobj-updater-independence
            • Def-1d-arr
            • Defstobj-clone
            • Def-2d-arr
            • Defabsstobj-events
            • Bitarr
            • Natarr
              • Set-nat
              • Resize-nats
              • Get-nat
              • Nats-length
          • Count-keys
          • Update-nth-array
          • Remove-global-stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
        • Oracle-eval
        • Defmacro-untouchable
        • <<
        • Primitive
        • Revert-world
        • Unmemoize
        • Set-duplicate-keys-action
        • Symbols
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Fake-oracle-eval
        • Defopen
        • Sleep
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Std/stobjs

Natarr

Abstract stobj: logically this just represents a list of |ACL2|::|NATP|s, but it is implemented as an array.

This is a simple abstract stobj array, introduced by def-1d-arr.

Definition: natarr

(defabsstobj natarr
  :foundation natarr$c
  :recognizer (natarrp :exec natarr$cp
                       :logic natarr$ap)
  :creator (create-natarr :exec create-natarr$c
                          :logic create-natarr$a)
  :corr-fn natarr$corr
  :exports ((nats-length :exec nats$c-length
                         :logic nats$a-length)
            (get-nat :exec nats$ci :logic nats$ai)
            (set-nat :exec update-nats$ci
                     :logic update-nats$ai)
            (resize-nats :exec resize-nats$c
                         :logic resize-nats$a)))

Subtopics

Set-nat
Modify the nth element of the natarr array.
Resize-nats
Change the length of the natarr array.
Get-nat
Read the nth element of the natarr array.
Nats-length
Get the length of the natarr array.