• 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
              • Bitxor-values
              • Bitior-values
              • Bitand-values
              • Shr-values
              • Shl-values
              • Test-value
              • Rem-values
              • Lt-values
              • Le-values
              • Gt-values
              • Ge-values
              • Sub-values
              • Mul-values
              • Div-values
              • Add-values
              • Ne-values
              • Eq-values
              • Bitnot-value
              • Plus-value
                • Minus-value
                • Lognot-value
              • 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
    • Operations

    Plus-value

    Apply unary + to a value [C17:6.5.3.3/1] [C17:6.5.3.3/2].

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

    It is an error if the value is not arithmetic.

    Definitions and Theorems

    Function: plus-value

    (defun plus-value (val)
      (declare (xargs :guard (valuep val)))
      (let ((__function__ 'plus-value))
        (declare (ignorable __function__))
        (if (value-arithmeticp val)
            (plus-arithmetic-value val)
          (error (list :plus-mistype
                       :required :arithmetic
                       :supplied (value-fix val))))))

    Theorem: value-resultp-of-plus-value

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

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

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

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

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