I am having problems with syntax sequences that start with capital letters in variables using the Prolog DCG notation. For example, if I have a string
f a X y Z X
and DCG, which parses this string, is there a way to parse each uppercase letter into a unique Prolog variable. For example, analyze a Yvariable and each Xvariable? The intended application would have to create a functor
T = f(a,X,y,Z,X)
using a DCG rule ending with an operator
{T =.. [Head|Args]}
source
share