Module Control.ValueSequence

This library defines a data structure for sequence of values. It is used in search trees (module SearchTree) as well as in set functions (module SetFunctions). Using sequence of values (rather than standard lists of values) is necessary to get the behavior of set functions w.r.t. finite failures right, as described in the paper

J. Christiansen, M. Hanus, F. Reck, D. Seidel: A Semantics for Weakly Encapsulated Search in Functional Logic Programs Proc. 15th International Conference on Principles and Practice of Declarative Programming (PPDP'13), pp. 49-60, ACM Press, 2013

Note that the implementation for PAKCS is simplified in order to provide some functionality used by other modules. In particular, the intended semantics of failures is not provided in the PAKCS implementation.

Author: Fabian Reck

Version: January 2019

Summary of exported operations:

emptyVS :: ValueSequence a   
An empty sequence of values.
addVS :: a -> ValueSequence a -> ValueSequence a   
Adds a value to a sequence of values.
failVS :: Int -> ValueSequence a   
Adds a failure to a sequence of values.
(|++|) :: ValueSequence a -> ValueSequence a -> ValueSequence a   
Concatenates two sequences of values.
vsToList :: ValueSequence a -> [a]   
Transforms a sequence of values into a list of values.

Exported datatypes:


ValueSequence

A value sequence is an abstract sequence of values. It also contains failure elements in order to implement the semantics of set functions w.r.t. failures in the intended manner (only in KiCS2).

Constructors:


Exported operations:

emptyVS :: ValueSequence a   

An empty sequence of values.

Further infos:
  • solution complete, i.e., able to compute all solutions

addVS :: a -> ValueSequence a -> ValueSequence a   

Adds a value to a sequence of values.

Further infos:
  • solution complete, i.e., able to compute all solutions

failVS :: Int -> ValueSequence a   

Adds a failure to a sequence of values. The argument is the encapsulation level of the failure.

Further infos:
  • solution complete, i.e., able to compute all solutions

(|++|) :: ValueSequence a -> ValueSequence a -> ValueSequence a   

Concatenates two sequences of values.

vsToList :: ValueSequence a -> [a]   

Transforms a sequence of values into a list of values.

Further infos:
  • solution complete, i.e., able to compute all solutions