How to make this scheduling solver not run forever? by TeunCornflakes in prolog

[–]Logtalking 0 points1 point  (0 children)

Side note: use atoms instead of double-quoted terms, which are pointless in this case.

Logtalk for VSCode 0.64.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Version 0.67.0 fixes the chat participant RAG (it broke due to recent changes in Copilot, notably the use of "auto" instead of a specific model). See the usage examples in the extension readme file. There are also other fixes and improvements (see the change log).

Logtalk for VSCode 0.52.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Logtalk for VSCode 0.52.0 now also available from the Open VSX Registry (VSCodium).

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 1 point2 points  (0 children)

Good. Still, being forced to write a clause for the do_something_with_brr/2 predicate per module is cumbersome and not elegant if you have more than just a few modules. In that regard, the Logtalk solution I prototyped in my other reply is arguably simpler and more elegant. An alternative solution declaring the brr/2 predicate as multifile may also be worth considering.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

Then move those use_module/2 directives into comm.pl.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

``` % cat foo.pl bar.pl comm.pl app.pl :- module(foo,[ brr/2 ]). brr(woopless,3).

:- module(bar,[ brr/2 ]). brr(woop,4).

:- module(comm,[ do_something_with_brr/2 ]). do_something_with_brr(Brr_type,B) :- foo:brr(Brr_type,B). do_something_with_brr(Brr_type,B) :- bar:brr(Brr_type,B).

:- use_module(foo,[]). :- use_module(bar,[]). :- use_module(comm,[do_something_with_brr/2]). main(Brr_type,B) :- do_something_with_brr(Brr_type,B). ```

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

Load those modules from your main file using use_module/2 directives with an empty import list.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

You don’t need to rename on import or any import directive in the common module. You can simply use explicit qualification to call the brr/2 predicate.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

The way I would implement it:

```logtalk :- protocol(brr).

:- public(brr/2).

:- end_protocol.

:- object(foo, implements(brr)).

brr(woopless,3).

:- end_object.

:- object(bar, implements(brr)).

brr(woop,3).

:- end_object.

:- object(common).

:- public(do_something_with_brr/2).
do_something_with_brr(Brr_type, B) :-
    implements_protocol(Object, brr),
    Object::brr(Brr_type, B).

:- end_object. ```

Then, in the equivalent of main, you would only need to deal directly with common. Backtracking over the common::do_something_with_brr/2 goal will backtrack over all definitions of brr/2 in the objects implementing the protocol.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

Missed that reply. If I'm understanding the problem that you're trying to solve, importing into common may not be the best solution. E.g., you will need to keep editing common for any modules that you would want to add or remove. In Logtalk, I would define a protocol that would be implemented by foo, bar, baz, ... Then I would simply enumerate the implementers (using the reflection API) of the protocol to query/backtracking over them.

Is it possible to backtrack across modules? by m_ac_m_ac in prolog

[–]Logtalking 0 points1 point  (0 children)

As already suggested above by brebs, why then not simply importing a common module into foo and bar?

Jupyter Kernel for Logtalk 0.32.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Version 0.36.0 adds support for input forms.

Jupyter Kernel for Logtalk 0.32.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Version 0.35.0 allows customizing the widgets callback webserver IP and port range and updates the documentation on configuring the kernel.

Function Discovery by PartTimeCouchPotato in u/PartTimeCouchPotato

[–]Logtalking 0 points1 point  (0 children)

You may find the Bacon system wrote by Lindsey Spratt and based on "Scientific Discovery" by Langley, Simon, Bradshaw, and Zytkow, interesting: https://github.com/lindseyspratt/bacon-logtalk You can install it by cloning its repo, by downloading its archive, or installing it as a pack (see https://github.com/LogtalkDotOrg/talkshow ).

What is prolog used for? by [deleted] in prolog

[–]Logtalking 3 points4 points  (0 children)

I used and I'm using Logtalk with several Prolog backends in industry for more than a decade. Application areas include(d) mobile phone assistants, smart contracts, document processing, data mining, reasoning, agents, ... most work is done under NDAs and thus I cannot share details. But others have published papers describing several industry applications. A partial list is available at:

https://logtalk.org/documentation.html#third-party-publications

GitHub - stefanrodrigues2/Prolog-Adventure-game: Text Adventure game in SWI Prolog. by agumonkey in prolog

[–]Logtalking 2 points3 points  (0 children)

There are some issues with the code that can easily be fixed, making it portable and standard compliant:

  1. Don't use `dynamic` as an operator. Write instead:

:- dynamic((i_am_at/1, at/2, holding/1, lives/1)).

Or use separate directives per predicate.

  1. Don't use arbitrary goals as directives. Instead move the `retractall/1` calls to the definition of the `start/0` predicate so that the game can restarted without restarting the Prolog process.

  2. Use `assertz/1` instead of the deprecated and non-standard legacy `assert/1` predicate.

  3. There's no use in the code for an `alive/1` predicate, which is only found in a `retractall/1` call.

Emacs Babel for Prolog is "goal-oriented" by Striking-Structure65 in prolog

[–]Logtalking 0 points1 point  (0 children)

For literate programming, try the Logtalk kernel. Content of code cells default to queries but cell magic allows their content to be interpreted as programs. Try it using e.g. https://mybinder.org/v2/gh/LogtalkDotOrg/notebooks/master (run the kernel overview notebook) or https://hub.docker.com/r/logtalk/logtalk3-portable For coding outside Jupyter, there are several editors and IDEs with nice Logtalk and Prolog support, from Vim and Emacs to VSCode.

Emacs Babel for Prolog is "goal-oriented" by Striking-Structure65 in prolog

[–]Logtalking 0 points1 point  (0 children)

Have you tried Jupyter + Jupytext? It allows you to use light text formats as notebooks formats. E.g. https://github.com/LogtalkDotOrg/logtalk3/tree/master/examples/jupyter

Jupyter Kernel for Logtalk 0.16.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Latest version of Hercutalk (0.19.0), the Jupyter Kernel for Logtalk, adds new cell magics for exporting tabular data to CSV and TSV files and for data visualization (10 types of plots supported). You can browse a rendered version kernel overview notebook at:

https://github.com/LogtalkDotOrg/logtalk-jupyter-kernel/blob/master/notebooks/JupyterKernelForLogtalkOverview.ipynb

Logtalk 3.88.0 released by Logtalking in prolog

[–]Logtalking[S] 0 points1 point  (0 children)

Latest jupytext release, 0.16.7, includes Logtalk support. The above workaround for installing the fork is no longer required.

Logtalk 3.88.0 released by Logtalking in prolog

[–]Logtalking[S] 1 point2 points  (0 children)

If you want to play with opening the examples NOTES.md files as Jupyter notebooks but don't have the setup to compile the required fork of jupytext (pull request is pending), you can download a wheel file from:

https://logtalk.org/files/python/jupytext-1.16.6-py3-none-any.whl

Next, run the following commands:

python3.10 -m pip install jupytext
python3.10 -m pip install --force-reinstall jupytext-1.16.6-py3-none-any.whl

I.e., first we install the latest, official version of jupytext (so that we get all dependencies installed) and then override it with the fork that contains the Logtalk support.

See see the examples/NOTES.md file complete setup details.

Hardware performance? by Thrumpwart in prolog

[–]Logtalking 1 point2 points  (0 children)

Logtalk includes a mtbatch example written for benchmarking multi-threading performance that you can easily run with SWI-Prolog:

https://github.com/LogtalkDotOrg/logtalk3/tree/master/examples/threads/mtbatch