João Aragão
unread,Sep 19, 2022, 3:20:02 PM9/19/22You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hey. I'm trying to make a program with DCG that recognizes a list of variables as such:
x1, x9, a, b, ..., z
it's getting like this:
var -->
[X], var, {char_type(X, alnum)}
| [X], var, {X='_'}.
var -->
[X], {char_type(X, alnum)}
| [X], {X='_'}.
var-list -->
var, [,], var-list, !.
var-list -->
var.
the problem is that when i try to run phrase(var-list, X), if X is a fairly lengthily list like [a,,,b,,,c,,,d,,,e,,,f,,,g,,,h,,,i,,,j,,,k, ')'] it backtracks too much before returning "false"! ( ')' is not part of list of variables)
any suggestions???