• 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-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
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • 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-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
            • Add-macro-fn
            • Check-vars-not-free
            • Safe-mode
            • 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
          • Installation
          • Mailing-lists
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Defequal-implementation

      Defequal-fn

      Check redundancy, process the inputs, generated the events.

      Signature
      (defequal-fn name left left-present right 
                   right-present vars enable verify-guards 
                   left-to-right-name left-to-right-enable 
                   right-to-left-name right-to-left-enable 
                   print show-only call ctx state) 
       
        → 
      (mv erp event state)
      Arguments
      left-present — Guard (booleanp left-present).
      right-present — Guard (booleanp right-present).
      call — Guard (pseudo-event-formp call).
      Returns
      event — A pseudo-event-formp.

      Definitions and Theorems

      Function: defequal-fn

      (defun defequal-fn (name left left-present right
                               right-present vars enable verify-guards
                               left-to-right-name left-to-right-enable
                               right-to-left-name right-to-left-enable
                               print show-only call ctx state)
        (declare (xargs :stobjs (state)))
        (declare (xargs :guard (and (booleanp left-present)
                                    (booleanp right-present)
                                    (pseudo-event-formp call))))
        (let ((__function__ 'defequal-fn))
          (declare (ignorable __function__))
          (b* ((expansion? (defequal-redundant? call (w state)))
               ((when expansion?)
                (b* (((run-when show-only)
                      (cw "~x0~|" expansion?)))
                  (cw "~%The call ~x0 is redundant.~%" call)
                  (value '(value-triple :invisible))))
               ((er (list x1...xn left-to-right right-to-left))
                (defequal-process-inputs
                     name left left-present right
                     right-present vars enable verify-guards
                     left-to-right-name left-to-right-enable
                     right-to-left-name right-to-left-enable
                     print show-only ctx state))
               (event (defequal-gen-everything
                           name
                           left right x1...xn enable verify-guards
                           left-to-right left-to-right-enable
                           right-to-left right-to-left-enable
                           print show-only call)))
            (value event))))