We illustrate the different approximations supported by the current version of Propia on a single small example. The results for

`IC`

integer domains.
The first approximation we will introduce in this section is one that searches for the unique answer to the query. It is writtenp(1,a). p(2,f(Z)). p(3,3).?- p(X, Y) infers most. X = X{1 .. 3} Y = Y There is 1 delayed goal. Yes (0.00s cpu) ?- X :: 1 .. 3, p(X, Y) infers most. X = X{1 .. 3} Y = Y There is 1 delayed goal. Yes (0.00s cpu) ?- p(2, Y) infers most. Y = f(_326) There is 1 delayed goal. Yes (0.00s cpu)

In the second example, by contrast,?- p(X, Y) infers unique. X = X Y = Y There is 1 delayed goal. Yes (0.00s cpu)

`infers unique`

yields the same
result as `infers most`

:
The next example shows that?- p(X,X) infers unique. X = 3 Yes (0.00s cpu)

The next approximation we shall describe is even weaker: it tests if there is an answer and if not it fails. If there is an answer it checks to see if the constraint is already true.?- p(2, X) infers unique. X = f(Z) Yes (0.00s cpu)

The strongest language?- p(1, X) infers consistent. X = X There is 1 delayed goal. Yes (0.00s cpu) ?- p(1, a) infers consistent. Yes (0.00s cpu) ?- p(1, X) infers consistent, X = b. No (0.00s cpu)

`infers most`

extracts any information
possible from the loaded constraint solvers. The solvers currently
handled by Propia are `IC`

library is
loaded by `lib(ic)`

and the symbolic library by
`lib(ic_symbolic)`

. These libraries are described elsewhere. If
both libraries are loaded, then `infers most`

extracts
information from unification, `IC`

domains and symbolic domains. For example:
with the above programp(f(X),1) :- X *>=0, X *=< 10. p(f(X),1) :- X=12.

The approximation?- p(X, Y) infers most. X = f(_338{0.0 .. 12.0}) Y = Y{[1, 2]} There is 1 delayed goal. Yes (0.00s cpu)

`infers ic`

is
similar to `infers most`

. However, while `infers most`

extracts information based on whatever constraint solvers are loaded,
the others only infers information derived from the specified constraint
solver.
Here's the same example using `infers ic`

:
One rather special approximation langue is?- p(X, Y) infers ic. X = f(_353{0.0 .. 12.0}) Y = Y{[1, 2]} There is 1 delayed goal. Yes (0.00s cpu)

`infers ac`

, where
`ac`

stands for arc-consistency.
This has similar semantics to `infers ic`

, but is implemented
very efficiently using the built-in `element`

constraint of the
`IC`

solver.
The limitation is that `Goal infers ac`

is implemented by
executing the goal repeatedly to find all the solutions, and then
manipulating the complete set of solutions.
It will only work in case there are finitely many solutions and they
are all ground. Finally it is possible to invoke Propia in such a way as to influence its waking conditions. To do this, use the standard

`suspend`

syntax. For example “forward checking” can be
implemented as follows:
In this case the Propia constraint wakes up each time a variable in the goal is instantiated.propagate(Goal,fc) :- !, suspend(Goal,7,Goal->inst) infers most.

The default priority for Propia constraints is 3. However, in the above example, the priority of the Propia constraint has been set to 7.