-
Notifications
You must be signed in to change notification settings - Fork 49
[Tactic] Rewrite Equiv
Cameron Low edited this page Jan 29, 2024
·
4 revisions
The main idea is to provide a way to rewrite a procedure call, somewhere in a program, into a different procedure call, using an equiv.
There is a variant provided to handle cases where the function to be rewritten to has different arguments and/or left-value than the instance provided.
Same arguments: rewrite equiv[{m} p d lem]
Different arguments: rewrite equiv[{m} p d lem (a1, a2, ... :@ lv?)]
where
- m: 1 or 2
- p: code position
-
d: direction, either
-
or nothing - lem: equiv for the rewrite
- ai: an expression representing a function argument
- lv: a left-value
pRHL judgements
For examples tests/rwequiv.ec or instances in the standard library.