Counter Automata and Classical Logics for Data Words

Similar documents
What You Must Remember When Processing Data Words

On the Satisfiability of Two-Variable Logic over Data Words

Two-Variable Logic with Counting and Linear Orders

Two-Variable Logic on Data Words

On the use of guards for logics with data

Chapter 1. Automata over infinite alphabets

Logics and automata over in nite alphabets

Part I: Definitions and Properties

Query Reasoning on Data Trees with Counting

Graph Reachability and Pebble Automata over Infinite Alphabets

Two-Variable Logic on Data Trees and XML Reasoning

Two-Variable Logic on Data Trees and XML Reasoning

Alternating nonzero automata

Partially Ordered Two-way Büchi Automata

On Recognizable Languages of Infinite Pictures

Counting in trees. Helmut Seidl 1 Thomas Schwentick 2 Anca Muscholl 3. 1 Introduction

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

On Recognizable Languages of Infinite Pictures

Automata Theory for Presburger Arithmetic Logic

Foundations of Informatics: a Bridging Course

1 Efficient Reasoning about Data Trees via Integer Linear Programming

On Nondeterministic Unranked Tree Automata with Sibling Constraints

On the use of guards for logics with data

Applied Automata Theory

LTL with Arithmetic and its Applications in Reasoning about Hierarchical Systems

Monadic Second Order Logic and Automata on Infinite Words: Büchi s Theorem

Algorithmic Analysis of Array-Accessing Programs

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER

Tree Automata and Rewriting

Finite Universes. L is a fixed-length language if it has length n for some

Final exam study sheet for CS3719 Turing machines and decidability.

Efficient Reasoning about Data Trees via Integer Linear Programming

Automata, Logic and Games: Theory and Application

Closure Under Reversal of Languages over Infinite Alphabets

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics

Chapter 3. Regular grammars

Introduction. Büchi Automata and Model Checking. Outline. Büchi Automata. The simplest computation model for infinite behaviors is the

Automata-Theoretic LTL Model-Checking

DM17. Beregnelighed. Jacob Aae Mikkelsen

Opleiding Informatica

1 Extending two-variable logic on data trees with order on data values and its automata

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Aperiodic String Transducers

Finite Automata and Regular languages

Unary Automatic Graphs: An Algorithmic Perspective 1

Languages, logics and automata

Modal logics and their semantics

Theory of computation: initial remarks (Chapter 11)

The theory of regular cost functions.

Tree languages defined in first-order logic with one quantifier alternation

A Logical Characterization for Weighted Event-Recording Automata

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Computation Histories

Semipositivity in Separation Logic With Two Variables

Theoretical Foundations of the UML

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

LTL with the Freeze Quantifier and Register Automata

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations

Origin-equivalence of two-way word transducers is in PSPACE

Sanjit A. Seshia EECS, UC Berkeley

Decision Problems for Additive Regular Functions

TheTwo-VariableGuardedFragmentwith Transitive Guards Is 2EXPTIME-Hard

Quasi-Weak Cost Automata

Reversal-Bounded Counter Machines

From Monadic Second-Order Definable String Transformations to Transducers

3515ICT: Theory of Computation. Regular languages

CS481F01 Prelim 2 Solutions

Theory of Computation

An Alternative Construction in Symbolic Reachability Analysis of Second Order Pushdown Systems

CHURCH SYNTHESIS PROBLEM and GAMES

Extending Two-Variable Logic on Trees

A Uniformization Theorem for Nested Word to Word Transductions

Introduction to Tree Logics

Team Semantics and Recursive Enumerability

Sri vidya college of engineering and technology

New Complexity Results for Some Linear Counting Problems Using Minimal Solutions to Linear Diophantine Equations

Finite-State Transducers

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

Parameterized Regular Expressions and Their Languages

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

Modal Logic XVI. Yanjing Wang

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Weak Cost Monadic Logic over Infinite Trees

Computer Sciences Department

Spectra and satisfiability for logics with successor and a unary function

CpSc 421 Final Exam December 15, 2006

Theoretical Computer Science. Complexity of multi-head finite automata: Origins and directions

CPSC 421: Tutorial #1

6.8 The Post Correspondence Problem

Herbrand Theorem, Equality, and Compactness

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Variable Automata over Infinite Alphabets

The Parikh image of languages and linear constraints

Two-Way Cost Automata and Cost Logics over Infinite Trees

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Theory of computation: initial remarks (Chapter 11)

Transcription:

Counter Automata and Classical Logics for Data Words Amal Dev Manuel amal@imsc.res.in Institute of Mathematical Sciences, Taramani, Chennai, India. January 31, 2012

Data Words Definition (Data Words) A data word w = (a 1, d 1 )... (a n, d n ), a i Σ, d i where, Σ is a finite alphabet. is an (recursive) infinite set. Definition (Data Language) A data language L (Σ ). Example L n All w in which at least n distinct data values occur. L <n All w in which every data value occurs at most n times. L a b All w whose string projections are in the set a b. L a All w under the label a are different. L a b All w occurring under a occurs under b as well. There is a d in w which occurs in consecutive positions. L dd

Regularity for Data Languages Robustness, Low complexity decision problems, Regularity Confluence of Alternate characterizations, Nice closure properties. Question. What constitutes the class of regular data languages? Approach. Try to extend regular word devices to data words. devices Regular expressions, Linear grammars, Monadic second order logic, Finite state automata.

Extensions of finite state automata Memory-structures stack push-down hash-table registers counters

Register automata Finite state automata + registers storing data values Definition ([KF94]) A k-register automaton A = (Q, Σ,, k, q 0, F ), where Q is a finite set of states q 0 Q is the initial state F Q is the set of final states k is the number of registers (Q Σ [k] Q) (Q Σ Q [k]) For p, q Q, a Σ, i [k], transitions of the form (p, a, i, q) are called read transitions and transitions of the form (p, a, q, i) are called write transitions.

Register automaton example (Σ, read 1) (Σ, read 1) (Σ, read 1), (Σ, read 2) (a, read1), (a, write 1) (a, read 1) q 0 q 1 q f (Σ, write 1) (Σ, write 2) (Σ, write 2) Figure: Register automaton accepting the language L a.

Register automaton example (Σ, write 1) (Σ, write 1) q 0 (Σ, read 1) q f (Σ, read 1) Figure: 1-Register automaton accepting the language L dd

Register automaton properties Fact Register automata are closed under union, intersection, length-preserving morphisms. Not closed under complementation (L a is not accepted by any register automaton.)

Register automaton properties Fact Register automata are closed under union, intersection, length-preserving morphisms. Not closed under complementation (L a is not accepted by any register automaton.) Lemma If a k-register automaton A accepts any word at all, then it accepts a word containing at most k + 1 distinct data values.

Register automaton properties Fact Register automata are closed under union, intersection, length-preserving morphisms. Not closed under complementation (L a is not accepted by any register automaton.) Lemma If a k-register automaton A accepts any word at all, then it accepts a word containing at most k + 1 distinct data values. Theorem ([KF94]) Emptiness checking of register automata is decidable (NP-c).

Data automaton Definition A data automaton is a tuple A = (B, C) where B is a finite state transducer with input alphabet Σ and output alphabet Σ. C is a finite state auotmaton with alphabet Σ. A has an (accepting) run on w if B has an (accepting) run on w defining a unique output word w. C has an (accepting) run on each class of w.

Data automaton example Example (The language L a ) The transducer B is a copy machine, copies every letter to the output The automaton C accepts the language Σ aσ aσ.

Data automaton example Example (The language L dd ) Choose the intermediate alphabet to be {0, 1}. B chooses two consecutive positions and label them by 1, all other positions are labelled 0. The automaton C accepts the language 0 10 10 + 0.

Data automaton properties Theorem ([KF94, BS10]) Register automata are strictly less powerful than Data automata in terms of expressiveness. Theorem ([BMS + 06, BS10]) The emptiness problem for Data automata is decidable (not known to be elementary).

Counters for data words Setup : Finite state automata + Γ -many counters. A counter for each data value. All counters are initially zero. Whenever the automaton encounters a pair (a, d) The counter for d is checked against a constraint, Counter is incremented or reset.

Class counting automata Definition A class counting automaton, abbreviated as CCA, is a tuple CCA = (Q, Σ,, I, F ), where Q is a finite set of states, I Q is the set of initial states, F Q is the set of final states, fin (Q Σ C Inst N Q), Inst = {inc, reset}, C is the set of all univariate inequalities over N.

Class counting automata run A configuration of A is a pair (q, h), where q Q and h : Γ N. An initial configuration of A is (q 0, h 0 ), q 0 I and d Γ, h 0 (d) = 0. Given a data word w = (a 1, d 1 ),... (a n, d n ), a run of A on w is a sequence γ = (q 0, h 0 )(q 1, h 1 )... (q n, h n ) such that (q 0, h 0 ) is an initial configuration and for each 1 i n there exists a transition t i = (q, a, c, π, m, q ) such that q = q i, q = q i+1, a = a i+1 and: h i (d i+1 ) = c. h i+1 is given by: { hi (d h i+1 = i+1, m ) if π = inc, m = h i (d i+1 ) + m h i (d i+1, m) if π = reset

CCA example a, x = 0, [+1] a, x 0, [0] a, x = 1, [0] q 0 q 1 b, x 0, [0] b, x 0, [0] Figure: CCA accepting the language L a

CCA example Σ, x = 0, [0] Σ, x 0, [0] Σ, x = 0, [+1] Σ, x = 1, [0] q 0 q 1 q f Figure: CCA accepting the language L dd.

CCA properties Fact CCA-recognizable data languages are closed under union and intersection but not under complementation.

CCA properties Fact CCA-recognizable data languages are closed under union and intersection but not under complementation. Theorem The non-emptiness problem for CCA is Expspace-complete.

CCA extensions and subclasses Many bag CCA is equivalent to one bag CCA. CCA + context check contains register automata. CCA with counter acceptance conditions is equivalent to Data automata. CCA with presburger constraints is still in Expspace. Two-way-ness and alternation leads to undecidability.

Logic for data words A data word can be naturally represented as a first-order structure w = ([n], Σ, <, +1, ). Example The word ababab is encoded as the structure, ([6], P a = {1, 3, 5}, P b = {2, 4, 6}, <, +1). Example The data word (a, d 2 )(b, d 1 )(a, d 1 )(b, d 2 )(a, d 3 )(b, d 2 ) is encoded as the structure, ([6], P a = {1, 3, 5}, P b = {2, 4, 6}, <, +1, = {{1, 4, 6}, {2, 3}, {5}}).

First-order logic over data words The set of first order (abbreviated as FO) formulas over the vocabulary τ is given by the following syntax; ϕ ::= x = y R(x 1,..., x n ) ϕ ϕ ϕ ϕ ϕ x ϕ Theorem ([BMS + 06]) (finite) satisfiability of FO is undecidable over data words. Undecidability prevails even for three variable fragment.

First-order logic over data words The set of first order (abbreviated as FO) formulas over the vocabulary τ is given by the following syntax; ϕ ::= x = y R(x 1,..., x n ) ϕ ϕ ϕ ϕ ϕ x ϕ Theorem ([BMS + 06]) (finite) satisfiability of FO is undecidable over data words. Undecidability prevails even for three variable fragment. Theorem ([BMS + 06]) (finite) satisfiability of FO 2 is decidable over data words.

Two-variable logic examples Example The following FO 2 (Σ, <, +1) formula describes that the model (in this case a word) contains three a s. ϕ 1 = x (P a (x) y (x < y P a (y) x (y < x P a (x)))). Example The formula below states that each class contains an a if it contains a b and vice versa. ϕ 2 = x ((P a (x) y (P b (y) x y)) (P b (x) y (P a (y) x y)

Ordered data words Let Γ be a linear order on Γ. Data values d i and d j on positions i and j can have any of the following relationships: d i = d j or d i < Γ d j or d i > Γ d j. This relationship can be expressed by a total preorder on positions given by, i p j d i < Γ d j or d i = d j. Hence an ordered data word can be represented logically as a first order structure w = ([n], Σ, l, +1 l, p, +1 p ); where l denotes the linear order on positions and p denotes the total preorder on positions induced by the order on the data values.

Two-variable logic on ordered data words Theorem ([BMS + 06, MZ11]) Two variable logic on ordered data words is undecidable. More precisely FO 2 is undecidable on the vocabularies (Σ, <, +1, +1 p ) and (Σ, <, +1, p ). To retrieve decidability one has to drop either < or +1. Theorem ([SZ10]) Finsat of FO 2 (Σ, < l1, < p2, +1 p2 ) is decidable in Expspace. Theorem ([Man10]) Finsat of FO 2 (Σ, +1 l1, +1 l2 ) is decidable in 2-Nexptime.

Undecidability Theorem ([Man10]) The finite satisfiability problems for the following logics are undecidable. (a) FO 2 (Σ, l1, +1 l1, l2, +1 l2 ) (b) FO 3 (Σ, +1 l1, +1 l2 ) (c) FO 2 (Σ, +1 l1, +2 l1, +3 l1, +1 l2, +2 l2 )

Two-variable logic on ordered data words Theorem ([MZ11]) Finite satisfiability of FO 2 (Σ, +1 l1, < p2, +1 p2 ) is decidable when classes of < p2 are of size at most k. For the proof, the notion of data automata are generalized so that they accept ordered data words. A translation from the above logic to these automata is established and finally the non-emptiness of these automata are shown to be decidable by reduction to reachability problem in vector addition systems. Since it is definable in FO 2 that < p2 is a linear order, Corollary Finite satisfiability of FO 2 (Σ, +1 l1, < l2, +1 l2 ) is decidable (not known to be elementary). This corollary completes the classification of FO over two linear orders.

Undecidability in 2-ss Theorem ([Man10]) The finite satisfiability problems for the following logics are undecidable. (a) FO 2 (Σ, l1, +1 l1, l2, +1 l2 ) (b) FO 3 (Σ, +1 l1, +1 l2 ) (c) FO 2 (Σ, +1 l1, +2 l1, +3 l1, +1 l2, +2 l2 ) Proof. Reduction from PCP. I = {(u i, v i ) i [n], u i, v i Σ 2 } over the alphabet Σ = {l 1, l 2,... l k }. We encode the PCP solution as structures in the above vocabularies, in the following way. Let Σ = {l 1, l 2,... l k } and ˆΣ = Σ Σ.

Proof contd. Given a word w = a 1 a 2... a n in Σ, we denote by w the word a 1 a 2... a n in Σ. A solution of I is a structure A = (A, ˆΣ, +1 l1, +1 l2 ) over ˆΣ such that, (1) The word (A, ˆΣ, +1 l1 ) is in the language (u 1 v 1 + u 2v 2... + u nv n) +. This language is expressible in FO 2 (ˆΣ, +1 l1 ), let us call it ϕ 1. (2) The word (A, ˆΣ, +1 l2 ) is in the language (l 1 l 1 + l 2l 2... + l kl k )+. This language is expressible in FO 2 (ˆΣ, +1 l2 ) by the formulas (call them ϕ 2 ),

Proof contd. Enforcing the matching, ϕ 3a xy ((Σ(x) Σ(y) x l1 y x l2 y) ( Σ (x) Σ (y) x l1 y x l2 y )) ϕ 3b xyz (( Σ(x) Σ(y) Σ (z) S(x, y) x+ 1 l2 z ) z + 1 l2 y ) xyz (( Σ (x) Σ (y) Σ(z) S(x, y) x + 1 l2 z ) z + 1 l2 y ) ϕ 3c xy ((Σ(x) Σ(y) S(x, y)) x + 2 l2 y) xy (( Σ (x) Σ (y) S(x, y) ) x + 2 l2 y )

Logic Complexity (lower/upper) Comments One linear order FO 2 (+1 l ) Nexptime-complete [EVW02] FO 2 ( l ) Nexptime-complete [EVW02] FO 2 (+1 l, l ) Nexptime-complete [EVW02] One total preorder FO 2 (+1 p ) FO 2 ( p ) Nexptime-complete Nexptime-complete FO 2 (+1 p, p ) Expspace-complete [SZ11] Two linear orders FO 2 (+1 l1 ; +1 l2 ) Nexptime/2-Nexptime [Man10] FO 2 (+1 l1 ; l2 ) Nexptime/Expspace [SZ11] FO 2 (+1 l1, l1 ; +1 l2 ) VASS-Reachability/Decidable [MZ11] FO 2 (+1 l1, l1 ; l2 ) Nxptime/Expspace [SZ11] FO 2 (+1 l1, l1 ; +1 l2, l2 ) Undecidable [MZ11] Figure: Summary of results on finite satisfiability of FO 2 with successor and order relations. Cases that are symmetric and where undecidability is implied are

Logic Complexity (lower/upper) Comments Two total preorders FO 2 (+1 p1, +1 p2 ) Undecidable [MZ11] FO 2 (+1 p1 ; p2 ) Undecidable [MZ11] FO 2 ( p1 ; p2 ) Undecidable [SZ10] One linear order and one total preorder FO 2 (+1 l1 ; +1 p2 )? FO 2 (+1 l1, l1 ; +1 p2 ) Undecidable [MZ11] FO 2 (+1 l1, l1 ; p2 ) Undecidable [BMS + 06] FO 2 (+1 l1 ; +1 p2, p2 )? FO 2 ( l1 ; +1 p2, p2 ) Expspace-complete [SZ11] Many orders FO 2 ( l1, l2, p3 ) Undecidable [SZ10] FO 2 ( l1,..., l3 ) Undecidable [Kie11] FO 2 (+1 l1,..., +1 lk )? Figure: Summary of results on finite satisfiability of FO 2 with successor and order relations. Cases that are symmetric and where undecidability is implied are omitted.

2-successor structures Marking alphabet Γ = { 1, 0, 1}. Definition (Marked String Projections of A) msp 1 (A) = ( ) A, (P a ) a Σ, (M i ) i Γ, 1 msp 2 (A) = ( ) A, (P a ) a Σ, (M i ) i Γ, 2 msp s are words over the alphabet Σ Γ. Lemma Let x 1 y. The marking M 2 (y) can be computed from M 1 (x) and M 1 (y). Proof. Construct a table.

Example a b c d ( a 1 ) ( b 0 msp 1 (A) ) ( c 1 ) ( d 0 ) ( b 1 ) ( a 0 msp 2 (A) ) ( c 1 ) ( d 0 )

Automata on 2-ss Definition (2-ss Automaton) A 2-ss automaton T is a tuple (B, Σ o, C) where, B Finite state transducer with input alphabet Σ Γ and output alphabet Σ o, Σ o Intermediate alphabet, C Finite state recognizer with input alphabet Σ o. Definition (Run of T ) A run ρ T of the 2-ss automaton T is of the form ρ T = (ρ B, ρ C ), ρ B is a run of B on msp 1 (A) outputting ( A, (P a ) a Σo, 1 ) over Σ o, ρ C is a run of C on ( A, (P a ) a Σo, 2 ). The run is accepting if both ρ B and ρ C are accepting. L (T ) = {A T has an accepting run on A}.

Example Languages Example L 1 = {A = ( A, (P a ) a Σ, 1, 2 ) 1 = 2 } Check the markings. Example L 2 = {A sp 1 (A) a b c, sp 2 (A) (a b c) } The transducer B projects the marked string to Σ and checks if it belongs to a b c. The automaton C checks if its input is in (a b c). Example L 3 = {A xy (a(x) b(y) x 1 y x 2 y)} Use transduction!.

Lemma 1. Given a regular language L Σ, there is a 2-ss automaton accepting all 2-ss whose projections to 1 is in L. 2. Similarly, there is a 2-ss automaton accepting all 2-ss whose projections to 2 is in L. Proof. 1. The transducer B checks if the projection to 1 (ignoring the markings) is in L and C accepts Σ o. 2. The transducer B simply copies the string (ignoring the markings) and C accepts if its input is in L.

Lemma Languages recognized by 2-ss automata are closed under union, intersection and renaming. Proof. Closure under union and intersection is obtained from usual product construction (using a composed output alphabet). Closure under renaming is achieved using the non-determinism of the transducer.

L m is the set of all 2-ss A = (A, λ, 1, 2 ) such that, sp 1 (A) a + b +, sp 2 (A) (a b) +, x, y A, λ(x) = λ(y) such that x + 1 y and y + 2 x. L m is accepted by a 2-ss automaton. But L m is not accepted by any 2-ss automaton. Proof. Pumping and Crosswiring. Lemma The class of languages accepted by 2-ss automata are not closed under complementation.

Theorem Given a 2-ss automaton T, there is a formula ϕ T EMSO 2 (Σ, 1, 2 ) such that L(T ) = L (ϕ T ). Proof. Let Σ o = {l 1,..., l n }. The formula ϕ T of T on A in the following way, states that there is a run ϕ T = P l1 P l2... P ln (ϕ part (P l1,..., P ln ) ϕ B ϕ C ) ϕ part (P l1,..., P ln ) says that the predicates P l1,..., P ln form a partition of the set of all positions. ϕ B is the encoding of B in EMSO 2 (Σ, P l1,..., P ln, 1 ). ϕ C is the encoding of C in EMSO 2 (P l1,..., P ln, 2 ). P l1,..., P ln are free in ϕ B and ϕ C.

Logic to Automata Translation to Scott Form ϕ R 1... R n ( x y χ i x y ψ i ) The predicates R i are unary, and χ and ψ i are quantifier-free formulas in FO 2 (Σ, 1, 2 ). 2-ss are closed under renaming and intersection. Hence it suffices to construct a 2-ss automaton for each of the formulas x y χ and x y ψ i.

Lemma Given an FO 2 (Σ, 1, 2 ) formula of the form ϕ = x y χ where χ is quantifier free, an equivalent 2-ss automaton of doubly exponential size can be constructed. Proof. ϕ can be reduced to a conjunction of exponentially many formulas in one the following forms, 1. True, False, A formula over one successor relation, 2. xy (α(x) β(y) x y x 1 y δ 2 (x, y)), 3. xy (α(x) β(y) x y x 2 y δ 1 (x, y)), 4. xy ( α(x) β(y) x y δ + 1 (x, y) δ+ 2 (x, y)), where α, β : types, δ i : disjunction over O i, δ + i : disjunction over O + i. O + i = {x i y, y i x}, O i = {x i y, x i y, y i x, y i x}. Each of these formulas can be translated to a 2-ss automaton.

Lemma For each FO 2 (Σ, 1, 2 ) formula of the form ϕ = x y ψ where ψ is quantifier free, an equivalent 2-ss automaton of doubly exponential size can be constructed. Proof. ϕ can be reduced to a conjunction of exponentially many formulas in one the following forms, 1. A formula over one successor relation, 2. x y ( α(x) β(y) x y δ + 1 (x, y) δ 2(x, y) ), 3. x y ( α(x) β(y) x y δ + 2 (x, y) δ 1(x, y) ), 4. x y ( α(x) β(y) x y δ 1 (x, y) δ 2 (x, y)). where α, β : types, δ i O i, δ + i O + i, δ i : conjunction over O i. O i = {x i y, y i x}, Each of these formulas can be translated to a 2-ss automaton.

Lemma Given an EMSO 2 (Σ, 1, 2 ) formula ϕ, there exists a 2-ss automaton T ϕ such that L (ϕ) = L (T ϕ ). Theorem L is definable in EMSO 2 (Σ, 1, 2 ) if and only if L is recognized by a 2-ss automaton.

Decidability of 2-ss Automata Proof Idea Given a 2-ss automaton T = (B, C), L (T ) is non-empty if there is a marked word w such that, w is accepted by B a permutation of output of B on w, consistent with the marking of w, is accepted by C.

Let w = ([n], λ, ) be a marked word of length n. We denote the projection of w to Σ by w Σ. Given a permutation π : [n] [n], π(w) is defined as the word ( [n], π 1 λ, ). π defines a successor relation π = π 1 (1)... π 1 (n) on the positions. We say that the permutation π is consistent with the marking if w is the marked string projection of the 2-ss A = ([n], λ,, π ) to the order. Definition (mperm(w)) Given w Σ, by mperm(w), we denote the set of all the marked words w such that there is a permutation π consistent with the marking such that π(w Σ) = w. Given L Σ, we define mperm(l) = w L mperm(w ).

Definition (Presburger word automaton, Habermahl Muscholl Schwentick Seidl, 04) A Presburger word automaton P is a tuple (A, S), A is a finite state automaton with states Q = {q 1,... q n }, S is a semi-linear set in N n. A word w is accepted by the automaton P if, there is an accepting run ρ of A on w, ( ρ q0,..., ρ qn ) S. Example The following languages are recognizable by a Presburger word automaton. {a n b n c n n N}, {w Σ 5 w a = 2 w b 3 w c }, Permutation(L) if L is context-free.

Lemma If L is regular then mperm(l) is accepted by a Presburger automaton. Proof. Given an automaton C for L, the Presburger automaton P checks non-deterministically if there is a run of C on some consistent permutation of w. To achieve this, the automaton P assigns a transition δ = (p, a i, q) to each position i of the marked word. We can define a flow f where each transition δ of C is labelled by the number of times it is associated with a position. Finally, we can write linear constraints which checks that, 1. f is locally consistent, 2. the subgraph induced by the states with a non-zero flow is connected, 3. f is consistent with the marking. The resulting automata P is poly-sized in terms of the size

Theorem Emptiness checking of a 2-ss automaton T = (B, C) is in NP. Proof. Construct a Presburger automaton P with linear constraints which accepts mperm(l(c)). Take the intersection of the transducer B and P in such a way that the output of B is supplied as the input of P. Finally we check the emptiness of the resulting automaton which is in NP. Theorem Emptiness checking of a Presburger automaton is polynomial time reducible to the emptiness checking of a 2-ss automaton.

Theorem Finite Satisfiability problem of FO 2 (Σ, 1, 2 ) is in 2-Nexptime. Proof. Given ϕ, construct T ϕ, check if L (T ϕ ) is non-empty. Over words, FinSat of both FO 2 (Σ) and FO 2 ( ) with one unary predicate are Nexptime-hard [Etessami, 02].

Thank You!

Mikolaj Bojanczyk, Anca Muscholl, Thomas Schwentick, Luc Segoufin, and Claire David. Two-variable logic on words with data. In LICS, pages 7 16. IEEE Computer Society, 2006. Henrik Björklund and Thomas Schwentick. On notions of regularity for data languages. Theoretical Computer Science, 411(4-5):702 715, 2010. Kousha Etessami, Moshe Y. Vardi, and Thomas Wilke. First-order logic with two variables and unary temporal logic. Information and Computation, 179(2):279 295, 2002. Michael Kaminski and Nissim Francez. Finite-memory automata. Theoretical Computer Science, 134(2):329 363, 1994. Emanuel Kieronski. Decidability issues for two-variable logics with several linear orders.

In CSL, volume 12 of LIPIcs, pages 337 351, 2011. Amaldev Manuel. Two orders and two variables. In MFCS, volume 6281 of LNCS, pages 513 524, 2010. Amaldev Manuel and Thomas Zeume. Two variable logic with a linear successor and a preorder. Under preparation, 2011. Thomas Schwentick and Thomas Zeume. Two-variable logic with two order relations. In CSL, volume 6247 of LNCS, pages 499 513, 2010. Thomas Schwentick and Thomas Zeume. Two-variable logic with two order relations. To appear, 2011.