Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.

Similar presentations


Presentation on theme: "Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving."— Presentation transcript:

1 Programming with Constraints Jia-Huai You

2 Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving problems that can be characterized by constraints Any solution of a problem must satisfy all the constraints that represent the given problem.

3 Typical Problems Almost all computationally hard problems fall into it: Scheduling: airline, sports, … Planning: logistics, networking, robots, … Optimization NP-hard problems: combinatorial, graph- theoretic problems, bio informatics, puzzles, etc.

4 Before CP Given a problem develop an algorithm for it prove the properties of the algorithm implement it in a computer language perhaps try to improve it

5 The CP Approach One of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it. Related to Declarative Programming

6 Example: Graph Coloring Represented by nodes and arcs, the user states: Every node must be colored with one and exactly one color; If two nodes A and B are connected by an arc, then their colors must be distinct The encoding of the above differs in different approaches to CP.

7 Planning Represented by constraints that express: Action choice which action(s) should be chosen at each state Affected objects the affected objects by an action Effects if affected, what are the effects Frame axioms if not affected by any action at a state, the fluents that hold at the current state remain to hold in the next state.

8 Some Approaches to CP Constraint Satisfaction Problem (CSP) SAT/Answer Set Programming Integer Programming Pseudo-Boolean constraint solvers

9 CSP A problem specified by variables, domains, and constraints. Convenient to solve many combinatorial, optimization problems ILOG: A commercial product Constraint Logic Programming -Efficient solvers embedded in Prolog, 30+ systems -Global constraints

10 SAT Check whether a collection of propositional clauses has a model Successfully employed in large-scaled circuit verification, design automation, etc. Modern SAT solvers are quite efficient (best known: zChaff)

11 Answer Set Programming (ASP) A variant of SAT with a non-monotonic semantics, enhanced by a number of programming constructs; e.g. cardinality constraints Example: 3-coloring 1 {colored(A,red),colored(A,yellow),colored(A,blue)} 1 :- node(A). :- node(A), node(B), color(C), colored(A,C), colored(B,C), arc(A,B).

12 Features of ASP Capable of solving problems harder than NP-complete ones. Capable of representing and reasoning with default A suitable framework for Knowledge Representation? Efficient implementations (Smodels, DLV)

13 General Research Issues General Research Issues Representation -languages, semantics, complexity, power of representation, properties, solution methods, …… Solvers -Complete solvers; random approaches -Constraint propagation: pruning power vs. overhead -Heuristics -Backtrack strategies Programming environment Relationships among competing approaches What if a problem doesn’t have a solution Benchmarks/Applications

14 Representative publications J You and G Liu. Loop formulas for logic programs with arbitrary constraint atoms. AAAI-08. F Lin and J You. Abduction in logic programming by nonground rewrite systems. AAAI-08.Abduction in logic programming by nonground rewrite systems. Y Shen and J You. A generalized Gelfond-Lifschitz transformation for logic programs with abstract constraints. AAAI '07A generalized Gelfond-Lifschitz transformation for logic programs with abstract constraints. G Wu, J You, G Lin. Quartet based phylogeny reconstruction with answer set programming. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 2007.Quartet based phylogeny reconstruction with answer set programming. Janhunen, I. Niemela, D. Seipel, P. Simons, J. You. Unfolding partiality and disjunctions in stable model semantics. ACM Transactions on Computational Logic ’06Unfolding partiality and disjunctions in stable model semantics.


Download ppt "Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving."

Similar presentations


Ads by Google