• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
        • ACL2-programming-language
        • Prime-fields
        • Json
          • Parser-output-to-values
          • Values
          • Syntax
          • Patbind-pattern
          • Operations
            • Object-member-values
            • Object-member-value?
            • Object-member-value
            • Object-has-member-p
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Operations

    Object-has-member-p

    Check if a JSON object has some member with a given name.

    Signature
    (object-has-member-p name object) → yes/no
    Arguments
    name — Guard (stringp name).
    object — Guard (valuep object).
    Returns
    yes/no — Type (booleanp yes/no).

    The member may not be unique, i.e. if there are multiple members with the same name, this predicate returns t.

    Definitions and Theorems

    Function: object-has-member-p

    (defun object-has-member-p (name object)
      (declare (xargs :guard (and (stringp name) (valuep object))))
      (declare (xargs :guard (value-case object :object)))
      (let ((__function__ 'object-has-member-p))
        (declare (ignorable __function__))
        (consp (object-member-values name object))))

    Theorem: booleanp-of-object-has-member-p

    (defthm booleanp-of-object-has-member-p
      (b* ((yes/no (object-has-member-p name object)))
        (booleanp yes/no))
      :rule-classes :rewrite)