• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
        • Primitive-functions
        • Translated-terms
        • Values
        • Evaluation
        • Program-equivalence
        • Functions
          • Function
            • Function-fix
            • Function-equiv
            • Make-function
            • Function->params
            • Change-function
            • Function->name
            • Function->body
            • Functionp
            • Function-lookup
            • Function-option
            • Lift-function
            • Lift-function-list
            • Function-set
          • Packages
          • Programs
          • Interpreter
          • Evaluation-states
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Function

    Functionp

    Recognizer for function structures.

    Signature
    (functionp x) → *

    Definitions and Theorems

    Function: functionp

    (defun functionp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'functionp))
        (declare (ignorable __function__))
        (and (true-listp x)
             (eql (len x) 3)
             (b* ((name (std::da-nth 0 x))
                  (params (std::da-nth 1 x))
                  (body (std::da-nth 2 x)))
               (and (symbol-valuep name)
                    (symbol-value-listp params)
                    (ttermp body))))))

    Theorem: consp-when-functionp

    (defthm consp-when-functionp
      (implies (functionp x) (consp x))
      :rule-classes :compound-recognizer)