Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "cclab"

Title:Continuations lab
Rating:Not rated. Create the first rating!
Latest version:0.1.5
SHA1 sum:570bf9cb87f8b0e0b1142b58d7f346d6080a48da
Author:Samer Abdallah <s.abdallah@ucl.ac.uk>
Download URL:https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.5.tgz
Requires:dcgutils
genutils
typedef

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.1af19900b752e1d935f1a7ff12f906f2d2233bc4a1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.1.tgz
0.0.2128ed4cbfe2f2ff213373b1efc257b90303af8801https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.2.tgz
0.0.32cf76f85e669e10659bb9fffae5852472182328b1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.3.tgz
0.0.441db0b636b4946dfed50a39db2e23ca8d1da701d1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.4.tgz
0.0.502f2f7dcb9084b73edfb8a2e19355e80914093751https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.5.tgz
0.0.6e2cf2e7aa319de6bd2978cb63395172867a061161https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.6.tgz
0.0.70906a6a58801c6379c37cc597cf07a41fe2abacd1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.7.tgz
0.0.83038d610757161fcdf5d5c8b062a84a0b363a9794https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.8.tgz
0.0.92fd8da37348ca4c65313e402727a67d67622254c1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.0.9.tgz
0.1.09f939512cbd7238c0cae7f41fb8e904bc1bb0dfa1https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.0.tgz
0.1.20b7dc6bd6af40afae1e9e3e7fea02e12dec49e762https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.2.tgz
0.1.390aea936e572c1490a800725bc3feb6dc5317cb21https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.3.tgz
0.1.4d0f25ec2ccb72b26d9cd222e34d1b3f2949552611https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.4.tgz
0.1.5570bf9cb87f8b0e0b1142b58d7f346d6080a48da2https://raw.githubusercontent.com/samer--/prolog/master/cclab/release/cclab-0.1.5.tgz

cclab - A temporary pack for playing with delimited continuations

This package explores a few ways of working with SWI Prolog's delimited continuations (reset/1 and shift/1) and some applications, including tabling.

There are some experimental libraries in the prolog directory:

delimcc - 3 alternative interfaces to shift and reset
ccstate - Backtrackable state as a control effect reified as DCG goal.
          Hygienic nonbacktrackable state using nb_setval and nb_getval.
cclistm - Nondeterminism reified as a list (like Haskell List monad)
lambda1 - Lightweight lambdas
lambda2 - Lightweight lambdas, different operator precedences

There are three subdirectories:

ccmisc - Initial experiments with combining statefulness and nondetermism effects
cclazy - Memoisation, nondeterminism and probabilistic choice reified as lazy search trees
cctab  - More Prolog oriented tabling experiments, using Prolog nondetermism directly

Running tests

From the shell prompt:

$ swipl -g 'consult(library(ccmisc/state_nondet2))'
$ swipl -g 'consult(library(cctab/test_memo))'
$ swipl -g 'consult(library(cctab/test_prob))'
$ swipl -g 'consult(library(cctab/cctab))'

Implementation notes

Copying continuations

In order to run a continuation multiple times, or do other maniplulations, it is often necessary to copy a continuation along with any variables with which it interfaces with other parts of the program. In many cases, the pattern of copying and calling is nicely captured by the semantics of lambda terms. This is why I've included a couple of experimental minimal lambda libraries here. They are closely modelled on Ulrich Neurmerkel's lambda library, but with a little less checking and a different representation of free variables.

Contents of pack "cclab"

Pack contains 50 files holding a total of 197K bytes.