• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
              • Convert-integer-value
              • Result-integer-value
              • Uaconvert-values
              • Bitnot-integer-value
              • Bitand-integer-values
              • Promote-value
              • Rem-integer-values
              • Shr-integer-values
              • Shl-integer-values
              • Value-integer
              • Div-integer-values
              • Bitxor-integer-values
              • Bitior-integer-values
              • Sub-integer-values
              • Mul-integer-values
              • Add-integer-values
              • Ne-integer-values
              • Lt-integer-values
              • Le-integer-values
              • Gt-integer-values
              • Ge-integer-values
              • Eq-integer-values
              • Minus-integer-value
              • Plus-integer-value
                • Value-integer->get
                • Lognot-integer-value
                • Test-integer-value
                • Value-integer-and-value-integer->get
              • Computation-states
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Integer-operations

    Plus-integer-value

    Apply unary + to an integer value [C17:6.5.3.3/2].

    Signature
    (plus-integer-value val) → resval
    Arguments
    val — Guard (valuep val).
    Returns
    resval — Type (value-resultp resval).

    By the time we reach this ACL2 function, the value has been already promoted, so we put that restriction in the guard.

    Since the value is already promoted, this function returns the value unchanged. We introduce this function mainly for uniformity with other operations, despite it being trivial in a way.

    Definitions and Theorems

    Function: plus-integer-value

    (defun plus-integer-value (val)
      (declare (xargs :guard (valuep val)))
      (declare (xargs :guard (and (value-integerp val)
                                  (value-promoted-arithmeticp val))))
      (let ((__function__ 'plus-integer-value))
        (declare (ignorable __function__))
        (value-fix val)))

    Theorem: value-resultp-of-plus-integer-value

    (defthm value-resultp-of-plus-integer-value
      (b* ((resval (plus-integer-value val)))
        (value-resultp resval))
      :rule-classes :rewrite)

    Theorem: plus-integer-value-of-value-fix-val

    (defthm plus-integer-value-of-value-fix-val
      (equal (plus-integer-value (value-fix val))
             (plus-integer-value val)))

    Theorem: plus-integer-value-value-equiv-congruence-on-val

    (defthm plus-integer-value-value-equiv-congruence-on-val
      (implies (value-equiv val val-equiv)
               (equal (plus-integer-value val)
                      (plus-integer-value val-equiv)))
      :rule-classes :congruence)