Testing from a Finite State Machine: An introduction 1
|
|
- Winfred Chandler
- 5 years ago
- Views:
Transcription
1 Testing from a Finite State Machine: An introduction 1 The use of Finite State Machines (FSM) to model systems has lead to much interest in deriving tests from them. Having derived a test sequence from an FSM, this is applied to the implementation under test (IUT) and the test output compared with that expected. At the end of this section you should be able to: Define a finite state machine and explain how it operates Define and explain the relevance of terms related to finite state machines Find sequences to reach or distinguish states Find a distinguishing sequence, UIOs, or a characterizing set for an FSM Generate a transition tour from an FSM Apply Chow s method Reading The material on FSM based testing is not covered in the core text. This document thus provides an overview of the topic. Section 1 briefly describes finite state machines. Section 2 considers the problem of reaching a state of an FSM. Approaches to verifying a state are then described in Section 3 and test generation is discussed in Section Finite state machines A finite state machine (also called a Mealy Machine) M is defined by a tuple (S,s 1,!,",X,Y) where S is a finite set of states, s 1 is the initial state (and thus s 1 #S),! is the state transfer function, " is the output function, X is the finite input alphabet, and Y is the finite output alphabet. If M receives input x#x when in state s i #S, it moves to state s j =!(s i,x) and produces output y="(s i,x). This defines a transition (s i,s j,x/y). A graphical representation of an FSM given in Aho et al. [1988] is shown in Figure 1. Here the initial state is s 1. This FSM will be denoted M 0 throughout this document. A general FSM with n states will be denoted M=(S,s 1,!,",X,Y). The functions! and " can be extended to take input sequences, giving functions! * (type S$X * %S) and " * (type S$X * %Y * ) respectively. Here given a set A, A * denotes the set of strings of elements taken from A (this includes the empty sequence). 1 These notes are closely based on notes by Prof. Robert Hierons, whom I gratefully acknowledge. b/1 s 2 s 3 b/0 c/1 b/0 s 5 b/0 a/2 s 1 s 4 c/1 Figure 1: The FSM M 0 The formal definition of an FSM can seem daunting. Don t be daunted. Many of the elements of the six-element tuple which define an FSM and really simple. In fact, four are very simple ones. X is the finite input alphabet, and Y is the finite output alphabet. These are just the set of things which can be input to the machine (X) and the set of things which it can produce as output (Y). In defining them we are simply declaringthe input type and the output type. S is the set of states, we usually label these S1,,Sn for n states, so s is really nothing more than a set of labels. OK, so that is three elements ofthe six element tuple. The element S1, is simply the start state of the machine. Without formally defining it, we would not know here to start execution from, because the drawing ofthe state machine is just a graph (as you can see, above). So that leaves two elements, the delta function (!) and the lambda function ("). These are there to show how the machine behaves. The delta function tells us how the states are connected together. In the diagram, it is the delta function which defines the arrows of the graph. The delta function tells is to which state we should move, when we find ourselves in a state s, and we receive an input i. Therefore, it is a function, which takes as parameters, the state we are currently in the s value) and the input we receive (the i value) and returns as its result, the label of the state to which we should move. The lambda function defines the output that is produced. It needs to take as parameters the input received by the machine and the state that the machine is in. Based upon these two parameters, it determines the output to be produced. Consider the behaviour of M 0. If M 0 receives input abaa, when in the initial state s 1, we get the following: 1 2
2 The initial input a triggers the transition (s 1,s 1,) and thus M 0 does not change state and outputs 0 (the final state of the transition is s 1 ). The second input b now triggers the transition (s 1,s 2,b/0) and thus M 0 moves to state s 2 and outputs 0. The third input a is now received when M 0 is in state s 2 and triggers the transition (s 2,s 5,). Thus M 0 moves to state s 5 and outputs 0. The final input a is received when M 0 is in state s 5 and triggers the transition (s 5,s 4,a/2). Thus M 0 moves to state s 4 and outputs 2. Thus the input of abaa in state s 1 leads to output 0002 and to M 0 moving to state s 4. From this we can see that in M 0,! * (s 1,abaa)=s 4 and " * (s 1,abaa)=0002. An FSM is said to be deterministic if there are no pairs of transitions that have the same initial state and input. This is implicit in the above definition, since! and " are functions (in each case there is only one allowed value given a state and input). We shall only consider deterministic FSMs. An FSM M is said to be completely specified if for each input x#x and each state s i there is a transition in M from s i that has input x. If an FSM M is not completely specified, a completely specified FSM M can be produced from M by applying one of the following approaches: 1. Adding an error state. For each (s i,x), with s i #S and x#x, such that there is no transition from s i with input x, we add a transition with input x from s i to the error state and make the output of this transition be some error message. 2. Adding null actions. For each (s i,x), with s i # S and x#x, such that there is no transition from s i with input x, we add a transition with input x from s i to s i and make the output of this transition be null. 3. The first approach corresponds to the case where there being no specified behaviour for input x and state s i means that the system should not receive x when in state s i and thus that this should lead to an error message or an exception being raised. The second case corresponds to the assumption that there being no specified behaviour for input x and state s i means that in state s i the input of x has no effect. Consider now the FSM M 0 in Figure 1 and assume that we apply the second approach. The FSM M 0 is converted to a completely specified FSM by adding the transitions (s 2,s 2,c/null), (s 3,s 3,a/null), (s 4,s 4,c/null), (s 5,s 5,b/null) and (s 5,s 5,c/null). Only completely specified FSMs shall be considered. An FSM M is initially connected if every state of M is reachable from the initial state of M. If there is a state s that is not reachable from the initial state, s may be removed since it does not contribute to the specified behaviour of M. We may thus assume that any FSM considered is initially connected. FSM M is strongly connected if, given any ordered pair of states (s i,s j ), there is a sequence of transitions that moves M from s i to s j. A reset operation is an input that takes M to its initial state irrespective of the current state. Many real systems have a reset operation; sometimes this simply represents switching the system off and then on again. A number of test techniques assume the existence of a reliable reset operation: a reset operation that is known to have been implemented correctly. Clearly, if M has a reset operation and is initially connected then it is strongly connected. Since most systems have some reset it is normal to assume that any FSM considered is strongly connected. It is easy to confirm that M 0 is initially connected. For example, in order to reach the state s 5 from the initial state it is sufficient to use the input sequence ca. Thus, M 0 with a reset operation added is strongly connected. Two states s i and s j of an FSM M are said to be distinguished by input sequence x if the input of x in states s i and s j leads to different output sequences. Essentially this means that, if you knew that the implementation was currently either in state s i or s j then in order to determine the current state it would be sufficient to input x and observe the output. More formally, x distinguishes s i and s j if " * (s i,x)&" * (s j,x). If some input sequence distinguishes s i and s j they are said to be distinguishable. For example, in M 0 the states s 1 and s 5 are distinguishes by input a. Thus, if we knew that the IUT was either in state s 1 or s 5 it would be sufficient to input a: it the response was 2 then we were is s 5 and if the response was 0 we were in s 1. Two states of an FSM M are said to be equivalent if they are not distinguishable. This is exactly when the same set of input/output sequences is produced from each state. Two FSMs are equivalent if their initial states are equivalent. An FSM M is said to be minimal if there is no equivalent FSM with fewer states. When M is initially connected, M is minimal if it has no pair of equivalent states. It is relatively easy to check that no two of states M 0 are equivalent. However, the FSM given in Figure 2 has two states and these are equivalent: for every input sequence x, the output sequences produced by the input of x in these two states are identical. b/1 b/1 Figure 2: An FSM with two equivalent states Given an FSM it is possible to produce an equivalent minimal FSM by merging equivalent states. For example, the FSM in Figure 2 is equivalent to a one state FSM in which there is an arc from the state to itself with label and there is an arc from the state to itself with label b/1. A directed graph (digraph) is defined by a set of vertices and a set of directed edges between the vertices. Labels can be added to the edges. Thus, an FSM can be 3 4
3 represented by a digraph in which the vertices correspond to states and the edges, labelled with the input/output, correspond to the transitions. 2. Reaching States Suppose we wish to test the behaviour of the IUT corresponding to a transition from state s of M. Then we need to find some input sequence that takes M from its initial state to state s. This may be achieved by simply searching through the paths from the initial state. If done by hand, the easiest approach is to find a path to state s and then find the corresponding input sequence. Consider, for example, the problem of reaching state s 5 of M 0. Here we start at s 1 and we might note that we can follow the arc from s 1 to s 2 and then the arc from s 2 to s 5. The first of these edges has input b and the second has input a. Thus, s 5 is reached by the input sequence ba from s 1 (the corresponding output sequence is 00) 3. State verification Testing from an FSM can often be seen as a process of checking the transitions of the IUT against those of the FSM. In order to check a transition t=(s i,s j,x/y) we need to input a sequence to move to state s i, input the value x (checking that y is output) and then check that the state is now s j. Testing from an FSM specification is typically black-box testing: the actual state of the implementation is not visible to the tester. This leads to two additional problems: Controllability: when testing a transition from state s it is necessary to apply an input sequence that takes the implementation to the corresponding state Observability: when testing a transition from state s to state s it is necessary to check that the state of the IUT is correct after the transition. The problem of controllability has already been discussed. In order to overcome the observability problem it is sufficient to be able to check the state of the IUT by providing further input and observing the output produced. Thus in order to test a transition it is necessary to have some way of checking its final state. There are three main approaches to checking a state. These are based upon: 1. Distinguishing sequence (DS) 2. Unique Input/Output sequences (UIO) 3. Characterizing set A distinguishing sequence is an input sequence that produces a different output for each state. Thus, when a distinguishing sequence D is input, the output produced in response to this identifies the state the system was in before D was input. Given a distinguishing sequence D, in order to check transition t we follow it by D. It is easy to check that the FSM M 0 (with null transitions added) has a number of distinguishing sequences, including ba. Note that here we have to consider the additional transitions with null outputs. In order to check the final state of a transition using a distinguishing sequence D it is sufficient to follow the transition by D. For example, to check the final state of the transition (s 2,s 5,) of M 0 it is sufficient to input b (to get to state s 2 ), then input a (to execute the transition) and then input ba (to check the final state of the transition). Thus the input sequence baba checks the transition (s 2,s 5,) of M 0. An input/output sequence x/y is a unique input/output sequence for a state s i if the following hold: y is the output produced when x is input in state s i (y=" * (s i,x)); and for all s j &s i we have that " * (s j,x)&y. Thus x distinguishes s i from all other states of M. Although x can verify s i it need not be able to verify any other state. Thus, when testing a transition t we follow it by the UIO for the final state of t. Clearly a DS is a UIO for each state. However, some FSMs have a UIO for every state but no DS. M 0 has the following UIOs:, for s 1, b/1 for s 2, c/1,a/2 for s 3, b/0,c/1 for s 4, and a/2 for s 5. Note: since ba is a DS for M 0, it also forms the input of a UIO for each state of M 0. In order to find a UIO for a state s it is sufficient to search through the set of input sequences until one is found. In practice we can form a table in which each row represents a state and each column represents an input sequence. The contents of a cell, for state s and input sequence x, is the response of M when it receives input x when in state s. An input sequence x is the input of a UIO for state s if the contents of the cell for (s,x) is different from the contents of all other cells in that column: the output sequence corresponding to (s,x) is unique. Note: if all the cells in a column are different, the input sequence is a distinguishing sequence. Consider the problem of finding a UIO for state s 1 of M 0. We may extend the table until a UIO is found, forming the following table. State Response to a Response to b Response to c Response to aa s ,0 s null 0,2 s 3 null 0 1 null,null s null 0,2 s 5 2 null null 2,0 Note that from the above, the input aa gives the input of UIOs for states s 1, s 3, and s 5 since their cell contents in this column do not appear elsewhere in this column. Further, a forms the input of UIOs for states s 3 and s 5 and b forms the input of a UIO for states s 2 and s 5. To check the transition (s 2,s 5,) of M 0 using the UIO b/1 it is sufficient to use the following input sequence: bab. Some FSMs do not have either a DS or a UIO for each state. Every minimal FSM does, however, have a characterising set. A characterising set W is a set of input 5 6
4 sequences with the property that, if every sequence is executed from some state s i, the set of output sequences verifies s i. Thus W is a characterizing set if for every pair of states (s i,s j ) there is some input sequence w#w that distinguishes s i and s j. When checking a transition t=(s i,s j,x/y) using characterising set W we need to, separately, follow t by each element from W. The set {a,b,c} is a characterising set for M 0. Naturally, since ba is a DS for M 0, {ba} is an alternative characterising set for M 0. In order to generate a characterising set for an FSM it is sufficient to produce a table as above and find a set of columns with the property that the corresponding values of the cells identify a state. From the above table it is possible to confirm that {a,b,c} is a characterising set for M 0 : for each row there is a unique sequence of values in these columns. For example, the row for s 1 has values 0,0,1 and this appears in no other row (no other state of M 0 responds to a with 0, responds to b with 0, and responds to c with 1). Thus, to check the transition (s 2,s 5,) of M 0 using this characterising set it is sufficient to use the following separate input sequences: baa, bab, bac. Naturally, where there may be state transfer faults a transition tour is usually seen to be insufficient. In fact, where there may be state transfer faults a transition tour is not even guaranteed to detect every output fault: state transfer faults may mask such output faults. Figure 3 gives an example of this. Here the specification is M 3 and the implementation machine M 4 contains an output fault (in the transition from s 3 ) that, due to the state transfer fault in the transition from s 2, is not detected by the transition tour aaa. To see that M 4 is faulty, consider its response to input aaaa and the response of the specification M 3 to aaaa. 4. Test generation This section will provide an overview of some FSM based test techniques. The techniques that will be described are: 1. The transition tour 2. Chow's method (also called the W-method) 3. The UIO method (not covered) When testing from an FSM M it is normal to assume that the implementation under test (IUT) can be modelled by an unknown FSM M I that has the same input and output alphabets as M. Thus testing involves comparing the behaviour of two FSMs (one of which is unknown: it acts as a black box). Normally we also assume that M I has at most m states for some predetermined m. A fault in a transition can be categorized as one or more of the following: 1. an output fault: a transition has the wrong output; or 2. a state transfer fault: the transition takes M to the wrong state. The different test techniques vary in the types of faults they look for and the properties of the specification they assume. We will now describe these techniques The transition tour method If we assume that only output faults exist it is sufficient to produce some test sequence that executes every transition of M. Such a sequence is called a transition tour. For example, M 0 has the following transition tour (note the need to use resets): s 1 -a->s 1 -b->s 2 -a-s 5 -a->s 4 -b->s 3 -c->s 5 -a->s 4 -a->s 5 -a->s 4 -b->s 3 -b-s 5 -reset->s 1 -c->s 4 -reset->s 1 -b-s 2 -b-s 3 -reset->s 1 By following this path through M 0 it is possible to confirm that it goes through every edge and thus includes every transition. This path leads to the following test sequence: a,b,a,a,b,c,a,a,a,b,b,reset,c,reset,b,b,reset 7 8
5 s 1 s 2 s 1 a/1 a/1 M 3 M 4 a/1 s 3 s 3 s 2 VW'VXW'VXXW' 'VX m-n+1 W Here, given a set A the term A k denotes AA A (k times). Thus, for example, A 4 denotes AAAA and contains all sequences that are composed of 4 elements from A. For example, since X={a, b, c}, X 2 ={aa, ab, ac, ba, bb, bc, ca, cb, cc}. If, for example, m=n+3 we get the following test set: Figure 3: Specification M 3 and faulty implementation M Chow's method We shall now describe Chow's method, which produces a checking experiment: a set of input sequences that, between them, determine correctness as long as the IUT behaves like some (unknown) FSM that has no more than m states and with the same input alphabet as M. The sequences produced are separated by a reset and thus the method relies upon the existence of a reliable reset operation. Chow's method uses a characterising set W and a state cover V, where V is a state cover if it is a set of input sequences with the property that: each state of M is reached from s 1 by exactly one sequence from V. Naturally, there will normally be more than one choice for this state cover but a minimal state cover may be found using a breadth-first search (see Section 2). M 0 has state cover {(, b, c, bb, ca} (where ( denotes the empty sequence). Here ( reaches s 1, b reaches s 2, c reaches s 4, bb reaches s 3, and ca reaches s 5. We might also use the characterising set W={a, b, c}. Where it is assumed that the implementation M I has no more state than M (and thus m=n) Chow's method produces the following test: VW'VXW Here two sets P and Q being sequenced to form PQ means we take all the sequences that may be formed by: following a sequence from P by a sequence from Q. Thus PQ={pq p#p,q#q}. Test sequences are separated by (reliable) resets. In the example this test is: {(, b, c, bb, ca}{a, b, c}'{(, b, c, bb, ca}{a, b, c}{a, b, c} The first of these sets ({(, b, c, bb, ca}{a, b, c}) is: VW'VXW'VXXW' VXXXW ' VXXXXW It is not as hard as it seems This material may seem quite hard, but it is very easy if you practice. I strongly recommend that you attempt all of the exercises for this week s lectures and check the model answers to see that you understand this material. The definitions may take a while to master, but the ideas are really very intuitive. You can use the diagrammatic form of the FSM to guide you. A lot of the ideas I present are much more immediate in terms of the diagrams, than in terms of the definitions. This is particularly the case for those students who are not mathematically minded. I would point out that testing from finite state machines, using the techniques we are learning here, is a very widespread activity in industry, particularly in the telecommunications industry and in any situation where embedded systems are used. 5. References 1. Aho A. V., Dahbura A. T., Lee D., and Uyar M. U., 1988, An Optimization Technique for Protocol Conformance Test Generation Based on UIO Sequences and Rural Chinese Postman Tours, In the Proceedings of Protocol Specification, Testing, and Verification VIII, pages 75-86, Elsevier (North-Holland). 2. Sidhu D. P. and Leung T.-K., 1989, Formal Methods for protocol testing: A detailed Study, IEEE Transactions on Software Engineering, 15 4, pp {a, b, c, ba, bb, bc, ca, cb, cc, bba, bbb, bbc, caa, cab, cac} The second set is rather large (it has 45 elements) and so its elements will not be listed here. Note: in this example W=X but in general this will not be the case. Where m>n Chow's method produces the following test set: 9 10
Using a Minimal Number of Resets when Testing from a Finite State Machine
Using a Minimal Number of Resets when Testing from a Finite State Machine R. M. Hierons a a Department of Information Systems and Computing, Brunel University, Uxbridge, Middlesex, UB8 3PH, United Kingdom
More informationTheory of Computation
Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.
More informationDISTINGUING NON-DETERMINISTIC TIMED FINITE STATE MACHINES
DISTINGUING NON-DETERMINISTIC TIMED FINITE STATE MACHINES Maxim Gromov 1, Khaled El-Fakih 2, Natalia Shabaldina 1, Nina Yevtushenko 1 1 Tomsk State University, 36 Lenin Str.. Tomsk, 634050, Russia gromov@sibmail.com,
More informationUNIT-I. Strings, Alphabets, Language and Operations
UNIT-I Strings, Alphabets, Language and Operations Strings of characters are fundamental building blocks in computer science. Alphabet is defined as a non empty finite set or nonempty set of symbols. The
More informationAuthor: Vivek Kulkarni ( )
Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-2: Finite State Machines Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Construct Mealy and Moore
More informationUsing Multiple Adaptive Distinguishing Sequences for Checking Sequence Generation
Using Multiple Adaptive Distinguishing Sequences for Checking Sequence Generation Canan Güniçen 1, Guy-Vincent Jourdan 2, and Hüsnü Yenigün 1 1 Sabanci University, Istanbul, Turkey {canangunicen,yenigun}@sabanciuniv.edu
More informationTesting Distributed Systems
Testing Distributed Systems R. M. Hierons Brunel University, UK rob.hierons@brunel.ac.uk http://people.brunel.ac.uk/~csstrmh Work With Jessica Chen Mercedes Merayo Manuel Nunez Hasan Ural Model Based Testing
More informationUsing Distinguishing and UIO Sequences Together in a Checking Sequence
Using Distinguishing and UIO Sequences Together in a Checking Sequence M.CihanYalcinandHusnuYenigun Faculty of Engineering and Natural Sciences, Sabanci University, Tuzla 34956, Istanbul, Turkey Abstract.
More informationTESTING is one of the most important parts of the
IEEE TRANSACTIONS 1 Generating Complete Controllable Test Suites for Distributed Testing Robert M. Hierons, Senior Member, IEEE Abstract A test suite is m-complete for finite state machine (FSM) M if it
More informationModel-Based Testing: Testing from Finite State Machines
Model-Based Testing: Testing from Finite State Machines Mohammad Mousavi University of Leicester, UK IPM Summer School 2017 Mousavi FSM-Based Testing IPM 2017 1 / 64 Finite State Machines Outline 1 Finite
More informationSchool of Information Technology and Engineering University of Ottawa Ottawa, Canada
Using Adaptive Distinguishing Sequences in Checking Sequence Constructions Robert M. Hierons Guy-Vincent Jourdan Hasan Ural Husnu Yenigun School of Information Systems, Computing and Mathematics Brunel
More informationUNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r
Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite
More informationEmbedded systems specification and design
Embedded systems specification and design David Kendall David Kendall Embedded systems specification and design 1 / 21 Introduction Finite state machines (FSM) FSMs and Labelled Transition Systems FSMs
More informationDIAGNOSING MULTIPLE FAULTS IN COMMUNICATING FINITE STATE MACHINES
DIAGNOSING MULTIPLE FAULTS IN COMMUNICATING FINITE STATE MACHINES Khaled El-Fakih+, Nina Yevtushenko++ and Gregor v. Bochmann+ +School of Information Technology and Engineering,University of Ottawa, ON,
More informationAutomata: a short introduction
ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible
More informationFormal Definition of a Finite Automaton. August 26, 2013
August 26, 2013 Why a formal definition? A formal definition is precise: - It resolves any uncertainties about what is allowed in a finite automaton such as the number of accept states and number of transitions
More informationChapter 5 Simplifying Formulas and Solving Equations
Chapter 5 Simplifying Formulas and Solving Equations Look at the geometry formula for Perimeter of a rectangle P = L W L W. Can this formula be written in a simpler way? If it is true, that we can simplify
More informationOvercoming observability problems in distributed test architectures
Overcoming observability problems in distributed test architectures J. Chen a R. M. Hierons b H. Ural c a School of Computer Science, University of Windsor, Windsor, Ontario, Canada b School of Information
More informationNondeterministic finite automata
Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the
More informationIntroduction to Computers & Programming
16.070 Introduction to Computers & Programming Theory of computation: What is a computer? FSM, Automata Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Models of Computation What is a computer? If you
More informationFABER Formal Languages, Automata. Lecture 2. Mälardalen University
CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010 1 Content Languages, g Alphabets and Strings Strings & String Operations Languages & Language Operations
More informationSFWR ENG 2FA3. Solution to the Assignment #4
SFWR ENG 2FA3. Solution to the Assignment #4 Total = 131, 100%= 115 The solutions below are often very detailed on purpose. Such level of details is not required from students solutions. Some questions
More informationUNIT-VI PUSHDOWN AUTOMATA
Syllabus R09 Regulation UNIT-VI PUSHDOWN AUTOMATA The context free languages have a type of automaton that defined them. This automaton, called a pushdown automaton, is an extension of the nondeterministic
More informationFinite State Machines 2
Finite State Machines 2 Joseph Spring School of Computer Science 1COM0044 Foundations of Computation 1 Discussion Points In the last lecture we looked at: 1. Abstract Machines 2. Finite State Machines
More informationLet s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.
Finite State Machines Introduction Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc. Such devices form
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of
More informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
More informationA conformance testing for communication protocols modeled as a set of DFSMs with common inputs
15 A conformance testing for communication protocols modeled as a set of DFSMs with common inputs Atsushi Fukadat, Tadashi Kaj'/,t*, Teruo Higashinot, Kenichi Taniguch'/,t and Masaaki Montt t Dept. Information
More informationLecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA
More information1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,
1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, v, x, y, z as per the pumping theorem. 3. Prove that
More informationDISTINGUISHABILITY RELATIONS BETWEEN INITIALIZED NONDETERMINISTIC FSMs. Nina Yevtushenko Tomsk State University, Russia April, 12, 2011
DISTINGUISHABILITY RELATIONS BETWEEN INITIALIZED NONDETERMINISTIC FSMs Nina Yevtushenko Tomsk State University, Russia April, 12, 2011 Outline 1. Why do we need distinguishability relations? 2. External
More informationModel Based Testing -- FSM based testing
Model Based Testing -- FSM based testing Brian Nielsen {bnielsen}@cs.aau.dk Automated Model Based Conformance Testing x>=2 Model DBLclick! click? x:=0 click? x
More informationGEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I
GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three
More informationEXAMPLE CFG. L = {a 2n : n 1 } L = {a 2n : n 0 } S asa aa. L = {a n b : n 0 } L = {a n b : n 1 } S asb ab S 1S00 S 1S00 100
EXAMPLE CFG L = {a 2n : n 1 } L = {a 2n : n 0 } S asa aa S asa L = {a n b : n 0 } L = {a n b : n 1 } S as b S as ab L { a b : n 0} L { a b : n 1} S asb S asb ab n 2n n 2n L {1 0 : n 0} L {1 0 : n 1} S
More informationNotes for Comp 497 (454) Week 10
Notes for Comp 497 (454) Week 10 Today we look at the last two chapters in Part II. Cohen presents some results concerning the two categories of language we have seen so far: Regular languages (RL). Context-free
More informationA FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic
A FIRST COURSE IN LINEAR ALGEBRA An Open Text by Ken Kuttler Matrix Arithmetic Lecture Notes by Karen Seyffarth Adapted by LYRYX SERVICE COURSE SOLUTION Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)
More informationSemigroup presentations via boundaries in Cayley graphs 1
Semigroup presentations via boundaries in Cayley graphs 1 Robert Gray University of Leeds BMC, Newcastle 2006 1 (Research conducted while I was a research student at the University of St Andrews, under
More informationSection 1 (closed-book) Total points 30
CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes
More informationTheory of Computation - Module 3
Theory of Computation - Module 3 Syllabus Context Free Grammar Simplification of CFG- Normal forms-chomsky Normal form and Greibach Normal formpumping lemma for Context free languages- Applications of
More informationComputability and Complexity
Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability
More informationFinite-state machines (FSMs)
Finite-state machines (FSMs) Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada January 10, 2017 1/19 Finite-state machines (FSMs) and state
More informationFinite Automata Part One
Finite Automata Part One Computability Theory What problems can we solve with a computer? What kind of computer? Computers are Messy http://en.wikipedia.org/wiki/file:eniac.jpg Computers are Messy That
More informationCOSE212: Programming Languages. Lecture 1 Inductive Definitions (1)
COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2017 Fall Hakjoo Oh COSE212 2017 Fall, Lecture 1 September 4, 2017 1 / 9 Inductive Definitions Inductive definition (induction)
More informationPRINCIPLES AND METHODS OF TESTING FINITE STATE MACHINES A SURVEY. David Lee. Mihalis Yannakakis. AT&T Bell Laboratories Murray Hill, New Jersey
PRINCIPLES AND METHODS OF TESTING FINITE STATE MACHINES A SURVEY David Lee Mihalis Yannakakis AT&T Bell Laboratories Murray Hill, New Jersey ABSTRACT With advanced computer technology, systems are getting
More informationCISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata
CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences
More informationAn integration testing method that is proved to find all faults
An integration testing method that is proved to find all faults Florentin Ipate & Mike Holcombe Formal Methods and Software Engineering (FORMSOFT) Group Department of Computer Science University of Sheffield,
More informationCS 154. Finite Automata vs Regular Expressions, Non-Regular Languages
CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing
More informationAuthor: Vivek Kulkarni ( )
Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-3: Regular Expressions Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Define the following and give
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,
More informationCOSE212: Programming Languages. Lecture 1 Inductive Definitions (1)
COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2018 Fall Hakjoo Oh COSE212 2018 Fall, Lecture 1 September 5, 2018 1 / 10 Inductive Definitions Inductive definition (induction)
More informationIn English, there are at least three different types of entities: letters, words, sentences.
Chapter 2 Languages 2.1 Introduction In English, there are at least three different types of entities: letters, words, sentences. letters are from a finite alphabet { a, b, c,..., z } words are made up
More informationTheory of Computation Turing Machine and Pushdown Automata
Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type
More informationacs-04: Regular Languages Regular Languages Andreas Karwath & Malte Helmert Informatik Theorie II (A) WS2009/10
Regular Languages Andreas Karwath & Malte Helmert 1 Overview Deterministic finite automata Regular languages Nondeterministic finite automata Closure operations Regular expressions Nonregular languages
More information1.9 Algebraic Expressions
1.9 Algebraic Expressions Contents: Terms Algebraic Expressions Like Terms Combining Like Terms Product of Two Terms The Distributive Property Distributive Property with a Negative Multiplier Answers Focus
More informationChapter 2. Linear Algebra. rather simple and learning them will eventually allow us to explain the strange results of
Chapter 2 Linear Algebra In this chapter, we study the formal structure that provides the background for quantum mechanics. The basic ideas of the mathematical machinery, linear algebra, are rather simple
More informationSection 1.3 Ordered Structures
Section 1.3 Ordered Structures Tuples Have order and can have repetitions. (6,7,6) is a 3-tuple () is the empty tuple A 2-tuple is called a pair and a 3-tuple is called a triple. We write (x 1,, x n )
More informationTheory of Computer Science
Theory of Computer Science C1. Formal Languages and Grammars Malte Helmert University of Basel March 14, 2016 Introduction Example: Propositional Formulas from the logic part: Definition (Syntax of Propositional
More informationMTH401A Theory of Computation. Lecture 17
MTH401A Theory of Computation Lecture 17 Chomsky Normal Form for CFG s Chomsky Normal Form for CFG s For every context free language, L, the language L {ε} has a grammar in which every production looks
More informationChapter 6. Properties of Regular Languages
Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is
More informationNotes for Comp 497 (Comp 454) Week 10 4/5/05
Notes for Comp 497 (Comp 454) Week 10 4/5/05 Today look at the last two chapters in Part II. Cohen presents some results concerning context-free languages (CFL) and regular languages (RL) also some decidability
More informationMA 1128: Lecture 08 03/02/2018. Linear Equations from Graphs And Linear Inequalities
MA 1128: Lecture 08 03/02/2018 Linear Equations from Graphs And Linear Inequalities Linear Equations from Graphs Given a line, we would like to be able to come up with an equation for it. I ll go over
More information(Refer Slide Time: 0:21)
Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata
More information2. Two binary operations (addition, denoted + and multiplication, denoted
Chapter 2 The Structure of R The purpose of this chapter is to explain to the reader why the set of real numbers is so special. By the end of this chapter, the reader should understand the difference between
More informationConceptual Explanations: Simultaneous Equations Distance, rate, and time
Conceptual Explanations: Simultaneous Equations Distance, rate, and time If you travel 30 miles per hour for 4 hours, how far do you go? A little common sense will tell you that the answer is 120 miles.
More informationOutline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)
Outline Nondeterminism Regular expressions Elementary reductions http://www.cs.caltech.edu/~cs20/a October 8, 2002 1 Determistic Finite Automata A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Q is a finite
More informationLecture 10: Synchronous Sequential Circuits Design
Lecture 0: Synchronous Sequential Circuits Design. General Form Input Combinational Flip-flops Combinational Output Circuit Circuit Clock.. Moore type has outputs dependent only on the state, e.g. ripple
More informationCMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013
CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset
More informationComparing State Machines: Equivalence and Refinement
Chapter 14 Comparing State Machines: Equivalence and Refinement Hongwei Zhang http://www.cs.wayne.edu/~hzhang/ Ack.: this lecture is prepared in part based on slides of Lee, Sangiovanni-Vincentelli, Seshia.
More informationForeword. Grammatical inference. Examples of sequences. Sources. Example of problems expressed by sequences Switching the light
Foreword Vincent Claveau IRISA - CNRS Rennes, France In the course of the course supervised symbolic machine learning technique concept learning (i.e. 2 classes) INSA 4 Sources s of sequences Slides and
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 4 Ana Bove March 23rd 2018 Recap: Formal Proofs How formal should a proof be? Depends on its purpose...... but should be convincing......
More informationConstructing checking sequences for distributed testing
DOI 10.1007/s00165-005-0083-8 BCS 2006 Formal Aspects of Computing (2006) 18: 84 101 Formal Aspects of Computing Constructing checking sequences for distributed testing Hasan Ural and Craig Williams School
More informationCS 341 Homework 16 Languages that Are and Are Not Context-Free
CS 341 Homework 16 Languages that Are and Are Not Context-Free 1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure
More informationRegular Expressions and Finite-State Automata. L545 Spring 2008
Regular Expressions and Finite-State Automata L545 Spring 2008 Overview Finite-state technology is: Fast and efficient Useful for a variety of language tasks Three main topics we ll discuss: Regular Expressions
More information2015 SUMMER MATH PACKET
Name: Date: 05 SUMMER MATH PACKET College Algebra Trig. - I understand that the purpose of the summer packet is for my child to review the topics they have already mastered in previous math classes and
More informationPlease bring the task to your first physics lesson and hand it to the teacher.
Pre-enrolment task for 2014 entry Physics Why do I need to complete a pre-enrolment task? This bridging pack serves a number of purposes. It gives you practice in some of the important skills you will
More informationStream Codes. 6.1 The guessing game
About Chapter 6 Before reading Chapter 6, you should have read the previous chapter and worked on most of the exercises in it. We ll also make use of some Bayesian modelling ideas that arrived in the vicinity
More informationFinite Automata Part One
Finite Automata Part One Computability Theory What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm We need a simpler
More informationFinite Automata Part One
Finite Automata Part One Computability Theory What problems can we solve with a computer? What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm
More informationChapter Five: Nondeterministic Finite Automata
Chapter Five: Nondeterministic Finite Automata From DFA to NFA A DFA has exactly one transition from every state on every symbol in the alphabet. By relaxing this requirement we get a related but more
More informationTAFL 1 (ECS-403) Unit- II. 2.1 Regular Expression: The Operators of Regular Expressions: Building Regular Expressions
TAFL 1 (ECS-403) Unit- II 2.1 Regular Expression: 2.1.1 The Operators of Regular Expressions: 2.1.2 Building Regular Expressions 2.1.3 Precedence of Regular-Expression Operators 2.1.4 Algebraic laws for
More informationLinear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.
POLI 7 - Mathematical and Statistical Foundations Prof S Saiegh Fall Lecture Notes - Class 4 October 4, Linear Algebra The analysis of many models in the social sciences reduces to the study of systems
More informationIntroduction to Finite-State Automata
Introduction to Finite-State Automata John McDonough Language Technologies Institute, Machine Learning for Signal Processing Group, Carnegie Mellon University March 26, 2012 Introduction In this lecture,
More informationVTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a.
VTU QUESTION BANK Unit 1 Introduction to Finite Automata 1. Obtain DFAs to accept strings of a s and b s having exactly one a.(5m )( Dec-2014) 2. Obtain a DFA to accept strings of a s and b s having even
More informationCompiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz
Compiler Design Spring 2011 Lexical Analysis Sample Exercises and Solutions Prof. Pedro C. Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292 pedro@isi.edu
More informationPushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack
A pushdown automata (PDA) is essentially: An NFA with a stack A move of a PDA will depend upon Current state of the machine Current symbol being read in Current symbol popped off the top of the stack With
More informationLet us first give some intuitive idea about a state of a system and state transitions before describing finite automata.
Finite Automata Automata (singular: automation) are a particularly simple, but useful, model of computation. They were initially proposed as a simple model for the behavior of neurons. The concept of a
More informationCSEP 590 Data Compression Autumn Arithmetic Coding
CSEP 590 Data Compression Autumn 2007 Arithmetic Coding Reals in Binary Any real number x in the interval [0,1) can be represented in binary as.b 1 b 2... where b i is a bit. x 0 0 1 0 1... binary representation
More informationLecture 4: More on Regexps, Non-Regular Languages
6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with
More informationCOS 140: Foundations of Computer Science
COS 140: Foundations of Computer Science Boolean Algebra Fall 2018 Introduction 3 Problem................................................................. 3 Boolean algebra...........................................................
More informationCSCI 340: Computational Models. Regular Expressions. Department of Computer Science
CSCI 340: Computational Models Regular Expressions Chapter 4 Department of Computer Science Yet Another New Method for Defining Languages Given the Language: L 1 = {x n for n = 1 2 3...} We could easily
More informationThis pre-publication material is for review purposes only. Any typographical or technical errors will be corrected prior to publication.
This pre-publication material is for review purposes only. Any typographical or technical errors will be corrected prior to publication. Copyright Pearson Canada Inc. All rights reserved. Copyright Pearson
More informationProblem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y.
CSE2001, Fall 2006 1 Problem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y. S 00S1 A - xay, where x = 2 y.
More informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Lecture 4 Ana Bove March 24th 2017 Structural induction; Concepts of automata theory. Overview of today s lecture: Recap: Formal Proofs
More informationTheory of Computation
Theory of Computation (Feodor F. Dragan) Department of Computer Science Kent State University Spring, 2018 Theory of Computation, Feodor F. Dragan, Kent State University 1 Before we go into details, what
More informationFoundations of the X-machine Theory for Testing
Foundations of the X-machine Theory for Testing Research Report CS-02-06 J. Aguado and A. J. Cowling Department of Computer Science, Sheffield University Regent Court, 211 Portobello Street, Sheffield,
More information3 Boolean Algebra 3.1 BOOLEAN ALGEBRA
3 Boolean Algebra 3.1 BOOLEAN ALGEBRA In 1854, George Boole introduced the following formalism which eventually became Boolean Algebra. Definition. An algebraic system consisting of a set B of elements
More informationTheory of Computation - Module 2
Theory of Computation - Module 2 Syllabus Introduction to Automata Theory - Definition of Automation - Finite automata - Language acceptibility by finite automata - Deterministic and non deterministic
More informationCS375: Logic and Theory of Computing
CS375: Logic and Theory of Computing Fuhua (Frank) Cheng Department of Computer Science University of Kentucky 1 Table of Contents: Week 1: Preliminaries (set algebra, relations, functions) (read Chapters
More informationHoming and Synchronizing Sequences
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
More information