Open tueda opened 8 years ago
Another example to crash, in which argument field wildcards are contained in a bit different way:
CF f,R;
S x1,x2,x3;
L F = f(R(1,2)) * R(3);
id all, f(?a,R(x1?,x2?),?b) * R(x3?) = f(x1,x2,x3);
.end
This is rather complicated. The way the backtracking works, the normal matches abort after success. In the case of id,all the program stores the complete match and continues. This cannot work well when multiple matches could occur inside functions inside functions, because when it has the match inside the deepest function, it returns to one level lower and keeps looking for the remaining part of the pattern. There is no way to return later to the point in the deepest function to continue there (at least not at the moment). As it was, it had the match inside the deepest function and thought it could complete things there, even though other wildcards had not been assigned yet. This caused the crash or other wild behaviour. I have now made it such that it only keeps looking for more matches to one level deep as in ` S x1,...,x9; CF f,g; L F = f(g(x1,x2),g(x3,x4)); id,all,f(?a,g(?b,x1?,?c),?d) = f(?a,g(?b,?c),?d)*g(x1); P +s; .end
F =
As you see, at the first level it can keep going; at the second level it cannot. I do not know yet how to make it work properly at higher levels without having to make massive changes.
Jos
The following FORM code crashes:
Valgrind output: