150 likes | 162 Views
Dichotomies in CSP. Karl Lieberherr. inspired by the paper: Dichotomies and Duality in First-order Model Checking Problems by Barnaby Martin The 11th Mons Days of Theoretical Computer Science 2006 Irisa - Rennes. Generalized model checking.
E N D
Dichotomies in CSP Karl Lieberherr inspired by the paper: Dichotomies and Duality in First-order Model Checking Problems by Barnaby Martin The 11th Mons Days of Theoretical Computer Science 2006 Irisa - Rennes CSG 260 Fall 2006
Generalized model checking • Find an interpretation that satisfies a fraction t (between 0 and 1) of the constraints. • The generalized model checking problem over the logic called positive existential conjunctive fragment of FOL, {and, exists}-FOL, takes as input a structure A and a sentence f in {and, exists}-FOL and asks whether there exists an interpretation for f satisfying at least the fraction t of the weighted conjuncts. • This problem is equivalent to the maximum constraint satisfaction problem (MaxCSP). FOL = first-order logic CSG 260 Fall 2006
Dichotomy for {and, exists}-FOL • The class MaxCSP(A) exhibits a dichotomy: For all structures A (set of binary relations) there exists an algebraic constant tA between 0 and 1 such that the set of A-formulas f in {and, exists}-FOL satisfying • Fraction(f, tA) are in P and (1) • Fraction(f, tA+e) is NP-complete for any e > 0. • Fraction(f, t) = there exists an interpretation for f satisfying at least fraction t of the weighted constraints. • There is a universal polynomial algorithm parameterized by A for case (1). This is called a P-optimal algorithm. • We use the terminology: MaxCSP(A) and MinCSP(A) for the maximization and minimization version. In the minimization version we replace “at least” by “at most”. CSG 260 Fall 2006
Example • A = {OneInThree} where OneInThree(x1, x2, x3) = x1+x2+x3. • t {OneInThree} = 4/9. • See: Lieberherr/Specker JACM 1981 and Lieberherr Journal of Algorithms 1982. • http://www.ccs.neu.edu/home/lieber/p-optimal/README.html CSG 260 Fall 2006
More examples • R = AllRenaming(Orn), tR = 1-1/(2**n) • R = Or1 union AllRenaming(Or>=2), tR = (sqrt(5)-1)/2 = 0.618 … • R = AllRenaming(Or<=n), tR = ½ for all n >= 1. CSG 260 Fall 2006
Minimization • We use the terminology: MaxCSP(A) and MinCSP(A) for the maximization and minimization version. In the minimization version we replace “at least” by “at most”. • We reinterpret tA as tMax,A and we introduce by analogy tMin,A. • Find an A so that tMax,A is different from tMin,A. CSG 260 Fall 2006
A more general context • First order predicate logic • A conjunctive formula must be true, i.e., all conjuncts must be true. Drop weights. • A model checking problem over a logic L takes as input a structure A and a sentence f of L and asks: A╞ f (before we had A, t╞ f), where 0<=t<=1. • Parameterize over A or f. CSG 260 Fall 2006
L = FOL (first-order logic) • Alphabet: G1 union G2, where G1 = {not, and, or, exists, for all, =}, G0 ={(,),R,v,0,1} • R(v1,v2, … ,vn) is a formula with free variables v1,v2, … ,vn. • vi=vj is a formula with free variables vi, vj • if f1 and f2 are formulas, then “f1and f2”, “f1 or f2” and “not f1” are also formulae (having as free variables those free in the constituent formulae) CSG 260 Fall 2006
FOL (continued) • if f contains the free variable v, then “exists v f” and “for all v f” are formulae whose free variables are exactly those of f less v. • A sentence is a formula with no free variables. • We currently study {and, exists}-FOL but similar questions can be asked for other subsets of FOL. CSG 260 Fall 2006
Standard Definition of Model Checking • Model checking definition: Efficiently deciding whether a temporal logic formula is satisfied in a finite state machine model. CSG 260 Fall 2006
Model checking • The model is usually given as a source code description in an industrial hardware description language or a special-purpose language. Such a program corresponds to a finite state machine, i.e., a directed graph consisting of nodes (or vertices) and edges. A set of atomic propositions is associated with each node, typically stating which memory elements are one. The nodes represent states of a system, the edges represent possible transitions which may alter the state, while the atomic propositions represent the basic properties that hold at a point of execution. • Formally, the problem can be stated as follows: given a desired property, expressed as a temporal logic formula p, and a model M with initial state s, decide if M,s╞ p . If M is finite, as it is in hardware, model checking reduces to a graph search. CSG 260 Fall 2006
Going full circle • Symbolic algorithms avoid ever building the graph for the FSM; instead, they represent the graph implicitly using a formula in propositional logic (BDDs). More recently, SAT solvers (see Boolean satisfiability problem) are used to perform the graph search. CSG 260 Fall 2006
Model checking andtraversal specifications • M,s╞ p • M an object graph OG, s a node in OG • p a formula expressing a desired node, e.g., • bypassing {X,Y} via Z bypassing R to T • a strategy graph with source and target • Meta level: M’,s’╞ p must hold, otherwise compile-time error message. CSG 260 Fall 2006
Modular Implementation[Kiczales / Mezini] • it is textually local • there is a well-defined interface that describes how it interacts with the rest of the system • the interface is an abstraction of the implementation, in that it is possible to make material changes to the implementation without violating the interface • an automatic mechanism enforces that every module satisfies its own interface and respects the interface of all other modules • the module can be automatically composed – e.g., by a compiler – with other modules to produce a complete system CSG 260 Fall 2006
A, t╞ f CSG 260 Fall 2006