• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
        • Defprojection
        • Deflist
        • Defaggregate
        • Define
        • Defmapping
        • Defenum
        • Add-io-pairs
        • Defalist
        • Defmapappend
        • Returns-specifiers
        • Defarbrec
        • Defines
        • Define-sk
        • Error-value-tuples
        • Defmax-nat
        • Defmin-int
        • Deftutorial
        • Extended-formals
        • Defrule
        • Defval
        • Defsurj
        • Defiso
        • Defconstrained-recognizer
        • Deffixer
        • Defmvtypes
        • Defconsts
        • Defthm-unsigned-byte-p
        • Support
          • Extract-keywords
          • Dumb-string-sublis
          • Raise
          • Look-up-return-vals
          • Logic-mode-p
            • Look-up-wrapper-args
            • Look-up-formals
            • Legal-kwds-p
            • Split-///
            • Keyword-legality
            • Getarg+
            • Var-is-stobj-p
            • Look-up-guard
            • Getarg
            • Cons-listp
            • Tuplep
            • Tuple-listp
            • Ends-with-period-p
          • Defthm-signed-byte-p
          • Defthm-natp
          • Defund-sk
          • Defmacro+
          • Defsum
          • Defthm-commutative
          • Definj
          • Defirrelevant
          • Defredundant
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • Add-macro-fn
          • Check-vars-not-free
          • Safe-mode
          • Macro-libraries
            • B*
            • Defunc
            • Fty
            • Apt
            • Std/util
              • Defprojection
              • Deflist
              • Defaggregate
              • Define
              • Defmapping
              • Defenum
              • Add-io-pairs
              • Defalist
              • Defmapappend
              • Returns-specifiers
              • Defarbrec
              • Defines
              • Define-sk
              • Error-value-tuples
              • Defmax-nat
              • Defmin-int
              • Deftutorial
              • Extended-formals
              • Defrule
              • Defval
              • Defsurj
              • Defiso
              • Defconstrained-recognizer
              • Deffixer
              • Defmvtypes
              • Defconsts
              • Defthm-unsigned-byte-p
              • Support
                • Extract-keywords
                • Dumb-string-sublis
                • Raise
                • Look-up-return-vals
                • Logic-mode-p
                  • Look-up-wrapper-args
                  • Look-up-formals
                  • Legal-kwds-p
                  • Split-///
                  • Keyword-legality
                  • Getarg+
                  • Var-is-stobj-p
                  • Look-up-guard
                  • Getarg
                  • Cons-listp
                  • Tuplep
                  • Tuple-listp
                  • Ends-with-period-p
                • Defthm-signed-byte-p
                • Defthm-natp
                • Defund-sk
                • Defmacro+
                • Defsum
                • Defthm-commutative
                • Definj
                • Defirrelevant
                • Defredundant
              • Defdata
              • Defrstobj
              • Seq
              • Match-tree
              • Defrstobj
              • With-supporters
              • Def-partial-measure
              • Template-subst
              • Soft
              • Defthm-domain
              • Event-macros
              • Def-universal-equiv
              • Def-saved-obligs
              • With-supporters-after
              • Definec
              • Sig
              • Outer-local
              • Data-structures
            • Trans1
            • Defmacro-untouchable
            • Set-duplicate-keys-action
            • Add-macro-alias
            • Magic-macroexpand
            • Defmacroq
            • Trans!
            • Remove-macro-fn
            • Remove-macro-alias
            • Add-binop
            • Untrans-table
            • Trans*-
            • Remove-binop
            • Tcp
            • Tca
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Support

      Logic-mode-p

      (logic-mode-p fn world) looks up the function fn and returns t if fn is in logic mode, or nil otherwise. It causes a hard error if fn isn't a function.

      Definitions and Theorems

      Function: logic-mode-p

      (defun logic-mode-p (fn world)
        (declare (xargs :guard (and (symbolp fn)
                                    (plist-worldp world))))
        (b* ((__function__ 'logic-mode-p)
             (look (getprop fn 'acl2::formals
                            :bad 'acl2::current-acl2-world
                            world))
             ((when (eq look :bad))
              (raise "Can't look up the formals for ~x0!"
                     fn))
             (symbol-class (getprop fn 'acl2::symbol-class
                                    nil 'acl2::current-acl2-world
                                    world))
             ((unless (member symbol-class
                              '(:common-lisp-compliant :ideal :program)))
              (raise "Unexpected symbol-class for ~x0: ~x1."
                     fn symbol-class)))
          (not (eq symbol-class :program))))

      Theorem: booleanp-of-look-up-formals

      (defthm booleanp-of-look-up-formals
        (or (equal (logic-mode-p fn world) t)
            (equal (logic-mode-p fn world) nil))
        :rule-classes :type-prescription)