• 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
        • Syntax-for-tools
        • Atc
        • Language
        • Representation
          • Representation-of-integer-operations
          • Atc-arrays
            • Atc-def-integer-arrays
            • Ushort-array-write
            • Ushort-array-integer-write
            • Ulong-array-integer-write
            • Ullong-array-write
            • Ullong-array-integer-write
            • Uchar-array-integer-write
            • Sshort-array-write
            • Sshort-array-integer-write
            • Slong-array-integer-write
            • Sllong-array-write
            • Sllong-array-integer-write
            • Schar-array-integer-write
            • Ulong-array-write
              • Uchar-array-write
              • Slong-array-write
              • Schar-array-write
              • Uint-array-write
              • Uint-array-integer-write
              • Sint-array-write
              • Sint-array-integer-write
              • Ushort-array
              • Ullong-array
              • Sshort-array
              • Sllong-array
              • Ulong-array
              • Uint-array
              • Uchar-array
              • Slong-array
              • Sint-array
              • Schar-array
              • Ushort-array-integer-read
              • Ushort-array-integer-index-okp
              • Ullong-array-integer-read
              • Ullong-array-integer-index-okp
              • Sshort-array-integer-read
              • Sshort-array-integer-index-okp
              • Sllong-array-integer-read
              • Sllong-array-integer-index-okp
              • Ulong-array-integer-read
              • Ulong-array-integer-index-okp
              • Ullong-array-read
              • Uint-array-integer-read
              • Uint-array-integer-index-okp
              • Uchar-array-integer-read
              • Uchar-array-integer-index-okp
              • Slong-array-integer-read
              • Slong-array-integer-index-okp
              • Sllong-array-read
              • Sint-array-integer-read
              • Sint-array-integer-index-okp
              • Schar-array-integer-read
              • Schar-array-integer-index-okp
              • Ushort-array-read
              • Ushort-array-index-okp
              • Ulong-array-read
              • Ulong-array-index-okp
              • Ullong-array-index-okp
              • Uint-array-read
              • Uchar-array-read
              • Uchar-array-index-okp
              • Sshort-array-read
              • Sshort-array-index-okp
              • Slong-array-read
              • Slong-array-index-okp
              • Sllong-array-index-okp
              • Sint-array-read
              • Schar-array-read
              • Schar-array-index-okp
              • Uint-array-index-okp
              • Sint-array-index-okp
              • Ushort-array-of
              • Ullong-array-of
              • Uchar-array-length
              • Sshort-array-of
              • Sllong-array-of
              • Ulong-array-of
              • Uint-array-of
              • Uchar-array-of
              • Slong-array-of
              • Sint-array-of
              • Schar-array-of
              • Ushort-array-length
              • Ulong-array-length
              • Ullong-array-length
              • Sshort-array-length
              • Sllong-array-length
              • Uint-array-length
              • Slong-array-length
              • Sint-array-length
              • Schar-array-length
              • Atc-def-integer-arrays-loop
            • Representation-of-integers
            • Representation-of-integer-conversions
            • Pointed-integers
            • Shallow-deep-embedding-relation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • 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
    • Atc-arrays

    Ulong-array-write

    Write an element to an array of type unsigned long, using a c integer index.

    Signature
    (ulong-array-write array index element) → new-array
    Arguments
    array — Guard (ulong-arrayp array).
    index — Guard (cintegerp index).
    element — Guard (ulongp element).
    Returns
    new-array — Type (ulong-arrayp new-array).

    Definitions and Theorems

    Function: ulong-array-write

    (defun ulong-array-write (array index element)
      (declare (xargs :guard (and (ulong-arrayp array)
                                  (cintegerp index)
                                  (ulongp element))))
      (declare (xargs :guard (ulong-array-index-okp array index)))
      (let ((__function__ 'ulong-array-write))
        (declare (ignorable __function__))
        (if (mbt (ulong-array-index-okp array index))
            (ulong-array-of (update-nth (integer-from-cinteger index)
                                        (ulong-fix element)
                                        (ulong-array->elements array)))
          (ulong-array-fix array))))

    Theorem: ulong-arrayp-of-ulong-array-write

    (defthm ulong-arrayp-of-ulong-array-write
      (b* ((new-array (ulong-array-write array index element)))
        (ulong-arrayp new-array))
      :rule-classes :rewrite)

    Theorem: len-of-ulong-array->elements-of-ulong-array-write

    (defthm len-of-ulong-array->elements-of-ulong-array-write
     (equal
      (len
        (ulong-array->elements (ulong-array-write array index element)))
      (len (ulong-array->elements array))))

    Theorem: ulong-array-length-of-ulong-array-write

    (defthm ulong-array-length-of-ulong-array-write
     (equal (ulong-array-length (ulong-array-write array index element))
            (ulong-array-length array)))

    Theorem: ulong-array-write-to-integer-write

    (defthm ulong-array-write-to-integer-write
     (equal
          (ulong-array-write array index val)
          (ulong-array-integer-write array (integer-from-cinteger index)
                                     val)))

    Theorem: ulong-array-write-alt-def

    (defthm ulong-array-write-alt-def
      (implies (and (ulong-arrayp array)
                    (cintegerp index)
                    (ulongp elem)
                    (ulong-array-index-okp array index))
               (equal (ulong-array-write array index elem)
                      (value-array-write (integer-from-cinteger index)
                                         elem array))))

    Theorem: ulong-array-write-of-ulong-array-fix-array

    (defthm ulong-array-write-of-ulong-array-fix-array
      (equal (ulong-array-write (ulong-array-fix array)
                                index element)
             (ulong-array-write array index element)))

    Theorem: ulong-array-write-ulong-array-equiv-congruence-on-array

    (defthm ulong-array-write-ulong-array-equiv-congruence-on-array
      (implies (ulong-array-equiv array array-equiv)
               (equal (ulong-array-write array index element)
                      (ulong-array-write array-equiv index element)))
      :rule-classes :congruence)

    Theorem: ulong-array-write-of-cinteger-fix-index

    (defthm ulong-array-write-of-cinteger-fix-index
      (equal (ulong-array-write array (cinteger-fix index)
                                element)
             (ulong-array-write array index element)))

    Theorem: ulong-array-write-cinteger-equiv-congruence-on-index

    (defthm ulong-array-write-cinteger-equiv-congruence-on-index
      (implies (cinteger-equiv index index-equiv)
               (equal (ulong-array-write array index element)
                      (ulong-array-write array index-equiv element)))
      :rule-classes :congruence)

    Theorem: ulong-array-write-of-ulong-fix-element

    (defthm ulong-array-write-of-ulong-fix-element
      (equal (ulong-array-write array index (ulong-fix element))
             (ulong-array-write array index element)))

    Theorem: ulong-array-write-ulong-equiv-congruence-on-element

    (defthm ulong-array-write-ulong-equiv-congruence-on-element
      (implies (ulong-equiv element element-equiv)
               (equal (ulong-array-write array index element)
                      (ulong-array-write array index element-equiv)))
      :rule-classes :congruence)