• 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
          • 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
        • 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
    • Integer-operations

    Lognot-integer-value

    Apply ! to an integer value [C17:6.5.3.3/5].

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

    This always returns an int (never an error), either 0 or 1. It is equivalent to comparing the integer for equality to 0, which in our curren model is equivalent to whether the integer value is 0 or not.

    Definitions and Theorems

    Function: lognot-integer-value

    (defun lognot-integer-value (val)
      (declare (xargs :guard (valuep val)))
      (declare (xargs :guard (value-integerp val)))
      (let ((__function__ 'lognot-integer-value))
        (declare (ignorable __function__))
        (if (equal (value-integer->get val) 0)
            (value-sint 1)
          (value-sint 0))))

    Theorem: valuep-of-lognot-integer-value

    (defthm valuep-of-lognot-integer-value
      (b* ((resval (lognot-integer-value val)))
        (valuep resval))
      :rule-classes :rewrite)

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

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

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

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