• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
        • Type-prescription
        • Rewrite
          • Force
          • Hide
          • Syntaxp
          • Free-variables
          • Bind-free
          • Loop-stopper
          • Backchain-limit
          • Double-rewrite
          • Rewrite-lambda-object
          • Rewriting-versus-cleaning-up-lambda-objects
          • Random-remarks-on-rewriting
          • Set-rw-cache-state
          • Case-split
          • Rewrite-lambda-object-actions
          • Syntactically-clean-lambda-objects-theory
          • Hands-off-lambda-objects-theory
          • Rewrite-lambda-objects-theory
          • Simple
          • Rewrite-stack-limit
          • Rewrite-equiv
            • Assume-true-false-aggressive-p
            • Remove-trivial-equivalences-enabled-p
            • Rewrite-lambda-modep
            • Rewrite-if-avoid-swap
            • Set-rw-cache-state!
            • Rw-cache-state
          • Meta
          • Linear
          • Definition
          • Clause-processor
          • Tau-system
          • Forward-chaining
          • Equivalence
          • Congruence
          • Free-variables
          • Executable-counterpart
          • Induction
          • Type-reasoning
          • Compound-recognizer
          • Rewrite-quoted-constant
          • Elim
          • Well-founded-relation-rule
          • Built-in-clause
          • Well-formedness-guarantee
          • Patterned-congruence
          • Rule-classes-introduction
          • Guard-holders
          • Refinement
          • Type-set-inverter
          • Generalize
          • Corollary
          • Induction-heuristics
          • Backchaining
          • Default-backchain-limit
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rewrite

    Rewrite-equiv

    Force ACL2 to perform substitution using a stylized equivalence hypothesis

    Rewrite-equiv is actually the identity function: (rewrite-equiv x) = x for all x. However, a term of the form (hide (rewrite-equiv (equiv x y))) appearing in the hypothesis induces ACL2 to aggressively substitute y for x when equiv is an equivalence relation (including equal) and x appears in a context in which equiv is being maintained.

    Equivalence relations appearing in the hypothesis are not generally used by ACL2 to perform substitutions except under special circumstances, such as when one argument is a symbol or a constant or during the fertilization stage of the waterfall process. A stylized rewrite-equiv expression of the form (hide (rewrite-equiv (equiv x y))) can be used to override this default behavior. Care should be taken in using rewrite-equiv, however, because it can easily result in rewrite loops.

    For an example of a clause-processor that leverages Rewrite-equiv to induce substitution using equivalence relations appearing in the hypothesis, see rewrite-equiv-hint.