Languages. A Language is set of finite length strings on the symbol set i.e. a subset of (a b c a c d f g g g) At this point, we don’t care how the language.

Slides:



Advertisements
Similar presentations
CSE 311 Foundations of Computing I
Advertisements

4b Lexical analysis Finite Automata
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
YES-NO machines Finite State Automata as language recognizers.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Pushdown Automata Part II: PDAs and CFG Chapter 12.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Equivalence, DFA, NDFA Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 2 Updated and modified by.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
Conformance Simulation Relation ( ) Let and be two automata over the same alphabet simulates () if there exists a simulation relation such that Note that.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Languages. A Language is set of finite length strings on the symbol set i.e. a subset of (a b c a c d f g g g) At this point, we don’t care how the language.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Languages and Machines Unit two: Regular languages and Finite State Automata.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Pushdown Automata (PDA) Intro
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
using Deterministic Finite Automata & Nondeterministic Finite Automata
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Theory of Computation Automata Theory Dr. Ayman Srour.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Lecture #5 Advanced Computation Theory Finite Automata.
CIS Automata and Formal Languages – Pei Wang
Sequential Flexibility
Non Deterministic Automata
Recognizer for a Language
Chapter 2 FINITE AUTOMATA.
Jaya Krishna, M.Tech, Assistant Professor
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
REGULAR LANGUAGES AND REGULAR GRAMMARS
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
Finite Automata.
Chapter Five: Nondeterministic Finite Automata
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
NFAs accept the Regular Languages
Presentation transcript:

Languages. A Language is set of finite length strings on the symbol set i.e. a subset of (a b c a c d f g g g) At this point, we don’t care how the language is generated or represented. So initially the comments apply to all kinds of languages  regular -regular  push-down automata languages  Petri net languages … A symbol can be made up of a vector of variable values, e.g. 1a3de0 or These are examples of a single symbol. Languages can be manipulated as follows:

Examples of Languages Alphabet  = {a, b, c}. Language includes all the strings, in which all occurrences of a appear before all occurrences of b: , a, b, c, ab, ac, acb, cab, aacaabbbccb, … Strings not in the language: ba, aacabbaccc, … Binary variables x, y.  x =  y = {0,1},  =  x   y = {00, 01, 10, 11}. Language includes all the strings appearing as input/output combinations of the given circuit (reset to 0): (00), (10), (00)(00)(00), (00)(10)(11),… Strings not in the language: (01), (11), (00)(01), … DFF xy

 Intersection -  Complement -  Catenation - Union

Lowering and Raising  Given a Language over the alphabet projection is defined as –  Given a Language L over the alphabet X lifting to the alphabet is defined as -

Examples of Projection and Lifting Binary variables x, y, z.  x =  y =  z = {0,1}.  xyz =  x   y   z = {000, 001, 010, 011, 100, 101, 110, 111}. Language includes all the strings that can appear as input/output combinations of the given circuit (reset to 0): ,(000), (110)(001)(100),… Projecting to alphabet  xz : (00), (10)(01)(10),… Lifting to alphabet  xyzu =  xyz   u : (000-), (110-)(001-)(100-),… = (0000), (0001), (1100)(0010)(1000), (1100)(0010)(1001), (1100)(0011)(1000),… DFF x z y

 Given a Language L over the alphabet the restriction to X is defined as - where  Given a Language L over X and an alphabet Y disjoint from X, the expansion of L is defined as the language over such that -

Regular Expressions. Regular Expressions over alphabet {} is a regular expression is a regular expression are regular expression If r and s are regular expressions then r+s, r s, and are regular expressions. The language associated with a regular expression is called a regular language. Theorem: The complement of a regular language is a regular language

Examples of Regular Expressions Regular expression a + b stands for {a,b} Regular expression ab stands for {ab} Regular expression a* stands for { ,a, aa, aaa, aaaa, …} Alphabet  = {a, b, c}. Language includes all the strings, in which all occurrences of a appear before all occurrences of b: (a+c)*(b+c)* Alphabet  =  x   y = {00, 01, 10, 11}. Language includes all the strings appearing as input/output combinations of the given circuit (reset to 0): ( (00)*(10)(11)*(01) )* DFF xy

Classes of Languages  A language is prefix closed if  A language over is I-progressive if  A language over is I-Moore if

Examples of Languages Prefix-closed language includes, with its every string, all the prefixes of this string. Example 1: Language a*b* is prefix closed Example 2: Language a*b is not prefix closed I-progressive language includes the strings, which, for each input symbol, have some output symbol Example 1: Language ( (00)*(10)(11)*(01) )* is I-progressive Example 2: Language ( (00)*(10)(01) )* is not I-progressive

Classes of Languages  A language over is prefix closed if A language over is IO-progressive if

Composition of Languages  Given disjoint alphabets I,U,O and languages L 1 over and L 2 over, their synchronous composition is.  Given disjoint alphabets I,U,O and languages L 1 over and L 2 over, their parallel composition is.

Synchronous Composition Spec is defined over I  O Fixed is defined over I  V  U  O Unknown should be over U  V The solution to the equation F  X  S is More specifically I O VU Fixed Unknown F X Specification S

“While synchronous product often is thought to be a simple – even uninteresting – type of coordination, it can be shown that, through the use of non-determinism, this conceptually simple coordination serves to model the most general ‘asynchronous’ coordination, i.e. where processes progress at arbitrary rates relative to one another. In fact the ‘interleaving’ model, the most common model for asynchrony in the software community, can be viewed as a special case of this synchronous product” – Kurshan, Uses non-determinism and self loops with null transitions at each state to model parallel with synchronous.

Finite Automata A finite automaton (FA) is where S is a set of states, is an input alphabet, is a transition relation, r is the initial state, and is the set of accepting states.

An input sequence leads from r to s’ if there exists a sequence of states, such that for all i = 0,...,n-1. w is in the language of F ( ) if and only if w leads from r to i.e. where denotes the set of states that can be reached from r under the input sequence w.

Examples of Finite Automata Example 1: Language a*b* is prefix closed Example 2: Language a*b is not prefix closed X Y a b X Y a b b

Theorem: A languages is regular if and only if it is the language of a finite automaton Theorem: The set of all languages for deterministic FA is the same as for non-deterministic FA. (we will show how this can be done using the so- called subset construction.)

Operations on FA.  projection ( ): convert F over into F’ over X by replacing each edge (xv s s’) by the edge (x s s’)  lifting ( ): convert F over X into F’ over by replacing each edge (x s s’) by where stands for any.

Examples of Projection and Lifting Projection  y Lifting  u DFF x z y u Note: Automaton after projection is non-deterministic

 restriction ( ): convert F over to F’ over V, by changing every edge (v s s’) where into ( )  expansion ( ): Change F over X into F’ over by adding for each state, a self-loop for all v, i.e. add an edge where stands for any

Operations on FA. Product Given FAs both over, the product is where Complementation If F is deterministic, then. If F is non-deterministic, the only known way for complementation is to determinize it first. This is done by the sub-set construction.

Example of Product of Automata

Composition Synchronous Composition. Given two automata and over alphabets and their synchronous composition is i.e. the product of the two automata when they are made to have the same alphabet. Parallel Composition. Given two automata and on alphabets and their synchronous composition is i.e. the product of the two automata when they are made to have the same alphabet.

Subset Construction Given NFA we create a DFA F’ with the same language as F: where and s’ Theorem: F and F’ have the same language. Proof:

Interpretation of Subset Construction Non-deterministic automaton (NDA) can transit into several states under the same input We can think of these transitions happening at the same time It means that the NDA can be in several states at the same time –If string s has driven an NDA into a subset of states containing at least one accepting state, s is accepted Non-determinism is useful to compactly represent languages, but manipulation of NDAs is hard Determinization consists in constructing a DA equivalent to the given NDA Determinization procedure performs subset construction –The idea of subset construction is to transform (unfold) the NDA, which can be in a subset of states, into a DA, which can only be in one state, by associating each subset of states of the NDA with one state of the DA

Example of Subset Construction

Finite State Machines as Automata A FSM is where I is the set of input symbols, O the set of output symbols, r the initial state, and T(s,i,s’,o) is the transition relation. A transition (s,i,s’,o) from state s to s’ with output o can happen on input i can if and only if If then M is complete, otherwise partial.

It is deterministic if for all (s,i) there is at most one (s’,o) such that It is pseudo-non-deterministic if for all (s,i,o) there is at most one s’ such that A FSM is of Moore type if i.e. i’ can determine the next state but not the output.

Examples of FSMs 0 1 0/0 1/0 1/0 1/1 0/1 DFF x z y /0 01/0 10/0 11/0 11/1 00/1 01/1 10/1 Deterministic FSM Non-Deterministic FSM Circuit 0 1 0/0 1/0 1/1 0/1 Pseudo-Non-Deterministic FSM

Converting an FSM to an automaton An FSM M can be converted into an automaton F by the following: where Note that Q = S, i.e. all states are accepting The resulting automaton is typically not complete, since there are io combinations for which a next state is not defined. We can complete it by augmenting to include a transition to a new non-accepting state DCN. DCN s

Converting FSM into Automaton /0 01/0 10/0 11/0 11/1 00/1 01/1 10/1 FSM Incomplete Automaton Complete Automaton

FSMs as Automata The language of an FSM is defined to be the language of the associated automaton A pseudo non-deterministic FSM is one whose automaton is deterministic. The language of an FSM is prefix closed. The language of an FSM is I-progressive Conversion is done by grouping i/o on edges to (io) and making all states accepting. Conversion can be done only if the language is prefix closed and I-progressive. In this case, delete all non-accepting states (prefix), and change edges from (io) to i/o.