Cum. Final Flashcards

(94 cards)

1
Q

The empty set can be written as ∅ or {}.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The concatenation of two strings x and y is the string containing all symbols of x in the order, followed by all the symbols of y in order.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For any string x, xɛ = ɛx = x.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

{} = {ɛ}

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The Kleene closure of an alphabet can be a finite set.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A language is a sequence over some fixed alphabet.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The language defined by a DFA M is the set of strings over Σ.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a state transition diagram, the labels of states can impact the behavior of the machine being represented.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A string x ∈ Σ* is accepted by a DFA M = (Q,Σ,δ,q0, F) if and only if δ*(q0,x)∈F.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The regular languages are closed under complement.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

If L1 and L2 are languages, the intersection of L1 and L2 is L1 ∩ L2 = {x|x∈L1 or x∈L2}

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If L is a regular language, its complement must also be a regular language.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Regular languages are not closed under intersection.

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Regular languages are closed under union.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the definition of an alphabet?

A

An alphabet is a non-empty, finite set of symbols.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the definition of a string?

A

A string is a finite sequence of zero or more symbols.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How many elements are in {ɛ}

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The Kleene closure of an alphabet Σ, written Σ*, contains what?

A

The set of all strings over Σ.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the definition of a language?

A

A set of strings over some fixed alphabet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What indicates the accept state in a state transition diagram?

A

A double circle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How is the start state indicated in a state transition diagram?

A

An arrow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What kinds of languages are recognized by DFAs?

A

regular languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What set operation forms the set of all pairs using elements from two sets?

A

Cartesian Cross Product.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the only difference between the product construction of the DFA for the union of two languages and the DFA for the intersection of the same two languages?

A

The intersection only accepts both accept states from the languages. The union will accept either or both accept states.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
A DFA has exactly one transition from every state for every symbol in the alphabet.
T
26
An NFA can be thought of as a special kind of DFA.
F
27
A DFA can make a state transition spontaneously, without consuming an input symbol.
F
28
ɛ transitions are especially useful for combining smaller automata into larger ones.
T
29
If S is a set, the powerset of S is P(S) = {R|R⊆S}
T
30
For any NFA, there is a DFA that recognizes the same language.
T
31
Any symbol a∈Σ is a regular expression with L(a) = {a}
T
32
The special symbol ɛ is a regular expression with L(ɛ) = {ɛ}.
T
33
The special symbol ∅ is regular expression with L(∅) = {ɛ}.
F
34
If L is a language, the Kleene close of L is L* = {x1x2...xn | n≥0, with all xi ∈L}
T
35
In a regular expression without parentheses, * has highest precednece and + has lowest precedence.
T
36
The regular expression L((a+b)*) = L((a*+b*)).
F
37
DFAs, NFAs , and regular expressions all have equal power for defining languages.
T
38
Every regular language has a unique minimum-state NFA.
F
39
The squaring extension adds the ability to define new languages
F
40
What does NFA stand for?
Non-deterministic Finite Automata
41
In (q,x) an instantaneous description of an NFA, what are q and x?
q= current state, x=unread part of string.
42
The regular expression for an infinite, regular language must contain what operation?
*
43
What is the language for the regular expression: b*a?
[b*a}
44
What does the Unix tool egrep do?
egrept searches a file for lines that contain a sub-string matching a specified pattern.
45
What does the "." symbol do when used as input to the Unix tool egrp?
Matches any symbol (except the end-of-line marker).
46
What method is often used to define the token of a language when designing a compiler?
Write a collection of regexps.
47
Give the formal definition of a NFA.
A non-deterministic finite automaton M (Q, Σ,δ,q0, F) where: Q is the finite set of states. Σ is the alphabet. δ∈(Qx(Σ∪{ɛ})→P(Q)) is the transition function. q0∈Q is the start state. F⊆Q is the set of accepting states.
48
When doing derivation, there can be more than one place in a string where a rule can be applied.
T
49
When two sets are disjoint, they have no common elements.
T
50
The language {a^n b^n| is a regular language.
F
51
The pumping lemma is very useful for proving that languages are regular.
F
52
All infinite languages are regular.
F
53
Every context free language is regular.
F
54
Every regular language is a context free language.
T
55
In BNFs, the terminal symbols are called tokens.
T
56
Grammars and regular expressions are language generators.
T
57
The results of parsing a program is a tree.
T
58
EBNF allows defining language constructs that cannot be defined in BNF.
F
59
A regular expression for an infinite language must have a Kleene closure or a positive closure.
T
60
What is the term for the rules in a grammar that define how to modify strings by substitution?
Production
61
What is a non-terminal alphabet.
It contains the symbols that do not occur in the string that is finally derived.
62
What is the term for a sequence of strings created using a grammar where each string in the sequence is separated by =>?
Derivation.
63
If each rule of a grammar has a single non-terminal on its left-hand side and a string containing at most one non-terminal on the right-hand, what kind of grammar is it?
right-linear grammar.
64
What two kinds of grammars make up the regular grammars?
Right and left linear grammar.
65
What kind of language is generated by a regular grammars?
Regular languages.
66
What mathematical tryth is often used to prove languages non-regular?
Pumping lemma.
67
What is a ' pumpable' substring?
A substring that can be repeated multiple times and still produce a string accepted by the language.
68
If each rule of a grammar has a single nonterminal on its right-hand side, what kind of grammar is it?
Context free.
69
How are nonterminal symbols written in BNF?
With words surrounded by angle-brackets.
70
Give the formal definition of a grammar.
A grammar G is a 4-tuple G=(V,Σ,S,P) where: V is an alphabet, the nonterminal alphabet. Σ is another alphabet, the terminal alphabet, disjoint from V. S∈V is the start symbol. P is a finite set of productions, each of the form x→y, where x and y are strings over Σ∪V and x≠ɛ.
71
The set of languages that can be defined using a stack machine is the same as the set of languages that can be defined using aDFA, which is the regular languages.
F
72
The size of the stack in a stack machine is limited to the cardinality of the stack alphabet.
F
73
Stack machines make state transitions.
F
74
When a stack machine starts, its stack contains just a special symbol, S.
T
75
Stack machine are only nondeterministic.
F
76
The transition function of a stack machine δ takes only one parameter.
F
77
A stack machine can have a transition for the case when the state is empty.
F
78
There is an equivalent stack machine for any finite atupmation.
T
79
If M is a stack machine, L(M) is a CFG.
T
80
If L is a CFG, there exists a stack machine that recognizes L.
T
81
The intersection a CFL with a regular language is a CFL.
T
82
The pumping lemma is useful for proving that languages are context free.
F
83
PDAs can be illustrated with state-transition diagrams.
F
84
A PDA can be designed to accept a string by emptying its stack, by ending in an accept state, or by both.
T
85
The DCFLs have the same closure properties as CFLs.
F
86
The union of any two DCFLs is a DCFL.
T
87
What is the operation that adds data to a stack?
Push
88
How does a stack machine indicate that it has accepted the input string?
By leaving its stack empty.
89
For an instantaneous description for a stack, (x,y), what are the x and y?
x= unused input; y= stack contents.
90
What are some of the operations under which the CFLs are closed?
Union, Concatenation, and Kleene Star.
91
Fow what operations are the CFLs not closed?
Complement and intersection.
92
What does PDA stand for?
Push-down Automata.
93
What is a deterministic context-free language?
A language L(M) for some DPDA M.
94
What is the formal definition of a stack machine?
A stack machine M is a 4-tuple M=(Γ,Σ,S,δ) where: Γ is the stack alphabet. Σ is the input alphabet. S∈Γ is the intial stack symbol δ∈((Σ∪{ɛ})xΓ→P(Γ*)) is the transition function