• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
        • Make-event
        • Defmacro
        • Untranslate-patterns
        • Tc
        • Trans*
        • Macro-aliases-table
        • Macro-args
        • Defabbrev
        • User-defined-functions-table
        • Trans
        • Untranslate-for-execution
        • Add-macro-fn
        • Check-vars-not-free
        • Safe-mode
        • Macro-libraries
          • B*
          • Defunc
          • Fty
          • Apt
          • Std/util
          • Defdata
          • Defrstobj
          • Seq
          • Match-tree
          • Defrstobj
          • With-supporters
          • Def-partial-measure
          • Template-subst
          • Soft
          • Defthm-domain
          • Event-macros
          • Def-universal-equiv
            • Def-saved-obligs
            • With-supporters-after
            • Definec
            • Sig
            • Outer-local
            • Data-structures
          • 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
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
        • B*
        • Defunc
        • Fty
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
          • Def-saved-obligs
          • With-supporters-after
          • Definec
          • Sig
          • Outer-local
          • Data-structures
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Macro-libraries

      Def-universal-equiv

      A macro for defining universally quantified equivalence relations.

      It is often useful to introduce equivalence relations such as:

      A === B when for every possible element E, A and B agree on E.

      For some particular notion of what agree means. This macro gives you a quick way to introduce such a relation, using defun-sk, and then automatically prove that it is an equivalence relation. For instance, an equivalence such as:

      (defun-sk foo-equiv (a b)
        (forall (x y z)
                (and (bar-equiv (foo a x y)
                                (foo b x y))
                     (baz-equiv (fa a z)
                                (fa b z)))))

      Can be introduced using:

      (def-universal-equiv foo-equiv (a b)
        :qvars (x y z)
        :equivs ((bar-equiv (foo a x y))
                 (baz-equiv (fa a z))))

      When called with :defquant t, we use defquant instead of defun-sk. This requires that the WITNESS-CP book be included.

      Note that :qvars may be omitted, in which case there is no quantifier (defun-sk) introduced. This can be used as a shortcut to prove that a fixing function induces an equivalence relation, e.g.,

      (def-universal-equiv gfix-equiv
        :equiv-terms ((equal (gfix x))))

      produces

      (defun gfix-equiv (x y)
       (equal (gfix x) (gfix y)))
      
      (defequiv gfix-equiv)

      (with appropriate hints to ensure that the defequiv succeeds).