Unit two-variable-per-inequality (UTVPI) constraints form one of the largest class of integer constraints which are polynomial time solvable (unless P=NP). There is considerable interest in their use for constraint solving, abstract interpretation, spatial databases, and theorem proving. In this paper we develop a new incremental algorithm for UTVPI constraint satisfaction and implication checking that requires O(m + n log n + p) time and O(n+m+p) space to incrementally check satisfiability of m UTVPI constraints on n variables and check implication of p UTVPI constraints.
Deep Dive into Incremental Satisfiability and Implication for UTVPI Constraints.
Unit two-variable-per-inequality (UTVPI) constraints form one of the largest class of integer constraints which are polynomial time solvable (unless P=NP). There is considerable interest in their use for constraint solving, abstract interpretation, spatial databases, and theorem proving. In this paper we develop a new incremental algorithm for UTVPI constraint satisfaction and implication checking that requires O(m + n log n + p) time and O(n+m+p) space to incrementally check satisfiability of m UTVPI constraints on n variables and check implication of p UTVPI constraints.
The unit two-variable-per-inequality (UTVPI) constraints form one of the largest class of integer constraints which are polynomial time solvable (unless P=NP). There is considerable interest in their use for constraint solving [7,6], abstract interpretation [9], spatial databases [11] and theorem proving [8]. In this paper we develop new incremental algorithms for UTVPI constraint satisfaction and implication.
A UTVPI constraint has the form ax+by ≤ d where x, y are integer variables, d ∈ Z and a, b ∈ {-1, 0, 1}. For example x+y ≤ 2, x-y ≤ -1, 0 ≤ -1 and x ≤ 2 are UTVPI constraints. UTVPI constraint solving is based on transitive closure: A constraint ax-y ≤ d 1 and y +bz ≤ d 2 implies the constraint ax+bz ≤ d 1 +d 2 . We can determine all the UTVPI consequences of a set of UTVPI constraints by transitive closure, but we need to tighten some constraints. The transitive closure procedure can generate constraints of the form x + x ≤ d and -xx ≤ d, which need to be tightened to x ≤ d 2 and -x ≤ d 2 respectively. Jaffar et al. [7] and Harvey et al. [6] present incremental consistency checking algorithms for adding a UTVPI constraint c to a set φ of UTVPI constraints. They are based on maintaining the transitive and tight closure of the set of UTVPI constraints φ involving n variables. Both algorithms require O(n 2 ) time and O(n 2 ) space for an incremental satisfaction check. Both algorithms can also be used to incrementally check implication of UTVPI constraints by φ ∪ {c}. These algorithms require O(n 2 + p) time and O(n 2 + p) space for an incremental implication checking, where p is the number of constraints we need to check for implication. In order to (non-incrementally) check satisfiability of m UTVPI constraints on n variables these approaches require O(n 2 m) time, and to check implication they require O(n 2 m + p) time.
An improvement on the complexity of (non-incremental) satisfiability for UTVPI constraints was devised by Lahiri and Musuvathi [8]. They define a non-incremental satisfiability algorithm requiring O(nm) time and O(n + m) space. The key behind their approach is to map UTVPI constraints to difference constraints (also called separation theory constraints) of the form xy ≤ d, where x and y are integer variables and d ∈ Z.
The difference constraints are a well studied class of constraints because of their connection to shortest path problems. We can consider the constraint xy ≤ d as a directed edge x → y with weight d. Satisfiability of difference constraints corresponds to the problem of negative weight cycle detection, and implication of difference constraints corresponds to finding shortest paths (see e.g. [3] for details).
The mapping of UTVPI to difference constraints by Lahiri and Musuvathi [8] is a relaxation of the problem. The relaxed problem is solved by a negative (weight) cycle detection algorithm but it guarantees only the satisfiability in Q for the UTVPI problem. In order to check satisfiability in Z they need to construct an auxiliary graph and check for certain paths in this graph.
In this paper we first extend Lahiri and Musuvathi’s algorithm [8] to check satisfaction incrementally in O(n log n + m) and O(n + m) space. Then we show how to build an incremental satisfiability and implication algorithm using the relaxation of Lahiri and Musuvathi and incremental approaches to implication for difference constraints of Cotton and Maler [3], which can incrementally check implication in O(n log n + m + p) time and O(n + m + p) space.
In this section we given notation and preliminary concepts.
A weighted directed graph G = (V, E) is made up vertices V and a set E of weighted directed edges (u, v, d) from vertex u ∈ V to vertex v ∈ V with weight d. We also use the notation
The path weight of a path P , denoted w(p) is Σ k i=1 d i . Let G be a graph without negative weight cycles, that is without a cycle P where w(P ) < 0. Then we can define the shortest path from v 0 to v k , which we denote by SP (v 0 , v k ), as the (simple) path P from v 0 to v k such that w(P ) is minimized.
Let wSP (x, y) = w(SP (x, y)) or +∞ if no path exists from x to y.
Given a graph G and vertex x define the functions δ ← x , δ → x : V → R as δ ← x (y) = wSP (y, x) and δ → x (y) = wSP (x, y) . Let G be a graph without negative weight cycles. Then π is a valid potential function for G if π(u) + dπ(v) ≥ 0 for every edge (u, v, d) in G.
There are many algorithms (see e.g. [2]) for detecting negative weight cycles in a weighted directed graph, which either detect a cycle or determine a valid potential function for the graph.
Given a valid potential function π for graph G = (V, E) we can define the reduced cost graph rc(G) as (V, {(x, y, π(x)+d-π(y) | (x, y, d) ∈ E}). All weights in the reduced cost graph are non-negative and we can recover the original path length w(P ) for path P from x to y from paths in the reduced cost graph since w(P ) = w + π(y)π(x) where w is the weight of the correspondin
…(Full text truncated)…
This content is AI-processed based on ArXiv data.