Did you know ... Search Documentation:
Pack modeling -- prolog/quantifiers.pl
PublicShow source
author
- Francois Fages
version
- 1.0.0

for_all/2 bounded universal quantifier with in/2 and where/2 conditions.

list_of/2 list of values satisfying in/2 and where/2 conditions.

exists/2 and let/2 existential quantifier allowing functional notations (e.g. for array cells) in expressions.

apply_list/2, call_list/2,3,4,5 conjunctive application of a goal


?- for_all(I in 1..3, J #> I).
clpfd:(J in 4..sup).

?- for_all(I in 1..3, J #= I+1).
false.

?- exists([I], (I=2, J #= I+1)).
J = 3.

?- let([I=2], J #= I+1).
J = 3.
 apply_list(+Goal, +ArgsList)
Conjunctive application of Goal to list ArgsList of arguments. Fails if the conjunction is not satisfiable.
 call_list(+Goal, ?Args)
More efficient conjunctive application of a one argument Goal to list Args of arguments.
 call_list(+Goal, ?Args1, ?Args2)
Conjunctive application of Goal to list of arguments Args1, Args2, ...
 for_all(+Domains, +Goal)
universally quantified Goal satisfied for all variables values in Domains specified with in and where/2 conditions. for_all/2 is non-deterministic if either the Goal or a where/2 condition is non-deterministic.
 exists(+Vars, +Goal)
calls Goal with existentizlly quantified variables Vars.
 let(+Bindings, +Goal)
calls Goal with existentially quantified variable Bindings given with expressions allowing array notations.
 list_of(+Domains, ?Values)
Values is the list of tuple values that are in Domains with in and where conditions.
 expand_term(+Term, ?Expansion)[multifile]
Multifile predicate defining Term Expansion allowed in let expressions. Defined here for the conditional expression if/3 (TODO generalization to deep expressions ?) and in module arrays.pl for the Array[Indices] notation.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 call_list(Arg1, Arg2, Arg3, Arg4)
 call_list(Arg1, Arg2, Arg3, Arg4, Arg5)
 call_list(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)