Praise for Prolog, Designing Custom Language Semantics

Hello,

I am working on a semantic underpinning of a (domain specific) language and now have two kinds of code – one, an optimized implementation of the language (its work in progress) – which turned out to be mostly “procedural” prolog code, with lots of deterministic predicates (and cuts inside of them) and a declarative description of the language – with no cut in sight – its all non-deterministic.

I see the declarative description like an axiom system describing declaratively (essentially, in a restricted First Order Logic form) the formal semantic underpinning of the language.

What I find amazing is that creating an executable axiom system in Prolog allows uncovering assumptions and distinctions I didn’t identify during language implementation work – where the semantics was established by creating and analyzing test cases.

It’s amazing how powerful prolog (w/ tabling) is for language designers …

Perhaps, this is not surprising at all, since the origins of Prolog were NLP/NLU – Natural Language Processing and Understanding.

Dan

3 Likes