DefiniteClauseGrammar

ThoughtStorms Wiki

Context : OnParsing WritingCompilers

PrologLanguage has some SyntacticSugar to implement grammars as Prolog rules.

https://www.metalevel.at/prolog/dcg

In SwiProlog : https://www.swi-prolog.org/pldoc/man?section=DCG

Quora Answer : What's the nearest thing to Prolog's DCG in Clojure? To turn grammars into core.logic or similar?

Nov 1, 2018

Ah ... I see from clojure/core.logic (features), if you scroll down, there is an experimental implementation of DCG

Quora Answer : What is the programming language you are looking for and why?

Sep 27, 2018

Today, I'm looking for a language that has the easy ability to write grammars, something like Prolog has with Definite clause grammars.

And which can then be persuaded to derive from those grammars some kind of "expert system". A large knowledge-base which knows about both the structure that the grammars define. (Sort of like a "frame" based expert-system, but without the clunky OO-ness). But also represents that as a collection of rules which it can reason about. And which can be supplemented with actual domain rules.

Finally, I want this language to have high-level (ideally declarative) control over a) a user interface, and b) the file-system, so the result of running these rules is that the expert system prompts me for particular bits of input to fill in the blanks it doesn't know about, and then, based on my answers, produces a bunch of files (based on templates) filled with that information I'm giving it and extra derived data.

Because I like Clojure I've been looking to see if some combination of Instaparser and core.logic can help me here. But it's not quite as straightforward as I hope.

I wonder if this is actually easy to do in Prolog. But I don't know it well enough to say. Or whether it would be worth deep diving into Prolog to try it.

Perhaps Anne Ogborn or Alexander Tchitchigin could tell me.

Why I want this?

I want to make a system which involves eliciting a certain amount of specialist knowledge and then uses it to create a whole project full of documents.

But my ideal is that I can specify this in the most minimal / efficient way possible. Basically just writing a combination of BNF grammar rules and a few other inference rules.

No Backlinks