Show HN: A simple Prolog Interpreter written in a few lines of Python 3
github.com
github.com
Datalog: https://en.wikipedia.org/wiki/Datalog
... TBH, IDK about logic programming and bad facts. Resilience to incorrect and incredible information is - I suppose - a desirable feature of any learning system that reevaluates its learnings as additional and contradictory information makes its way into the datastores.
0. https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d...
If you want real power for implementing things in as few lines as possible, F# is definitely worth taking a look at as well!
https://github.com/VincentToups/emacs-utils/blob/master/with...
another blog entry discusses it (scroll down): https://github.com/VincentToups/emacs-utils/blob/master/mona...
This project even has a GUI/IDE. I believe that is a stronger selling point rather than "few" lines of code or "little work", "easy way" or any of these other colloquial 'flexing' terms.
Does anybody use Prolog scripting engine as part of their applications? For example, to write a solution lookup function for some specific problem that would be a nightmare to solve otherwise.
As a side note, I found that Lisp (the Scheme flavor) is essential in many applications. First of all, as a small and capable templating engine. Secondly, as a sophisticated NLP (natural language processing) engine.
Originally, I was trying to learn Kotlin along with wanting a refresher in Prolog, so I attempted to do the port using Kotlin and gave up half way though. I didn't have the patience to try to grok too many things at once, so I decided to go with Python due to it's simplicity, popularity, as well as the fact that I'm a lot more fluent in it than I am in Kotlin.
Anyways - sorry if I'm going off track. To answer your question, I grokked the implementation details through porting / refactoring the original code. The concepts / unification I was already familiar with from taking a university course which involved Prolog and from using it in a large AI project. From what I remember, it took me quite a long time to grasp the language and its power!!