• 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
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
              • Sub-arithmetic-values
              • Rem-arithmetic-values
              • Ne-arithmetic-values
              • Mul-arithmetic-values
              • Eq-arithmetic-values
              • Div-arithmetic-values
              • Add-arithmetic-values
              • Plus-arithmetic-value
                • Minus-arithmetic-value
              • 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
    • Arithmetic-operations

    Plus-arithmetic-value

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

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

    We promote the operand and then we apply the operation on the integer. In our current formalization, integers are the only arithmetic values. This ACL2 function will be extended with more cases if/when we extend our model with non-integer arithmetic values.

    Definitions and Theorems

    Function: plus-arithmetic-value

    (defun plus-arithmetic-value (val)
      (declare (xargs :guard (valuep val)))
      (declare (xargs :guard (value-arithmeticp val)))
      (let ((__function__ 'plus-arithmetic-value))
        (declare (ignorable __function__))
        (b* ((val (promote-value val)))
          (plus-integer-value val))))

    Theorem: value-resultp-of-plus-arithmetic-value

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

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

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

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

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