Parsing with DCG in the circuit (without Prolog)?

There are many implementations of Prolog-in-Scheme. For example. Canren, Schelog.

Apparently, in AI Programming Paradigms, Norvig implements the Prolog-to-Lisp compiler in Lisp to use literate markers of a certain type.

But is there an easier way? Maybe some clever use of the barn to avoid the full Prolog? What is the easiest way to have DCG-based parsing in a schema?

+5
source share
1 answer

DCGs use both unification and backtracking, so the implementation of the Prolog kernel should not be avoided. That is, you can present any pure Prolog program as a DCG by analyzing an empty list.

You can do this if you are not indifferent to any special case of DCG, for example, without variables (useful only for recognition, not for parsing).

+4
source

All Articles