Tractable Constraint Languages
Zion Schell
Based on Chapter 11 of Rina Dechter's Constraint Processing by David Cohen and Peter Jeavons
Zion Schell Tractable Constraint Languages - 1 4-15-13
Tractable Constraint Languages Zion Schell Based on Chapter 11 of - - PowerPoint PPT Presentation
Tractable Constraint Languages Zion Schell Based on Chapter 11 of Rina Dechter's Constraint Processing by David Cohen and Peter Jeavons Zion Schell Tractable Constraint Languages - 1 4-15-13 Disclaimer This chapter is a bit weird It
Zion Schell Tractable Constraint Languages - 1 4-15-13
– It lacks a central thread of ideas – It lacks a unifying thesis – It doesn't present clear derivations of many of
Zion Schell Tractable Constraint Languages - 2 4-15-13
– Expressiveness of Constraint Languages – Complexity of Constraint Languages
Zion Schell Tractable Constraint Languages - 3 4-15-13
Zion Schell Tractable Constraint Languages - 4 4-15-13
Zion Schell Tractable Constraint Languages - 5 4-15-13
Zion Schell Tractable Constraint Languages - 6 4-15-13
Zion Schell Tractable Constraint Languages - 7 4-15-13
– e.g: {x=y, x≠y, x>y} or {x+y=z, x>y, x=3}
Zion Schell Tractable Constraint Languages - 8 4-15-13
– Tractable Constraint Language
– Tractable Relation
Zion Schell Tractable Constraint Languages - 9 4-15-13
– 2SAT (tractable)
– Graph 3-coloring (intractable)
– 3SAT (intractable)
Zion Schell Tractable Constraint Languages - 10 4-15-13
Zion Schell Tractable Constraint Languages - 11 4-15-13
– Constraint Handling in Prolog – Domain
– Constraint Language
Zion Schell Tractable Constraint Languages - 12 4-15-13
Zion Schell Tractable Constraint Languages - 13 4-15-13
– Enforcing arc-consistency allows backtrack-
– Domain is infinite
– Compound arithmetic constraints can have
Zion Schell Tractable Constraint Languages - 14 4-15-13
Zion Schell Tractable Constraint Languages - 15 4-15-13
– The Constant Language – Max-closed Languages – Horn-SAT
Zion Schell Tractable Constraint Languages - 16 4-15-13
Zion Schell Tractable Constraint Languages - 17 4-15-13
– Domain:
– Constraint language:
– Solving is trivial:
– If any fail, there is no solution
Zion Schell Tractable Constraint Languages - 18 4-15-13
Zion Schell Tractable Constraint Languages - 19 4-15-13
– Domain:
– Given x and y in the set, either x>y or y>x
– Constraint language:
Zion Schell Tractable Constraint Languages - 20 4-15-13
– Max-closed relations are based on the
max((a1,a2),(b1,b2)) = (max(a1,b1),max(a2,b2)) e.g: max((3,7,2),(2,9,1)) = (3,9,2) = (max(3,2),max(7,9),max(2,1))
The function can always operate on its own output e.g: (1,2) and (3,4) in the domain implies (2,4) = max((1,2),(3,4)) in the domain
Zion Schell Tractable Constraint Languages - 21 4-15-13
Zion Schell Tractable Constraint Languages - 22 4-15-13
– Domain:
– Constraint language:
– e.g: (x
∨ y ∨ z ∨ w)
– Solvable in P by unit resolution
Zion Schell Tractable Constraint Languages - 23 4-15-13
Zion Schell Tractable Constraint Languages - 24 4-15-13
– Consider the problem (with domain {r,g,b}) – What is the relation between A and B?
Zion Schell Tractable Constraint Languages - 25 4-15-13
C B A D ≠ ≠ ≠ ≠ ≠ ?
– Consider the problem (with domain {r,g,b}) – What is the relation between A and B?
– The problem is a gadget for = – (A,B) is its construction site
Zion Schell Tractable Constraint Languages - 26 4-15-13
C B A D ≠ ≠ ≠ ≠ ≠ =
– Try to make A+B=0 out of A≠B – or prove that you can't
Zion Schell Tractable Constraint Languages - 27 4-15-13
– We'll call it Uk(Q)
– Domain – Variables – Constraints
Zion Schell Tractable Constraint Languages - 28 4-15-13
– The same domain as all problems in the
– e.g:
– Domain(Uk(Q)) = {0,1,2}
– Domain(Uk(Q)) = {0,1}
Zion Schell Tractable Constraint Languages - 29 4-15-13
– One variable for each k-tuple composed of
– e.g:
– Variables of Uk(Q) =
{v00,v01,v02,v10,v11,v12,v20,v21,v22}
Zion Schell Tractable Constraint Languages - 30 4-15-13
– name of a variable
Zion Schell Tractable Constraint Languages - 31 4-15-13
– name relation of a list of variables
Zion Schell Tractable Constraint Languages - 32 4-15-13
(v02,v01,v10,v22) {(0,0,1,2),(2,1,0,2)} transpose v v v v 0 0 1 2 2 1 0 2 v02 v01 v10 v22
– For each relation R in Q
– In other words, find all tuples of variables so if
Zion Schell Tractable Constraint Languages - 33 4-15-13
– A
– ¬A being the “not” relation
– Domain(Uk(Q)) is Boolean
Zion Schell Tractable Constraint Languages - 34 4-15-13
– Variables: 1-tuples of domain elements
– Constraints:
– i.e: name relation of (v0,v1) is {(0,1)}
– i.e: name relation of (v0) is {(0)}
Zion Schell Tractable Constraint Languages - 35 4-15-13
Zion Schell Tractable Constraint Languages - 36 4-15-13
v1 v0 ⊕ ¬
– Variables: 2-tuples of domain elements
– Constraints:
– name relation of (v00,v11) is {(0,1),(0,1)}, etc.
– name relation of (v00) is {(0),(0)}
Zion Schell Tractable Constraint Languages - 37 4-15-13
Zion Schell Tractable Constraint Languages - 38 4-15-13
v11 v00 ¬ v10 v01 ⊕ ⊕
– Variables: 3-tuples of domain elements
– Constraints:
– name relation of (v001,v110) is {(0,1),(0,1),(1,0)}, etc.
– name relation of (v000) is {(0),(0),(0)}
Zion Schell Tractable Constraint Languages - 39 4-15-13
Zion Schell Tractable Constraint Languages - 40 4-15-13
– Theorem 11.1 (Cohen, Gyssens, Jeavons, 1996)
– either Uk(Q) expresses R as a gadget with construction
site LR,
– or R is not expressible in Q
Zion Schell Tractable Constraint Languages - 41 4-15-13
– Is it possible to express (A
– (A
– (A
Zion Schell Tractable Constraint Languages - 42 4-15-13
– Looking for a pair of variables with name
Zion Schell Tractable Constraint Languages - 43 4-15-13
– Looking for a pair of variables with name
– Sample names would be ((0,0,1),(0,1,1)),
Zion Schell Tractable Constraint Languages - 44 4-15-13
– Looking for a pair of variables with name
– Sample names would be ((0,0,1),(0,1,1)),
Zion Schell Tractable Constraint Languages - 45 4-15-13
– If we treat U3(Q) as a gadget with construction
Zion Schell Tractable Constraint Languages - 46 4-15-13
– If we treat U3(Q) as a gadget with construction
Zion Schell Tractable Constraint Languages - 47 4-15-13
– The gadget does not form the relation (A
– This is proof that it is not possible to form
Zion Schell Tractable Constraint Languages - 48 4-15-13
VS
Zion Schell Tractable Constraint Languages - 49 4-15-13
C B A D ≠ ≠ ≠ ≠ ≠ ?
Zion Schell Tractable Constraint Languages - 50 4-15-13
Zion Schell Tractable Constraint Languages - 51 4-15-13
– Q is tractable if and only if for each R in Q:
Zion Schell Tractable Constraint Languages - 52 4-15-13
Zion Schell Tractable Constraint Languages - 53 4-15-13
– k-ary operation
– projection
Zion Schell Tractable Constraint Languages - 54 4-15-13
– e.g: addition function (k=2, D= )
– e.g: maximum function (k=2, D= )
– e.g: 3-disjunction function (k=3, D={0,1})
Zion Schell Tractable Constraint Languages - 55 4-15-13
– Maps (x,x,...,x) to x for all x
– Maps (x1,x2,...,xk) to f(xi) for some f(x) and i – A projection is a essentially-unary k-ary
Zion Schell Tractable Constraint Languages - 56 4-15-13
– Maps (x1,x2,...,xk) to xi in only some cases
– Maps (a,b,c) to its most common element
– Maps (a,b,c) to a+b-1+c
Zion Schell Tractable Constraint Languages - 57 4-15-13
– D is a domain
– a + i = a
– a + a-1 = i
– + is an operation on D2 such that
Zion Schell Tractable Constraint Languages - 58 4-15-13
– Let s be a solution to Uk(Q) – Let the k-ary operation ŝ associated with s
Zion Schell Tractable Constraint Languages - 59 4-15-13
– There exists a solution s to U3(Q) as follows:
– ŝ(1,1,1) = 1, ŝ(1,0,1) = 1, ŝ(0,1,0) = 0, etc.
Zion Schell Tractable Constraint Languages - 60 4-15-13
Zion Schell Tractable Constraint Languages - 61 4-15-13
– From:
– We get:
– ŝ is a majority operation! – Q is therefore not intractable
Zion Schell Tractable Constraint Languages - 62 4-15-13
– If all solutions to U|D|(Q) are essentially unary,
– This gets disgusting...
– This is the only time I have ever seen tetration used in
an actual formula (and I studied mathematics as an undergrad)
Zion Schell Tractable Constraint Languages - 63 4-15-13
– A relation R allows an operation w if w is
– inv(w) is the set of R such that R allows w
Zion Schell Tractable Constraint Languages - 64 4-15-13
– Let w be any constant operation on D
– Let Q = inv(w)
– Q is always tractable:
– The constant language is an example
Zion Schell Tractable Constraint Languages - 65 4-15-13
– Let + be any operation which is idempotent,
– Let Q = inv(+) – Q is always tractable; the following procedure
Zion Schell Tractable Constraint Languages - 66 4-15-13
– Establish GAC on the problem – If any domain is empty, no solution exists – Otherwise, return the solution where for each
– An example of this is Horn-SAT
x x = x; x y = y x; (x y) z = x (y z) ∧ ∧ ∧ ∧ ∧ ∧ ∧
Zion Schell Tractable Constraint Languages - 67 4-15-13
– Let w be any k-ary operation which requires
– 2-SAT falls into this category:
Zion Schell Tractable Constraint Languages - 68 4-15-13
– Even though the specifics of constraint
Zion Schell Tractable Constraint Languages - 69 4-15-13
Zion Schell Tractable Constraint Languages - 70 4-15-13
– specific sets of CSPs determined by their
– specific sets of CSPs determined by
Zion Schell Tractable Constraint Languages - 71 4-15-13
– specific sets of CSPs determined by their
Zion Schell Tractable Constraint Languages - 72 4-15-13
Zion Schell Tractable Constraint Languages - 73 4-15-13
Zion Schell Tractable Constraint Languages - 74 4-15-13