Satisfiability Modulo Difference Logic Combinatorial Problem - - PowerPoint PPT Presentation

satisfiability modulo difference logic
SMART_READER_LITE
LIVE PREVIEW

Satisfiability Modulo Difference Logic Combinatorial Problem - - PowerPoint PPT Presentation

Satisfiability Modulo Difference Logic Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodr guez-Carbonell May 25, 2016 Basic Definitions Given a directed graph G = ( V, E ) with weight function w : E R , the weight w (


slide-1
SLIDE 1

Satisfiability Modulo Difference Logic

Combinatorial Problem Solving (CPS)

Albert Oliveras Enric Rodr´ ıguez-Carbonell

May 25, 2016

slide-2
SLIDE 2

Basic Definitions

2 / 13

Given a directed graph G = (V, E) with weight function w : E → R, the weight w(p) of a path p = (v0, . . . , vk) is w(p) =

k

  • i=1

w(vi−1, vi)

The distance δ(u, v) from u to v is δ(u, v) =

  • min{w(p) : u

p

❀ v} if there is a path from u to v ∞

  • therwise

A shortest path from u to v is any path p such that u

p

❀ v and w(p) = δ(u, v)

slide-3
SLIDE 3

Difference Constraints

3 / 13

A difference constraint is a linear constraint of the form x − y ⊲ ⊳ k, where:

⊲ ⊳∈ {≤, ≥, <, >, =, =}

x and y are integer/real variables

k ∈ Z or R

Equivalent forms: x ⊲ ⊳ y + k, x + k ⊲ ⊳ y

  • Ex. Let sa, sb be the starting times of two tasks a and b.

sa + T ≤ sb: task b cannot start earlier than T minutes after task a (they use same resources, etc.)

sa ≤ sb + T: task a cannot start later than T minutes after task b (the product of b to be used by a expires, etc.)

slide-4
SLIDE 4

Difference Logic

4 / 13

Lits in Difference Logic (DL) are difference constraints

Some transformations are performed at parsing time

If domain is Z replace x − y < k by x − y ≤ k − 1

If domain is R replace x − y < k by x − y ≤ k − δ

δ is a sufficiently small real

δ is not computed but used symbolically (like in De Moura’s & Dutertre’s approach for LRA)

slide-5
SLIDE 5

Difference Logic

5 / 13

Note any solution to a set of DL literals can be shifted (i.e. if σ is a solution then so is σ′(x) = σ(x) + k)

This allows one to handle bounds x ≤ k

Introduce fresh variable zero

Convert all bounds x ≤ k into x − zero ≤ k

Given a solution σ, shift it so that σ(zero) = 0

slide-6
SLIDE 6

Difference Logic

6 / 13

x − y = k is replaced by x − y ≤ k ∧ x − y ≥ k

x − y = k is replaced by x − y < k ∨ x − y > k

If we allowed (dis)equalities as literals, then:

If domain is R, then consistency check is polynomial

If domain is Z, then consistency check is NP-hard (k-colorability)

1 ≤ ci ≤ k with i = 1 . . . |V | encodes colors for vertexs

ci = cj if (i, j) ∈ E encodes colorability constraint

Hence we can assume all literals are x − y ≤ k

slide-7
SLIDE 7

Constraint Graph

7 / 13

Given n variables x1, x2, ..., xn and a system S of m difference constraints xi − xj ≤ kij we can construct the constraint graph G = (V, E) where:

V = {x0, x1, ..., xn} (each vertex corresponds to a var plus extra vertex x0)

E = {(xj, xi) | xi − xj ≤ kij ∈ S} ∪ {(x0, xi) | 1 ≤ i ≤ n} (each edge corresponds to a constraint, plus extra edges from x0 to variables) Moreover, w(xj, xi) = kij and w(x0, xi) = 0

G has n + 1 vertices and n + m edges

Note that δ(x0, xi) < ∞ for any xi

But δ(x0, xi) may not be well-defined if xi belongs to a negative cycle

slide-8
SLIDE 8

Constraint Graph

8 / 13

x1 − x2 ≤ 2 x2 − x3 ≤ 1 x3 − x1 ≤ −1

−1 1 2 x2 x3 x1 x0

slide-9
SLIDE 9

Systems of Difference Constraints

9 / 13

  • Theorem. Given S a system of difference constraints,

let G = (V, E) be the corresponding constraint graph. 1. If G contains a negative cycle, then S is infeasible. 2. Otherwise xi → δ(x0, xi) is a solution to S. Proof. Let us prove 1. Let c = (v0, ..., vk) be a negative cycle, which corresponds to constraints x(vi) − x(vi−1) ≤ w(vi−1, vi), (1 ≤ i ≤ k) in S. (note x0 cannot be in the cycle, as it has no entering edges) By adding all these constraints we get the constraint 0 ≤ k

i=1 w(vi−1, vi),

which is trivially false as RHS is < 0.

slide-10
SLIDE 10

Systems of Difference Constraints

9 / 13

  • Theorem. Given S a system of difference constraints,

let G = (V, E) be the corresponding constraint graph. 1. If G contains a negative cycle, then S is infeasible. 2. Otherwise xi → δ(x0, xi) is a solution to S. Proof. Let us prove 2. If G does not contain any negative cycle, then for all 1 ≤ i ≤ n, we have −∞ < δ(x0, xi) < ∞. By the triangle inequality, xi → δ(x0, xi) is a solution.

slide-11
SLIDE 11

Example (I)

10 / 13

x1 − x2 ≤ 2 x2 − x3 ≤ 1 x3 − x1 ≤ −1

−1 1 2 x2 x3 x1 x0

(x1, x2, x3) = (δ(x0, x1), δ(x0, x2), δ(x0, x2)) = (0, 0, −1) is a solution!

slide-12
SLIDE 12

Example (II)

11 / 13

x1 − x2 ≤ 2 x2 − x3 ≤ 1 x3 − x1 ≤ −4

−4 1 x1 x0 x2 x3 2

Infeasible!

slide-13
SLIDE 13

Consistency Checks

12 / 13

Consistency checks can be performed using Bellman-Ford in time O(|V | · |E|)

Other more efficient variants exist

Inconsistency explanations are negative cycles (minimal wrt. set inclusion)

slide-14
SLIDE 14

Bibliography - Further reading

13 / 13

Chao Wang, Franjo Ivancic, Malay K. Ganai, Aarti Gupta. Deciding Separation Logic Formulae by SAT and Incremental Negative Cycle

  • Elimination. LPAR 2005: 322-336

Scott Cotton, Oded Maler. Fast and Flexible Difference Constraint Propagation for DPLL(T). SAT 2006: 170-183