sym_num

sym_num

I am creating a Prolog interpreter to learn Elixir. This is not practical. It is a toy program.

https://github.com/sasagawa888/Prolog

Example: (from PAIP, Peter Norvig)
?- assert(likes(kim,robin)).
true
?- assert(likes(sandy,lee)).
true
?- assert(likes(sandy,kim)).
true
?- assert(likes(robin,cats)).
true
?- assert((likes(sandy,X) :- likes(X,cats))).
true
?- assert((likes(kim,X) :- likes(X,lee),likes(X,kim))).
true
?- assert(likes(X,X)).
true
?- listing.
likes(kim,robin)
likes(sandy,lee)
likes(sandy,kim)
likes(robin,cats)
likes(sandy,X) :- likes(X,cats)
likes(kim,X) :- likes(X,lee)likes(X,kim)
likes(X,X)
true
?- likes(sandy,Who).
Who = lee;
Who = kim;
Who = robin;
Who = sandy;
Who = cats;
Who = sandy;
false
?-halt.
goodbye

Showing Posts 1 to 10

kip

kip

ex_cldr Core Team

This super exciting (for me). I’ve been re-reading Prolog with the idea of either implementing a Prolog-like DSL, or maybe an interpreter. I’ve only got as far as starting to research how to write a Horne clause theorem solver (really, just started), So this is going to be a great project for me to follow.

sym_num

sym_num OP

Thank you for your reply.
I’m glad to be interested.
Thank you very much.

datadrover

datadrover

Of tangential relevance because it’s not Elixir, but Erlog might be worth looking at. While it seems not to have been worked on for a few years, it has good pedigree (@rvirding). I also recall that @zkessin had some interest in Prolog on the Beam.

Beyond exploration, I can see a possible use case (actually considered doing it some time ago): As a triage frontend for a Prolog database running something like SWI Prolog.

zkessin

zkessin

Erlog is pretty cool, but could use some love. If I evere were to be in a position to sponsor someone to work on open source it would be on my list of things to work on (Not happening anytime soon) but I would love to chat about it

datadrover

datadrover

Likewise. Maybe sometime in the future I will have time and resource to revisit it. The application I was looking at had no business model and would probably have required public funding - unlikely as things stand right now.

sym_num

sym_num OP

Thank you for the information of Erlog.

rvirding

rvirding

Creator of Erlang

Yes, I haven’t worked on Erlog for a while but it is has not died. It has reached a certain level and I have left it there. It does implement a proper subset of standard prolog but of course it could be extended. The next step could be a rework of the interpreter maybe compiling the code a bit to improve speed.

Doing an elixir front-end to it would be relatively simple as the interface and internal data structures are quite straight forward. It is just that no one has asked for one yet. :smile:

There was a fork where someone else reworked the database to handle large tables but it used ETS and it wasn’t possible to make the database behave exactly as the prolog standard. Which was one of my requirements. There is a simple ETS interface which could be extended with more features.

mythicalprogrammer

mythicalprogrammer

LOL, we’ve come in full circle.

I’ve left Erlang because I was meh with the Prolog’s syntax for Elixir.

And now we have a project for prolog written in Elixir.

sym_num

sym_num OP

I appreciate the talent of Jose.
Elixir has given modern syntax to the capabilities of Erlang.
If great talent gives Prolog modern syntax, Prolog may come back.

emacstheviking

emacstheviking

Nice! I love Prolog and considered the same idea a few years ago. Recent months have seen me learning Mercury too, I have just about finished wrapping the SDL2 media library with it so I can write games in Mercury.

Creating a clean Prolog in Elixir is my kind of mad idea. I’ll check out the git pages and have a look!

Sean.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 92995 915
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New
GES233
I’m posting this in response to Jose’s recent tweet (Cr. link) : People are sleeping on Elixir for a coding harness: Hot-code swappi...
New
nseaSeb
AcmeScript — Writing JS hooks as if I were still using Elixir I’ve been having fun building a little something over the last few days: Ac...
New

Other Trending Topics Top

hauleth
Name: Łukasz Niemier Location: Poznań, Poland Remote / relocation / travel: Remote, with occasional travel. Work experience: I am soft...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews