eBarbarella
Technical User
Can someone, please explain to me is it possible (and how) to use grammar in Prolog for extracting the list elements.
For example, if I have a simple grammar
s --> number, explanation.
number --> [X], {integer(X)}.
explanation --> [X], {atom X}.
and if I have a list L=[1, 'someText']
s(L, []) will give answer yes, and is it pssible to get something like:
number=1, explnation = 'someText'?
For example, if I have a simple grammar
s --> number, explanation.
number --> [X], {integer(X)}.
explanation --> [X], {atom X}.
and if I have a list L=[1, 'someText']
s(L, []) will give answer yes, and is it pssible to get something like:
number=1, explnation = 'someText'?