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

Similar documents
Classes and conversions

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,

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

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

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

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

CS 208: Automata Theory and Logic

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Simplification of finite automata

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Sri vidya college of engineering and technology

Intro to Theory of Computation

CS 455/555: Finite automata

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Inf2A: Converting from NFAs to DFAs and Closure Properties

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

Regular Language Equivalence and DFA Minimization. Equivalence of Two Regular Languages DFA Minimization

September 7, Formal Definition of a Nondeterministic Finite Automaton

Finite Automata and Languages

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Equivalence of DFAs and NFAs

Lecture 5: Minimizing DFAs

Lecture 1: Finite State Automaton

Name: Student ID: Instructions:

CSE 311 Lecture 25: Relating NFAs, DFAs, and Regular Expressions. Emina Torlak and Kevin Zatloukal

Lecture 4 Nondeterministic Finite Accepters

CSE 105 THEORY OF COMPUTATION

Chapter 5. Finite Automata

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

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

CSE 105 THEORY OF COMPUTATION

Nondeterministic Finite Automata

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

CS 154, Lecture 3: DFA NFA, Regular Expressions

COM364 Automata Theory Lecture Note 2 - Nondeterminism

Formal Models in NLP

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Regular Expressions. Definitions Equivalence to Finite Automata

Algorithms for NLP

Nondeterministic Finite Automata

Computational Models - Lecture 5 1

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

Closure under the Regular Operations

CS21 Decidability and Tractability

Reversal of Regular Languages and State Complexity

Finite State Transducers

Lecture 3: Nondeterministic Finite Automata

CS21 Decidability and Tractability

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata

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

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

C2.1 Regular Grammars

C2.1 Regular Grammars

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

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

CPSC 421: Tutorial #1

Uses of finite automata

arxiv: v3 [cs.fl] 2 Jul 2018

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

CMSC 330: Organization of Programming Languages

Finite Automata and Regular languages

Foundations of Informatics: a Bridging Course

Finite Automata. Mahesh Viswanathan

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Chapter 6: NFA Applications

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal

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

arxiv: v1 [cs.fl] 19 Mar 2015

Lecture 17: Language Recognition

Non-deterministic Finite Automata (NFAs)

CS243, Logic and Computation Nondeterministic finite automata

Closure under the Regular Operations

Theory of Computation (I) Yijia Chen Fudan University

Further discussion of Turing machines

Lexical Analysis. DFA Minimization & Equivalence to Regular Expressions

Computational Models #1

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

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

Automata and Languages

Chapter Five: Nondeterministic Finite Automata

Minimization of DFAs

Java II Finite Automata I

Nondeterministic Finite Automata

Finite Automata Part Two

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Computational Models - Lecture 1 1

ACS2: Decidability Decidability

Deterministic Finite Automata (DFAs)

Automata-based Verification - III

Chapter 3: Linear temporal logic

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

Deterministic Finite Automata (DFAs)

Decision, Computation and Language

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

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Automata Theory for Presburger Arithmetic Logic

On language equations with one-sided concatenation

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions

Transcription:

Finite Universes

Finite Universes When the universe is finite (e.g., the interval 0, 2 1 ), all objects can be encoded by words of the same length. A language L has length n 0 if L =, or every word of L has length n. L is a fixed-length language if it has length n for some n 0. Observe: Fixed-length languages contain finitely many words. and {ε} are the only two languages of length 0. is a language of any length!

The master automaton

The master automaton The master automaton over Σ is the tuple M = Q, Σ, δ, F, where Q is the set of all fixed-length languages; δ : Q Σ Q is given by δ L, a = L ; F is the set { ε }. Prop: The language recognized from state L of the master automaton is L. Proof: By induction on the length n of L. n = 0. Then either L = or L = ε, and result follows by inspection. n > 0. Then δ L, a = L for every a Σ, and L has smaller length than L. By induction hypothesis the state L recognizes the language L, and so the state L recognizes the language L.

The master automaton We denote the fragment of the master automaton reachable from state L by A : Initial state is L. States and transitions are those reachable from L. Prop: A is the minimal DFA recognizing L. Proof: By definition, all states of A are reachable from its initial state. Since every state of the master automaton recognizes its own language, distinct states of A recognize distinct languages.

Data structure for fixed-length languages The structure representing the set of languages L = {L,, L } is the fragment of the master automaton containing states L,, L and their descendants. It is a multi-dfa, i.e., a DFA with multiple initial states.

Data structure for fixed-length languages We represent multi-dfas as tables of nodes. A node is a pair q, s where q is a state identifier, and s = q,, q is a successor tuple. The table for a multi-dfa contains a node for each state but the states for and ε.

Data structure for fixed-length languages The procedure make[t](s) returns the state identifier of the node of table T having s as successor tuple, if such a node exists; otherwise it adds a new node q, s to T, where q is a fresh identifier, and returns q. make[t](s) assumes that T contains a node for every identifier in s.

Implementing union and intersection We give a recursive algorithm inter T q, q : Input: state identifiers q, q from table T of the same length. Output: identifier of the state recognizing L q L q in the multi-dfa for T. Side-effect: if the identifier is not in T, then the algorithm adds new nodes to T, i.e., after termination the table T may have been extended. The algorithm follows immediately from the following properties (1) if L = or L = then L L = ; (2) if L = ε = L then L L = {ε} ; (3) If L and L, then L L = L L for every a Σ.

Implementing union and intersection

Implementing union and intersection

Implementing union and intersection

Implementing fixed-length complement If a set X U is encoded by a language L of length n, then the set U X is encoded by the fixed-length complement Σ L, denoted by L. This is different from L! Since the empty language has all lengths, we have = Σ for every n 0, in particular = Σ = {ε}, The algorithm follows immediately from the following properties (1) If L has length 0 and L = then L = ε. (2) If L has length 0 and L = {ε} then L =. (3) If L has length n 1, then L = L.

Implementing fixed-length complement

Implementing fixed-length complement

Implementing complement

Implementing fixed-length universality A language L of length n is fixed-length universal if L = Σ. The algorithm for universality follows immediately from the following properties (1) If L = then L is not universal. (2) If L = {ε} then L is universal. (3) If L ε then L is universal iff L is universal for every a Σ.

Implementing fixed-length universality

Implementing fixed-length equality If two languages L, L of the same length are represented by nodes q, q of the same table then we have L = L iff q = q, and so equality can be checked in constant time. If the languages are represented by nodes from different tables, then equality amounts to isomorphism of the DFAs rooted at the nodes.

NFAs as starting point Given: Acyclic NFA A accepting a fixed-length language. Goal: Simultaneously determinize and minimize A Each state of A accepts a fixed-length language. We give an algorithm state(s): Input: a subset S of states of A accepting languages of the same length. Output: the state of the master automaton accepting L(q). Goal is achieved by calling state({q })

NFAs as starting point The algorithm follows from the following observations: 1) If S = then L S =. 2) If S F then L S = {ε}. 3) If S and S F then L S = a L S, where L S = δ(s, a ). This leads directly to a recursive algorithm:

NFAs as starting point

NFAs as starting point

Implementing operations on relations Assumptions: Objects are encoded as words of Σ (one word for each object) Pairs of objects are encoded as words of Σ Σ. Recall: Σ Σ and Σ Σ are isomorphic. Observe: both objects and pairs of objects are so encoded as words of length n, but over different alphabets. Notation: Given R Σ Σ, we denote R, = w, w Σ Σ aw, bw R. Master transducer: Master automaton over the alphabet Σ Σ.

Implementing fixed-length join The algorithm follows from: 1) R = R = 2) ε, ε ε, ε = ε, ε 3) If R, R have length at least 1, then R R = a, b (R, R, ),,

Implementing fixed-length join

Implementing fixed-length pre and post The algorithm for pre (post is analogous) follows from: 1) If R = or L = then pre = 2) If R = { ε, ε } and L = ε then pre = {ε} 3) If R { ε, ε } and L {ε} then Proof of 3): pre (L) = a pre, (L ),

Implementing fixed-length pre and post

Implementing projection We reduce projection to pre. Clearly: The projection of a language R Σ Σ onto the first component is the language pre (Σ ) Specializing the algorithm for pre we obtain:

Decision Diagrams (DDs)

Decision Diagrams (DDs) A decision diagram is an automaton whose transitions are labeled by regular expressions of the form aσ, n 0, and satisfies the following determinacy condition for every state q and letter a: there is exactly one k 0 such that δ q, aσ, and for this k there is a state q such that δ q, aσ {q }. Observe: Every DFA is a DD. A fixed-length language L is a kernel if L =, L = {ε}, or there are a, b Σ such that L L. The kernel L of a fixed-length language L is the unique kernel satisfying L = Σ L for some k 0. Observe: k and L uniquely determine L for every L.

The master decision diagram All kernels as states, {ε} as final state, transitions (K, aσ, K )

Reduction rule Proposition: The unique minimal DD for a kernel is the fragment of the master DD rooted at the kernel (modulo labels of transitions leaving the states and {ε}). Proposition: The minimal DD for a kernel is obtained from its minimal DFA by exhaustively applying the following reduction rule :

Data structure for kernels The structure representing the set of kernels L = {L,, L } is the fragment of the master DD containing states L,, L and their descendants. It is a multi-dd, i.e., a DD with multiple initial states.

Data structure for kernels We represent multi-dds as tables of kernodes. A kernode is a triple q, l, s where q is a state identifier, l is a length, and s = q,, q is a successor tuple. The table for a multi-dd contains a node for each state but the states for and ε.

Implementing intersection Given kernels K, K of languages L, L, we wish to compute K K = L L. We have 1. If K = or K = then K K =. 2. If K K then Σ K K if l < l K K = K Σ K if l < l K K if l = l 3. If l < l then (Σ K K = K K 4. If l < l then (K Σ K = K K 5. If l = l then K K = K K 3.-5. lead to a recursive algorithm

Implementing intersection

Implementing intersection

Implementing intersection