irz

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A language is a regular set

(or just regular) if it is accepted by some DFA (i.e. if it is L(M) for some DFA M).

Let P ={transitivity}. Then transitive closure of R, denoted R+, is defined by:

1) If aRb, then aR+b. 2) If aR+b and bRc, then aR+c. 3) Nothing is in R+ unless it so follows from (1) and (2). R+ is the smallest transitive relation that includes R.

Theorem. (Myhill-Nerode) The following statements are equivalent:

1) L ⊆ ∑* is a regular set; 2) RL is of finite index; 3) L is the union of some of the equivalence classes of a right invariant equivalence relation of finite index

In one move, the DFA in state q and reading symbol a :

1) enters state delta(q, a) and S 2) moves its window one symbol to the right.

Definition. Let sigma be alphabet. The regular expressions (r.e.) over sigma (and the sets that they denote) are defined inductively as follows:

1) nič is a r.e.; it denotes the empty set, ; 2) epsilon is a r.e.; it denotes the set {epsilon}; 3) For each a ∊ sigma, a is a r.e.; it denotes the set {a}; 4) If r and s are r.e.'s denoting languages R and S, respectively, then a) (r + s) is a r.e.; it denotes the set R U S ; (union of R and S) b) (rs) is a r.e.; it denotes the set RS ; (concatenation of R and S) c) (r*) is a r.e.; it denotes the set R*. (Kleene closure of R)

Theorem. The set L(M) accepted by a FA M with n states is:

1) nonempty iff M accepts a word of length ℓ, where ℓ < n. 2) infinite iff M accepts a word of length ℓ, where n ⩽ ℓ < 2n. Algorithms (naïve). The obvious procedure to decide - ''Is L(M) nonempty?'' is: "See if any word of length ℓ < n is in L(M)." - "Is L(M) infinite?" is: "See if any word of length n ⩽ ℓ < 2n is in L(M)."

Nondeterminism. S Question: Given an input sequence a1a2...an, who decides whether or not there exists a sequence of transitions leading from initial to some final state? Ho does NFA do that?

1)NFA itself. 2) The NFA is not a realistic model of computation: it is assumed that NFA can always 'guess right.' That is, it is assumed that NFA has the magic capability of choosing, from any given set of options, the 'right' option, i.e. the one leading to success (if such an option exists; otherwise, NFA halts).

S We will also define the language accepted by a PDA. The language can be defined in two ways, namely as the set of all inputs for which

1. some sequence of moves causes the PDA to empty its stack. This is the language accepted by empty stack; or 2. some sequence od moves causes the PDA to enter a final state. This is the language accepted by final state. We'll see that the definitions are equivalent in the sense that a set is accepted by empty stack by some PDA iff it is accepted by final state by some other PDA.

Every DFA is an NFA. S Why?

A DFA can be viewed as a trivial NFA.

Definition. A unit production is a production of the form

A→ B. The right-hand side must be a single variable; all other productions, including A → a and ε-productions, are non-unit.

TCS has it beginnings in diverse fields:

Biology (models for neuron nets) S Electrical engineering (switching theory in hardware design) S Mathematics (problems in the foundations of math and logic) S Linguistics (grammars for natural languages).

Question: Do deterministic PDA's accept the same class of languages as the nondeterministic PDA's?

But PDA's can accept in two different ways, by empty stack and final state, so there are two kinds of accepted languages, L(M)'s and N(M)'s. S Question: Which of the two are meant in the above question? S Answer: It doesn't matter; we'll see that the class of all L(M)'s and the class of all N(M)'s are the same. S Question: Does this class contain any languages that we already know? S Answer: Yes; we'll see that this class and the class of all CFL's are the same. Answer: No; ww^R is accepted by a nondeterministic PDA, but by no DPDA.

A nondeterministic finite automaton (NFA) is obtained from

DFA by allowing zero, one or more transitions from a state on the same input symbol; e.g.

Unlike FA, a PDA is assumed to be nondeterministic unless we state otherwise. In this case, we denote it by

DPDA (for deterministic PDA)

What is a model of computation?

Definition. A model of computation is a definition that formally characterizes the basic notions of algorithmic computation (i.e., the algorithm, its environment, and its execution in the environment)

A derivation tree is a natural description of the derivation of a particular sentential form of the grammar G. Why?

Definition. If we read the labels of the leaves in the left-to-right ordering (= preorder search through the tree that retains only leaves), we obtain a string which is called the yield of the derivation tree.

define the notion of a derivation tree formally.

Definition. Let G = (V, T, P, S ) be a CFG. A tree is called a derivation (or parse) tree for G if: 1) Every vertex has a label, which is a symbol of V UT U{ε}. 2) The label of the root is S. 3) If a vertex is interior and has label A, then A must be in V. 4) If n has label A and vertices nl, n2, ..., nk are the sons of vertex n, in order from the left, with labels X1, X2, ..., Xk , respectively, then A→X1X2...Xk must be a production in P. 5) If vertex n has label ε, then n is a leaf and is the only son of its father.

Equivalence of finite automata.

Definition. Two finite automata M1 and M2 are said to be equivalent if they accept the same language, i.e. if L(M1) = L(M2). Theorem. There is an algorithm to determine if two FA are equivalent

Theorem (Chomsky normal form).

Every CFL without ε can be generated by a grammar in which every production is of the form A → BC or A → a where A, B, C are variables and a is a terminal.

Theorem (Greibach normal form).

Every CFL without ε can be generated by a grammar in which every productions is of the form A → aα where A is a variable, a is a terminal, and α is a (possibly empty) string of variables.

Out of studies in biology, electrical engineering, mathematics, and linguistics came models of computation, that are central to TCS:

Finite automata Pushdown automata Turing machines

We are particularly interested in effective closure properties of the class of regular sets.

For such properties, given descriptors for regular sets, there is an algorithm to construct a descriptor for the regular set that results by applying the operation to these regular sets

Definition. A context-free grammar (CFG) is a 4-tuple

G = (V, T, P, S) V is a finite set of variables, T is a finite set of terminals, P is a finite set of productions, each of which is of the form A → alfa, where alfa is a word from the language (V U T )*; S is a special variable called the start symbol

A properly contained in B

If A⊆B but A ≠ B, then we write A ⊊ B.

There are several ways to restrict the format of productions without reducing the power of CFG's.

If L is a nonempty CFL then it can be generated by a CFG G with the following properties: - Each variable and terminal of G appears in the derivation of some word in L. - There are no productions of the form A → B where A and B are variables. - If ε is not in L, there need be no productions of the form A → ε. - If ε is not in L, we can require that every production of G be of one of the forms A → BC and A → a, where A, B, C are arbitrary variables and a is an arbitrary terminal or, alternatively, every production of G be of the form A → aα, where α is a string of variables (perhaps empty). These two special forms are called Chomsky normal form and Greibach normal form, respectively

The Kleene closure

In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation, either on sets of strings or on sets of symbols or characters. In mathematics it is more commonly known as the free monoid construction. The application of the Kleene star to a set V is written as V*. It is widely used for regular expressions, which is the context in which it was introduced by Stephen Kleene to characterise certain automata, where it means "zero or more".

On PA The moves will be of two types, regular moves and epsilon-moves.

In the regular move, an input symbol will be consumed Depending on the 1) state q of the finite control, 2) input symbol a, and 3) top symbol Z on the stack, finite number of choices will be possible After selecting a choice, S the window will advance one symbol. In the ε-move, an input symbol will not be consumed. Depending on the 1) state q of the finite control, 2) independent of the input symbol, and 3) top symbol Z on the stack, a finite number of choices will be possible. After selecting a choice, - the window will not advance. - This type of move will allow PDA to manipulate the stack without reading input symbols.

We view a NFA similarly to DFA.

It also reads an input tape, but the control unit at any time can be in any number of states.

The extended transition function is defined as

It takes a state q and an input string w to the resulting state. The definition proceeds by induction over the length of w

If L = L(G ) for some CFG G = (V, T, P, S), then L -{episilon} is

L(G' ) for some CFG G' with no useless symbols or ε-productions.

Definition. The language generated by a CFG G = (V,T,P,S) is the set

L(G) = {w|w ∊T* and SG⇒* w}.

The language accepted by a DFA M is the set

L(M) = {x | delta(q0, x) element F}

The language accepted by an NFAepsilon

L(M) = {x | sigma(q0, x) contains a state in F}

Definitions. For PDA we define two languages:

L(M), the language accepted by final state, to be L(M) = {w| (q0, w, Z0) ⊢* (p,ε ,γ) for some p ∊F and γ ∊ Γ*} N(M), the language accepted by empty stack, to be N(M) = {w| (q0, w, Z0) ⊢* (p, ε, ε) for some p ∊Q}.

Let sigma be an alphabet. Let L1, L2, L be sets of words from sigma*. The concatenation of L1, L2, denoted L1L2 , is the set

L1L2 = {xy | x element L1 and y element L2} Words in L1L2 are formed by taking an x in L1 and following it by a y in L2, for all possible x, y.

Pumping Lemma (for regular sets).

Let L be a regular set. Then there is a constant n (depending only on L) such that the following holds: if z is any word such that: z element L and |z|⩾ n, then there are words u,v,w such that z = uvw, |uv|⩽ n, |v|⩾ 1, and ∀i ⩾ 0: uv^iw ∊ L. In addition, n is at most the number of states of the smallest FA accepting L.

Principle of Mathematical Induction:

Let P(n) be a statement (proposition) about a natural number n. Then: If P(0) holds and P(k-1) ⇒ P(k) holds for any k ≥ 1, then P(n) holds for every n ≥ 0.

Question. The definition of substitution says nothing about the nature of the set L and the sets f (a), a ∊∑. What if we additionally required that L and all f (a), a ∊∑ be regular? Would then f (L) be regular too?

Let ∑={0,1}, ∆={a,b} and f a substitution defined by f (0)=a, f (1)=b*. Here both f (a), f (b) are regular. Let x = 010. Then f (x) = f (010) = ... = f (0) f (1) f (0) = ab*a. Let L be the regular set denoted by 0*(0+1)1*; then f (L) = a*(a+b*)(b*)*. This is a regular set too.

Definitions. S A string x is said to be accepted by a NFA

M = (..) if sigma(q0,x) contains some p element F

The language accepted by a NFA

M = (...) je množica L(M) = {x | sigma(q0, x) contains a state in F}

Question: If NFA is unrealistic, who needs it?

NFA (and other nondeterministic models that we will see later) can be used to find lower bounds on the time required to solve computational problems. Informally, the reasoning is as follows: if a computational problem P requires T time to be solved by a nondeterministic model M, then solving P on any deterministic version D of the model M must require at least T time (because D lacks the ability of prediction). Given a problem P, may be easier to design a NFA (or some other nondeterministic model that we will see later). We then try to construct an equivalent deterministic version (equivalent in the sense that it solves P too, regardless of the time needed).

It is easy to exhibit ambiguous CFG's. For example, the CFG with productions S→A|B, A→a, B→a is ambiguous. Why?

Not so easy to do is to find a CFL for which every CFG is ambiguous. Such a CFL is said to be inherently ambiguous. But, do such CFL's exist? Yes.

decision problems

Problems that ask for YES/NO answers are called decision problems. algorithms that solve such problems are decision algorithms

Definition. A NFA with epsilon-moves ( NFAepsilon) is a 5-tuple where:

Q is a finite set of states, sigma is a finite input alphabet, q0 element Q is the initial state, F podmnozica Q S is the set of final states, and ☟ sigma is the transition function, i.e. That is, is the set of all states p such that there is a transition labeled a from q to p, where a is either epsilon or a symbol in . S Note: can be viewed as a program of NFAepsilon. Every NFAepsilon has its own specific sigma.

Definition. A deterministic finite automaton (DFA) is a 5-tuple where:

Q is a finite set of states, sigma is a finite input alphabet, q0 element Q is the initial state, F podmnožica Q is the set of final states, and Delta is the transition function, i.e. . That is, is a state for each state q and input symbol a.

Definition. A nondeterministic finite automaton (NFA) is

Q is a finite set of states, sigma is a finite input alphabet, qo element Q is the initial state, F podmnozia Q is the set of final states, and ☟ sigma is the transition function, i.e. . That is, is the set of all states p such that there is a transition labeled a from q to p.

a language is accepted by a PDA iff it is a CFL.

Q is a finite set of states, ∑ is the input Γ is the stack alphabet, q0 is the initial state, Z0 ∈ Γ is the start symbol, F ⊆ Q is the set of final states, and δ is the transition function, i.e. a mapping from Q x(∑ U {ε})xΓ to finite subsets of Q x Γ* - δ can be viewed as a program of PDA. Every PDA has its own specific δ .

Let P ={reflexivity, transitivity}. For the reflexive and transitive closure of R, denoted R*, it holds:

R*= R+∪{(a,a)|a is in S}.

Question: Is there a minimum state DFA, i.e. a DFA that has, among all DFA accepting L, the smallest number of states ? If there is, can we algorithmically find (construct) it?

The answer is YES. But to see this we will need the so called Myhill-Nerode Theorem.

The definition tells nothing about the nature of the sets L1,L2. What if L1,L2 were regular? Would L1/L2 be regular too? What if L1 was regular and L2 arbitrary? Would L1/L2 be regular too?

The class of regular sets is closed under quotient with arbitrary sets.

What is the goal of TCS? Who needs it?

The goal of TCS is to analyze and formalize 1 what engineers have done, and more importantly, 2 what engineers cannot do Such an analysis is carried out by describing and classifying various theoretical models of computation.

Theorem. (minimum state DFA)

The minimum state DFA accepting a regular set L is unique up to an isomorphism (renaming of the states).

Given a DFA, a directed graph, called a transition diagram, is associated with it.

The vertices of the graph correspond to the states of the DFA. S If there is a transition from state qi to state qj on input a, then there is an arc qi → qj labeled a in the transition diagram.

Theorem. Let L be a set accepted by a NFA M.

Then there exists a DFA M' that accepts L.

Let L be a set accepted by an NFAepsilon M.

Then there exists an NFA M' that accepts L.

Let r be a regular expression.

Then there exists an NFAepsilon that accepts L(r).

The relationship between derivation trees and derivations.

Theorem. Let G = (V, T, P, S ) be a CFG. Then SG⇒* α iff there is a derivation tree for G with yield α.

Computer Science has two major areas:

Theoretical Computer Science (TCS), which investigates the fundamental ideas and models underlying computing; Engineering Techniques, which are needed and/or applied in the design of computing systems (both hardware and software), especially in the application of theory to design.

. Let M be a DFA.

There exists a regular expression that denotes L(M).

We must decide on a representation of regular sets

We'll assume regular sets are represented by FA. (Alternatively, we could assume that regular sets are represented by r.e.'s, as there are mechanical translations from r.e.'s into FA.)

A deterministic finite automaton (DFA) consists of

a finite set of states and a set of transitions from state to state that occur on input symbols chosen from an alphabet . For each input symbol there is exactly one transition out of each state.

Let ∑, ∆ be alphabets. A substitution is

a function f that maps each symbol of ∑ to a language over Δ; i.e. f (a) ⊆ ∆* for each a ∊∑. We extend f to words in ∑* by defining f (epsilon) = epsilon and f (wa) = f (w) f (a); and then to languages by defining f (L) = U(x element L) f(x)

Theorem. Every CFL without epsilon is defined by

a grammar with no useless symbols, ε-productions, or unit productions.

basic theorem of PDA

a language is accepted by a PDA iff it is a CFL.

A subtree of a derivation tree is

a particular vertex of the tree together with all its descendants, the edges connecting them, and their labels. If variable A labels the root, then we call the subtree an A-tree A subtree is like a derivation tree, but the label of the root of the subtree may not be the start symbol of the grammar.

Definition. An epsilon-production is

a prodution of the form A -> ε

A binary relation R is

a set of pairs: R = {(a, b)| a element A and b element B} The first component of each pair is chosen from a set A called the domain, and the second component of each pair is chosen from a (possibly different) set B called the range.

Normal-form theorems state that

all CFG's are equivalent to grammars with certain restrictions on the forms of productions. The first such theorem is due to Noam Chomsky.

A finite state system (FSS) is

an object that can read discrete inputs and can be in any one of a finite number of internal configurations called states. The state summarizes the information (concerning past inputs) needed to determine the behavior of the system on subsequent inputs. The finite automaton is a mathematical model of a FSS

If there is a path from vi to vj, then vi is said to be

ancestor of vj (and vj is a descendant of vi )

prefix

any number of leading symbols of that string

If the class of regular sets is closed under a particular operation, we call that fact

closure property of the class of regular sets.

We view a DFA as

control unit, which is in some state from Q, reading a sequence of symbols from sigma written on a tape.

Sets that can be injectively mapped into N are

countable or countably infinite.

directed graph

denoted G = (V, E), consists of a finite set V of vertices and a set E of ordered pairs of vertices called arcs. We also denote an arc (u,v) by u ➝ v.

undirected graph

denoted G = (V, E), consists of a finite set V of vertices (or nodes) and a set E of pairs of vertices called edges.

Pushdown automata

design of parsers, formal specification of programming languages

An equivalence relation R on a set S partitions S into

disjoint nonempty equivalence classes.

A relation R that is reflexive, symmetric, and transitive is said to be

equivalence relation

The PDA is

essentially an FA with control of an input tape and a stack. PDA is a nondeterministic device, and the deterministic version, DPDA, accepts only a subset of all CFL's.

Definition. A CFL L is said to be inherently ambiguous if

every CFG for L is ambiguous

A is contained in B if

every member of A is a member of B

We imagine that each of the copies continues execution independently of the others in the same fashion. The imaginary parallel computation is described by

execution tree.

the predecessor of graph

father

ID (q, ax, Zβ) directly becomes ID (pi, x,γi,β )

ff δ(q,a,Z) contains (pi,γi)

A CFG is

finite set variables, also called nonterminals, each of which represents a language. The languages represented by the variables are described recursively in terms of each other and primitive symbols called terminals.

lexical analyzer

fixed program that interprets the DFA.

Definition. A derivation is said to be leftmost

if at each step in the derivation a production is applied to the leftmost variable

A string x is said to be accepted by a DFA

if delta(q0, x) = p p element F

call A nullable

if for each A ∊ V holds A ⇒* ε.

closed under an operation

if the operation applied to regular sets is a regular set.

Definition. A derivation is said to be rightmost

if the rightmost variable is replaced at each step

Sets A and B have the same cardinality

if there is a bijection f :A→B

Sets A and B are equal

if they have the same members.

We say that we apply the production A → beta to the string alfaAbeta to obtain the string alfabetagama

if we substitute A by alfa in alfaAgama We also say that alfaAgama directly derives alfanetaga,a by A → beta.) Two strings are related by relation G⇒ if the first directly derives the second by one application of some production of G. Let alfa1, alfa2, ..., alfam∊ (V UT )*, m ≥1, and suppose that α1 G⇒α2, α2G⇒α3,...,αm-1 G⇒αm. Thenα1 derives αm in G; that is, α1 G⇒*αm .

Definition. A PDA M is called deterministic if

if δ fulfills two additional onditions for every q ∈ Q and Z ∈ Γ: 1. δ(q,ε,z) ≠ θ -> ∀a∈∑:δ(q,a,Z)=θ 2.∀a∈∑ U {ε} : |δ(q,a,Z)≤1 Now what does that mean? Condition 1 prevents the possibility of a choice between an ε-move and a regular move. Condition 2 prevents the possibility of a choice in the case of an ε-move and the possibility of a choice in the case of a regular move.

The PDA will have an

input tape, a control unit, and a stack The stack will be a string of symbols from some alphabet. The leftmost symbol of the string will be considered to be at the top of the stack. The device will be by definition nondeterministic, having some finite number of choices of moves in each situation.

set

is a collection of objects (members) without repetition.

string

is a finite sequence of symbols juxtaposed. E.g., a, b, and c are symbols and abcb is a string. The length of a string w, denoted |w|, is the number of symbols composing w. E.g., abcb has length 4. The empty string, denoted by ε, is the string consisting of zero symbols. Thus |ε| = 0.

alphabet

is a finite set of symbols.

A path in a digraph

is a sequence of vertices vl, v2, ..., vk, k ≥1, such that vi ➝ vi+1 is an arc for each i, 1≤ i < k. We say the path is from vl to vk

A path in a graph

is a sequence of vertices vl, v2, ..., vk, k ≥1, such that there is an edge {vi, vi+1} for each i, 1≤ i < k. The length of the path is k--1.

A (formal) language

is a set of strings of symbols from some alphabet. The empty set, , and the set consisting of the empty string, {ε}, are languages. They are distinct.

symbol

is an abstract entity that we shall not define formally. E.g., letters and digits are frequently used symbols.

suffix

is any number of trailing symbols. E.g., string abc has prefixes ε, a, ab, and abc; its suffixes are ε, c, bc, and abc. A prefix or suffix of a string, other than the string itself, is called a proper prefix or suffix.

A tree

is digraph with the following properties: S 1) There is exactly one vertex, called the root, that has no predecessors and from which there is a path to every vertex. S 2) Each vertex other than the root has exactly one predecessor. S 3) The successors of each vertex are ordered "from the left.

Theorem. The CFL L = {a^nb^nc^md^m|n⩾1, m⩾1} U {a^nb^mc^md^n|n⩾1, m⩾1}

is inherently ambiguous.

Juxtaposition

is used as the concatenation operator. That is, if w and x are strings, then wx is the concatenation of these two strings. The ε is the identity for the concatenation operator. That is, εw = wε = w for each string w.

theory of finite automata

is used in the design of such FSSs. (Certain programs, switching circuits)

Definitions. A language L is called context-free (CFL) if

it is L(G) for some CFG G. A string α ∊ (V U T )* is called a sentential form if S G⇒* α. Two grammars G1 and G2 are said to be equivalent if L(G1) = L(G2).

A vertex with no sons

leaf

undecidability

neodločljivost

Theorem. Every nonempty CFL is generated by a CFG with

no useless symbols.

There exist ?

non-regular languages. For these we will need a model of computation that will be more powerful than FA.

concatenation

of two strings is the string formed by writing the first, followed by the second, with no intervening space. E.g., the concatenation of dog and house is doghouse.

interior vertices

other vertices

The rules relating the variables are called

productions.

There are usual properties of relations. A relation R on S is:

reflexive if aRa for all a element S S irreflexive if aRa is false for all a element S S transitive if aRb and bRc imply aRc S symmetric if aRb implies bRa S asymmetric if aRb implies that bRa is false Note: any asymmetric relation is irreflexive. S Example < on is transitive and asymmetric (hence irreflexive).

Definition. The quotient of languages L1 and L2 is

s the set L1/L defined by L1/L2 = {x | obstaja y element L2 : xy element L1}. S Remark. So (L1/L2 )L2 = L1. (Prove; exercise.) S Example. To do. S Question. The definition tells nothing about the nature of the sets L1,L2. What if L1,L2 were regular? Would L1/L2 be regular too? What if L1 was regular and L2 arbitrary? Would L1/L2 be regular too? Here is the answer. S Theorem. The class of regular sets is closed under quotient with arbitrary sets. S Proof idea. To do or not to do. ⧠ L1/L2 = {x | 9y 2 L2 : xy 2 L1}.

The inverse homomorphic image of a word w is

set h^1(w) = {x|h(x) = w} and of a language L is the set h^-1(L) = {x|h(x) ∊L} Example. Let h be a homomorphism defined by h(0) = aa and h(1) = aba. Let x = 010. Then h(x) = h(010) = aaabaaa; and h^-1(aaabaaa) = {010}. (Why? Only 010 maps to aaabaaa.) Let L1 = (01)*. Then h(L1) = (aaaba)*. Let L2= (ab+ba)*a. Then h^-1(L2) = {x|h(x) ∊(ab+ba)*a} ={1}. Why?

Definitions. S A string x is said to be accepted by an NFAepsilon if

sigma(q0,x) contains some p element F

The languages accepted by finite automata are easily described by

simple expressions called regular expressions.

Definition. A CFG G is said to be ambiguous if

some word has more than one derivation tree

a successor of a vertex

son

Turing machines

stem from math and logic

Finite automata

stem from neuron nets and switching circuits today they serve in the design of: S Lexical analyzers (the part of a compiler that groups characters into indivisible units) S Pattern matching S Text editors S other Text-processing /File-searching programs S Theorem provers

Definition. A homomorphism is a

substitution h such that h(a) contains a single word for each a ∊ ∑. We extend h to words and languages as in the case of the substitution.

The class of regular sets is closed under

substitution,homomorphism and inverse homomorphism

The symbol ⇒ denotes

the act of deriving, that is, replacing a variable by the right-hand side of a production for that variable.

Just as the r.e.'s have an equivalent automaton—the FA, the CFG's have their machine counterpart

the pushdown automaton (PDA).

We say that the DFA accepts a word x if

the sequence of transitions corresponding to the symbols of x leads from q0 to an accepting state.

epsilon-Closure(q).

the set of all states reachable from the state q with epsilon-transitions only

The P-closure of a relation R is:

the smallest relation R' that includes R and possesses the properties in P.

Definition. Let G = (V, T, P, S) be a grammar. A symbol X is useful if

there exists a derivation S ⇒* αXβ ⇒* w for some α,β, and w ∊ T*. Otherwise X is useless.

A consequence of the Myhill-Nerode Theorem is that

there is an essentially unique minimum state DFA for every regular set.

Definitions. An instantaneous description(trenutni opis) (ID) is

tripple (q,w,γ), where q is a state, w a string of input symbols, and γ a string of stack symbols. trojka nam pove kakšne je posnetek v nekem trenutku nekega stroja

Theorem. The class of regular sets is closed under:

union, concatenation and Kleene closure. complementation and intersection.

operations on sets

union, intersection, difference, Cartesian product,2^A power set {X | X prava podmnožica A}

To describe the behavior of a NFA on a string

we extend sigma to apply to a state and a string (instead a state and just a symbol).

Teoretical CS

what engineers have done and what they cannot do

Definition. Let L⊆∑* be an arbitrary language. Define a relation RL on ∑* by

xRLy iff ∀z ∈ ∑* : xz ∈ L <-> yz ∈ L. Remarks. Two words x,y ∊ ∑* are in relation RL iff their arbitrary extensions xz,yz are either both in L or both outside L. Now, RL is an equivalence relation (prove). So, RL divides L into equivalence classes. The number of these is the index of RL. Generally, the index of RL is finite or infinite. (Example: If each x ∊ ∑* is in relation RL with no other y, then the index of RL is infinite.)

Definition. Let M = (Q,∑,sigma,q0,F) be a DFA. Define a relation RM on ∑* by

xRMy iff sigma(q0, x) = sigma(q0, y). Remarks. Two words x,y∊∑* are in relation RM iff they take M from q0 to the same q ∊ Q. RM is equivalence relation (why). It divides ∑* into equivalence classes, one for each state q reachable from q0. The number of the classes is the index of RM . The index of RM is finite (because |Q| is finite). Note that L(M) is the union of those equivalence classes which correspond to final states q ∊ F.

set former

{x | P(x)} . . . the set of objects x such that P(x) is true

Moves of the PDA. S The interpretation of the move

δ(q,a,Z) = {(p1,γ1), (p2,γ2), ..., (pm,γm)} is that the PDA in state q, with input symbol a and Z the top symbol on the stack can, for any i, 1⩽i⩽m, enter state pi, replace symbol Z by string γi, and advance the window one symbol. We call this the regular move. δ(q,ε,Z) = {(p1,γ1), (p2,γ2), ..., (pm,γm)} is that the PDA in state q, independent of the input symbol being scanned and with Z the top symbol on the stack, can enter state pi, and replace Z by γi, for any i, 1⩽i⩽mIn this case, the window is not advanced. We call this the ε-move.


Set pelajaran terkait

Clothing The Planet Chapters 1-5 TEST

View Set

Passpoint PrepU - Practice NCLEX #2

View Set

Chapter 1 - intro to insurance practice test, Chapter 2 practice exam - Insurance Contracts, Chapter 3, 5, 6, 8,9,12,13,15, Property Certification exam, Illinois Property & Casualty Insurance Day 2 - Commercial Lines, Casualty Certification Exam, Ill...

View Set

Chapter 49: Assessment and Management of Patients With Hepatic Disorders

View Set

Pediatrics_Infectious and Communicable Diseases_final

View Set

Medical Terminology Male Reproductive System

View Set

Intro to Planetary Astronomy Quest #4

View Set

IB Geography Unit 2 Global Climate Change

View Set