2 ms·
For those that don't know, Prolog allows of parsing in very nice ways and very easily using Domain Clause Grammar. parse(Output)--> [Input], {member(Input,
by segmondy 12y ago
For those that don't know, Prolog allows of parsing in very nice ways and very easily using Domain Clause Grammar.
parse(Output)--> [Input],
{member(Input, [ab, cd]), atom_codes(Input, Output)}.
test(In):-
phrase(parse(L), [In]), writeln(L).
?- test(ab).
[97,98]
true .
?- test(cd).
[99,100]
true.
?- test(xy).
false.