sym_num

sym_num OP

Thank you very much.
My Prolog implementation is still buggy. I am rewriting carefully by test code.

0
Post #11
sym_num

sym_num OP

Bidirectional calculation is now possible.
It is a small interpreter of about 1000 lines.
Everyone, please enjoy remodeling as you like.
It is BSD license.

Example:
mix prolog
Compiling 1 file (.ex)
Prolog in Elixir
?- assert(append(, Xs, Xs)).
true
?- assert((append([X | Ls], Ys, [X | Zs]) :- append(Ls, Ys, Zs))).
true
?- append(X,Y,[1,2,3]).
Y = [1,2,3]
X = ;
Y = [2,3]
X = [1];
Y = [3]
X = [1,2];
Y =
X = [1,2,3];
false

?-halt.
goodbye

1
Post #12
kip

kip

ex_cldr Core Team

@sym_num, this is great - please keep going!

2
Post #15
sym_num

sym_num OP

Thank you very much.

0
Post #16
sym_num

sym_num OP

I am also trying to implement the parallel logic language GHC (guarded Horn Clause) by Elixir.
https://github.com/sasagawa888/Elxghc

1
Post #17
rvirding

rvirding

Creator of Erlang

Try looking at FCP (Flat Concurrent Prolog) which is really interesting. Or Parlog or Strand for that matter. We once did an implementation of Erlang in Strand but found that were something that wouldn’t work properly.

3
Post #18
sym_num

sym_num OP

Thank you for the information.

2
Post #19
JohnSmall

JohnSmall

This is very interesting. I used to do Prolog way back in the 1980’s and loved it. But the language was used for things (AI) where better things are now possible.

Where Prolog shines is in the ability to state the intention of the code in just a few lines. I’m looking at this for a sharded UTXO blockchain project. We want to get away from the impenetrable Bitcoin script to have something more expressive than BTC script, but not as complex as Solidity. The declarative paradigm seems perfect for short smart contracts in cryptocurrencies.

The combination of Prolog and Elixir seems ideal for that use case.

I’ll be reading your Github repos closely to learn what I can.

John Small

4
Post #20