Logic: Lecture 22, 08 November 2012 ---------------------------------- Recall formal MSO syntax, word w defines a model ^w For free variables, fix an assignment to the variables: ^w |= phi(i1,...,im,I1....,In) MSO definable languages Sentence phi L = { w | ^w |= phi } FO fragment, FO definable languages Theorem [Buechi, Elgot, Trakhtenbrot 1960] A language (of nonempty words) is MSO definable iff it is regular. Eliminating min and max psi(min) ---> Ey (psi(y) and ~Ez z < y) psi(max) ---> Ey (psi(y) and ~Ez y < z) Eliminate < x < y ---> Ex [ ~X(x) and Az Az'(X(z) and S(z,z') -> X(z')) and X(y) ] Encoding a model for phi(x1,..,xl,X1,..,Xm) Word a_0 .. a_{n-1} plus an encoding of the assignment to the variables - Encode the assignment by the characteristic function - x_i |-> k_i is a 0/1 sequence of length n with exactly one 1 at k_i - X_i |-> K_i is a 0/1 sequence of length n with ones at each k in K_i Alphabet is now Sigma x {0,1}^{l+m} Proof of BET Theorem: A. Encoding automata in MSO ---------------------------- - A = (Q = {q_1,...,q_m}, Delta, q_1, F) Assume initial state is q_1 - Use set variables X_1,...,X_m to describe runs X_j is those positions in the run where the state is q_j EX_1 EX_2 ... EX_m [ X_j's form a partition and X_1(min) and Ax Ax S(x,y) -> a valid transition is applied and the move from max can lead to a final state ] EX_1 EX_2 ... EX_m [ Ax Or_j X_j(x) and ~Ex And_i,j X_i(x) and X_j(x) and X_1(min) and Ax Ax S(x,y) -> Or_{q_j,a,q_k in Delta} X_j(x) and Q_a(x) and X_k(y) and Or_{q_j,a,f in Delta, f in F} X_j(max) and Q_a(max) ] Note: - Only existential set quantifiers needed to encode automata: EMSO - Can make do with log n quantifiers using binary encoding for n states B. Encoding MSO in automata --------------------------- Reduce to MSO_0 -- no individual variables - X subseteq Y, X subseteq P_a - Sing(X) [ "X is a singleton"] - S(X,Y) [ "X = {x}, Y = {y} and S(x,y)" ] - X < Y [ "X = {x}, Y = {y} and x < y" ] Can transform MSO to MSO_0 by induction e.g phi(X_1) = Ax (P_a(x) -> Ey (S(x,y) and X_1(y)) phi(X_1) = AX (Sing(X) and X subseteq P_a -> EY (Sing(Y) and S(X,Y) and Y subseteq X_1) Now, inductively build NFAs for MSO_0 formulas: 1. X_1 subseteq X_2 2. X_1 subseteq P_a 3. Sing(X_1) 4. S(X_1,X_2) 5. X_1 < X_2 For existential quantification, use projection: Lemma: Let f: Sigma -> Gamma. Extend f to words in the obvious way. L is regular implies f(L) is regular. Proof: Given automaton A for L, replace labels on transitions: (q,a,q') becomes (q,f(a),q'). New automaton accepts f(L). Given automaton for phi(X_1,X_2,...,X_n), automaton for EX_n phi(X_1,X_2,...,X_n) is obtained using the canonical projection (a,x_1,...,x_{n-1},x_n) |-> (a,x_1,...,x_{n-1}) Take the automaton for phi(X_1,...,X_n) and omit the last component of each transition label. Complexity ---------- Individual operations are polynomial, except complementation, which requires subset construction, so exponential. Overall worst-case complexity is a tower of exponentials of unbounded height [Meyer, Stockmeyer 1971]. More precisely, There is no translation of MSO-formulas phi to automata in which the number of states of the resulting automaton can be bounded by a function of the form 2^{2^{2^ ...{2^n}...}} where the height of the exponential is some constant k. ======================================================================