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 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews