• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
      • Std/system
      • Std/basic
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
      • Std/typed-alists
      • 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
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Natarr

    Set-nat

    Modify the nth element of the natarr array.

    In the execution this is an array write, but the logical definition is just a thin wrapper for update-nth:

    Function: update-nats$ai

    (defun
     update-nats$ai
     (stobjs::i stobjs::v natarr$a)
     (declare
          (xargs :guard (and (natarr$ap natarr$a)
                             (integerp stobjs::i)
                             (<= 0 stobjs::i)
                             (< stobjs::i (nats$a-length natarr$a))
                             (natp stobjs::v)
                             (stobjs::typep$ stobjs::v (integer 0 *)))))
     (ec-call (update-nth stobjs::i (nfix stobjs::v)
                          natarr$a)))