• 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
          • 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
        • 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
    • 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)