constraint programming computer science seminar april 9 th, 2004 kerem kacel
TRANSCRIPT
![Page 1: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/1.jpg)
CONSTRAINT PROGRAMMING
Computer Science Seminar
April 9th, 2004
Kerem Kacel
![Page 2: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/2.jpg)
OUTLINE
Introduction History The Method Constraint Logic Programming Applications Pros/Cons Discussion
![Page 3: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/3.jpg)
What is Constraint Programming?
Software technologyDescribe and solve large,
combinatorial problems 2 steps
State the constraints of the problemFind a solution satisfying all of the
constraints
![Page 4: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/4.jpg)
What is a Constraint?
Defined on a set of variables A relation on their domains
e.g. “The circle is inside the square”Does NOT necessarily specify valuesDoes restrict values
![Page 5: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/5.jpg)
Properties of Constraints
Express partial informationX > 0
HeterogeneousY = ABS(X)
Non-directionalX = Y+1 also means Y = X-1
![Page 6: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/6.jpg)
Properties of Constraints (2)
AdditiveX<4, X>1 also means X>1, X<4
Declarative“The pen is on the table”
Usually dependentX + Y = 5, X * Y = 6
![Page 7: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/7.jpg)
OUTLINE
Introduction History The Method Constraint Logic Programming Applications Pros/Cons Discussion
![Page 8: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/8.jpg)
Some History
Constraint Satisfaction Problems (CSPs) were formalized in early 70s
Constraint Logic Programming (CLP) emerged in early 80s, named by IBM
Prolog II was the first Later
CHIP (Constraints Handling in Prolog)Prolog III
![Page 9: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/9.jpg)
Some History
CosytecFounder of “Global Constraints”
• Helped solve a large class of problems• Planning, scheduling, sequencing
ILOG SOLVERConstraint programming classes for
C++, Java
![Page 10: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/10.jpg)
OUTLINE
Introduction History The Method Constraint Logic Programming Applications Pros/Cons Discussion
![Page 11: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/11.jpg)
METHOD
Define the problem as a CSP (Constraint Satisfaction Problem)
Solve the CSP
![Page 12: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/12.jpg)
What is a CSP?
Constraint Satisfaction ProblemSet of variables X = {x1,…,xn}
Domains Di for each variableSet of constraints
An example CSPA::{1,2}, B::{1,2}, C::{1,2}A = B, A ≠ C, B > C
![Page 13: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/13.jpg)
Solving a CSP
Example CSPA::{1,2}, B::{1,2}, C::{1,2}A = B, A ≠ C, B > C
Generate & TestFor every value assignment in the
domains, check if constraint is mete.g. A = 2, B = 2, C = 1
![Page 14: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/14.jpg)
Solving a CSP
Example CSPA::{1,2}, B::{1,2}, C::{1,2}A = B, A ≠ C, B > C
Back-TrackingStart with a specific assignmentChange values one by one until a
solution is reached
![Page 15: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/15.jpg)
Solving a CSP
Problem: These methods are inefficient
Other methods are being researched to optimize
![Page 16: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/16.jpg)
OUTLINE
Introduction History The Method Constraint Logic Programming Applications Pros/Cons Discussion
![Page 17: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/17.jpg)
Constraint Logic Programming
Constraints + LP = CLP
Platforms:CHIPECLiPSe
![Page 18: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/18.jpg)
OUTLINE
Introduction History The Method Constraint Logic Programming Applications Pros/Cons Discussion
![Page 19: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/19.jpg)
APPLICATIONS
Assignment problemsPersonnel assignment
Scheduling problemsClass schedules in schoolsProduction planning
Database SystemsEnsure consistency of data
![Page 20: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/20.jpg)
APPLICATIONS
Natural Language ProcessingConstruction of efficient parsers
Electrical EngineeringLocating faults in circuits
Molecular BiologyDNA sequences
![Page 21: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/21.jpg)
PROS/CONS
+ DeclarativeDescribe the problem, not solution
+ SemanticsClean, elegant languages
- UnpredictableWe don’t know how efficient
![Page 22: CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649ea25503460f94ba6a7c/html5/thumbnails/22.jpg)
DISCUSSION
“Were you to ask me which programming paradigm is likely to gain most in commercial significance over the next 5 years I’d have to pick Constraint Logic Programming, even though it’s perhaps currently one of the least known and understood.”
Dick Pountain, BYTE, February 1995