Class of machines called Nondeterministic Finite Automata:

Similar documents
Finite Automata. Reading: Chapter 2

Regular Languages and Finite State Machines

Finite Automata. Reading: Chapter 2

Regular Expressions and Automata using Haskell

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Compiler Construction

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

6.080/6.089 GITCS Feb 12, Lecture 3

Turing Machines: An Introduction

T Reactive Systems: Introduction and Finite State Automata

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Composability of Infinite-State Activity Automata*

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

The Halting Problem is Undecidable

Scanner. tokens scanner parser IR. source code. errors

Introduction to Finite Automata

Reading 13 : Finite State Automata and Regular Expressions

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Automata on Infinite Words and Trees

Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

Testing LTL Formula Translation into Büchi Automata

Deterministic Finite Automata

Formal Deænition of Finite Automaton. 1. Finite set of states, typically Q. 2. Alphabet of input symbols, typically æ.

Software Model Checking: Theory and Practice

Lecture I FINITE AUTOMATA

24 Uses of Turing Machines

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

FINITE STATE AND TURING MACHINES

CS 301 Course Information

Genetic programming with regular expressions

Properties of Stabilizing Computations

Automata and Computability. Solutions to Exercises

Model 2.4 Faculty member + student

CS5236 Advanced Automata Theory

Course Manual Automata & Complexity 2015

Finite Automata and Regular Languages

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Operators are typically activated through the menu items. Choose th 't. Ig on. r ht N d. IS ac Iva es an operator that highlights A-tr 't' 1 b 1 d

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

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

Converting Finite Automata to Regular Expressions

Hint 1. Answer (b) first. Make the set as simple as possible and try to generalize the phenomena it exhibits. [Caution: the next hint is an answer to

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Automata and Formal Languages

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

3515ICT Theory of Computation Turing Machines

CS 3719 (Theory of Computation and Algorithms) Lecture 4

A formal approach to model changeability of Enterprise Resource Planning Systems

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

Turing Machines, Part I

Web Data Extraction: 1 o Semestre 2007/2008

NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions

CHAPTER 7 GENERAL PROOF SYSTEMS

Introduction to Automata Theory. Reading: Chapter 1

Modeling of Graph and Automaton in Database

Transfer of the Ramsey Property between Classes

Two-dimensional Languages

The Optimum One-Pass Strategy for Juliet

C H A P T E R Regular Expressions regular expression

Postgres Plus xdb Replication Server with Multi-Master User s Guide

Enforcing Security Policies. Rahul Gera

Computability Theory

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar

A Roller Coaster Game Design using Automata Theory

Javadoc like technical documentation for CAPRI

How To Create A Diagram On Rational Software Development Platform

CPS122 - OBJECT-ORIENTED SOFTWARE DEVELOPMENT. Team Project

03 - Lexical Analysis

Objects for lexical analysis

Comparison of Standard, Integrated and Multimedia Information System (IS) with Solutions

Reliability Guarantees in Automata Based Scheduling for Embedded Control Software

Formal Verification by Model Checking

Chapter 2 Introduction to SPSS

SQL Database queries and their equivalence to predicate calculus

Intrusion Detection via Static Analysis

pure::variants Connector for Source Code Management Manual

Regular Languages and Finite Automata

WebSphere Business Monitor V7.0: Clustering Single cluster deployment environment pattern

Attix5 Pro Server Edition

Copyright 2013 wolfssl Inc. All rights reserved. 2

2. Basic Relational Data Model

Customizing the SSOSessionTimeout.jsp page for Kofax Front Office Server 3.5.2

Compilers Lexical Analysis

DRAFT Gigabit network intrusion detection systems

Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses

On Winning Conditions of High Borel Complexity in Pushdown Games

New York University Computer Science Department Courant Institute of Mathematical Sciences

Automata, languages, and grammars

How To Compare A Markov Algorithm To A Turing Machine

Learning Analysis by Reduction from Positive Data

Nesstar Server Nesstar WebView Version 3.5

ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605

Rewriting of Visibly Pushdown Languages for XML Data Integration

On a Structural Property in the State Complexity of Projected Regular Languages

Two Way F finite Automata and Three Ways to Solve Them

Runtime Monitoring of Web Service Conversations

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Transcription:

Class of machines called Nondeterministic Finite Automata: Last time we knew machines called Deterministic Finite Automata (DFA or FA) that accepts some simple languages as for example {a}. As you might have noticed, those DFAs have states and transitions which do not contribute to accepting strings and languages. For example all we need about an FA that accepts { a } is the following regardless of the alphabet (whether be it { a }, { a, b } or any other). This is an essence of FA. But it is not DFA. A DFA that accepts { a } need more states and transitions as the example below: Without extra states and transitions it is not a DFA if the alphabet is { a, b }. To avoid those redundant states and transitions and to make model easier we can use finite automata called Nondeterministic Finite Automata (short: NFA). There is presented a formal definition of NFA below and and some examples. For any NFA there is a DFA which accepts the same language and vice versa. NFAs are quite similar to DFAs. The only difference is in the transition function. NFAs do not necessarily go to a unique next state. The NFA may not go to any state from the current state on reading an input symbol or it may select one of several states nondeterministically as its next state. 1

Definition of nondeterministic finite automaton Let Q be a finite set and let be a finite set of symbols. Let be a function from Q to 2 Q, Let q 0 be a state in Q and let A be a subset of Q. If we call the elements of Q a state, the transition function, q 0 the initial state, A the set of accepting states. Then a nondeterministic finite automaton is a 5-tuple < Q,, q 0,, A > Notes on the definition 1. The set Q in the above definition is simply a set with a finite number of elements, as in the case of DFA its elements can be interpreted as a state that the system (automaton) is in. 2. The transition function is also called a next state function. Unlike as DFs a NFA moves into one of the states given by (q, a) if it receives the input symbol a while in state q. There is determined nondeterministically, which one of the states in (q, a) to select. 3. Note that is a function. Thus for each state q of Q and for each symbol a of (q, a) must be specified. The NFA aborts its operation if there is an empty set, 4. As in the case of DFA the accepting states are used to distinguish sequences of inputs given to the finite automaton. If the finite automaton is in an accepting state when the input ends i.e. ceases to come, the sequence of input symbols given to the finite automaton is "accepted". Otherwise it is not accepted. 5. Note that any DFA is also a NFA. Example 1: Q = { 0, 1 }, = { a }, A = { 1 }, the initial state is 0 and is as shown in the following table. 0 a { 1 } 2

A state transition diagram for this finite automaton is given below. If the alphabet is changed to { a, b } instead of { a } it still remains an NFA that accepts { a }. Example 2: Q = { 0, 1, 2 }, = { a, b }, A = { 2 }, the initial state is 0 and is as shown in the following table. 0 a { 1, 2 } 0 b 1 b { 2 } 2 a 2 b Note that for each state there are two rows in the table for corresponding to the symbols a and b, while in the Example 1 there is only one row for each state. A state transition diagram for this finite automaton is given below. 3

Example 3 For example consider the NFA with the following transition table: 0 a { 0, 1, 3 } 0 b { 2 } 1 b { 3 } 2 a { 3 } 2 b 3 a 3 b { 1 } The transition diagram for this NFA is as given below. 4

Task 2: Automaton accepting all the sets from the file in which there are elements which repeated themselves once. Using Nondeterministic Finite Automaton (NFA) propose a computer program which will accept all the sets contained elements which repeat themselves once. NFA is using following alphabet: = {0,1,2,3,4,5,6,7,8,9}. Program should read data from a whole file at once and points explicitly all cases (for example a position of the first element of the set) where the accepted sets are. It is possible to separate the sets from themselves with the symbol #. The Rules: Your program must use transition table to determine its next state, Finishing the program during the lab and sending it to the leading person a +, The console version of the program mark 4, The program with GUI mark 5, You can choose any language from C/C++, Java, C#, etc., Additional advantage if the program will be able to check the file s data correctness (if all enclosed sets were constructed correctly, please input the faulty set as the example). You can use NFA or FA to fulfill this additional task. If you will do that, the console version is enough to obtain mark 5. additional tip: you should enclose wider range alphabet than defined digits and letters for example as well as use the sign which terminates the whole file. EOF for example. The zip or rar packed archive should be named after following schema: LM_lab_2_Surname_indexnumber Copyright Dariusz Brzeziński & Łukasz Jopek 2011 5