DCG Expansion: Is Steadfastness ignored?
问题 Assume I have the following DCG rule: factor(X) --> "(", expr(X), ")". Normally this would be translated to: factor(X, A, B) :- [40|C] = A, expr(X, C, D), [41|B] = D. Would a Prolog system be allowed to translate it as follows, i.e. to merge the unifications into the head and the goal? factor(X, [40|A], B) :- expr(X, A, [41|B]). If DCG expansion would not be steadfast, it wouldn't be allowed to put [41|B] in the third argument of the expr call. But I guess steadfastness is in place, so