Вы находитесь на странице: 1из 4

UNIT IV

PROPERTIES OF CONTEXT FREE LANGUAGES

PART A
1. State the CNF theorem.
A CNF theorem state that if CFG is in CNF where all the production are as follows
A->BC
A->a
2. Define - pumping lemma of CFL
Pumping lemma of CFL is defined as
Let L be any CFL. Then there exist a constant n , depending on L, Such that if z is in L
and │z│≥ n, then z = uvwxy such that
i) │vx│≥1,
ii) │vwx│≤ n
iii)For all I ≥ 0 u vi w xi y is in.
3. List the closure properties of CFL.
closure properties of CFL are:
 Closure under union
 Closure under concatenation
 Closure under closure
 Closure under intersection
 Closure under difference and complement
 Closure under homomorphism
4. What you mean by null production and unit production? Give example.
A null production means If the grammar is having the production A->€, then A is said to
be null production.
A unit production is production of the form A->B .it is used to create unambiguous
grammar.
5. Give the steps to eliminate the useless symbol.
Steps to eliminate the useless symbols are:
S -> AB/a
A -> BC/b
B -> aB/C
C -> aC/B
Solution:Useful Symbols: {a, b, S, A}
And any combination of useful symbols will also make LHS a useful symbol.
So we could see that Symbol B and C are useless symbol, remove them
(Whole production in which it contains):
S -> a
A -> b
But because A is not reachable so we will remove A -> b as well:
S -> a
6. What are the two Normal Form?
Two Normal Forms are:
 CNF-Chomsky Normal Form
 GNF-Greibach Normal Form
7. What is halting problem.
The halting problem of the turning machine recognizes the language ‘L’, then it halts and there
is no next move whenever the input is accepted.
 If the input string is not accepted, then the turning machine never halts.
 So the Turning machines halts whenever it reaches an accepting state.
8. List out the different techniques for turning machine construction.
Turning machine construction techniques are:
 Storage finite control
 Multiple tracks
 Subroutines
 Checking off symbols
9. Define – TM [M/J 16]
Turning machine is defined as a tool for studying the computability of mathematical functions.
M=(Q,∑,┌, ᵟ,q0,B,F)
┌->set of tape symbols
B->blank symbol
10. What are the applications of TM?
An applications of turning machines are:
 Algorithmic information theory and complexity studies,
 Software testing,
 High performance computing,
 Machine learning,
 Software engineering,
 Computer networks and evolutionary computations

11. Define - multi tape TM


Multi-tape turning machine is defined as have multiple tapes where each tape is
accessed with a separate head. Each head can move independently of the other heads.
Initially the input is on tape 1 and others are blank.

12. Equivalence of PDA and CFG


A language is generated by a CFG,
 if and only if it is accepted by a PDA by empty stack
 if and only if it is accepted by a PDA by final state.
13. What are the required fields of an ID or configuration of a TM?
Rrequired fields of an ID are:
 The state of the TM.
 The contents of the tape.
 The position of the tape head on the tape.
14. Is halting problem decidable or undecidable problem
The machine starting at given configuration will halt after finite number of steps or will never
reach to a halt state. For a given configuration and input tape we can't determine whether the
machine will ever halt. This problem is called halting problem. The halting problem is unsolvable.
Hence it is undecidable problem.
15. List out different types of Turning Machine.
Types of Turning Machine are:
 Multi tape Turing machine,
 off-line Turing Machine,
 Multi track Turing machine
 Universal TM .
16. Define -two way infinite tape TM
Two way infinite tape TM is defined as it can move indefinitely in either direction. This
can be shown to be equivalent to a one way infinite tape TM by the following argument: It is clear
that two one-way infinite tape TMs can be used to simulate a two-way infinite tape.
17. Conclude CFG without null production.
S->a/Ab/aBa
A->b/ᵋ
B->b/B
Solution:
Wherever A (NON Terminal) comes apply ᵋ.
S->a/ Ab/aBa/ᵋb
S->a/ Ab/aBa/b
A->b
B->b/B
18. List down the process of converting grammar into CNF.
There are three steps to convert the grammar into CNF.
 Eliminate useless symbols
 Eliminate ᵋ production
 Eliminate Unit production
19. Define generating and Reachable symbol.
Generating symbol is defined as a symbol X in the grammar is generating if X=w for some
terminal string ‘w’. Every terminal is always generating since it derives itself in zero steps.
Reachable symbol is defined as a the symbol X is reachable if there is a derivation of the form
S=>αXβ for some α and β in V or T of the grammar G.
20. Give the configuration of turning machine? [N/D17]
A Turing machine configuration is an ordered triple (x, q, k) ∈ Σ∗ × K × N, where x
denotes the string on the tape, q denotes the machine's current state, and k denotes the
position of the machine on the tape. ... The machine starts in a valid starting configuration,
meaning that q0 = s and k0 = 0.
21. What are the difference between finite automata and turning machine? [M/J 16]
A finite state machine is just a set of states and transitions. The only memory it has is
what state it is in. Thus, the number of memory states is... finite.
A Turing machine is a finite state machine plus a tape memory. Each transition may be
accompanied by an operation on the tape (move, read, write). Its total possible configurations are
arbitrarily large, regardless of the size of the program; it expands towards infinity.

A FSM can recognize only regular expressions. . A Turing machine can recognize all
recursively enumerable languages.

22. Show that the CFL is closed under substitution. [N/D 14]

To prove reversal, Let L be a CFL, with grammar G= (V,T,P,S). Let LR be the reverse of L,

such that the Grammar is GR = (V,T,PR,S). That is, reverse every production.

Ex. P -> AB would become P -> BA

Since GR is a CFG, therefore L(GR) is a CFL.

Вам также может понравиться