• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • 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
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • 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)