[ Reference Manual | Alphabetic Index ]

library(suspend)

Lazy-checking versions of arithmetic primitives, and the suspend-attribute   [more]

Predicates

?Vars #:: ?Range
Range constraint combined with integrality constraint
#::(?Vars, ?Range, ?Bool)
Reified range constraint combined with integrality constraint
?Expr1 #< ?Expr2
The integer value of Expr1 is less than the integer value of Expr2.
#<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 #= ?Expr2
The integer value of Expr1 is equal to the integer value of Expr2.
#=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 #=< ?Expr2
The integer value of Expr1 is less than or equal to the integer value of Expr2.
#=<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 #> ?Expr2
The integer value of Expr1 is greater than the integer value of Expr2.
#>(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 #>= ?Expr2
The integer value of Expr1 is greater than or equal to the integer value of Expr2.
#>=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 #\= ?Expr2
The integer value of Expr1 is not equal to the integer value of Expr2.
#\=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Vars #:: ?Range
Pure range constraint
\$::(?Vars, ?Range, ?Bool)
Reified pure range constraint
?Expr1 \$< ?Expr2
The value of Expr1 is less than the value of Expr2.
\$<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 \$= ?Expr2
The value of Expr1 is equal to the value of Expr2.
\$=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 \$=< ?Expr2
The value of Expr1 is less than or equal to the value of Expr2.
\$=<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 \$> ?Expr2
The value of Expr1 is greater than the value of Expr2.
\$>(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 \$>= ?Expr2
The value of Expr1 is greater than or equal to the value of Expr2.
\$>=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 \$\= ?Expr2
The value of Expr1 is not equal to the value of Expr2.
\$\=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Vars :: ?Range
Range constraint with optional integrality constraint
::(?Var, ?Range, ?Bool)
Reified range constraint with optional integrality constraint
?Expr1 < ?Expr2
The value of Expr1 is less than the value of Expr2.
<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 =:= ?Expr2
The value of Expr1 is equal to the value of Expr2.
=:=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 =< ?Expr2
The value of Expr1 is less than or equal to the value of Expr2.
=<(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 => ?Expr2
If Expr1 arithmetically evaluates to 1, so does Expr2 (implication)
=>(?Expr1, ?Expr2, ?Bool)
Reified boolean operation
?Expr1 =\= ?Expr2
The value of Expr1 is not equal to the value of Expr2.
=\=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 > ?Expr2
The value of Expr1 is greater than the value of Expr2.
>(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 >= ?Expr2
The value of Expr1 is greater than or equal to the value of Expr2.
>=(?Expr1, ?Expr2, ?Bool)
Reified arithmetic comparison
?Expr1 and ?Expr2
Both Expr1 and Expr2 arithmetically evaluate to 1
and(?Expr1, ?Expr2, ?Bool)
Reified boolean operation
integers(?Vars)
Constrain Vars to be integers
neg ?Expr
Expr arithmetically evaluates to 0
neg(?Expr, ?Bool)
Reified boolean operation
?Expr1 or ?Expr2
At least one of Expr1 or Expr2 arithmetically evaluate to 1
or(?Expr1, ?Expr2, ?Bool)
Reified boolean operation
portray_delay_reified(?, ?)
No description available
portray_delayed_goals(?, ?)
No description available
reals(?Vars)
Constrain Vars to be a number or list of numbers
tr_if_suspend(?, ?, ?)
No description available

Other Exports

export macro(if / 2, tr_if_suspend / 3, [clause])
export op(750, fx, [neg])
export op(760, yfx, [and])
export op(770, yfx, [or])
export op(780, yfx, [=>])
export op(700, xfx, [#::, \$::, \$=, \$\=, \$>=, \$=<, \$>, \$<])
export portray(delay_until_ground / 3, portray_delayed_goals / 2, [goal])
export portray(delay_reified / 4, portray_delay_reified / 2, [goal])

Description

This library provides the following:
• the suspend pseudo-solver for general arithmetic
• the suspend attribute
The suspend pseudo-solver for arithmetic comparisons simply consists of suspending (lazy-checking) versions of all arithmetic comparisons (>/2, #>/2, etc). These all suspend until all their variables have been instantiated, then they wake up and test the condition, succeeding or failing as appropriate. Together with a search routine, this provides the means to implement simple test-and-generate algorithms.

The suspend-attribute is a basis for the implementation of similar user-defined data-driven computations that react to variable instantiation, variable binding, or general variable-constraining events. The suspend- attribute defines the following three suspension lists (and thus waking conditions) for a variable:

inst
woken when variable is instantiated.
bound
woken when variable is bound, even to an other variable.
constrained
woken when variable is (further) constrained. This is triggered by the notify_constrained built-in.
These three lists can be used as waking conditions in the suspend/3,4 built-in. Variables using the suspend-attribute do not have to be declared specially, the attribute is implicitly created when needed.