0% found this document useful (0 votes)
26 views

Sem QB

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Sem QB

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

S.A. ENGINEERING COLLEGE, CHENNAI-77.

(An Autonomous Institution, Affiliated to Anna University)


DEPARTMENT OF CSE (ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING)
QUESTIONBANK
Academic Year :2024-2025(ODD)
Year/ Sem : III/V
Subject Code : AM1502A
Subject Name : AUTOMATA AND COMPILER
Common to : AIML
UNIT-I
FINITE AUTOMATA
Introduction: Basic Mathematical Notation and techniques - Finite State Systems - Basic Definitions,
Finite Automaton: DFA – NDFA – with ε-moves, Regular Languages: Regular Expression Equivalence
of NFA and DFA – Equivalence of finite Automaton and regular expressions – Minimization of DFA –
pumping lemma.
PART-A
Q. Questions CO BT Competence
No
1. State the principal of Mathematical Induction. CO1 BTL-1 Remember
2. Compare and Contrast NFA and DFA CO1 BTL-1 Remember
3. State: Pumping lemma for regular languages CO1 BTL-1 Remember
4. Construct Finite Automata for the regular expression: CO1 BTL-2 Understand
(a|b)*abb
5. Define Deterministic Finite Automatan. CO1 BTL-1 Remember
6. Construct a finite automata for the language {0n | n mod 3 = 2, CO1 BTL-1 Remember
n ≥ 0}
7. Construct a DFA for the language over {0, 1}* such that it CO1 BTL-2 Understand
contains "000" as a substring.
8. Construct a DFA for the regular expression aa*bb*. CO1 BTL-2 Understand
9. CO1 BTL-4 Analyze
Tabulate the regular expression for the following L1=set of
strings 0 and 1 ending in 00
10. Illustrate deductive proof CO1 BTL-3 Apply
PART- B & C
1. i) Determine DFA from agiven NFA:
M= ({q0, q1}, {0,1}, δ, q0, {q1} where δ is given by BTL-2 Understand
CO1
δ(q0,0)={q0,q1}, δ(q0,1)={q1}, δ(q1,0)=φ, δ(q1,1)={q0,q1} (8)

ii) State and Prove the theorem of Mathematical Induction (5) BTL-3 Apply
2. i) State and Prove any two closure properties of Regular
Languages. (5) CO1 BTL-4 Analyze

ii) Find a minimum State Deterministic Finite Automata


recognizing the language corresponding to the regular
expression (0*10 + 1 * 0) (01 )* (8)
BTL-3 Apply
3. i) Outline the steps in converting non deterministic finite CO1 BTL-3 Apply
automaton to deterministic finite automaton. (5)
ii) Find the regular expression corresponding to the finite
automata given below. (8) BTL-4 Analyze

4.
Construct the DFA for the given NFA. (13)
States/Input
CO1 BTL-2 Understand
0 1
 q0 {q0,q1} {q2}
q1 {q0} {q1}
*q2 ɸ {q0,q1}

5. i) Explain the theorem for Pumping Lemma for regular BTL-3 Apply
language (7)
CO1
n m m+n
ii)Prove that the language L={0 1 2 /n>=1, m>=1} is BTL-3 Apply
not regular. (6)

UNIT-II
GRAMMARS
Grammar Introduction: Types of Grammar, Context Free Grammars and Languages, Derivations,
Simplification of CFG: Elimination of Useless Symbols Simplification of CFG: Unit productions, Null
productions, Chomsky normal form, Greibach Normal form – Pushdown Automata-phases of a compiler
– lexical analysis
PART-A
1. Write a Context Free Grammar for the language consisting of CO2 BTL-4 Analyze
equal number of a’s and b’s
2. Write CFG to accept the language defined by, L={aibjck|i,j,k>=0 CO2 BTL-4 Analyze
and i=j+k}
3. When do you say a CFG is ambiguous? CO2 BTL-1 Remember
4. What are the two normal forms of CFG? Write their CO2 BTL-2 Understand
production format.
5. State Chomsky normal form theorem. CO2 BTL-1 Remember
6. What is ambiguous grammar? Give example CO2 BTL-1 Remember
7. Define PDA CO2 BTL-1 Remember
8. What do you mean by null production and unit production? CO2 BTL-1 Remember
Give an example
9. Does a pushdown automata has memory? Justify CO2 BTL-3 Apply
10. Derive a string ‘aababa’ for the following Context Free CO2 BTL-3 Apply
Grammar
SaSX/b;
XXb/a
11. Give the steps to eliminate useless symbol. CO2 BTL-3 Apply
12. What is the role of lexical analysis phase? CO2 BTL-1 Remember
PART -B &C
1. Solve the following grammar CO2 BTL-5 Evaluate
SaAa | bBb | BB
AC
BS|A
CS | ε for the string abaaba. Give
i)Left most derivation (3)
ii)Right most derivation (3)
iii)Derivation Tree (3)
iv)For the string abaabbba, find the right most derivation (4)
2. Explain simplification of CFG with example. (13) CO2 BTL-3 Apply

3. i) Construct the following grammar to Chomsky Normal BTL-5 Evaluate


Form(5)
SA|AB0|A1A
AA0|ε CO2
BB1|BC
CCB|CA|1B

ii) State and prove Greibach Normal form (8) BTL-3 Apply
4. i) Construct PDA for the language{WCWR/WЄ{0,1}} (5) CO2 BTL-3 Apply
ii) Discuss the role of lexical analyzer in detail with necessary BTL-3 Apply
example (8)
5. i) Express a PDA for the language anbman+m (6) CO2 BTL-2 Understand

ii) Construct PDA for the language L={anbn | n>=0} BTL-3 Apply
6. Express the following grammar G into Greibach Normal CO2 BTL-1 Remember
Form(GNF) (13)
SXA | BB
Bb | SB
Xb
Aa
7. Explain the phases of compiler with neat diagram (13) CO2 BTL-2 Understand
UNIT-III

LEXICAL AND SYNTAX ANALYSIS


Need and Role of the Parser –Top-Down parsing: Recursive Descent Parsing – Predictive Parsing -
Bottom- up parsing: Shift Reduce Parsing, Operator Precedence Parsing, LR Parsers: Canonical LR
Parser – LALR Parser - Error Handling and Recovery.
PART-A
1. What is a Parse Tree? Give Example. CO3 BTL-1 Remember
2. List out the steps for performing LL Parsing CO3 BTL-3 Apply
3. Construct a Parse tree for –(id +id) CO3 BTL-3 Apply
4. Compare Syntax tree and Parse tree. CO3 BTL-3 Apply
5. Define LR(0) item. CO3 BTL-1 Remember
6. What are the different stages that a parser can recover from a CO3 BTL-1 Remember
syntactic error?
7. State some compiler construction tool. CO3 BTL-1 Remember
8. Write a short note on Error Handler? CO3 BTL-1 Remember
9. Compare syntax tree and parse tree CO3 BTL-2 Understand
10. Write the configuration of an LR parser? CO3 BTL-1 Remember
11. Define LALR Parser. BTL-1 Remember
PART-B &C
1. i) Differentiate Top Down Parser and Bottom Up Parser? Give CO3 BTL-1 Remember
Example for each. (7)
ii) Explain Error Recovery in Predictive Parsing. (6) BTL-5 Evaluate
2. Explain LR parsing algorithm with an example. (13) CO3 BTL-5 Evaluate
3. Construct Parsing table for the grammar and find moves made CO3 BTL-4 Analyze
by predictive parser on input id + id * id and find FIRST and
FOLLOW (13)
E -> E + T
E -> T
T -> T * F
T -> F
F -> (E)
F-> id
4. Show that the following grammar (13) CO3 BTL-4 Analyze
SAa | bAc | Bc |bBa
Ad
Bd
Is LR(1) but not LALR(1)
5. Explain Operator precedence parsing technique in detail. (13) CO3 BTL-2 Understand
UNIT-IV
CODE GENERATION AND TURING MACHINES
Intermediate Code Generation: Syntax Directed Definitions, Syntax Directed Translation Schemes –
Three address code - Translation of Expressions- Code Generation: Issues in Design of a Code
Generator, A Simple Code Generator Algorithm. Turing Machines: Introduction - Instantaneous
descriptions, Turing Machine as Acceptors - Turing Machine for computing functions (Transducer) -
Turing Machine Constructions
PART-A
1. Define three address code CO4 BTL-1 Remember
2. Write three address code sequence for the assignment CO4 BTL-2 Understand
statement
d:= (a-b)+(a-c)+(a-c)
3. Define type checking and mention the rules for type checking. CO4 BTL-1 Remember
4. List three kinds of intermediate representation. CO4 BTL-3 Apply
5. State the problem in code generation. CO4 BTL-3 Apply
6. Define the language recognized by any Turing Machine CO4 BTL-1 Remember
7. What is a Turing Machine? Write the application of Turing CO4 BTL-1 Remember
Machine
8. Explain Syntax Directed Definition. CO4 BTL-1 Remember
9. What are the required fields of an instantaneous description of CO4 BTL-2 Understand
a Turing Machine
10. Define Multi tape Turing Machine CO4 BTL-1 Remember
PART- B&C
1. i) Discuss the issues in code generation with examples. (7) CO4 BTL-2 Understand
ii) Describe in detail about
a) Quadruples
b) Triples (6) BTL-1 Remember
2. Write a simple code generator algorithm. With an example CO4 BTL-3 Apply
code, show how the algorithm generates code.
3. Design a Turing machine to recognize the language {0n1n0n | CO4 BTL-4 Analyze
n>=1} (13)
4. Construct a Turing Machine for the language (13) CO4 BTL-4 Analyze
{WW |WЄ{0,1}}

5. Discuss the following in detail about the syntax directed CO4 BTL-2 Understand
Definitions.
i)Inherited attributes and synthesized attributes (7)
ii) Evaluate SDD of a parse tree (6)
UNIT-V
UNDECIDABILITY
Undecidability: Basic definitions – Decidable Problems – Examples of undecidable problems – Semi-
decidability – Rice’s Theorem, problems about Turing Machine – Post’s Correspondence Problem –
Properties of Recursive and Recursively enumerable languages.
PART-A
1. State Post’s Correspondence Problem CO5 BTL-1 Remember
2. What are recursive languages? CO5 BTL-2 Understand
3. Define NP-class CO5 BTL-1 Remember
4. State when a problem is said to be decidable and give an CO5 BTL-1 Remember
example of an undecidable problem.
5. What do you mean by Universal Turing Machine? CO5 BTL-1 Remember
6. Describe an example of Undecidable problem CO5 BTL-1 Remember
7. Illustrate about time and space complexity of TM CO5
8. Describe Post Correspondence Problem CO5 BTL-2 Understand
9. When is a language said to be recursively enumerable? CO5 BTL-3 Apply
10. Point out the properties of Recursive and Recursively CO5 BTL-4 Analyze
enumerable languages
PART-B & C
1. With proper examples, explain P and NP complete problems CO5 BTL-2 Understand
(13)

2. i) Describe about tractable and intractable problems (8)


ii) Highlight the features of Universal Turing Machine (5) CO5 BTL-1 Remember
3. What is Post’s Correspondence Problem (PCP)? Explain with CO5
the help of an example. (13) BTL-1 Remember

4. Show that the Halting Problem is undecidable. (13) CO5 BTL-3 Apply
5. Prove that Universal language is recursively enumerable but not CO5 BTL-3 Apply
recursive (13)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy