• 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
          • Rule
            • Defruledl
            • Defruled
            • Defrulel
          • Defval
          • Defsurj
          • Defiso
          • Defconstrained-recognizer
          • Deffixer
          • Defmvtypes
          • Defconsts
          • Defthm-unsigned-byte-p
          • Support
          • 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
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defrule
    • Thm

    Rule

    A thm-like version of defrule.

    The rule macro is a thin wrapper around defrule. It supports all of the same syntax extensions like top-level :enable and :expand ACL2::hints. However, like thm, rule does not take a rule name and does not result in the introduction of a rule afterward.

    Examples:

    (rule (implies x x))                    ;; will work
    
    (rule (equal (append x y)               ;; will fail
                 (append y x))
          :enable append
          :expand (append y x))
    
    (rule (equal (consp x)                  ;; will work
                 (if (atom x) nil t))
          :do-not '(generalize fertilize))

    The rule command is implemented with a simple make-event, and its calls are valid embedded events. However, on success a rule merely expands into (value-triple :success). No record of the rule's existence is found in the world, so there is no way to use the rule once it has been proven, etc.