310 likes | 334 Views
Finite Model Theory Lecture 8. Logics and Complexity Classes. Reading Assignment. R. Fagin, Finite-Model Theory – a Personal Perspective May skip Sec. 6 for now, since we will cover this in class. Problem 1. Let s ¹ ; . [Fagin’74] A class C µ STRUCT[ s ] is in 9 SO iff it is in NP
E N D
Finite Model TheoryLecture 8 Logics and Complexity Classes
Reading Assignment • R. Fagin, Finite-Model Theory – a Personal Perspective • May skip Sec. 6 for now, since we will cover this in class
Problem 1 Let s¹;. [Fagin’74] A class C µ STRUCT[s] is in 9 SO iff it is in NP Now let s = ;. A structure = a number [Fagin’74, Jones&Selman’74] A set of numbers C µ N is in 9 SO iff it is in NE (nondeterministic exponential time) PROVE IT. WHY THE JUMP IN COMPLEXITY ?
Problem 2 • Let A = (A, R1A, …, RmA) be a structure. • The active domain, adom(A) = the set of all constants in s, and all constants occurring in R1A, …, RmA. • Let Aadom = (adom(A), RA1, …, RAm) • A formula f is domain independent if 8A:A²f iff Aadom²f • Undecidable if f is domain independent
Problem 2 (con’t) • Let k ¸ 0. The k’th active domain of Aadomk(A) = adom(A)[{some k constants in A -adom(A)}adomk(A) = A if |A - adom(A)| · k • Aadomk = (adomk(A), RA1, …, RAm) • Say that f is weak domain independent if 9k. 8A. A²f iff Aadomk²f PROBLEM. IS WEAK DOMAIN INDEPENDENCE DECIDIABLE ? CAN ONE COMPUTE K (OR AN UPPER BOUND) ?
Problem 3 • f(R, x) is monotone in R if for any two structures A, B s.t. RAµ RB, A=B, and SA=SB for any other relation name S, {a | A²f} µ {a | B²f} • Prove that it is undecidable if a formula f(R, x) is monotone in R
Outline • Fixpoints • Fixpoint Logics • Immerman and Vardi’s results: FO+LFP+< = FO+IFP+< = PTIME FO+PFP+< = PSPACE
Motivation • Recall Fagin’s result:9 SO = NP • Are there other logics that capture complexity classes ? • Yes ! But those logics are not as elegant as 9 SO. (Or, it takes more arguing to present them as elegant.)
Least Fixpoint Fix U = a finite set Definition Let F : P(U) ! P(U). A fixpoint for F is X µ U s.t. F(X) = X Definition The least fixpoint is some X s.t. for every other fixpoint Y, X µ Y Notation: lfp(F)
Fixpoints • Define:X0 = ;Xi+1 = F(Xi)X1 = [i ¸ 0 Xi • Is X1 the least fixpoint of F ?
Least Fixpoint F is monotone if X µ Y ) F(X) µ F(Y) Theorem [Tarski-Knaster] If F is monotone, then lfp(F) exists and is given by any of the following two expressions:lfp(F) = Å {Y | F(Y) µ Y}lfp(F) = X1 Note: one of the above fails when U = infinite. Which one ?
Inflationary Fixpoint F is inflationary if Y µ F(Y) for all Y Fact. If F is inflationary, then X1 is a fixpoint [is X1 the least fixpoint ?] Denote ifp(F) = X1
Inflationary Fixpoint • Let F be arbitrary. • Define G(Y) = Y [ F(Y). • G is inflationary [why ?], hence X1 is its inflationary fixpoint • Define ifp(F) = X1
Partial Fixpoint • Let F be arbitrary, X0 = ;, Xi+1 = F(Xi) • Define:pfp(F) = Xn if Xn = Xn+1pfp(F) = ; if there is no such n
Fixpoints • The distinction is necessary only when F is not monotone. Otherwise: • Fact If F is monotone, then:lfp(F) = ifp(F) = pfp(F)
Fixed Point Logics s = vocabulary, R Ïs Let f(R, x) be a formula over s[ {R} here |x| = arity(R) [that is, x are all the free variables in f] Define three new formulas: [lfpR, xf(R, x)][t] [ifpR, xf(R, x)][t] [pfpR, xf(R, x)][t]
Fixed Point Logics • Hence, three new logics: • FO + LFP or LFP • FO + IFP or IFP • FO + PFP of PFP • Need semantics (next)
Fixed Point Logics • Given a structure A and formula f(R, x), define the following operator Ff : P(A) ! P(A):Ff(X) = { a | A²f(X/R, a) } • The meaning of [lfpR, xf(R, x)][t] is lfp(Ff) • The meaning of [ifpR, xf(R, x)][t] is ifp(Ff) • The meaning of [pfpR, xf(R, x)][t] is pfp(Ff)
LFP • WAIT ! lfp is defined only if Ff is monotone. • Perhaps restrict lfp to monotone formulas f only ?
LFP Theorem Checking if f is monontone is undecidable [proof: in class] Hence in lfp we require R to occur under an even number of negations.
Example 1 s = {E} (graphs) What does this formula say ? 8 u.8 v.[lfpR, x, yf(R, x, y)](u,v)where f(R, x, y) = (E(x,y) Ç9 z.(E(x,z) Æ R(z,y))
Examples • What does this say ? 8 u.[lfpS,xf(S, x)](u),where:f(S, x) = 8 y.(E(y,x) ! S(y))
Example 3 • Consider the following game with one pebble on a graph G • Player 1 places pebble on node a • Player 2 moves the pebble to a successor • Player 1 moves the pebble to a successor • … • Whoever cannot move, looses WRITE A FORMULA THAT CHECKS IF PLAYER 1 WINS !
Example 3 (cont’d) [lfpS,xf(S,x)](a) where:f(S,x) = 8 y(E(x,y) !9 z.(E(y,z) Æ S(z))
Fixed Point Logics • LFP, IFP, PFP look very complicated and procedural • Nothing one can do; deeper analysis brings back some of the elegance (future lectures) • We made several arbitrary choices. • Let’s analyze some of the choices
Discussion 1 Should we allow free variables in lfp, ifp, pfp ? • Example • Colored graph: E(x, c, y) • Check if every pair of nodes is connected by a path where all edges have the same color: 8 x.8 y.9 c.[lfpR,x,yf(R, x,y,c)](x,y) Where f(R,x,y,c) = E(x,c,y) Ç9 z.(R(x,z) Æ E(z,c,y))
Discussion 1 (cont’d) • We can express the same formula without free variables in lfp • [show in class] • This holds in general
Discussion 2 • Simultaneous fixpoints • Is there a path of even length from a to b ? • [lfpR,xf(R, S, x),y(R, S, x)](b) • Where • f(R,S,x) = 9 z.(S(x,z) Æ E(z,x)) y(R,S,x) = E(a,x) Ç9 z.(R(x,z) Æ E(z,x)) EXPRESS THE SAME THING WITH ONLY ONE LFP !
Discussion 3 • Nested Fixpoints • Example: have <express +, £ (in class) • How can we remove the nested fixpoint ?
LFP = IFP Theorem [Gurevitch and Shelah] LFP = IFP • Technically involved proof, see the book
Main Results Theorem [Immeman86, Vardi82] LFP + < = IFP + < = PTIME Theorem [Vardi82] PFP + < = PSPACE