-
Notifications
You must be signed in to change notification settings - Fork 1
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 matchingthmat which we rewrite:[n_1 n_2 n_3 ...]for rewriting at alln_ipositions,[- n_1 n_2 n_3 ...]for rewriting at all positions exceptn_iand empty for rewriting at all positions -
thmfor 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 - //= -?[- 5 6](cat_take_drop i s2) def_m_i -cat_cons at h |-