I have a really, really complicated set of string simplification rules (only it doesn't actually work on strings, I use stuff like
F[x__,a,y__]:=F[x,b,y];
F[x__,b,b,y__]:=F[x,c,y];
to get the results on the fly - also I never know beforehand which rule is applicable in a concrete situation). As you can imagine, 100 of these rules have at least one hidden typo.
Is it possible to partially "Hold" the execution with something like this pseudocode happening
>exec F[a,a] 3 steps
F[b,a], rule 1 used
F[b,b], rule 1 used
F[c], rule 2 used
Done
>exec F[a,c] 1 steps
F[b,c], rule 1 used
Done
so I can then control by hand where a substition went haywire (which is luckily easy)? I.e. print out all intermediate results of the replacements?
F[x__,a,y__]
beF[x___,a,y___]
? and similarly,F[x__,b,b,y__]
should beF[x___,b,b,y___]
? $\endgroup$