Homing and Synchronizing Sequences

Similar documents
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,

PRINCIPLES AND METHODS OF TESTING FINITE STATE MACHINES A SURVEY. David Lee. Mihalis Yannakakis. AT&T Bell Laboratories Murray Hill, New Jersey

Fooling Sets and. Lecture 5

September 7, Formal Definition of a Nondeterministic Finite Automaton

CSC236 Week 11. Larry Zhang

Nondeterministic Finite Automata

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

Introduction to Computers & Programming

Describing Homing and Distinguishing Sequences for Nondeterministic Finite State Machines via Synchronizing Automata

arxiv: v3 [cs.fl] 2 Jul 2018

MTAT Complexity Theory October 13th-14th, Lecture 6

Peled, Vardi, & Yannakakis: Black Box Checking

CS21 Decidability and Tractability

Nondeterministic Finite Automata

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

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

Timo Latvala. March 7, 2004

Model-Based Testing: Testing from Finite State Machines

Representing Arithmetic Constraints with Finite Automata: An Overview

CSE 105 THEORY OF COMPUTATION

2 P vs. NP and Diagonalization

Theory of computation: initial remarks (Chapter 11)

3515ICT: Theory of Computation. Regular languages

Class Note #20. In today s class, the following four concepts were introduced: decision

Theory of computation: initial remarks (Chapter 11)

What we have done so far

COM364 Automata Theory Lecture Note 2 - Nondeterminism

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

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

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CS21 Decidability and Tractability

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

Chapter Five: Nondeterministic Finite Automata

Compute the Fourier transform on the first register to get x {0,1} n x 0.

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 455/555: Finite automata

CS 154 Introduction to Automata and Complexity Theory

Turing Machines and Time Complexity

Theory Bridge Exam Example Questions

Introduction to Kleene Algebras

Nondeterministic Finite Automata

September 11, Second Part of Regular Expressions Equivalence with Finite Aut

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

Compilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam

Theory of Computation (I) Yijia Chen Fudan University

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

Prime Languages, Orna Kupferman, Jonathan Mosheiff. School of Engineering and Computer Science The Hebrew University, Jerusalem, Israel

In complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size.

Inf2A: Converting from NFAs to DFAs and Closure Properties

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

We define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ,

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Space Complexity. The space complexity of a program is how much memory it uses.

Outline. CS21 Decidability and Tractability. Regular expressions and FA. Regular expressions and FA. Regular expressions and FA

Finite-State Machines (Automata) lecture 12

Advanced Automata Theory 11 Regular Languages and Learning Theory

CPS 220 Theory of Computation REGULAR LANGUAGES

Lipschitz Robustness of Finite-state Transducers

Language Stability and Stabilizability of Discrete Event Dynamical Systems 1

A General Testability Theory: Classes, properties, complexity, and testing reductions

Introduction to Formal Languages, Automata and Computability p.1/51

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity

DISTINGUING NON-DETERMINISTIC TIMED FINITE STATE MACHINES

Computational Models: Class 3

October 6, Equivalence of Pushdown Automata with Context-Free Gramm

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

Final exam study sheet for CS3719 Turing machines and decidability.

Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

Finite-state Machines: Theory and Applications

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

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

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Quantum Computing Lecture 8. Quantum Automata and Complexity

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Computational Theory

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

Lecture 23 : Nondeterministic Finite Automata DRAFT Connection between Regular Expressions and Finite Automata

Advanced Automata Theory 7 Automatic Functions

Regular Expressions and Language Properties

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Theory of Computation (II) Yijia Chen Fudan University

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Finite Automata. BİL405 - Automata Theory and Formal Languages 1

Using a Minimal Number of Resets when Testing from a Finite State Machine

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

The State Explosion Problem

Finite Automata and Languages

Finite State Machines 2

Le rning Regular. A Languages via Alt rn ting. A E Autom ta

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Data Structures in Java

COMP Analysis of Algorithms & Data Structures

Lecture Notes on Inductive Definitions

Definition: Alternating time and space Game Semantics: State of machine determines who

Transcription:

Homing and Synchronizing Sequences Sven Sandberg Information Technology Department Uppsala University Sweden 1

Outline 1. Motivations 2. Definitions and Examples 3. Algorithms (a) Current State Uncertainty (used in algorithms) (b) Computing Homing Sequences (c) Computing Synchronizing Sequences 4. Variations (a) Adaptive homing sequences (b) Computing shortest sequences (c) Parallel algorithms (d) Difficult related problems 5. Conclusions 2

Motivation for Homing Sequences: Testing [13] Learning algorithms: experiment with a given a black box automaton until you learn the contents Protocol verification Hardware fault-detection 3

Motivation for Synchronizing Sequences: Pushing Things [12] Goal: 4 nts 3 2 1 4

Mealy Machines [11] a/0 t a/0 s b/0 i i Deterministic, total, finite state machine with outputs on transitions b/1 u a/1 b/1 PSfrag replacements v b/0 a/0 i Inputs: I = {a, b} i Outputs: O = {0, 1} i States: S = {s, t, u, v} Mealy machine: M = I, O, S, δ, λ Inputs, I Outputs, O States, S transition function ( arrows ), δ : S I S output function, λ : S I O 5

Synchronizing Sequences [12] Intuitive Definition 1. Initial state is unknown. 2. Apply a sequence x I of inputs, 3. afterwards only one final state is possible If this is possible, x is a synchronizing sequence Formal Definition x I is synchronizing iff δ(s, x) = 1 6

Example: Getting Home by Subway in Uppsala [14] Flogsta Ekeby Håga Eriksberg Kåbo Initial position is unknown There are no signs that reveal the current station Find your way to Flogsta, switching red and blue line as needed Solution: brrbrrbrrbrr 7

Homing Sequences [13] Intuitive Definition 1. Initial state is unknown. 2. Apply a sequence x I of inputs, 3. observe outputs, 4. conclude what the final state is If this is possible, x is a homing sequence Formal Definition x I is homing iff for all states s, t S, δ(s, x) δ(t, x) = λ(s, x) λ(t, x) 8

Homing Sequences: Example Homing sequences care about the output E.g., in Uppsala the subway sometimes goes above ground. Using this information, we can more efficiently figure out the final state. Flogsta Ekeby Above ground Håga Solution: e.g., brr Above ground Eriksberg Above ground Kåbo 9

Initial State Uncertainty [14] Data structure crucial in algorithms computing homing sequences The Initial State Uncertainty with respect to an input string indicates for each output string the set of possible initial states Formally, for an input string x I it is the partition of states induced by the equivalence relation s t λ(s, x) = λ(t, x) ( x produces the same output from s as from t ) 10

Initial State Uncertainty: Example a/0 s a/1 b/0 t b/0 b/0 u a/0 11

Initial State Uncertainty: Example input initial state string uncertainty ε {{s, t, u}} a {{t} 1, {s, u} 0 } ab {{t} 10, {s, u} 00 } aba {{t} 100, {s} 000, {u} 001 } (here, the output corresponding to a block is indicated in red) 12

Current State Uncertainty [15] Another data structure crucial in algorithms computing homing sequences The Current State Uncertainty with respect to an input string indicates for each output string the set of possible final states Formally, for an input string x I it is the set σ(x) def = {δ(b, x) : B is a block of the initial state uncertainty w.r.t. x}. Important: x is homing iff σ(x) is a set of singletons 13

Current State Uncertainty: Example a/0 s a/1 b/0 t b/0 b/0 u a/0 14

Current State Uncertainty: Example input initial state current state string uncertainty uncertainty ε {{s, t, u}} {{s, t, u}} a {{t} 1, {s, u} 0 } {{s} 1, {s, u} 0 } ab {{t} 10, {s, u} 00 } {{u} 10, {u, t} 00 } aba {{t} 100, {s} 000, {u} 001 } {{u} 100 or 000, {s} 001 } 15

Computing Homing Sequences: Idea [16] Assume machine is minimized. Concatenate strings iteratively, in each step improving the current state uncertainty. ( B σ(x) decreases) B σ(x) Each string should be separating for two states in the same block: A separating sequence x I for two states s, t S gives different outputs: λ(s, x) λ(t, x) Since the machine is minimized, separating sequences always exist 16

Computing Homing Sequences: Algorithm [17] 1 function Homing-For-Minimized(Minimized Mealy machine M) 2 x ε 3 while there is a block X σ(x) with X > 1 4 take two different states s, t X 5 let y be a separating sequence for s and t 6 x xy 7 return x 17

Homing Sequences: Quality of Algorithm (n = number of states, I = number of input symbols) Time: O(n 3 + n 2 I ) Space: O(n) (not counting the space needed by the output) Sequence length: n(n 1)/2 Some machines require n(n 1)/2 18

Computing Synchronizing Sequences: Idea [17] Very similar to algorithm for homing sequences: Concatenate strings iteratively, in each step decrease δ(s, x). Each string should be merging for two states in δ(s, x): A merging sequence y I for two states s, t S takes them to the same final state: δ(s, y) = δ(t, y) This guarantees that δ(s, xy) < δ(s, x) Merging sequences exist for all states there is a synchronizing sequence 19

Computing Synchronizing Sequences: Algorithm [18] Very similar to algorithm for homing sequences: 1 function Synchronizing(Mealy machine M) 2 x ε 3 while δ(s, x) > 1 4 take two different states s, t δ(s, x) 5 let y be a merging sequence for s and t (if none exists, return Failure) 6 x xy 7 return x 20

Synchronizing Sequences: Quality of Algorithm [19 20] Time: O(n 3 + n 2 I ) Space: O(n 2 + n I ) (not counting the space needed by the output) Sequence length: (n 3 n)/6 Černý s conjecture: length (n 1) 2 (true in special cases, open in general) Some machines require length (n 1) 2 21

Homing Sequences for General Machines [20 21] We don t need to assume the machine is minimized A different algorithm solves this more general problem, but less efficiently Combines ideas from algorithms for homing and synchronizing sequences Often possible to assume the machine is minimized 22

Adaptive Homing Sequences [21 22] Apply the sequence as it is being computed, and let current input depend on previous outputs Can use modified version of the usual homing sequence algorithm May result in shorter sequence, but equally long in the worst case: (n 1) 2 23

Finding the Shortest Sequence [24 26] It is important to minimize the length of sequences: recall pushing things in testing, a machine may be remote or very slow Exponential algorithms have been used Unfortunately, the problems are NP-complete Even impossible to approximate unless P=NP (follows from NP-completeness proof) 24

Related Problems are PSPACE-complete [26 28] 1. Nondeterministic transition system (instead of deterministic) 2. The initial state is in a subset X S (instead of S) 3. The final state may be in a subset X S (instead of any single state in S) 25

Parallel Algorithms [29] Homing Sequences Randomized algorithm uses log 2 n time, O(n 7 ) processors. Hence, the problem belongs to RNC. Deterministic algorithm uses O( n log 2 n) time Impractical due to high communication cost There is also a practical randomized algorithm Synchronizing Sequences No known parallel algorithm Except one for monotonic automata 26

Conclusion Homing sequences Problem is more or less solved (optimal and polynomial algorithm is known) Apparently more used for testing than synchronizing sequences Synchronizing sequences Open question: Narrow the gap between upper bound O(n 3 ) and lower bound Ω(n 2 ) for the length of sequences Interesting algebraic properties and other applications, but less used for testing 27