• 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
            • Defun-inst-implementation
              • Defun-inst-quant-events
              • Defun-inst-plain-events
              • Defun-inst-fn
              • Defun-inst-choice-events
              • Check-qrewrite-rule-funvars
                • Check-sofun-inst
                • Show-defun-inst
                • Defun-inst-macro-definition
            • Defequal
            • 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
          • Trans
          • User-defined-functions-table
          • 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
                  • Defun-inst-implementation
                    • Defun-inst-quant-events
                    • Defun-inst-plain-events
                    • Defun-inst-fn
                    • Defun-inst-choice-events
                    • Check-qrewrite-rule-funvars
                      • Check-sofun-inst
                      • Show-defun-inst
                      • Defun-inst-macro-definition
                  • Defequal
                  • 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
      • Defun-inst-implementation

      Check-qrewrite-rule-funvars

      Check if the rewrite rule of a quantifier second-order function, or of an instance of it, depends exactly on the same function variables that the matrix of the function depends on.

      Signature
      (check-qrewrite-rule-funvars fun wrld) → err-msg?
      Arguments
      fun — Guard (symbolp fun).
      wrld — Guard (plist-worldp wrld).
      Returns
      err-msg? — A maybe-msgp.

      When a quantifier second-order function, or an instance thereof, is introduced, the submitted event form first introduces the function, and then checks whether its rewrite rule depends exactly on the same function variables that the matrix of the function depends on. The following code performs this check.

      If the check is satisfied, nil is returned. Otherwise, an error message is returned.

      This check is relevant when the rewrite rule is a custom one. Otherwise, it is a redundant check.

      Definitions and Theorems

      Function: check-qrewrite-rule-funvars

      (defun check-qrewrite-rule-funvars (fun wrld)
       (declare (xargs :guard (and (symbolp fun)
                                   (plist-worldp wrld))))
       (let ((__function__ 'check-qrewrite-rule-funvars))
        (declare (ignorable __function__))
        (let* ((rule-name (defun-sk-rewrite-name fun wrld))
               (rule-body (formula rule-name nil wrld))
               (fun-matrix (defun-sk-matrix fun wrld)))
         (if (set-equiv (funvars-of-term rule-body wrld)
                        (funvars-of-term fun-matrix wrld))
             nil
          (msg
           "The custom rewrite rule ~x0 must have ~
                  the same function variables as the function's matrix ~x1.~%"
           rule-body fun-matrix)))))