• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • 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
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • 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)