R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA.

Similar documents
St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

6. Discuss how producer-consumer problem and Dining philosophers problem are solved using concurrency in ADA. [16]

INSTITUTE OF AERONAUTICAL ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Programming Languages, Summary CSC419; Odelia Schwartz

Programming Languages Third Edition. Chapter 7 Basic Semantics

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram

G COURSE PLAN ASSISTANT PROFESSOR Regulation: R13 FACULTY DETAILS: Department::

S.No Question Blooms Level Course Outcome UNIT I. Programming Language Syntax and semantics

CMSC 331 Final Exam Section 0201 December 18, 2000

Informal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility

MIDTERM EXAMINATION - CS130 - Spring 2003

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI

CS 415 Midterm Exam Spring 2002

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Semester Review CSC 301

Question Marks 1 /11 2 /4 3 /13 4 /5 5 /11 6 /14 7 /32 8 /6 9 /11 10 /10 Total /117

SE352b: Roadmap. SE352b Software Engineering Design Tools. W3: Programming Paradigms

Test 1 Summer 2014 Multiple Choice. Write your answer to the LEFT of each problem. 5 points each 1. Preprocessor macros are associated with: A. C B.

CPS 506 Comparative Programming Languages. Syntax Specification

MIDTERM EXAM (Solutions)

Question Bank. 10CS63:Compiler Design

Chapter 5. Names, Bindings, and Scopes

NOTE: Answer ANY FOUR of the following 6 sections:

Imperative Programming

Section A. A grammar that produces more than one parse tree for some sentences is said to be ambiguous.

Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov Compiler Design (170701)

Introduction. A. Bellaachia Page: 1

Contents. Chapter 1 SPECIFYING SYNTAX 1

COURSE DESCRIPTION FORM. Level Credits Periods/ Week Prerequisites

Principles of Programming Languages [PLP-2015] Detailed Syllabus

G Programming Languages - Fall 2012

Attributes, Bindings, and Semantic Functions Declarations, Blocks, Scope, and the Symbol Table Name Resolution and Overloading Allocation, Lifetimes,

Chapter 5 Names, Binding, Type Checking and Scopes

LOGIC AND DISCRETE MATHEMATICS

VIVA QUESTIONS WITH ANSWERS

CS 3360 Design and Implementation of Programming Languages. Exam 1

G Programming Languages - Fall 2012

11. a b c d e. 12. a b c d e. 13. a b c d e. 14. a b c d e. 15. a b c d e

The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program.

Chapter 3: Describing Syntax and Semantics. Introduction Formal methods of describing syntax (BNF)

CMSC 331 Final Exam Section 0201 December 18, 2000

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

CSE3322 Programming Languages and Implementation

Lecture 7: Type Systems and Symbol Tables. CS 540 George Mason University

Concepts of Programming Languages

Compilers. Type checking. Yannis Smaragdakis, U. Athens (original slides by Sam

CS5363 Final Review. cs5363 1

CSC 533: Organization of Programming Languages. Spring 2005

Programming Languages (PL)

Compiler Theory. (Semantic Analysis and Run-Time Environments)

R10 SET a) Explain the Architecture of 8085 Microprocessor? b) Explain instruction set Architecture Design?

Concepts of Programming Languages

JVM ByteCode Interpreter

SEMANTIC ANALYSIS TYPES AND DECLARATIONS

Chapter 5 Names, Bindings, Type Checking, and Scopes

Chapter 3. Describing Syntax and Semantics

The results for a few specific cases below are indicated. allequal ([1,1,1,1]) should return true allequal ([1,1,2,1]) should return false

COMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking

Static Semantics. Winter /3/ Hal Perkins & UW CSE I-1

Programmiersprachen (Programming Languages)

Time : 1 Hour Max Marks : 30

Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer.

Chapter 3. Syntax - the form or structure of the expressions, statements, and program units

Introduction to Programming Using Java (98-388)

Department of Computer Science & Engineering Question Bank

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS

Type Bindings. Static Type Binding

PL Revision overview

9/7/17. Outline. Name, Scope and Binding. Names. Introduction. Names (continued) Names (continued) In Text: Chapter 5

Programming Languages

Semantic Analysis. Compiler Architecture

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End

Principles of Programming Languages. Lecture Outline

G Programming Languages Spring 2010 Lecture 4. Robert Grimm, New York University

9/21/17. Outline. Expression Evaluation and Control Flow. Arithmetic Expressions. Operators. Operators. Notation & Placement

CS 3360 Design and Implementation of Programming Languages. Exam 1

Answer: Early binding generally leads to greater efficiency (compilation approach) Late binding general leads to greater flexibility

The role of semantic analysis in a compiler

CS 415 Midterm Exam Fall 2003

Chapter 3. Describing Syntax and Semantics ISBN

Lecture 4 Memory Management

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current

Type Inference Systems. Type Judgments. Deriving a Type Judgment. Deriving a Judgment. Hypothetical Type Judgments CS412/CS413

Types. What is a type?

Midterm 2 Solutions Many acceptable answers; one was the following: (defparameter g1

Computer Science Department Carlos III University of Madrid Leganés (Spain) David Griol Barres

6. Names, Scopes, and Bindings

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / EVEN SEMESTER

CPS 506 Comparative Programming Languages. Programming Language Paradigm

Chapter 4. Lexical and Syntax Analysis. Topics. Compilation. Language Implementation. Issues in Lexical and Syntax Analysis.

Programming Language Syntax and Analysis

Question Marks 1 /12 2 /6 3 /14 4 /8 5 /5 6 /16 7 /34 8 /25 Total /120

Chapter 9. Subprograms

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

VALLIAMMAI ENGINEERING COLLEGE

Transcription:

R13 SET - 1 III B. Tech I Semester Regular Examinations, November - 2015 1 a) What constitutes a programming environment? [3M] b) What mixed-mode assignments are allowed in C and Java? [4M] c) What is an alias? What are the problems associated with it? [4M] d) What is attribute grammar? Explain how attribute grammar is use for [4M] evaluation of the expressions. e) What is type inferencing used in ML? [3M] f) What is the difference between checked and unchecked exception in java? [4M] 2 a) What is the difference between a sentence and a sentential form in a CFG? [4M] b) Explain with an example how the weakest precondition for a logical pretest loop is derived. c) A concise and understandable description of a programming language is essential to the language s success. Comment on this. [4M] 3 a) What are the merits of sub range types? [3M] b) Explain in detail various design issues of character string types. c) What is a variable and what are the attributes of a variable? Elaborate on address of a variable. [5M] 4 a) Discuss the following term: [10M] i) Dangling pointers, ii) Tail recursion elimination. b) Explain associative arrays, their structure and operations. [6M] 5 a) What is the difference between the way original C and C89 deal with an actual parameter whose type is not identical to that of the corresponding formal parameter? b) Discuss in detail overloaded operators. 6 Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA. [16M] 7 a) For what sort of application logic programming is useful? Briefly explain. b) What are existential queries? Briefly explain. '' ''' '' ' ''''

R13 SET - 2 III B. Tech I Semester Regular Examinations, November - 2015 1 a) What do you mean by a general purpose language? Is C a general purpose language? [3M] b) Give an example of left recursive rule in CFG. What is the significance of left [4M] recursive rule? c) What do you mean by binding? Give examples of some of the bindings and their [4M] binding times. d) Consider the following C program: [4M] int fun(int _ i) { *i+=5; return 4; } void main { int x=3; x=x+fun (&x) } What is the value of x after assignment statement in main method assuming i. operands are evaluated left to right? e) What are advantages and disadvantages of dynamic local variables? [3M] f) What is type inferencing used in ML? [4M] 2 a) Explain the process of compilation in each phase of a compiler. b) Give some reasons why computer scientists and professional software developers should study general concepts of language design and evaluation. 3 a) Discuss about Context-free grammar and regular expression? Give the parse tree of a following statement: A = (B+C) * (D / E). b) Consider the following pseudo code. Procedure P (A, B: real) X: real Procedure Q (B, C: real) Y: real... Procedure R (A, C: real) Z: real... (*)... Assuming static scope, what is the referencing environment at location marked by (*)? 1 of 2 '' ''' '' ' ''''

R13 SET - 2 4 a) Explain in detail arrays, indices, subscript bindings, and array categories. b) What are the problems posed by managing a heap of single-size cell and variable-size cell? Explain in detail various methods for reclaiming garbage. 5 a) Discuss precedence and associativity rules of different programming languages. b) Explain in detail multiple selection constructs. 6 a) What are the characteristics of co-routine feature? List the languages which allow coroutines. b) How to implement generic functions in C++? 7 a) Define monitor? Explain how cooperation synchronization and competition synchronization are implemented using monitors. b) Write a prolog description of your family tree (based only on facts), going back to your grandparents and including all descendants. Be sure to include all relationships. 2 of 2 '' ''' '' ' ''''

R13 SET - 3 III B. Tech I Semester Regular Examinations, November - 2015 1 a) Differentiate between Hybrid Interpretation and Pure Interpretation. [3M] b) Write short notes on Short Cut evaluation. [4M] c) What are the design issues for exception handling in JAVA? [3M] d) Differentiate In mode and Out Mode parameter passing mechanisms. [4M] e) With respect to the object oriented programming, briefly explain virtual [3M] functions. f) What are the three features of Haskell that makes very different from schema? [4M] 2 a) What are the main features of the programming paradigm with examples? b) Define CFG? What does it mean for CFG to be ambiguous? 3 a) (i) Explain Dijkstra s selection construction and loop structure. (ii) Explain with examples user-located loop control mechanisms provided by various languages. b) What is meant by type checking? Differentiate between static type checking and dynamic type checking and give their relative advantages. 4 a) Discuss the significance of holes in the records. Why they do and what problem do they cause? b) Explain the difference between virtual and non-virtual methods. 5 a) Describe three alternative means of allocating co-routine stacks. What are their relative strengths and weaknesses? b) What is dangling-else problem? Discuss How it can be handled by the programming language. 6 a) Explain the following terms : Message passing [6M] b) Concurrency in Ada [5M] c) Monitors. [5M] 7 a) For what sort of application logic programming is useful? Briefly explain. b) Write a LISP function fib(n) that computes nth Fibonacci number. '' ''' '' ' ''''

R13 SET - 4 III B. Tech I Semester Regular Examinations, November - 2015 1 a) Briefly write about Virtual Machines. [3M] b) What are the advantages of user-defined data types? [4M] c) How does C support relational and Boolean expressions? [3M] d) Explain with example how operand-evaluation order interacts with functional side [4M] effects. e) Write a short note on this pointer in C++. [3M] f) Explain about LISP interpreter. [4M] 2 Explain language evaluation criteria and the characteristics that affect them. [16M] 3 a) Define syntax and semantics. [5M] b) The levels of acceptance of any language depend on the language description. [5M] Comment on this. c) Define grammars, derivation and a parse tree. [6M] 4 a) What are dangling pointers and lost heap-dynamic variables? How are they created? b) What are the problems posed by managing a heap of single-size cell and variablesize cell? Explain in detail various methods for reclaiming garbage. 5 Discuss about the various attributes of a good language and explain the process of evaluating attributes with example. [16M] 6 a) Write an analysis of the similarities and differences between java packages and C++ namespaces. b) Explain how information hiding in provided in an ADA package. 7 a) Discuss about basic elements of prolog. Give examples. b) Explain how data abstraction is implemented in ADA. '' ''' '' ' ''''

R13 SET - 1 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2016 1 a) Define Left Recursive Grammar Rule. [4M] b) Define Binding and Binding Time. [3M] c) Which languages allow variable number of parameters? [3M] d) What is an overriding method? [4M] e) What data types were parts of original LISP? [4M] f) What are two parts of a compound term? [4M] 2 Using this grammar <assign><id>=<expr> <id>a B C <expr><id>+<expr> <id>*<expr> (<expr>) <id> Show parse tree and Left most derivation for following: (a) A= (A+B)*C (b) A=B*(C*(A+B)) [16M] 3 a) Define name and structure type compatibility. What are relative merits of these two? b) Define Coercion, Typeerror, Typechecking and Strong Typing. 4 a) Explain design issues of functions. [6M] b) Explain about Co-Routines with an example. [10M] 5 a) What is Co-Operation Synchronization? [6M] b) Implement Producer and Consumer problem using Semaphores. [10M] 6 a) Explain about data objects in LISP. [12M] b) Write factorial function using COMMON LISP. [4M] 7 a) Explain Inferencing process of PROLOG. [10M] b) Write differences between procedural and non-procedural languages. [6M]

R13 SET - 2 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2016 1 a) Define Lexeme and Token. [3M] b) Define row major order and column major order in arrays. [3M] c) Write differences between function and procedure. [4M] d) Briefly describe advantage of monitor over semaphores. [4M] e) Write difference between EQ and EQV. [4M] f) What are forms of Horn Clauses? [4M] 2 a) Prove that the following grammar is ambiguous <S> <A> <A><A>+<A> <id> <id>-a b c b) What is primary use of attribute grammar? 3 a) Explain Categories of Arrays. b) Explain Array Operations. 4 Explain different parameter passing methods with an example. [16M] 5 a) Explain Thread class in JAVA and its methods. [10M] b) Explain how concurrency is provided in ML. [6M] 6 a) Explain about Predicate functions in Scheme. b) How functions are defined in Scheme? 7 a) Explain about fact and rule statements in PROLOG b) Explain how backtracking works in PROLOG

R13 SET - 3 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2016 1 a) Draw Parse tree for expression a=b/ (a+c). [3M] b) Define narrowing and widening conversions. [3M] c) What is parameter profile? [4M] d) Write differences between logical and physical concurrency. [4M] e) What does a lambda expression specify? [4M] f) What are three forms of PROLOG Term? [4M] 2 a) Describe purpose of ACTION and GOTO table in an LR Parser with example. [10M] b) Describe differences between Top-Down and Bottom-Up Parsers. [6M] 3 a) What is mixed mode assignment? Explain mixed mode assignments in Ada, [10M] Java and ML. b) Explain structure of an associative array. [6M] 4 a) What is an overloaded subprogram? Explain with an example. b) Explain two methods for implementing blocks. 5 What is exception handling? How exceptions are handled in C++ and JAVA. [16M] 6 a) Explain about list functions in Scheme. b) Explain about primitive functions in Scheme. 7 a) Write deficiencies of PROLOG. [10M] b) Explain generate and test programming strategy in PROLOG. [6M]

R13 SET - 4 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2016 1 a) What is primary task of a Lexical Analyzer? [3M] b) What are design issues of Two-Way Selection Statement? [3M] c) Define scope and Lifetime. [4M] d) Explain wait () and release () methods of semaphores. [4M] e) What are antecedents and consequents? [4M] f) What are two forms of DEFINE? [4M] 2 Perform Pair wise disjointness test for following rules: AaB b cbb BaB ba abb C-aaA b cab [16M] 3 a) Explain advantages and disadvantages of Java for loop compared to Ada for loop. b) Explain about Guarded Command 4 Describe deep access and shallow access methods for implementing dynamic scoping. [16M] 5 a) Explain features of Object-Oriented Programming Languages. [6M] b) Explain how Ada supports concurrency. [10M] 6 Explain how functions are defined in Scheme and ML. [16M] 7 Explain list structures and Goal statements in PROLOG. [16M]

R13 SET - 1 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 a) What are the factors influencing the writability of a language? [4M] b) List the advantages of using control structures in any of the compiled [3M] programming languages. c) Define Shallow and Deep binding for referencing environment of subprograms [4M] that have been passed as parameters. d) Describe briefly about Monitors. [4M] e) Write about Meta Language declaration statements. [4M] f) What is the relationship between resolution and unification in Prolog? [3M] 2 a) Compare and contrast between the special purpose and general purpose [4M] programming languages. b) What is attribute grammar? Give the syntax directed definition for a desktop calculator. c) What are the limitations of recursive descent parser? [4M] 3 a) Explain the conditional statements and its implementation with examples. b) Explain the scope and lifetime of variables. Illustrate when they would coincide and when they don t. 4 a) Define a subprogram.write the semantics of call and return of a subprogram. b) Discuss about nested subprograms with examples. 5 a) How message passing is implemented in Ada? Explain with examples. b) What is an event? How the events are handled in various OOP languages. 6 a) Discuss the fundamental concepts of lambda calculus. b) Explain about LISP functional programming language. 7 a) Discuss about basic elements of Prolog. b) Explain different types of propositions present in logic programming.

R13 SET - 2 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 a) Describe the approach of using axiomatic semantics to convert the correctness [4M] of a given program? b) List the advantages and disadvantages of mixed mode arithmetic expressions. [4M] c) Why is type checking the parameters of a subprogram important? [3M] d) What is the primary problem with semaphores to provide synchronization? [4M] e) Write a short note on ML functions. [4M] f) What are the syntactic form and usage of fact and ruled statements in Prolog? [3M] 2 a) How do you describe the meanings of programs using dynamic semantics? [4M] b) Explain in detail about recursive descent parsing. c) Give an example of left recursive rule in CFG. What is the significance of left Recursive rule? [4M] 3 a) Explain about the following i) associative arrays ii) union types b) State whether static binding is more reliable or dynamic binding. Justify. 4 a) Define a function. What are the design issues for functions? Explain. b) Explain how subprogram is overloaded? Give examples. 5 a) Compare and contrast the cooperation synchronization and competition synchronization in message passing. b) Explain the basic concepts of exception handling. 6 a) How ML is different from other functional programming languages? b) Why were imperative features added to most dialects of LISP? 7 a) Explain how RDBMS and expert systems are helped using logic programming. b) Discuss Terms and Goal statements in Prolog with examples.

R13 SET - 3 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 a) Define grammar, derivation and a parse tree. [4M] b) What are the design issues for string types? [3M] c) What are generic methods? [4M] d) List out the errors that can occur in expression evaluation. [4M] e) What is type inferencing used in ML? [4M] f) Mention the various applications of multi paradigm languages. [3M] 2 a) Explain language evaluation criteria and the characteristics that affect them. b) Discuss the general approaches for the implementation of a Lexical analyzer. 3 a) Explain in detail arrays, indices, subscript bindings, and array categories. b) Define unconditional branching. What are the problems with unconditional [4M] branching? c) Discuss various methods for reclaiming garbage. [4M] 4 a) Discuss the design issues of subprogram and its operations performed on them. b) Explain how subprogram names are passed as parameters. 5 a) Define a Thread. How are threads different from processes? Explain java threads with examples. b) Define monitor. Explain how cooperation synchronization and competition synchronization are implemented using monitors. 6 a) Explain about scheme functional programming language. b) Discuss how Haskell differs from ML. 7 a) Correlate the importance of logic programming languages over functional programming languages. b) Explain Fact and Rule Statements in Prolog with suitable examples.

R13 SET - 4 III B. Tech I Semester Regular/Supplementary Examinations, October/November - 2017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 a) What are the difficulties in using an attribute grammar to describe all of the [4M] syntax and static semantics of a contemporary programming language? b) Write a note on Boolean and relational expressions. [3M] c) State the importance of Local Referencing Environments with suitable [4M] examples. d) Differentiate between physical and logical concurrency. [4M] e) What scoping rules are used in ML? [3M] f) Describe the multi - paradigm languages. [4M] 2 a) Discuss in detail about the attribute grammars. [4M] b) Explain how is the order of evaluation of attributes determined for the tree of a given grammar. c) Why lexical and syntax analyzer are separated out? [4M] 3 a) Discuss the merits of guarded commands. [3M] b) What is a variable? What are the attributes of a variable? Elaborate on address of a variable. c) Explain in detail about overloaded operators. [5M] 4 a) Discuss how generic methods are implemented with suitable examples. b) Explain the importance of dynamic scoping with an example. 5 a) What are the three possible levels of concurrency in programs? Explain. b) Discuss the reasons for using exception handlers in a programming language. What if there exist programming languages with no exception handlers. 6 a) Give comparison of Functional and Imperative Languages. b) Explain the control structure of a PROLOG program. 7 a) How PROLOG is different from other logic programming languages? Give an example for each feature. b) Explain Prolog interfacing process.