I have SWI-Prolog running and upgraded on Ubuntu 18.04 but JPL is a package and needs to be added separately. Currently reading Deploying for users - on Linux
Details of error
?- use_module(library(jpl)).
ERROR: source_sink `library(jpl)' does not exist
ERROR: In:
ERROR: [19] throw(error(existence_error(source_sink,...),_11038))
ERROR: [15] '$resolve_source_path'(library(jpl),_11070,[if(not_loaded),...]) at /usr/lib/swi-prolog/boot/init.pl:2265
ERROR: [14] '$load_file'(library(jpl),user,[if(not_loaded),...]) at /usr/lib/swi-prolog/boot/init.pl:2239
ERROR: [9] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Forward chaining => is renamed to ==> to avoid conflict with extensive downstream use of =>/2 to mean logical implication.
Bidirectional Forward chaining <=> renamed to <==> to avoid conflict with logical equivance <=>
Memoized backchain <= is renamed to <- to avoid conflict with extensive downstream use of <=/2 to mean reverse implication… Historically ‘<-’ had meant what is now know as “:-” being unused it was borrowed as it means “Backchaining”
Added Macro Transform =@=> so instead of asserting the Anteceedant to assert the Consequent
Although, upon use_module(library(pfc)), i get an error:
?- use_module(library(pfc)).
ERROR: c:/programdata/swi-prolog/pack/pfc/prolog/pfc2.0/mpred_loader.pl:199:
ERROR: source_sink `library(dictoo_lib)' does not exist
Warning: c:/programdata/swi-prolog/pack/pfc/prolog/pfc2.0/mpred_loader.pl:199:
Warning: Goal (directive) failed: pfc_lib:use_module(library(dictoo_lib))
but installing the dictoo pack (luckily its there), removes the error …
that’s great.
Curious what ain stands for – there is no aout … i guess, there needs to be a way to remove an asserted fact so that the machinery can retract male(joe) as well.
I noticed that once i installed pfc the prolog window generates a lot of messages during visual debug – and the few messages that my application generates (via writeln) essentially scroll away.
Is there a way to remove all the messages – i assume these are messages generated by the internal pfc mechanisms.
Can you paste an example with the messages. I am curious as to exactly how you are initiating this and also what the messages are. I am thinking debug/1 but that does not seem correct in this case.
Well 1.2 was Tim’s original version and did not work with modules (using independent forward chain rules “per module”).
So I created 2.0 which is module aware… But the code over time got messy but lots of new features:
Module inheritance of rules.
Forward chaining rules that could edit existing prolog “:-” code. (Not just facts)
Support for 2 types of Negation:
By failure +
By explicit ~
… a few more i’ll document…
But a few years ago since the code was getting messy I decided to restart it as 2.2 But it never worked out well.
Then this last week I was starting 3.0 which was supposed to be simpler/faster with the features.
But now I am abandoning 3.0 (for a while for awhile) and just fixing 2.0 to run faster since it is still the best.
So for now the 2.0 version is going to continue to be improved.
And yes I’ll fix the issue with JPL in the next couple hours … I think this might be a windows specific issue and its been a while since i tested this on windows
As some other suggestions to improve this for others that may follow. I personally have no pressing need for these at the moment.
Convert the examples in to SWI-Prolog unit test, or at least duplicate them as test when running with SWI-Prolog. I can do that if you prefer and send a pull request, but it would not be for quite some time.
While @grossdan and I use Windows 10, it would also be nice to know how to install this with the PPA build on Ubuntu. I ran into the problem of trying to install JPL but my Linux troubleshooting knowledge base is not as extensive as my Windows troubleshooting knowledge base.
Can the JPL usage be converted to library(persistency)? Finding out how to use library(persistency) is a bit of a challenge so I can help here if you seek this.
While I know the code is meant for Prolog in general, this site is indexed by many search engines and if a Wiki topic is added it would also get indexed and bring more attention to pfc. Again I can help you here if needed.
The reason for these suggestions is that from the little I have seen you have a great tool with pfc but others are
not aware of it
don’t know how to install it
don’t know the benefits it can bring to solving certain problems
will not use it if it is not easy to get started with, e.g. having to convert the examples and know the code works with test cases.
I am hoping to make extensive use of Pfc – it seems to fit very well with what i need – and performance will indeed become a key issue in the future.
I would be happy to also contribute example uses, and if time permits, intro tutorials, as i myself learn how to use it well – and note down my own lessons learned.