CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel (York) Toby Walsh (Cork)

Slides:



Advertisements
Similar presentations
Symmetry Definitions for Constraint Satisfaction Problems Dave Cohen, Peter Jeavons, Chris Jefferson, Karen Petrie and Barbara Smith.
Advertisements

The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Exploiting Symmetry in Planning Maria Fox Durham Planning Group University of Durham, UK.
1 Constraint operations: Simplification, Optimization and Implication.
Inferring Disjunctive Postconditions Corneliu Popeea and Wei-Ngan Chin School of Computing National University of Singapore - ASIAN
Non-binary constraints: modelling Toby Walsh Cork Constraint Computation Center.
Generating Implied Constraints via Proof Planning Alan Frisch, Ian Miguel, Toby Walsh Dept of CS University of York EPSRC funded project GR/N16129.
Leeds: 6 June 02Constraint Technology for the Masses Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Collaborators:
Section 7.4: Closures of Relations Let R be a relation on a set A. We have talked about 6 properties that a relation on a set may or may not possess: reflexive,
Prepared by Doron Shahar
GOLOMB RULERS AND GRACEFUL GRAPHS
Dynamic semantics Precisely specify the meanings of programs. Why? –programmers need to understand the meanings of programs they read –programmers need.
Consistency & Propagation with Multiset Constraints Toby Walsh 4C, UCC & Uppsala.
Transforming and Refining Abstract Constraint Specifications Alan Frisch, Brahim Hnich*, Ian Miguel, Barbara Smith, and Toby Walsh *Cork Constraint Computation.
Maths of Constraint Satisfaction, Oxford, March 2006 Constraint Programming Models for Graceful Graphs Barbara Smith.
Symmetry as a Prelude to Implied Constraints Alan Frisch, Ian Miguel, Toby Walsh University of York.
Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel AI Group University of York Toby Walsh 4C.
1 Optimisation Although Constraint Logic Programming is somehow focussed in constraint satisfaction (closer to a “logical” view), constraint optimisation.
Solving Partial Order Constraints for LPO termination.
Inference and Resolution for Problem Solving
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
Modelling and Solving English Peg Solitaire Chris Jefferson, Angela Miguel, Ian Miguel, Armagan Tarim. AI Group Department of Computer Science University.
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel AI Group University of York Toby Walsh 4C.
Matrix Modelling: Déjà Vu Pierre Flener (Uppsala) Alan M. Frisch (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Ian Miguel, and Toby Walsh (York)
Global Constraints for Lexicographic Orderings Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University)
Modelling a Steel Mill Slab Design Problem Alan Frisch, Ian Miguel, Toby Walsh AI Group University of York.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’
Induction and recursion
Decision Procedures An Algorithmic Point of View
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Reading and Writing Mathematical Proofs
Symmetry Breaking Ordering Constraints Zeynep Kiziltan Department of Information Science Uppsala University, Sweden A progress.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
Context-Free Grammars Normal Forms Chapter 11. Normal Forms A normal form F for a set C of data objects is a form, i.e., a set of syntactically valid.
1 Chapter 8 Inference and Resolution for Problem Solving.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Solving a System of Equations in Two Variables By Elimination Chapter 8.3.
1 Combinatorial Algorithms Local Search. A local search algorithm starts with an arbitrary feasible solution to the problem, and then check if some small,
CP Summer School Modelling for Constraint Programming Barbara Smith 4. Combining Viewpoints, Modelling Advice.
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Implementing a Dependently Typed λ -Calculus Ali Assaf Abbie Desrosiers Alexandre Tomberg.
Chapter 2) CSP solving-An overview Overview of CSP solving techniques: problem reduction, search and solution synthesis Analyses of the characteristics.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
Intro to Planning Or, how to represent the planning problem in logic.
MATH 416 Equations & Inequalities II. Solving Systems of Equations Apart from the graphic method, there are three other methods we could use to solve.
LIMITATIONS OF ALGORITHM POWER
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Eliminating non- binary constraints Toby Walsh Cork Constraint Computation Center.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
Divide and Conquer Faculty Name: Ruhi Fatima Topics Covered Divide and Conquer Matrix multiplication Recurrence.
3.2.1 – Linear Systems, Substitution
Optimization Problems
Chapter 2: Simplification, Optimization and Implication
Perturbation method, lexicographic method
RS – Reed Solomon List Decoding.
Semantics In Text: Chapter 3.
Resolution Proofs for Combinational Equivalence
Chapter 11 Limitations of Algorithm Power
Generic SBDD using Computational Group Theory
CS203 Lecture 15.
Presentation transcript:

CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel (York) Toby Walsh (Cork)

Motivation Modelling experts carefully transform problems to reduce greatly the effort required to solve them. The challenge: Automate these transformations. Identify useful transformations.

Types of Transformation 1.Add constraints to eliminate symmetrical solutions. Given: Add: 2.Add implied constraints. Given: and Infer:

Types of Transformation (2) 1.Replacing constraints with equivalents. E.g. Introducing new variables as we will see later. 2.Removing redundant constraints. Given: and is redundant

Overview of Rest of Talk Case Study: The Golomb Ruler. Transformation at 3 Levels of Abstraction. Conclusions/Future Work

The Golomb Ruler A set of n ticks at integer points on a ruler, length m. All inter-tick distances must be unique. Minimise m. Practical applications: astronomy, crystallography Previously, useful implied constraints found by hand [Smith et al 2000].

The Golomb Ruler – Characteristics of a Good Model Break Symmetry: All n ticks are symmetrical. Introduce distance variables: Allows us to use the all-different constraint.

Approach 1: Instance Level Transformation Minimise: max i (x i ) Constraints of the form: (x i – x j  x k – x l ) Subject to: i  j, k  l, i  k  j  l Domains: [0 – n 2 ] Poor Model: Quaternary Constraints. Symmetry.

CGRASS Constraint GeneRation And Symmetry-breaking. Based on, and extends, Bundy’s proof planning. Patterns in proofs captured in methods. Strong preconditions limit applicability. Prevent combinatorially explosive search. Easily adaptable to problem transformation. Methods now encapsulate common patterns in hand- transformation.

Proof Planning - Operation Given a goal to prove: –Select a method. –Check pre-conditions. –Execute post-conditions. –Construct output goal(s). Associated tactic constructs actual proof. CGRASS makes transformations rather than constructing sub-goals to prove.

The Introduce Method Preconditions 1. Exp has arity greater than 1, occurs more than once in the constraint set. 2. someVariable = Exp not already present. Post-conditions 1.Generate new var, x, domain defined by Exp. 2.Add constraint: x = Exp.

An Instance of Eliminate Preconditions: 1. Lhs = CommonExp s.t. CommonExp also present in another constraint c. 2. c new obtained by replacing all occurrences of CommonExp by Lhs in c. 3.Size of c new less than that of c. 4. c new not obviously redundant. Post-conditions 1.Add c new, remove c.

Normalisation Lexicographic ordering + Simplification. Inspired by HartMath: Necessary to deal with associative/commutative operators (e.g. +, *). Replaces semantic equivalence test with simple syntactic comparison (to an extent).

3-tick Golomb Ruler Basic model produces 30 constraints. Initial normalisation of the constraint set reduces this to just 12. –Constraints with reflection symmetry across an inequation identical following normalisation. –Some cancellation also possible E.g. x 1 – x 2  x 1 – x 3

Symmetry-breaking Often useful implied constraints can be derived only when some/all symmetry broken. Symmetry breaking method as pre-processing. Symmetrical variables: Have identical domains. If exchange x 1, x 2 throughout, re-normalised constraint set returns to original state. Symmetry-testing on the 3-tick instance: x 1, x 2, x 3 are symmetrical. Hence we add: x 1  x 2, x 2  x 3

Variable Introduction/Elimination After symmetry breaking, strengthening inequalities. x 1 < x 2 x 2 < x 3 x1  x3x1  x3 x 1 - x 2  x 2 – x 1 x 1 - x 2  x 2 – x 3 x 1 - x 2  x 3 – x 1 x 1 - x 3  x 2 – x 1 x 1 - x 3  x 3 – x 1 x 1 - x 3  x 3 – x 2 x 2 - x 1  x 3 – x 2 x 2 - x 3  x 3 – x 1 x 2 - x 3  x 3 – x 2 Still 9 quaternary constraints. Reduce arity by introducing new variables: E.g. z 0 = x 1 – x 2 Eliminate substitutes new variables into quaternary constraints, reducing arity.

Final Problem State Combination of Introduce and Eliminate GenAllDiff greedily checks for cliques of inequations. x 1 < x 2 x 2 < x 3 x1  x3x1  x3 z 0 = x 2 – x 1 z 1 = x 3 – x 2 z 2 = x 3 – x 1 All-different(z 0, z 1, z 2 )

Results Model3-tick4-tick5-tick6-tick BasicFails Nodes Time0.06s 0.5s28.8s TransformedFails Nodes Solve0.05s 0.06s CGRASS 0.4s5.1s74s782s

Analysis of Results Cost of making inferences far outweighs the benefit gained. An instance of a bad model may have huge numbers of constraints. E.g. bad model of 6-tick ruler has 870 quaternary constraints. Conclusion: Inference at instance level alone unlikely to be cost-effective in general.

Approach 2: Transformation of Quantified Constraint Expressions Minimise: max i (x i ) This model still in terms of CSP variables. Input small, represents whole class. Fairly straightforward to justify distance vars. Symmetry of ticks is difficult Swapping ticks, re-normalising doesn’t work.

Approach 3: High Level Transformation of the Golomb Ruler Put n ticks on a ruler of size m such that all inter-tick distances are unique. Minimise m. Find T  {0, …, m}, |T|=n. Minimise m, (upper bound: n 2 ). distance({x, y}) = |x – y| {distance({x, y})  distance({x’, y’}) | {x, y}  T, {x’,y’}  T, {x, y}  {x’,y’}}

Initial Transformations Given recurrence of distance, natural to introduce distance variables. {d xy = distance({x, y}) | {x, y}  T} Substituting: {d xy  d x’y’ | {x, y}  T, {x’, y’}  T, {x, y}  {x’, y’}} This defines a clique. Lifted GenAllDiff : All-diff({d xy | {x, y}  T})

Refinement We use refinement methods to move to lower levels of abstraction: E.g. To pick subset, size n, from set A, size m, totally ordered by  : Introduce set S of n variables, {s 1, …, s 2 }. Domain of each s i is A. Assignments to elements of S form a set totally ordered by , i.e. s 1 < s 2 < … < s n

Application of refine(subset) Assign S = {s 1, s 2, …, s n } Each s i has domain {0, …, m} s 1 < s 2 < … < s n {d ij = distance({s i, s j }) | {s i, s j }  S} All-diff({d ij | {s i, s j }  S}) Starting to look more like a CSP

Final Transformations Domain of each s i bounded above by m, which is to be minimised. Refine {s i, s j } from a set to an ordered pair. Assign S = {s 1, s 2, …, s n } Each s i has domain {0, …, m} s 1 < s 2 < … < s n Minimise(s n ) {d ij = s j – s i |  S x S, i < j} All-diff({d xy |  S x S, i < j})

Conclusions/Future Work CGRASS: Automatic transformation of instances. Based on proof planning. Transformation at instance level alone not practical. Transformation at the `right’ level is much easier. Individual Instances Quantified Constraints Sets/Mappings Higher Levels… Abstract Refine