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! |
Latest version: | 1.2.0 |
SHA1 sum: | c9c6bbd2a6f86d785469363d6154fb4e41f2d326 |
Author: | Julio P. Di Egidio <julio@diegidio.name> |
Home page: | http://julio.diegidio.name/Projects/Nan.System.Sources/ |
Download URL: | https://github.com/jp-diegidio/Nan.System.Sources-Prolog/releases/download/1.2.0-beta/nan_system_sources-1.2.0.zip |
Provides: | sources |
system |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
1.2.0 | c9c6bbd2a6f86d785469363d6154fb4e41f2d326 | 15 | https://github.com/jp-diegidio/Nan.System.Sources-Prolog/releases/download/1.2.0-beta/nan_system_sources-1.2.0.zip |
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 [1], with at least the following differences:
next
operation (get
in Tarau's)
supports an asynchronous pattern: e.g. this allows for easy
implementation of parallelism in combinators;reset
operation that restarts the
enumeration, so Tarau's split
combinator is not necessary;yield
operation
(return
in 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 [3].
A flow diagram for the yield
operation (denoted return
in the diagram)
was later presented here [4].
[1] 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 [2] P. Tarau, A. Majumdar, "Interoperating Logic Engines": http://www.cse.unt.edu/~tarau/research/LeanProlog/InteroperatingLogicEngines.pdf [3] J.P. Di Egidio, "Answer Sources in Prolog (SWI) - Preview": http://seprogrammo.blogspot.it/2015/09/answer-sources-in-prolog-swi-preview.html [4] 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.