Set expressions are posted via the predicate in/2 respectively ins/2 and are similarly handled to equality. Further forward checking and duplicate detection is also applied. But element hood provides additional functionality. Namely we find the following additional inference rule for the element hood:
The interval consistency has been both implemented for the scalar product and multiplication. A restricted form of interval consistency has been implemented. Namely intervals only propagate to the lexical head of a scalar product respectively multiplication. Directed interval consistency also works for the recently introduced abs/1 function.Examples:
?- X in 0..9, Y #= X+1, Z #= Y+1, X #= Z+1.
Z #= X-1,
Z in 2..8,
?- X in 0..sup, Y #= X+1, Z #= Y+1, X #= Z+1.
Z #= X-1,
Z #> 1,
This directed form of interval consistency is weaker than the full interval consistency. The directed form might accept equations that would otherwise be detected as inconsistent. But it has the advantage that it never loops and therefore also works for unbounded domains.
The following integer set expressions are provided:
The following integer value predicates are provided: