<commit_before>erlog-server
============

This is an effort to allow you to build a gen_server from a prolog
file with a custom API that can be defined in prolog. It is a very
early stage right now everything can and may change.

Pull Requests welcome!

This is designed so that you can create a prolog module .pl and
compile it down to a beam file which will run as a gen_server. 

In your prolog file you should tell it which functiors to export by
using the `erl_export/3` predicate, where the first item is the
functor to return, the second is the atom `return` and the final is
either the name of the parameter to return or boolean. (the examples
are taken from the _po_sets.pl_ file in the priv directory.


````prolog
erl_export(path/3, return, 'Path').
path(A,B,Path) :-
       travel(A,B,[A],Q), 
       reverse(Q,Path).

````

This will create a module that has the erlang function that takes the
PID of the server and the other parameters and returns the return
value specified in prolog.

````erlang
path(Erlog, A,B) ->
	Path.
	
````

If you ask for a return type of `boolean` then it will simply return
true if the predicate succeded and false if it failed.

Note that as of now this does not work yet! I am working on it. 

There is also a plan for a rebar plugin
<commit_msg>describe make_supervisor_childspec<commit_after>erlog-server
============

This is an effort to allow you to build a gen_server from a prolog
file with a custom API that can be defined in prolog. It is a very
early stage right now everything can and may change.

Pull Requests welcome!

This is designed so that you can create a prolog module .pl and
compile it down to a beam file which will run as a gen_server. 

In your prolog file you should tell it which functors to export by
using the `erl_export/3` predicate, where the first item is the
functor to return, the second is the atom `return` and the final is
either the name of the parameter to return or boolean. (the examples
are taken from the _po_sets.pl_ file in the priv directory.


````prolog
erl_export(path/3, return, 'Path').
path(A,B,Path) :-
       travel(A,B,[A],Q), 
       reverse(Q,Path).

````

This will create a module that has the Erlang function that takes the
PID of the server and the other parameters and returns the return
value specified in prolog.

````erlang
path(Erlog, A,B) ->
	Path.
	
````

If you ask for a return type of `boolean` then it will simply return
true if the predicate succeed and false if it failed.

Note that as of now this does not work yet! I am working on it. 

There is also a plan for a rebar plugin

If you want to have your erlog server running from a supervisor, then
the generated module will include a function
`make_supervisor_childspec` which will generate a basic child_spec
that will enable you to hook it up to a supervision tree.
{'fraction_non_alphanumeric': 0.06269813314547376, 'fraction_numerical': 0.0014089468122578373, 'mean_word_length': 3.896551724137931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3239871', 'n_tokens_mistral': 832, 'n_tokens_neox': 789, 'n_words': 468}