Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 010010. These are examples of a single symbol. Languages can be manipulated as follows:

2 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  {0,1}. Alphabet  = {00, 01, 10, 11}. Language includes all the strings that can appear 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

3  Intersection -  Complement -  Catenation - Union

4 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 -

5  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 -

6 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

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

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

9 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.

10 “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, 1994. Uses non-determinism and self loops with null transitions at each state to model parallel with synchronous.

11 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.

12 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.

13 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.)

14 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.

15  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

16 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.

17 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.

18 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:

19 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.

20 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.

21 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

22 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.


Download ppt "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."

Similar presentations


Ads by Google