|Did you know ...||Search Documentation:|
|Packs (add-ons) for SWI-Prolog|
|Title:||Nan.System.Sources - Answer Sources in Prolog|
|Rating:||Not rated. Create the first rating!|
|Author:||Julio P. Di Egidio <firstname.lastname@example.org>|
No reviews. Create the first review!.
Nan.System.Sources Nan.System.Sources/Prolog 1.2.0-beta Answer Sources in Prolog Copyright 2015-2017 Julio P. Di Egidio Licensed under GNU GPLv3. http://julio.diegidio.name/Projects/Nan.System.Sources/ https://github.com/jp-diegidio/Nan.System.Sources-Prolog/
This library implements Answer Sources in Prolog. This is an open and free project. Source code available and pull requests accepted.
Answer sources can be seen as generalized iterators, allowing a given program to control answer production in another. Each source works as a separate program interpreter, and, in our implementation, in its own process, via multi-threading.
For the rationale and design, we have followed almost exactly Paul Tarau on fluents , with at least the following differences:
getin Tarau's) supports an asynchronous pattern: e.g. this allows for easy implementation of parallelism in combinators;
resetoperation that restarts the enumeration, so Tarau's
splitcombinator is not necessary;
returnin Tarau's) to be available to the target predicate, i.e. in the context of the source worker loop.
A "Preview" version of Answer Sources was initially presented here .
A flow diagram for the
yield operation (denoted
return in the diagram)
was later presented here .
 P. Tarau, "Fluents: A Refactoring of Prolog for Uniform Reflection and Interoperation with External Objects": http://www.cse.unt.edu/~tarau/research/LeanProlog/RefactoringPrologWithFluents.pdf  P. Tarau, A. Majumdar, "Interoperating Logic Engines": http://www.cse.unt.edu/~tarau/research/LeanProlog/InteroperatingLogicEngines.pdf  J.P. Di Egidio, "Answer Sources in Prolog (SWI) - Preview": http://seprogrammo.blogspot.it/2015/09/answer-sources-in-prolog-swi-preview.html  J.P. Di Egidio, "Answer Sources: from Fluents to Interactors": http://seprogrammo.blogspot.co.uk/2015/09/answer-sources-from-fluents-to.html
This library comprises the following modules:
sources(nan/system/sources.pl) Provides the predicates that implement Answer Sources in Prolog.
sources_types(nan/system/sources_types.pl) Provides type testing predicates to validate arguments in user code.
For detailed documentation on the available modules and predicates, please see the code docs accompanying the Prolog code files.
This library was developed and tested with SWI-Prolog 7.3.25.
Basic usage example:
?- pack_install(nan_system_sources). true. ?- use_module(library(nan/system/sources)). true. ?- using_source(I, between(1, 2, I), _S, ( repeat, source_next(_S, answer(_Det, the(I))), (_Det == last -> !; true) )). I = 1 ; I = 2.
Pack contains 15 files holding a total of 96.7K bytes.