• 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
            • Pointer-operations
              • Value-pointer-validp
              • Value-pointer->designator
              • Lognot-pointer-value
                • Test-pointer-value
                • Value-pointer-danglingp
                • Value-pointer-dangling
                • Value-pointer-nullp
                • Value-pointer-null
              • 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
    • Pointer-operations

    Lognot-pointer-value

    Apply ! to a pointer value [C17:6.5.3.3/5].

    Signature
    (lognot-pointer-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 pointer for equality to 0, i.e. to check whether the pointer is null or not.

    Definitions and Theorems

    Function: lognot-pointer-value

    (defun lognot-pointer-value (val)
      (declare (xargs :guard (valuep val)))
      (declare (xargs :guard (value-case val :pointer)))
      (let ((__function__ 'lognot-pointer-value))
        (declare (ignorable __function__))
        (if (value-pointer-nullp val)
            (value-sint 1)
          (value-sint 0))))

    Theorem: valuep-of-lognot-pointer-value

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

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

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

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

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