AI3, FIN

Don't use plagiarized sources. Get Your Custom Essay on
AI3, FIN
Just from $13/Page
Order Essay

1

UU – COM-402

2

Artificial Intelligence

and Compiler Design

Summative Assessment

3

Overview of Compilation, Code Generation and Optimization & Previous Topics

Introduction

Summative Assessment 3 will test your knowledge on the aspects of compiler design as well as

other topics that have been covered throughout the module. In addition, you will be tested on your

ability to apply concepts from these topics with practical lab exercises.

 Summative Assessment 3 (Final Assignment) is worth 40% of the final module

grade and is due at the end of Week 7 by 11.59 p.m. (23.59 hours) VLE (UTC).

 Please submit your work using the “Summative assessment 3 submission link” on the

module’s VLE page

Assessment guidelines

Summative Assessment 3 will marked out of 100 points consist of three parts:

 Part 1: Multiple Choice Questions (MCQ’s)

[20 points]

o 20 multiple choice questions, each question is worth 1 point

o A single choice is required for each question

 Part 2: Logical questions [20 points]

o 2 questions, each question is worth 10 points

 Part 3: Short answers [20 points]

o 5 questions, each question is worth 4 points

o Answers must be short but must cover the topic with an appropriate level of depth

o The maximum word length must be between 150-200 words

o Where necessary references should be included using the required referencing style

(APA)

 Part 3: Lab Tasks [40 points]

o Multiple practical exercises that require knowledge acquired from all the Topic

Overviews and the associated Practical Lab Exercises

o You will need to provide screenshots and/or program code of the exercises as proof

of completion

2

UU – COM-4022

Artificial Intelligence
and Compiler Design

Assessment criteria

Please refer back to the assessment guidelines for the explicit breakdown of marks (points) for

summative assessment 3.

The overall marking of the overall assessment for all sections will be based on the following

criteria:

 The ability to demonstrate an understanding of the chosen topic(s)

 The ability to synthesize ideas, develop strong arguments, summarize key ideas and draw

effective conclusions.

 The ability to follow the requirements

 The ability to effectively support ideas using relevant references.

 The ability to demonstrate an adherence to good grammar, spelling and logical structure

3

UU – COM-4022
Artificial Intelligence
and Compiler Design

Part 1: MCQ’s (20 points)

1. What is a compiler?

a. System program that converts instructions to machine language

b. System program that converts machine language to high-level language

c. System program that writes instructions to perform

d. None of the mentioned

2. Which of the following is a stage of compiler design?

a. Semantic analysis

b. Intermediate code generator

c. Code generator

d. All of the mentioned

3. What is the use of a symbol table in compiler design?

a. Finding name’s scope

b. Type checking

c. Keeping all of the names of all entities in one place

d. All of the mentioned

4. Which of the following error can a compiler check?

a. Syntax Error

b. Logical Error

c. Both Logical and Syntax Error

d. Compiler cannot check errors

4

UU – COM-4022
Artificial Intelligence
and Compiler Design

5. A programmer, writes a program to multiply two numbers instead of dividing them

by mistake, how can this error be detected?

a. Compiler or interpreter

b. Compiler only

c. Interpreter only

d. None of the mentioned

6. Users write the programs in which language?

a. Low-level Language

b. High-Level Language

c. Decimal-Format d. Middle-Level Language

7. Which computer program accepts the high-level language and converts it into

assembly language?

a. Interpreter

b. Linker

c. Assembler

d. Compiler

8. Does the compiler program translate the whole source code in one step?

a. No

b. Depends on the Compiler

c. Don’t Know

d. Yes

5

UU – COM-4022
Artificial Intelligence
and Compiler Design

9. Which of the following file is an output of the assembler?

a. Program file

b. Object file

c. Data File

d. Task File

10. Which tool is used for grouping of characters in tokens in the compiler?

a. Parser

b. Code optimizer

c. Code generator

d. Scanner

11. What is the linker?

a. It is always used before the program execution.

b. It is required to create the load module.

c. It is the same as the loader

d. None of the above

12. Parsing is categorized into how many types?

a. Three types

b. Four types

c. Two types

d. Five types

6

UU – COM-4022
Artificial Intelligence
and Compiler Design

13. In which parsing, the parser constructs the parse tree from the start symbol and

transforms it into the input symbol.

a. Bottom-up parsing

b. Top-down parsing

c. None of the above

d. Both a and b

14. What is the action of parsing the source program into proper syntactic classes known

as?

a. Interpretation Analysis

b. General syntax analysis

c. Syntax analysis

d. Lexical analysis

15. What does a bottom-up parser generate?

a. Rightmost derivation in reverse

b. Rightmost derivation in reverse

c. Leftmost derivation in reverse

d. Leftmost derivation

16. What is the bottom-up parsing method also known as?

a. Predictive parsing

b. Shift reduce parsing

c. Recursive descent parsing

d. None

7

UU – COM-4022
Artificial Intelligence
and Compiler Design

17. The output of the lexical analyzer is _______

a. String character

b. A syntax tree

c. A set of RE

d. A set of tokens

18. From the following grammars, which describes the lexical syntax?

a. Lexical Grammar

b. Context-free Grammar

c. Syntactic Grammar

d. Regular Grammar

19. Which of the following is a system program that integrates a program’s individually

compiled modules into a form that can be executed?

a. Interpreter

b. Assembler

c. Compiler

d. Linking Loader

20. Which of the following is a part of a compiler that takes as input a stream of

characters and produces as output a stream of words along with their associated

syntactic categories?

a. Optimizer

b. Scanner

c. Parser

d. None of the mentioned

8

UU – COM-4022
Artificial Intelligence
and Compiler Design

Part 2: Logical questions (20 points)

1. Fill in the values of the four evaluation criteria for each search strategy shown.

o Assume a tree search where b is the finite branching factor;

o d is the depth to the shallowest goal node;

o m is the maximum depth of the search tree;

o l is the depth limit;

o step costs are identical and equal to some positive ε;

o in bidirectional search both directions use breadth-first search.

9

UU – COM-4022
Artificial Intelligence
and Compiler Design

2. For each of the following terms on the left, write in the letter corresponding to the

best answer or the correct definition on the right.

* The first one is done for you as an example.

10

UU – COM-4022
Artificial Intelligence
and Compiler Design

Part 3: Short Answers (20 points)

1. What are the Probabilistic methods (Bayesian) and Certainty Factors (CF)?

2. What is Implementation of Block Structured Language in compiler design?

3. What is Input Buffering in Compiler Design?

4. What is Non-Immediate Left Recursion in compiler design?

5. Describe in your own words Token, Patterns, and Lexemes?

11

UU – COM-4022
Artificial Intelligence
and Compiler Design

Part 4: Lab Tasks (40 points)
1. Write a C program to identify whether a given line is a comment or not.

Hints:

RESOURCE: Turbo C++

PROGRAM LOGIC:

Read the input string.

Check whether the string is starting with ‘/’ and check next character is ‘/’ or’*’.

If condition satisfies print comment.

Else not a comment.

PROCEDURE: Go to debug -> run or press CTRL + F9 to run the program.

INPUT & OUTPUT:

Input:

Enter comment: //hello

Output: It is a comment

Input: Enter comment: hello

Output: It is not a comment

2. Write a C program to recognize strings under ‘a*’, ‘a*b+’, ‘abb’

Hints:

RESOURCE: Turbo C++ 3.3

PROGRAM LOGIC:

By using transition diagram we verify input of the state.

If the state recognize the given pattern rule.

Then print string is accepted under a*/ a*b+/ abb.

12

UU – COM-4022
Artificial Intelligence
and Compiler Design

Else print string not accepted.

PROCEDURE: Go to debug -> run or press CTRL + F9 to run the program.

INPUT & OUTPUT:

Input : Enter a String: aaaabbbbb

Output: aaaabbbbb is accepted under rule ‘a*b+’

Enter a string: cdgs

cdgs is not recognized

3. Write a C program to test whether a given identifier is valid or not.

Hints: RESOURCE: Turbo C++

PROGRAM LOGIC: Read the given input string.

Check the initial character of the string is numerical or any special character except ‘_’

then print it is not a valid identifier.

Otherwise print it as valid identifier if remaining characters of string doesn’t contains any

special characters except ‘_’.

PROCEDURE: Go to debug -> run or press CTRL + F9 to run the program.
INPUT & OUTPUT:

Input: Enter an identifier: first

Output: Valid identifier

Enter an identifier:1aqw

Not a valid identifier

13

UU – COM-4022
Artificial Intelligence
and Compiler Design

4. Write a C program to simulate lexical analyzer for validating operators.

Hints:

RESOURCE: Turbo C++
PROGRAM LOGIC:

Read the given input.

If the given input matches with any operator symbol.

Then display in terms of words of the particular symbol.

Else print not a operator.

PROCEDURE: Go to debug -> run or press CTRL + F9 to run the program.
INPUT & OUTPUT:

Input Enter any operator: *

Output Multiplication

NOTE – You will need to provide screenshots and/or program code of the exercises as proof of

completion of the exercises above

Achiever Essays
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Live Chat+1(978) 822-0999EmailWhatsApp

Order your essay today and save 20% with the discount code RESEARCH