Top "Dcg" questions

DCGs (Definite Clause Grammars) are a compact way to describe lists in Prolog.

Implement the member predicate as a one-liner

Interview question! This is how you normally define the member relation in Prolog: member(X, [X|_]). % member(X, [Head|Tail]) …

list prolog dcg
Flatten a list in Prolog

I've only been working with Prolog for a couple days. I understand some things but this is really confusing me. …

list prolog flatten dcg difference-lists
Read a file line by line in Prolog

I'd like to read a plain text file and apply a predicate to each line (the predicates contain write which …

io prolog swi-prolog dcg
Prolog - Palindrome Functor

I am trying to write a predicate palindrome/1 in Prolog that is true if and only if its list input …

prolog palindrome dcg
how to split a sentence in swi-prolog

I am trying my hands on SWI-Prolog in win xp. I am trying to understand how to split a sentence …

prolog swi-prolog dcg
What are good starting points for someone interested in natural language processing?

Question So I've recently came up with some new possible projects that would have to deal with deriving 'meaning' from …

nlp dcg
Check if string is substring in Prolog

Is there a way to check if a string is a substring of another string in Prolog? I tried converting …

prolog substring dcg subsequence
What is SML used for?

What are the uses of SML in the real word? Are its practical uses similar to that of Prolog?

prolog sml dcg