• 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
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
              • Atc-event-and-code-generation
              • Fty-pseudo-term-utilities
              • Atc-term-recognizers
                • Atc-stmt-noncval-termp
                • Atc-pure-c-valued-termp
                • Atc-c-valued-termp
                • Atc-boolean-termp
                  • *atc-op-type1-type2-fns*
                  • *atc-type1-from-type2-fns*
                  • *atc-type-base-const-fns*
                  • *atc-op-type-fns*
                  • *atc-boolean-from-type-fns*
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
            • Language
            • 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
    • Atc-term-recognizers

    Atc-boolean-termp

    Recognize expression terms returning booleans.

    Signature
    (atc-boolean-termp term) → yes/no
    Arguments
    term — Guard (pseudo-termp term).
    Returns
    yes/no — Type (booleanp yes/no).

    We just check whether the term is a call of a boolean-from-<type> function or a call of and or or.

    Definitions and Theorems

    Function: atc-boolean-termp

    (defun atc-boolean-termp (term)
      (declare (xargs :guard (pseudo-termp term)))
      (let ((__function__ 'atc-boolean-termp))
        (declare (ignorable __function__))
        (b* (((mv andp & &) (check-and-call term))
             ((when andp) t)
             ((mv orp & &) (check-or-call term))
             ((when orp) t))
          (case-match term
            ((fn . &)
             (if (member-eq fn *atc-boolean-from-type-fns*)
                 t
               nil))
            (& nil)))))

    Theorem: booleanp-of-atc-boolean-termp

    (defthm booleanp-of-atc-boolean-termp
      (b* ((yes/no (atc-boolean-termp term)))
        (booleanp yes/no))
      :rule-classes :rewrite)