Answer Sources in Prolog (SWI) - Preview

40 views
Skip to first unread message

Julio Di Egidio

unread,
Sep 3, 2015, 10:01:28 AM9/3/15
to SWI-Prolog
Hi guys, so that you know:

I have implemented an initial version of Answer Sources in SWI-Prolog [1], now submitted for preliminary discussion to comp.lang.prolog [2].  For the rationale and design, I have followed Paul Tarau on "fluent sources" [3], although with some important differences.  Indeed, I am just at the stage of collecting feedback on the soundness of the design and the technical approach: in this sense, the code I have submitted should be regarded as a working prototype/proof of concept.

Taking it to "production level", to be distributed as an SWI pack, would require a significant amount of additional work, so you are very welcome to have a look at it and provide your early feedback.

If no major flaws are found, the idea is to go open under LGPL, bring the code to production level, and distribute as an SWI pack.  At that point issues more specific to SWI would certainly pop up, which I would rather ask about/discuss here in the SWI group.

Thank you,

Julio

[1] Code preview with answer sources and the basic combinators:

[2] (Short) presentation and discussion on comp.lang.prolog:

[3] Paul Tarau, "Fluents: A Refactoring of Prolog for Uniform Reflection and Interoperation with External Objects":

Douglas Miles

unread,
Jan 6, 2017, 4:23:27 PM1/6/17
to SWI-Prolog
Hi Julio, 

I noticed a small problem in the answer sources library: 


13 ?- source_open(X, member(X,[A,B,A]), S1).
S1
= source(t0, 7).


14 ?- source_enum($S1, answer(_, the(X))),writeq(X).
_76
S1
= source(t0, 7) ;
_6
S1
= source(t0, 7) ;
_6
S1
= source(t0, 7) ;



Notice in the last two results they ended up being the same variable: 

The answer I expected back was: 

14 ?- source_enum($S1, answer(_, the(X))),writeq(X).
_76
S1
= source(t0, 7) ;
_6
S1
= source(t0, 7) ;
_76
S1
= source(t0, 7) ;



Just letting you know and find out if you've patched it since.. 


Thank you in advance! 

Douglas R. Miles  
Reply all
Reply to author
Forward
0 new messages