-
Notifications
You must be signed in to change notification settings - Fork 0
Rewrite patterns
Vladimir Gladstein edited this page Mar 22, 2024
·
2 revisions
We support SSReflect version of rewrite
. The general syntax for it is:
srw ([-] [? <|> !] [ [[-] pos*] ] trm)* [at loc]
where
-
[-]
is responsible for the rewrite direction: empty for direct and-
for reversed -
[? <|> !]
is responsible for the number of times we rewrite:?
for 0 and more and!
for 1 and more -
[ [[-] [pos*] ] ]
is responsible for positions of terms matchingthm
at which we rewrite:[n_1 n_2 n_3 ...]
for rewriting at alln_i
positions,[- n_1 n_2 n_3 ...]
for rewriting at all positions exceptn_i
and empty for rewriting at all positions -
thm
for the equality which we want to rewrite -
[at loc]
for the location at which we rewrite (empty for rewriting in the goal)
You can also use //
, /=
, //=
, /==
and //==
inside srw
.
example :
srw -![1 3](cat_take_drop i m) //= -?[- 5 6](cat_take_drop i s2) def_m_i -cat_cons at h |-