• 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
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
          • Semantics
            • Primitive-function-macros
            • Primitive-values
            • Floating-point-placeholders
            • Pointers
            • Floating-point-value-set-parameters
            • Values
            • Primitive-operations
              • Integer-operations
                • Long-long-ushiftr
                • Long-int-ushiftr
                • Int-long-ushiftr
                • Int-int-ushiftr
                • Long-long-shiftr
                • Long-long-shiftl
                • Long-int-shiftr
                • Long-int-shiftl
                • Int-long-shiftr
                • Int-int-shiftr
                • Int-long-shiftl
                • Int-int-shiftl
                • Long-xor
                • Long-neq
                • Long-lesseq
                • Long-ior
                • Long-greateq
                • Long-and
                • Int-xor
                • Int-ior
                • Int-greateq
                • Long-rem
                • Long-mul
                • Long-less
                • Long-great
                • Long-eq
                • Long-div
                • Long-add
                • Int-neq
                • Int-mul
                • Int-lesseq
                • Int-great
                • Int-eq
                • Int-and
                • Int-add
                • Long-sub
                • Int-sub
                • Int-rem
                • Int-less
                • Int-div
                • Long-plus
                • Long-not
                • Long-minus
                • Int-not
                • Int-minus
                  • Int-plus
                • Floating-point-operations
                • Boolean-operations
              • Primitive-conversions
              • Reference-values
        • Taspi
        • Riscv
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Integer-operations

    Int-minus

    Unary minus - on ints [JLS14:4.2.2] [JLS14:15.15.4].

    Signature
    (int-minus operand) → result
    Arguments
    operand — Guard (int-valuep operand).
    Returns
    result — Type (int-valuep result).

    Definitions and Theorems

    Function: int-minus

    (defun int-minus (operand)
      (declare (xargs :guard (int-valuep operand)))
      (b* ((x (int-value->int operand)))
        (int-value (logext 32 (- x)))))

    Theorem: int-valuep-of-int-minus

    (defthm int-valuep-of-int-minus
      (b* ((result (int-minus operand)))
        (int-valuep result))
      :rule-classes :rewrite)

    Theorem: int-minus-of-int-value-fix-operand

    (defthm int-minus-of-int-value-fix-operand
      (equal (int-minus (int-value-fix operand))
             (int-minus operand)))

    Theorem: int-minus-int-value-equiv-congruence-on-operand

    (defthm int-minus-int-value-equiv-congruence-on-operand
      (implies (int-value-equiv operand operand-equiv)
               (equal (int-minus operand)
                      (int-minus operand-equiv)))
      :rule-classes :congruence)