• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
      • Defdata
      • Defrstobj
      • Seq
      • Match-tree
      • Defrstobj
      • With-supporters
      • Def-partial-measure
      • Template-subst
      • Soft
        • Soft-future-work
        • Soft-macros
          • Defun-inst
          • Defequal
            • Defequal-implementation
              • Defequal-fn
              • Defequal-event-generation
              • Defequal-input-processing
              • Defequal-table
                • Defequal-trim-call
                • Defequal-redundant?
                  • Defequal-record-call
                  • Defequal-trim-call-args
                • Defequal-macro-definition
            • Defsoft
            • Defthm-inst
            • Defun2
            • Defunvar
            • Defun-sk2
            • Defchoose2
            • Defthm-2nd-order
            • Define-sk2
            • Defund-sk2
            • Define2
            • Defund2
          • Updates-to-workshop-material
          • Soft-implementation
          • Soft-notions
        • 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
    • Defequal-table

    Defequal-redundant?

    Check if a call of defequal is redundant, returning the associated expansion if it is.

    Signature
    (defequal-redundant? call wrld) → event?
    Arguments
    call — Guard (pseudo-event-formp call).
    wrld — Guard (plist-worldp wrld).
    Returns
    event? — Type (maybe-pseudo-event-formp event?).

    Definitions and Theorems

    Function: defequal-redundant?

    (defun defequal-redundant? (call wrld)
     (declare (xargs :guard (and (pseudo-event-formp call)
                                 (plist-worldp wrld))))
     (let ((__function__ 'defequal-redundant?))
      (declare (ignorable __function__))
      (b* ((table (table-alist+ 'defequal-table wrld)
    )
           (call (defequal-trim-call call))
           (pair? (assoc-equal call table)))
       (if pair?
        (b* ((expansion (cdr pair?)))
         (if (pseudo-event-formp expansion)
             expansion
          (raise
           "Internal error: ~
                        the DEFEQUAL table associates the call ~x0 ~
                        with a value ~x1 that is not a pseudo event form."
           call expansion)))
        nil))))

    Theorem: maybe-pseudo-event-formp-of-defequal-redundant?

    (defthm maybe-pseudo-event-formp-of-defequal-redundant?
      (b* ((event? (defequal-redundant? call wrld)))
        (maybe-pseudo-event-formp event?))
      :rule-classes :rewrite)