Download An Introduction to Constraint (Logic) Programming Using ECLiPSe

Transcript
Some Constraints
ECLi PSe CLP
Stefano
Benedettini
Scope and
Motivations
Prolog as a
Constraint
Solver
ECLi PSe
Extensions to
Prolog
Syntactic Facilities
% In constraint
X in D :- member(X, D).
% Not in constraint
_ not_in [].
X not_in [H|T] :- not(X in [H|T]).
Iteration Constructs
Modules
Constraint
Satisfaction
with ECLi PSe
The Interval
Constraints Library:
ic
Search and
Optimization with
i
e
ECL PS
Other Constraint
Libraries
% All different
all_different([]).
all_different([H|T]) :all_different(T),
H not_in T.
% Ordered
ordered([_]).
ordered([X, Y|Z]) :- X < Y, ordered([Y|Z]).