[ library(propia) | Reference Manual | Alphabetic Index ]

+Goal infers +Language

Do generalized propagation over Goal according to the approximation Language.
Callable Term.
One of the terms most, unique, consistent, ac, or the name of a supported solver (fd, ic, sd, ic_symbolic)


Used to turn an arbitrary, nondeterministic Goal into a (deterministic) constraint, whose inference power is determined by the approximation Language. This is done using the Generalised Propagation Method (see T. Le Provost and M. Wallace, Domain-Independent Propagation, Proceedings of the FGCS'92, Tokyo, June 1992).

The infers-predicate computes the most specific generalization of all the solutions of the Goal according to the approximation Language and delays if Goal has several non comparable solutions.

With the language 'most', Goal is bound to the most specific generalization of all its solutions. This generalisation will depend what solvers are loaded - (e.g. ic, fd, sd or several of them). If one of the solutions is not a variant of this answer, the goal is delayed until one of its variables is bound. Note that the Goal may have an infinity of solutions.

Using other languages, an approximation of this most specific generalization can be computed. With the 'unique' language, infers/2 instantiates the Goal only if it has a unique solution (or the first solution of Goal subsumes all the others). With the 'consistent' language, infers/2 does not bind the Goal but only checks if Goal has at least one solution.

The name of a supported solver (ic, fd, ic_symbolic, sd, ... or a list of them) can also be used to specify the language. In this case, the infers-predicate computes the most specific generalisation expressible in terms of that solver's domain variables (e.g. intervals, finite domains, ...)

The language 'ac' implements generalised arc consistency on the table produced by computing all the (finitely) many solutions to the goal in advance. This requires that some solver implementing the element/3 constraint is loaded (fd, ic_global).


This predicate is sensitive to its module context (tool predicate, see @/2).

Fail Conditions

Fails if Goal has no solution.




(4) instantiation fault
Goal or Language is not instantiated.
(6) out of range
Language is not a correct language.
(68) calling an undefined procedure
Goal is an undefined procedure.


	[eclipse]: member(X, [f(1), f(2)]) infers most.
        X = f(_g1)
        Delayed goals:
        member(f(_g1), [f(1), f(2)]) infers most
	[eclipse]: [user].
	and(0, 0, 0).
        and(0, 1, 0).
	and(1, 0, 0).
	and(1, 1, 1).
	user       compiled traceable 528 bytes in 0.00 seconds
	[eclipse]: and(0, X, Y).
	X = X
	Y = 0     More? (;)          % Prolog: two solutions
	X = 0
	Y = 0
	[eclipse]: and(0, X, Y) infers most.
	X = X
	Y = 0
	yes.                         % Prolog + infers: one solution
	[eclipse]: [user].
	greater_than(succ(X), X).
	greater_than(succ(X), Y) :- greater_than(X, Y).
	user       compiled traceable 268 bytes in 0.00 seconds
	[eclipse]: greater_than(X, zero).
	X = succ(zero)     More? (;) % Prolog: infinity of solutions
	[eclipse]: greater_than(X, zero) infers most.
	X = succ(_g2)
	Delayed goals:
	    infers(greater_than(succ(_g2), zero), most, eclipse)
        [eclipse]: lib(fd).
        [eclipse]: member(X, [f(1), f(2)]) infers most.
	X = f(_g3[1, 2])
	[eclipse]: member(1, [2, 3]) infers consistent.
	no (more) solution.
	Goal infers most. % Error 4
	true infers true.  % Error 6

See Also