The Parikh image of languages and linear constraints

Similar documents
From Monadic Second-Order Definable String Transformations to Transducers

Automata Theory for Presburger Arithmetic Logic

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

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

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

Applied Automata Theory

Foundations of Informatics: a Bridging Course

On the Satisfiability of Two-Variable Logic over Data Words

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

On the Accepting Power of 2-Tape Büchi Automata

Theory of Computation 4 Non-Deterministic Finite Automata

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

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

Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD

Reversal-Bounded Counter Machines

Automata-based Verification of Programs with Tree Updates

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Regular transformations of data words through origin information

Automata-based Verification - III

Reversal-Bounded Counter Machines Revisited

Automata, Logic and Games: Theory and Application

Deciding the weak definability of Büchi definable tree languages

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

Computational Models - Lecture 5 1

Path Logics for Querying Graphs: Combining Expressiveness and Efficiency

ON STATELESS AUTOMATA AND P SYSTEMS

Taming Past LTL and Flat Counter Systems

Alternating nonzero automata

On decision problems for timed automata

Properties of Context-Free Languages

Ehrenfeucht-Fraïssé goes elementarily automatic for structures of bounded degree

Counter Automata and Classical Logics for Data Words

Optimal Metric Planning with State Sets in Automata Representation [3]

Sri vidya college of engineering and technology

On Recognizable Languages of Infinite Pictures

On Recognizable Languages of Infinite Pictures

Modal Logics with Presburger Constraints

FLAC Context-Free Grammars

Parikh s Theorem and Descriptional Complexity

Lecture 2: Connecting the Three Models

Integer Vector Addition Systems with States

CSC173 Workshop: 13 Sept. Notes

CPSC 421: Tutorial #1

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

Tree Automata and Rewriting

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Automata-based Verification - III

A Solvable Class of Quadratic Diophantine Equations with Applications to Verification of Infinite-State Systems

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Parikh s theorem. Håkan Lindqvist

Reachability Analysis of Pushdown Automata with an Upper Stack

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER

An algebraic characterization of unary two-way transducers

Büchi Automata and Their Determinization

Formal Languages, Automata and Models of Computation

The Downward-Closure of Petri Net Languages

Taming Past LTL and Flat Counter Systems

Representing Arithmetic Constraints with Finite Automata: An Overview

Efficient Reasoning about Data Trees via Integer Linear Programming

Closure under the Regular Operations

Flat counter automata almost everywhere!

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

Lecture 17: Language Recognition

NP-completeness. Chapter 34. Sergey Bereg

Mathematical Preliminaries. Sipser pages 1-28

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Automata Theory and Formal Grammars: Lecture 1

Regularity Problems for Visibly Pushdown Languages

Reachability in Succinct and Parametric One-Counter Automata

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

Beyond Regularity for Presburger Modal Logics

Regular Expressions and Language Properties

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

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

Final exam study sheet for CS3719 Turing machines and decidability.

Weak Cost Monadic Logic over Infinite Trees

DM17. Beregnelighed. Jacob Aae Mikkelsen

Decidability (intro.)

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

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

Intro to Theory of Computation

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

A Note on Decidable Separability by Piecewise Testable Languages

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Probabilistic Aspects of Computer Science: Probabilistic Automata

1991 Mathematics Subject Classification. 03B10, 68Q70.

Mixed and Integer Linear Programming Using Automata Techniques

Notes for Comp 497 (454) Week 10

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Computational Models - Lecture 4

Advanced Automata Theory 7 Automatic Functions

Combining Decision Procedures

Automata, Logic and Games: Theory and Application

CS 154, Lecture 3: DFA NFA, Regular Expressions

Query Reasoning on Data Trees with Counting

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

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

A Generalization of Cobham s Theorem to Automata over Real Numbers

Theory Bridge Exam Example Questions

Transcription:

The Parikh image of languages and linear constraints Peter.Habermehl@liafa.univ-paris-diderot.fr 1 1 LIAFA, Université Paris Diderot, Sorbonne Paris Cité, CNRS CP meets CAV, Turunç June 28th, 2012 Peter Habermehl (LIAFA) Parikh image June 28th, 2012 1 / 18

Overview Parikh image The Parikh image of the language of a finite-state automaton Some applications Peter Habermehl (LIAFA) Parikh image June 28th, 2012 2 / 18

The Parikh image of a language Let Σ = {a 1,...,a n }. Let L Σ be a language. The Parikh image of any w Σ is defined as σ(w) = (x 1,...,x n ) such that x i = w ai for all i {1,...,n}. The Parikh image σ(l) of L is defined as {σ(w) w L}. Examples: σ((ab) ) = {(x 1,x 2 ) x 1 = x 2 } σ({a n b n n 0}) = {(x 1,x 2 ) x 1 = x 2 } σ({a n b n c n n 0}) = {(x 1,x 2,x 3 ) x 1 = x 2 = x 3 } σ((aa) ) = {(x 1 ) x 1 is divisible by 2} = { k.k 0 2 k = x 1 } etc. Peter Habermehl (LIAFA) Parikh image June 28th, 2012 3 / 18

Parikh s theorem, Presburger arithmetic and semilinear sets Theorem 1 (Parikh JACM 66) Every context-free language L has a Parikh image definable by a formula of Presburger arithmetic. Presburger arithmetic: first-order logic over integers with addition and equality corresponds to quantifier free formulae with linear ( x a d) and modulo constraints ( a x c d) corresponds to semilinear sets A subset of N n is called linear if it can be written as (for some m 0) v 0 +N v 1 +...+N v m ( v 0 is the base vector and v i the period vectors) A subset of N n is called semilinear if it is a finite union of linear sets. Peter Habermehl (LIAFA) Parikh image June 28th, 2012 4 / 18

The Parikh image of an automaton Let A = (Q,Σ,δ,q 0,F) be an automaton We will give an existential Presburger formula ϕ A defining the Parikh image of L(A) whose size is linear in the size of A [Seidl et al. ICALP 2004] Example: c 3 1 a b 1 2 c 6 2 3 4 4 7 c b 5 d 5 Peter Habermehl (LIAFA) Parikh image June 28th, 2012 5 / 18

Consistent flow A flow of A = (Q,Σ,δ,q 0,{q f }) is a function F which maps triples (p,a,q) with q δ(p,a) to natural numbers. We write in F (q) = F(p,a,q) and out F (p) = F(p,a,q) p Q,a Σ q δ(p,a) p Q,a Σ q δ(p,a) A flow F is consistent if, for each p Q, one of the following holds inf (p) = out F (p) p = q0 and 1+in F (p) = out F (p) p = qf and in F (p) = out F (p)+1 Peter Habermehl (LIAFA) Parikh image June 28th, 2012 6 / 18

Connectedness c 3 1 a c 1 6 2 3 4 4 7 b d 5 t 1 = 1,t 3 = 5,t 4 = 1,t 6 = 3,t 7 = 3 is a consistent flow. Therefore consistency is not enough. A state p occurs in F if p {q 0,q f } or in F (p) > 0 A flow is connected if the directed graph G which has the occurring states as vertices and has edges {(p,q) F(p,a,q) > 0, for some a Σ} is connected. Peter Habermehl (LIAFA) Parikh image June 28th, 2012 7 / 18

The Parikh image of an automaton Lemma 2 A vector (x 1,...,x n ) is in the Parikh image of A iff there is a consistent and connected flow F such that for each a i Σ, x i = F(p,a,q) p,q δ(p,a) We can construct a formula ϕ A with free variables t (p,a,q) where p,q Q,a Σ and q δ(p,a) which characterizes all consistent and connected flows. ϕ A is a conjunction of ψ A and φ A where ψ A corresponds to all consistent flows and φ A checks that they are connected. ψ A is easy to give Peter Habermehl (LIAFA) Parikh image June 28th, 2012 8 / 18

Example c 3 1 a b 1 2 c 6 2 3 4 4 7 c b 5 d 5 state 1: 1 = t 1 +t 2 state 2: t 1 +t 3 = t 3 +t 4 state 3: t 2 +t 7 = t 6 +t 5 state 4: t 6 = t 7 state 5: t 4 +t 5 = 1 Peter Habermehl (LIAFA) Parikh image June 28th, 2012 9 / 18

What about connectedness? One could give constraints saying that for each transition taken, there is a path to it composed of transitions taken. exponential The graph G is connected iff we can label each node of G by a natural number such that The initial state q0 gets 0 Each other node gets a number > 0 Each node of G different from q0 has a neighbour in G with a smaller number We can give a linear size formula φ A for that Finally, ϕ A is given as (t p,a,q ) q δ(p,a) φ A ψ A a i Σx i = p,q t p,a,q Peter Habermehl (LIAFA) Parikh image June 28th, 2012 10 / 18

Computing the Parikh image using semilinear sets I Fix an automaton A with alphabet Σ = {a 1,...,a n } Each transition with letter a i of an automaton corresponds to a vector v = (v 1,...,v n ) where n = Σ and v j = 0 for j i and v i = 1 One can define generalized transitions obtained by concatenation, union and the star operator (regular expressions) Instead of computing a regular expression equivalent to A (this is a standard algorithm) one can compute a representation of the Parikh image of A by replacing concatenation, union and star by the corresponding operations on sets of Parikh images. for example concatenation corresponds to addition (aab(b +(aabbb) ).ab(bbb) ) ((2,1)+N(0,1)+N(2,3)) ((1,1)+N(0,3)) = (3,2)+N(0,1)+N(2,3)+N(0,3) Peter Habermehl (LIAFA) Parikh image June 28th, 2012 11 / 18

Computing the Parikh image using semilinear sets II Fix an automaton A with k states and alphabet Σ = {a 1,...,a n }. Let v be the sum of all components of v. Lemma 3 (Xie, Ling, Dang, CIAA 03) The Parikh image of A is a union of linear sets Q i. Each Q i is of the form v 0 +N v 1 +...+N v m where v 0 k 2 v j k for 1 j m m k n see also [Kopczynski, Widjaja To, LICS 2010] Peter Habermehl (LIAFA) Parikh image June 28th, 2012 12 / 18

Context-free grammars or tree-automata The construction of a PA formula can be easily generalized [Verma et al., CADE 2005] Example: 1 : S AB,2 : S BC 3 : A DAAA,4 : B a 5 : D b,6 : C CC,7 : C c One variable for each production One constraint for each non-terminal S : t 1 +t 2 = 1, A : t 3 = 3 t 3 +t 1, B : t 4 = t 1 +t 2 C : t 6 +t 7 = t 2 +2 t 6, D : t 5 = t 3 Plus connectedness One can construct from a CFG an automaton with the same Parikh image [Esparza et al. IPL 11] Peter Habermehl (LIAFA) Parikh image June 28th, 2012 13 / 18

Applications Reversal bounded counter automata Constraint automata Combining theories with BAPA WS1S automata Parikh image Several works on verification of concurrent systems etc. Peter Habermehl (LIAFA) Parikh image June 28th, 2012 14 / 18

Reversal bounded counter automata [Ibarra JACM 78] An RBCA is an automaton A R equipped with n counters Counters can be incremented, decremented and tested for 0 Only runs of the automaton where the number of reversals between increasing and decreasing of the counter is bounded by a fixed constant k are taken into account k can be reduced to 1 by adding additional counters Peter Habermehl (LIAFA) Parikh image June 28th, 2012 15 / 18

Reachability of an RBCA is decidable Reachability of an RBCA A R is decidable Construct finite-state automaton A R from A R by replacing increments of counter i by inc i decrements of counter i by dec i A R has alphabet {inc 1,dec 1,...,inc n,dec n} guess when each counter is 0 check that σ(a R ) {(x 1,x 2,...,x 2n 1,x 2n ) x 1 = x 2 x 2n 1 = x 2n } is not empty Peter Habermehl (LIAFA) Parikh image June 28th, 2012 16 / 18

Constraint automata There are lots of variations of the basic theme. A CA (A,ϕ) is a finite-state automaton A together with a Presburger formula ϕ(x 1,...,x n ). ϕ constrains the number of times letters of A appear. w L((A,ϕ)) iff w L(A) and σ(w) = ϕ can accept languages like {a n b n n 0} If we allow union of CA, then this class of automata is closed under union, intersection, negation, determinisation A transition CA is a finite-state automaton A together with a Presburger formula which constraints the number of times transitions are taken in an accepting run. can accept languages like {a n b n a m b m n,m 0} correspond to RBCA Transition CA are not closed under determinisation and complementation Peter Habermehl (LIAFA) Parikh image June 28th, 2012 17 / 18

Conclusion Parikh image: fundamental concept for language theory, verification An existentially quantified Presburger formula of linear size can be obtained for automata and CFG Is satisfiability of these formulae together with additional constraints efficiently solvable in practice? A systematic study of the practical complexity has yet to be done Peter Habermehl (LIAFA) Parikh image June 28th, 2012 18 / 18