getAllValues
:: a -> IO [a]
Gets all values of an expression (similarly to Prolog's findall).
Conceptually, the value is computed on a copy of the expression,
i.e., the evaluation of the expression does not share any results.
The strategy to search for all values depends on the Curry system:
getAllValuesDFS
:: a -> IO [a]
Gets all values of an expression. This operation is similar to getAllValues but uses a depth-first search strategy (if available). Thus, it could be more efficient than getAllValues but it might not terminate (instead of computing of all values) if the search space is infinite.
getOneValue
:: a -> IO (Maybe a)
Gets one value of an expression or Nothing
if the expression has no value.
Conceptually, the value is computed on a copy of the expression,
i.e., the evaluation of the expression does not share any results.
The strategy to search for a value depends on the Curry system:
In PAKCS, the evaluation suspends as long as the expression or its computed value contain unbound variables.
getOneValueDFS
:: a -> IO (Maybe a)
Gets one value of an expression or Nothing
if the expression has no value.
This operation is similar to getOneValue
but uses a depth-first search
strategy (if available).
Thus, it could be more efficient than getOneValue
but it might not terminate
(instead of computing of value) if the search space is infinite.
getAllFailures
:: a -> (a -> Bool) -> IO [a]
Returns a list of values that do not satisfy a given constraint. As a simple example, the expression
getAllFailures ([] ? [1] ? [2]) (\xs -> head xs =:= 1)
evaluates to [[], [2]].
:: a
|
an expression ´e´ (e.g., a generator evaluable to various values) |
-> a -> Bool
|
a constraint ´c´ that should not be satisfied |
-> IO [a]
|
list of all values of e
such that (c e)
is not provable
|