You are on page 1of 158

MEPCO SCHLENK ENGINEERING COLLEGE, SIVAKASI

Mission
To Produce Competent, Disciplined and Quality Engineers & Administrators through Service Par
Excellence

Vision
Envisioning a world lead by our engineers, holding a beacon of hope and confidence for
generations to come
Department of Computer Science and Engineering
Vision
To become of a centre of excellence in computer education and research and to create the
platform for industrial consultancy

Program Educational Objectives


Graduating students of BE program in Artificial Intelligence will be able to

Specify, design, develop, test and maintain usable software systems that behave reliably and
efficiently and satisfy all the requirements that customers have defined for them following
professional practices
Work in a team using common tools and environments to achieve project objectives
Develop software systems that would perform tasks related to Research, Education and
Training and/or E-governance within the relevant international and national standards based
on an understanding of the impact such systems on the target groups and the environment

1
CS61 Artificial Intelligence

Course Details:
Subject Code : CS61
Subject Name : Artificial Intelligence
Semester : B.E(CSE) VI Semester
Prepared By : M.Rajakani / T.Jeyanthi
Approved By : Dr. K. Muneeswaran
Effective Date : 02.01.2012
Revision No. : 1

Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysis and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modeling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive
clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to engineering practice.

2
9. Understand and commit to professional ethics and responsibilities and norms of
engineering practice.

10. Understand the impact of engineering solutions in a societal context and


demonstrate knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business


practices, such as risk and change management, and understand their
limitations.

12. Recognize the need for, and have the ability to engage in independent and life-
long learning.

Competencies
1. Convert any system into intelligent agents (1)
2. Design a gaming environment with optimal decisions (1,3,4)
3. Determine the source of problem and searching for solutions (4,5)
4. Update knowledge by various learning methods (2,4)
5. Create the learning agents , problem solving agents and Intelligent agents (4,5,12)
6. Develop a Bayesian networks (4,10)
7. Design a knowledge based agents by Learning approach (11,12)

Concept Map

3
Course Assessment Matrix

Course Title : Artificial Intelligence


S. Programme Outcomes
No. (Washington Accord)
Competencies
1 2 3 4 5 6 7 8 9 10 11 12
1. Understand the concepts of intelligent
agents such that to convert any system X
into intelligent agents
2. Design a gaming environment with X
optimal decisions X X

3. Determine the source of problem and


searching for solutions X X

4. Understand the methods of learning in


terms of knowledge X X

5. Create the learning agents , problem X


solving agents and Intelligent agents X X

6. Develop a Bayesian networks X


X

7. Design a knowledge based agents by X X


Learning approach

Syllabus (As prescribed by Anna University, Tirunelveli)

CS61 ARTIFICIAL INTELLIGENCE


UNIT I PROBLEM SOLVING 9
Introduction Agents Problem formulation uninformed search strategies heuristics
informed search strategies constraint satisfaction
UNIT II LOGICAL REASONING 9
Logical agents propositional logic inferences first-order logic inferences in first-order logic
forward chaining backward chaining unification resolution
UNIT III PLANNING 9
Planning with state-space search partial-order planning planning graphs planning and acting
in the real world
UNIT IV UNCERTAIN KNOWLEDGE AND REASONING 9
Uncertainty review of probability - probabilistic Reasoning Bayesian networks inferences in
Bayesian networks Temporal models Hidden Markov models
UNIT V LEARNING 9
Learning from observation - Inductive learning Decision trees Explanation based learning
Statistical Learning methods - Reinforcement Learning
TOTAL: 45 HOURS
TEXT BOOK:
1. S. Russel and P. Norvig, Artificial Intelligence A Modern Approach, Second Edition, Pearson
Education, 2003.

4
REFERENCES:
1. David Poole, Alan Mackworth, Randy Goebel, Computational Intelligence : a logical
approach, Oxford University Press, 2004.
2. G. Luger, Artificial Intelligence: Structures and Strategies for complex problem solving,
Fourth Edition, Pearson Education, 2002.
3. J. Nilsson, Artificial Intelligence: A new Synthesis, Elsevier Publishers, 1998.
WEB REFERENCES
1. http://www.formal.stanford.edu/jmc/whatisai/
2. http://www. library.thinkquest.org/2705/
3. http://www.sciencedaily.com/news/computers_math/artificial_intelligence/
COURSE PLAN
MODULE I-INTRODUCTION

S.No TOPIC REFERENCE HOURS REMARKS

1. Introduction to AI T1:ch.1 1

2. Intelligent Agents T1:ch.2 1

3. Agents and environments T1:ch.2 1

4. Good behavior T1:ch.2 1

5. The nature of environments T1:ch.2 1

6. structure of agents T1:ch.2 1

7. Problem Solving T1:ch.3 1

8. problem solving agents T1:ch.3 1

9. Example problems T1:ch.3 1

10. Searching for solutions T1:ch.3 1

11. Uniformed search strategies T1:ch.3 1

12. Avoiding repeated states searching with partial information. T1:ch.3 1


TOTAL HOURS IN MODULE 1 12

MODULE II - LOGICAL REASONING

S.No TOPIC REFERENCE HOURS REMARKS

13. Logical agents-Knowledge based Agents T1: ch.7 1

14. The Wumpus World and logic and Propositional logic: T1: ch.7 1
A Very Simple Logic

15. First order logic representation revisited , Syntax T1:ch.8 1


and semantics for first order logic

16. Using first order logic T1:ch.8 1


17. Knowledge engineering in first order logic T1:ch.8 1

18. Inference in First order Logic: Prepositional T1:ch.9 1


versus first order logic, Unification and lifting

19. Forward chaining T1:ch.9 1

20. Backward chaining T1:ch.9 1


21. Resolution T1:ch.9 1

TOTAL HOURS IN MODULE 2 09

5
MODULE III PLANNING

S.No TOPIC REFERENCE HOURS REMARKS

22. Planning: Planning with state-space search T1:ch.11 1

23. Partial-order planning T1:ch.11 1

24. Planning graphs T1:ch.12 1

25. Planning and acting in the real world: Time, T1:ch.12 1


Schedules, and Resources

26. Hierarchical Task Network Planning T1:ch.12 2

27. Planning and Acting in Nondeterministic Domains T1:ch.12 1

28. Conditional Planning and Execution Monitoring and Replanning T1:ch.12 1

29. Continuous Planning and Multi-Agent Planning T1:ch.12 1

TOTAL HOURS IN MODULE 3 09


MODULE IV- UNCERTAIN KNOWLEDGE AND REASONING
S.No TOPIC REFERENCE HOURS REMARKS

30. Uncertainty Acting under Uncertainity T1:ch.13 1

31. review of probability Basic Probability Notation & The Axioms of T1:ch.13 1
Probability

32. Probabilistic Reasoning Representation Knowledge in an T1:ch.14 1


Uncertain Domain

33. Bayesian networks The semantics of Bayesian Networks T1:ch.14 2

34. Inferences in Bayesian networks Exact Inferences in Bayesian T1:ch.14 1


networks

35. Approximate inferences in Bayesian networks T1:ch.14 1

36. Inference in Temporal models T1:ch.15 1

37. Hidden Markov models T1:ch.15 1


TOTAL HOURS IN MODULE 4 09

MODULE V-LEARNING

S.No TOPIC REFERENCE HOURS REMARKS

38. Forms of learning T1:ch.18 1

39. Inductive learning T1:ch.18 1

40. Learning decision trees T1:ch.18 1

41. Explanation based learning T1:ch.19 1

42. Statistical learning methods - Learning with complete data T1:ch.20 1

43. Learning with hidden variable: The EM Algorithm T1:ch.20 1


44. Instance based learning T1:ch.20 1

45. Neural networks T1:ch.20 1


46. Kernel Machines T1:ch.20 1

6
47. Reinforcement Learning: T1:ch.21 1
Passive reinforcement learning - Active reinforcement learning

48. Generalization in reinforcement learning. T1:ch.21 1

TOTAL HOURS IN MODULE 5 11

TOTAL HOURS 50

TOTAL : 50HOURS
MODULE-1(PROBLEM SOLVING)
Module Overview
Artificial Intelligence (AI) is the area of computer science focusing on creating machines that can
engage on behaviors that humans consider intelligent. The ability to create intelligent machines
has intrigued humans since ancient times and today with the advent of the computer and 50 years
of research into AI programming techniques, the dream of smart machines is becoming a reality.
This module helps to understand about intelligent agents and also helps to identify the domain
problems by means of informed or uninformed (heuristic) problem definition in terms of
constraints.

Module Competencies
1. Explore the capabilities of AI and intelligent agents.
2. Design sequence actions that achieves its goals in problem formulation by informed
(heuristics) and uninformed search strategies.
3. Analysis and examine the problems by means of defined constraints.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes) and the Test Items (TI)
Module 1: INTRODUCTION

C1: Explore the capabilities of AI and intelligent agents.


1. Define AI and explain about its human behavior and rationality. (Remember)
1.1 How the AI definitions measure success in terms of fidelity to human
performance
TI1: What is turing test approach and research area of Artificial
Intelligence?
TI2: List out the research areas of Artificial intelligence for designing a
test for Turing test approach.
T13: What are two ways to identify that a system thinks like human in
cognitive approach?
1.2 Define the Ideal Concept of Intelligence
TI1: How laws of thought were supposed to govern the operation of the
mind by means of Logic?
TI2: How a rational agent can behave?
T13: Discuss the issues of limited rationality

7
2. Analyse the Agents and Environments. (Analyse)
2.1 Identify the nature of Agents and its Environment.
TI1: How an agent can act in Environment and draw its interaction with
its Environments?
TI2: What do you meant by actuators and percept sequence?
TI3: How an AGENT FUNCTION & AGENT PROGRAM maps any
percept sequence to an action?
2.2 List the Good behaviour and the concept of Rationality of Agent.
TI1: Define RATIONAL AGENT.
TI2: How the rationality depends upon four things at any given time?
TI3: What do you mean by omniscience, learning and autonomy?
3. Build the rational agents in required task (Create)
3.1 Explain about the Nature of Environments and Structure of agents.
TI1: Create task Environment for an automated Taxi.
TI2: Analyse and create a suitable environment for a thermostat
rational Agent.
3.2 Discuss the importance of designing an agent and agent program.
TI1: What is the job of AI and how the architecture and agent program
help to create an agent?
TI2: Discuss the four basic kinds of agent program that embody the
principles underlying almost all intelligent systems.
TI3: What do you meant by learning agent and what are the elements
in it?
C2. Design a sequence actions that achieves its goals in problem formulation by
informed (heuristics) and uninformed search strategies
1. To Explain the concepts of solving problems by searching (Understand).
1.1 List out the techniques of Problem solving Agents.
TI1: What do you mean by Goal formulation and problem formulation?
TI2: What are the four components of a problem?
TI3: Why abstraction is needed in formulating a problem?
1.2 Discuss about some real time problems
TI1: What are the two kinds of problems?
TI2: Give the Examples of Toy problems and Real world problems?
TI3: What is incremental and complete-state formulation?
1.3 Analyse about the searching for solutions.
TI1: How you formulate the problems description and what is the way
to solve it?
TI2: What are all the five components to represent a node?
TI3: How will you evaluate an algorithms performance?
TI4: Write the algorithm of TREE-SEARCH?

8
2. To Explain the techniques of blind or Uninformed Search
Strategies.(Understand)
2.1 List out the techniques of search strategies of uninformed search
TI1: List out the five search techniques of uninformed search strategies.
TI2: Explain about BFS, DFS and uniform-cost search.
TI3: Discuss about the Iterative deepening depth-first search and
Bidirectional search.
2.2 Compare the Uninformed search Strategies.
TI1: Write the Time complexity of BFS and DFS?
TI2: Compare and explain which searching strategies is the best?
3. Identify the methods for obtaining the problem-specific Information by
Heuristics or Informed search strategies. (Understand)
3.1 Describes the informed versions of the algorithm.
TI1: What is best first search and how it works in informed search
techniques?
TI2: What do you mean by Greedy search and HSLD?
TI3: Explain the A* Search and how it minimize the total Estimated
Solution cost?
TI4: What are the properties of A* search?
TI5: Discuss the Memory bound heuristic search?
3.2 Write down specifications from the given problem using heuristic function.
TI1: Define heuristic function
TI2: What is Manhattan distance?
TI3: Discuss the effect of heuristic accuracy on performance.
TI4: How you invent the admissible heuristic function
C3. Analysis and examine the problems by means of defined constraints.
1. Examines defined constraints whose states and goal test conform to a
standard, structured and very simple representation. (Understand)
1.1 Explain the concepts of constraint satisfaction problem. (Remember)
TI1: What is meant by variables, domain, consistent and objective
function?
TI2: What do you mean by constraint graph?
TI3: What is incremental formulation and complete state formulation?
TI4: What are types of constraints?
TI5: What do you mean by crypt arithmetic problem?
1.2 How Backtracking search is useful for CSP. (Analyse)
TI1: Define backtracking search and discuss why it necessary?
TI2: Write the Backtracking Search Algorithm
TI3: What do you meant by minimum remaining values (MRV)?
TI4: Explain the propagating information through constraints?
TI5: Discuss the intelligent backtracking techniques.

9
2. Analyse about the Local search algorithm and the Structure of problems for
Constraint satisfaction problems (Understand)
2.1 Analyse the techniques of complete state formulation
TI1: How you apply this local search technique in 8-queens problem?
TI2: Write the MIN-CONFLICTS algorithm.
TI3: What are the advantages of Local search for CSP?
3. Develop constraint graphs for representing various problem structures.
(Apply)
TI1: What do you mean by independent sub problem?
TI2: Develop a constraint graph for performance measurement of
multithreaded programs.

MODULE-2 (LOGICAL REASONING)


Module Overview
This module introduces the Knowledge based agents could represent the world in which it
operates and deduce what actions to take. For this propositional logic is used as representation
language because it sufficed to illustrate the basic concepts of logic and knowledge-based agents.
Unfortunately, propositional logic is too puny a language to represent knowledge of complex
environments in a concise way. So, first order logic which is sufficiently expressive to represent a
good deal of our commonsense knowledge. It also either subsumes or forms the foundation of
many other representation languages and has been studied for many decades.

Module Competencies
1. Explore knowledge based agents and the Propositional Logic Representation.
2. Analyse the drawbacks of propositional logic and representation of First Order Logic.
3. Model the effective procedures for answering questions posed in first order logic by
forward and backward chaining & Resolution.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes) and the Test Items (TI)
Module: LOGICAL REASONING

C1: Explore knowledge based agents and the Propositional Logic Representation.
1. Design and introduces a simple new environment (Understand)
1.1 Introduction about the concepts of knowledge based agents.

TI1: What do you mean by Knowledge base & Knowledge


representation language?
TI2: Which type of agent is selected for using this KB and why?
TI3: Write the algorithm for simple KB_AGENT.
TI4: What do you mean by knowledge level and implementation level?
TI5: Differentiate declarative approach and procedural approach.
IT6: Explain the overall agent design and introduces a simple new
environment, the Wumpus World.

10
2. Analyse the usage of knowledge by the agent (Analyse)
2.1 Deployment knowledge base in agent
TI1: List out the PEAS description of Wumpus world.
TI2: Analyse and prove that the logical thinking agent can use its KB
and take action in the Wumpus world Environment?
TI3: Analyse the new Environment WUMPUS WORLD and examine
whether the agent is using its knowledge base
3. Understand the syntax of Propositional Logic and its semantics the way in
which the truth of the sentences is determined. (Remember)
3.1 Understand the Syntax of Propositional Logic
TI1: What do you mean by a sentence?
TI2: What are the types of Sentences?
TI3: Write the syntax of Atomic sentences.
TI4: Write the syntax of Complex sentences.
TI5: Write the order of precedence in propositional logic.
4. Derive the semantics of Propositional Logic. (Apply)
TI1: Write the Truth table for P^Q.
TI2: Derive the semantics for this sentence P =>Q.
TI3: Write the syntax for the sentence A square is breezy if a
neighbouring square has a pit, and a square is breezy only if a
neighbouring square has a pit.
5. Create the Simple Knowledge base and analyse its inference rules. (Apply)
5.1 Create the Simple KB using all the inferences.
TI1: What it depicts if P1,1?
TI2: Develop the sentence for There is no pit in [1,1].
6. Enumerate all the models and check the sentences are valid using the
inference rules. (Remember)
TI1: Write the algorithm of TT-ENTAILS.
TI2: Write the algorithm of TT-CHECK-ALL.
TI3: Write the List out all the rules in propositional logic.
TI4: What do you mean by Equivalence, validity and satisfiability?
TI5: Define Deduction theorem
C2: Analyze the drawbacks of propositional logic and introduces the representation
of First Order Logic.
1. To derive the importance of first order logic by revisiting all the other
representation and Introduction about the syntax and semantics of first
order logic. (Remember)
1.1 Discuss about the nature of representation of languages.
TI1: What are the drawbacks of procedural languages?
TI2: Why first order logic is more expressive than propositional logic?
TI3: Define compositionality property.
TI4: What do you mean by objects, relations and functions in first order

11
logic?
TI5: Define ontological commitments and epistemological commitments.
TI6: Differentiate temporal logic and higher order logic.
1.2 Discuss about the various elements of the languages and analyse their
semantics in first order logic.
TI1: Draw the model for first order logic.
TI2: What do mean by domain, domain elements and objects?
TI3: Describe the syntax of first order logic specified in Backus Naur
form.
TI4: Define term and give examples
TI5: Write the Syntax of Atomic and Complex sentences in first order
logic.
TI6: What are the types of quantifiers?
2. Describe about the concepts of first order logic and deals with how to use
it.(Understand)
2.1 Describes the Assertions and queries in first order logic.
TI1: To add a Sentence to KB which keyword is used?
TI2: What do you mean by ASK?
TI3: What is Substitution or binding Lists?
T14: How you assert that John is a king and that kings are persons?
2.2 Derive the logic in the domain of family relationships or Kinship.
TI1: What do you mean by Kinship domain?
TI2: What are the relationships involved in kinship domain?
TI3: Create the logic for the Sentences
i. Ones mother is ones female parent
ii. A grandparent is a parent of ones parent.
TI4: Differentiate axioms and theorems.
2.3 Create the Numbers, sets and Lists logic in first order Logic.
TI1: Define infix and prefix notations.
TI2: Define Syntactic Sugar.
TI3: What do you mean by PEANO AXIOMS?
TI4: Create the logic for the Sentences
i. Two sets are equal if and only if each is a subset of the other.
ii. Adjoining an element already in the set has no effect.
TI5: What are the predicates in LISTS?
2.4 Create the Logic in THE WUMPUS WORLD.
TI1: Create the sentence for the typical percept sentence having
stench, Breeze & Glitter as predicates.
TI2: Differentiate binary and unary predicates.
TI3: Differentiate Synchronic and Diachronic Sentences.
TI4: How the adjacency of any two squares can be defined?
TI5: Create Diagnostic Rules in wumpus world environment.

12
TI6: Create Causal Rules in the same environment.
2. Describes the General process of knowledge base construction- a process
called knowledge Engineering. (Understand)
2.1 Describe the Steps of Knowledge Engineering process in General Process.
TI1: Define Knowledge Acquisition.
TI2: Write the Generalised Steps in Knowledge Engineering Process.
TI3: How the Knowledge based can be debugged?
TI4: How the falsehood information can be solved in Knowledge base?
2.2 Develop Knowledge Engineering Process in Electronic Domain.
TI1: Draw the Digital Circuit.
TI2: How you identify all the tasks in the DC?
TI3: How you assemble the relevant Knowledge in Digital circuit
domain?
TI4: Describe the process of encode general knowledge of the DC
domain?
TI5: How you will verify the simple circuit domain and prove this?
C3: Model the effective procedures for answering questions posed in first order logic
by forward and backward chaining & Resolution.
1. Describe the Comparison of Propositional Vs first order logic and the
generalised concepts of Unification and Lifting. (Remember)
1.1 Describe the ideas of Underlying the modern concepts of First order logic.
TI1: What is Universal Instantiation?
TI2: What is Existential Instantiation?
TI3: What are Skolem Constant and Skolemization?
TI4: How the inference rules of Propositional logic can be converted to
First order Logic? What are the Rules?
TI5: Explain the reduction to Propositional Inference process?

1.2 Analyse the importance of Unification and Lifting.


TI1: What is Generalised modus Modus Law? How it is lifted?
TI2: What is Unification?
TI3: What is Most General Unifier?
TI4: What is Occur Check?
TI5: what is Consumption Lattice?
2 Describe the Concepts of forward and backward Chaining. (Remember)
2.1 How the ideas of Forward chaining algorithm is used in First order logic.
TI1: Write the problem of Forward Chaining.
TI2: Derive the Laws from the Forward chaining Problem?
TI3: Why renaming is necessary in Forward Chaining?
TI4: What are properties of Forward Chaining Process?
TI5: Write the Algorithm of FOL-FC.

13
2.2 Describe the need of Backward chaining process in problem solving and
representation?
TI1: Why backward chaining is necessary?
TI2: Write the Algorithm for FOL-BC.
TI3: Describe the concepts of Logic Programming?
TI4: Describe the Efficient implementation of Logic programs?
TI5: Describe the redundant inference and inference loops?
TI6: Describe the Constraint Logic Programming.
3 Analyse the Concepts of Resolution. (Analyze)
3.1 Analyse the concepts by means of Example Proofs.
TI1: Solve the problem Everyone who loves all animals is loved by
smeone. Anyone who kills an animal is loved by no one. Jack loves
all animals. Either Jack or curiosity killed the cat, which is named
Tuna. Did, curiosity kill the cat?

MODULE-3(PLANNING)
Module Overview
The Task of coming up with a sequence of actions that will achieve a goal is called Planning. This
module is concerned primarily with scaling up to complex planning problems that defeat all the
other approaches. Planning is of two types, classical planning and non-classical planning. Classical
Planning means that environments are fully observable, deterministic, finite, static and discrete.
Non-classical planning is for partially observable or stochastic environments and involves a
different set of algorithms and agent designs.
Module Competencies
1. Design an expressive constrained language for representing planning problems & describes
the straightforward approaches is to use state-space search.
2. Developing Partial order planning and Partial Graphs.
3. Analyse the expressive representations and interactive agent architectures lead to planners
that are useful in the real world.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes) and the Test Items (TI)
Module: PLANNING
C1: Design an expressive language for representing planning problems & describes
the straightforward approaches is to use state-space search.
1. Introduction about the concepts of planning problems. (Remember)
1.1 Discussion about the problems of problem solving agent and identifies the
representation of planning problems.
TI1: List out the problems faced by problem solving agent.
TI2: Write the structure of Action Schema.
TI3: Define STRIPS Language and its importance.
TI4: How you represent the states, foals and actions in STRIPS
Language?
TI5: What do you mean by ADD list and DELETE list?

14
TI6: What do you mean by STRIPS Assumption?
1.2 Representing the planning problems and discussion about some example
problems.
TI1: Why STRIPS language is not suitable for real world problems?
TI2: Define ADL Language and its importance.
TI3: Differentiate STRIPS and ADL Language.
TI4: Identify a STRIPS problem involving transportation of Air-Cargo
problem.
TI5: Create the Spare Tire problem in ADL Languages.
2 Planning algorithms by using state space search. (Analyze)
2.1 Describe about the planning with forward state space search.
TI1: What do you mean by Progressing Planning?
TI2: What are drawbacks faced by Forward state space search?
2.2 Analyse about the planning with Backward state space search.
TI1: What are advantages of backward state space search?
TI2: For a given goal description how its predecessors are formulated?
2.3 Analyse about the planning with Heuristic state space search.
TI1: Why heuristic state space search is important than other two state
space search?
TI2: What is Sub goal independence?
TI3: What is empty delete list heuristic?
TI4: How can we derive the admissible heuristic value?
TI5: What do you mean by relaxed problem?
C2: Developing Partial order planning and Planning Graphs.
1. Explain the concepts of partial order planning with an Example.
(Understand and Analyze)
1.1 Explain the importance of partial order plan than the total order plan.
TI1: What is least commitment?
TI2: What do you mean by partial order planning and its example?
TI3: What is linearization?
TI4: What are the components in a plan?
TI5: What is causal Links?
TI6: Write the Partial order Plan algorithm?
1.2 Analyse the concepts of Partial order planning with unbound variables and
with heuristics.
TI1: Write an example for unbound variables.
TI2: Define inequality constraints.
TI3: What are the advantages and disadvantages of partial order plan?
TI4: Analyze its drawbacks and explain how heuristics is necessary?
TI5: What is most constrained variable?
2. Create a special Data Structure and understand its concepts The Planning
Graphs. (Understand and Apply)

15
2.1 Total order and partial order plan suffers from inaccuracies so created a
data structure called Planning Graphs
TI1: Define Planning Graph.
TI2: Draw the Planning Graph for Have cake and Eat cake problem.
C3: Analyze the expressive representations and interactive agent architectures lead
to planners that are useful in the real world.
1. Role of planners in terms of the representation language and the way that
the planner interacts with the environment. (Analyze)
1.1 Describes planning and scheduling with time and resource constraints.
TI1: What is job shop scheduling?
TI2: Develop a job shop scheduling problem for assembling two cars?
TI3: What is critical path method?
TI4: What is slack algorithm?
TI5: What do mean by reusable resources?
TI6: Define aggregation.
1.2 Analyze the complexity of Planning with most pervasive ideas by
Hierarchical Task Network Planning.
TI1: Define Hierarchical decomposition
TI2: What is plan library?
TI3: What are primary and secondary effects?
TI4: Draw the diagram for one possible decomposition for the Build
House action?
TI5: Explain about the modifying planner for decomposition?
TI6: Define subtask sharing.
TI7: Explain the magi problem?
2. Describes a series of agent architectures designed to deal with uncertain
environments. (Remember)
2.1 Describes about the Planning and Acting in Nondeterministic domain
TI1: Differentiate bounded indeterminacy and unbounded
indeterminacy.
TI2: What is conformant planning?
TI3: What is contingency planning?
TI4: Explain with an example to clarify the differences among the
various kinds of agents.
TI5: How will you use these non-deterministic concepts in real world?
2.2 Model a way to deal with uncertainty in the environment at predetermined
points in the plan.
TI1: Explain the conditional planning in fully observable environments?
TI2: Differentiate disjunctive effects and conditional effects.
TI3: What do you mean by game against nature?
TI4: Write the algorithm for AND-OR-GRAPH SEARCH and AND-
SEARCH.

16
TI5: Explain in detail about the conditional planning in partially
observable environments?
2.3 Describe the concepts of Execution monitoring and replanning.
TI1: Define Execution monitoring and action monitoring.
TI2: What is replanning?
TI3: What is Plan monitoring?
TI4: What are the advantages of serendipity?
TI5: Write the REPLANNING-AGENT algorithm?
3. Analyze the concepts of how to plan when the environment contains other
agents. (Analyze)
3.1 Design an agent that persists indefinitely in an Environment.
TI1: What is the need of continuous planning agent?
TI2: Explain how to modify the AND-OR-GRAPH-SEARCH algorithm to
generate a cycle plan if no acyclic plan exist.
TI3: Write the algorithm for CONTINUOUS-POP-AGENT.
TI4: What are the flaws handled by continuous planning agent?
Compare the issues of single agent Environment With the multi
agent Environment.
TI1: List out the issues of single agent environments?
TI2: What are the advantages of Multiagent environments?
TI3: Differentiate cooperative and competitive Environments?
TI4: Define Join plan.
TI5: Explain Multibody planning?
TI6: Define convention and competition.
TI7: List out the Emergent behaviors of flying pseudo body?

MODULE-4(UNCERTAIN KNOWLEDGE AND REASONING)


Module Overview
The Logical Agents knows enough facts about its environments, the logical approach enables it to
derive plans that are guaranteed to work. Unfortunately, agents almost never have access to the
whole truth about their environment. Agent must therefore act under uncertainty. And describes
the ideas in preparation for the development of the general theories of uncertain reasoning and
rational decisions.

Module Competencies
1. Identify the nature of uncertain knowledge and the concepts of basics of Probability.
2. Design a systematic way to represent relationships explicitly in the form of semantic
networks.
3. Analyze inference in temporal model and hidden markov model.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes) and the Test Items (TI)
Module: UNCERTAIN KNOWLEDGE AND REASONING

17
C1: Identify the nature of uncertain knowledge and the concepts of basics of
Probability.
1. Explain the concepts of Acting under Uncertainty. (Understand)
1.1 Introduction about the concepts of uncertainty and nature of uncertain
knowledge.
TI1: Define uncertainty.
TI2: Why rational decision is important in uncertainty?
TI3: Why first order logic fails in uncertainty?
TI4: What do you mean by degree of belief?
TI5: What are the kinds of probability?
1.2 Analyse the presence of uncertainty radically changes the way an agent
makes decisions.
TI1: Define decision theory.
TI2: Define utility theory.
TI3: What is maximum Expected Utility (MEU).
TI4: Write the algorithm for DT-AGENT.
2. Explore the need of uncertain knowledge and introduces a formal
language for representing and reasoning with uncertain knowledge.
(Remember)
2.1 Introduction about the concepts of propositions and Random variables.
TI1: What is random variable?
TI2: What are the three kinds of random variables?
TI3: What do you mean by atomic events?
TI4: What are the properties of Atomic events?
TI5: Define prior probability.
TI6: What do you mean by probability distribution and full joint
probability distribution?
TI7: What is probability density functions?
TI8: Define conditional probability and product rule.
2.2 Explain the Axioms of Probability and Full joint distribution.
TI1: Define kolmogorovs axioms?
TI2: Explain the uses of axioms of probability?
TI3: How do you derive a variety of useful facts from the basic axioms?
TI4: Why the axioms of probability are reasonable?
TI5: Define marginalization.
TI6: A domain consists of just three Boolean variables Toothache,
cavity and catch. Draw the full joint distribution 222 table.
TI7: Define the concept of independence.
C2: Design systematic way to represent relationships explicitly in the form of
semantic networks.
1. Explain about representing the knowledge in an uncertain domain and
about the semantics of Bayesian Networks. (Remember)

18
1.1 Describe the representation of uncertain knowledge in Bayesian Networks.
TI1: Define Bayesian Networks.
TI2: Describe the Burglary alarm problem.
TI3: What is conditional Probability table?
TI4: What are the properties of Bayesian Networks?
TI5: Draw the simple Bayesian Network consists of Toothache, Cavity,
Catch & Weather?
1.2 Analyse the syntax and semantics of the Bayesian networks.
TI1: Describe how you will representing the full joint distribution/
TI2: What is chain rule?
TI3: Analyse a method for constructing Bayesian Networks?
TI4: Define locally structured nodes?
TI5: Describe compactness and node ordering.
TI6: What is Markov blanket?
TI7: What is a conditional Independence relation in Bayesian Networks?
2. Deriving the Exact and approximate inference in Bayesian Networks.
(analyze)
2.1 Analyse the Exact and approximate inferences in Bayesian Networks.
TI1: The problem of counting the number of satisfying assignments for
a 3-SAT problem is #P complete. Show that exact inference is at
least as hard as approximate inference.
C3: Analyze inference in temporal model and hidden markov model
1. Analyze the basic inference tasks and general structure of inference
algorithms for Temporal Models (Analyze)
1.1 Analyze the inference in temporal models.
TI1: Illustrate the filtering process for umbrella example.
1.2 Analyze the inference in Hidden Markov model.
TI1: Justify that umbrella example is a HMM problem.

MODULE-5(LEARNING)
Module Overview
Agents that can improve their behaviour through diligent study of their own experience. Learning
is that percept should be used not only for acting, but also for improving the agents ability to act
in the future. Learning takes place as the agent observes its interactions with the world and its
own decision-making processes. Learning can range from trivial memorization of experience to the
creation of entire scientific theories. This module describes inductive learning from observations
and describes how to learn simple theories in propositional logic.

Module Competencies
1. Explore inductive learning.
2. Learning as a form of uncertain reasoning from observations
3. Evaluate the concepts of reinforcement learning.

19
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes) and the Test Items (TI)
Module: LEARNING
C1: Explore inductive learning.
1. Explain about how inductive learning possible from observation. (Remember)
1.1 Introduction about the forms of learning.
TI1: Why learning agent is suitable for learning mechanisms?
TI2: Write the three major issues faced while designing the learning
agent?
TI3: What are types of learning?
TI4: What is supervised learning?
TI5: What is unsupervised learning?
TI6: Define reinforcement learning?
1.2 Analyse the task of pure inductive inference.
TI1: What is Hypothesis?
TI2: Define the fundamental problem of induction.
TI3: Define Ockhams razor.
TI4: Differentiate realizable and unrealizable.
2. Explain about the decision trees and Explanation based learning.
(Remember)
2.1 Design a most successful forms of learning algorithm.
TI1: Define Decision Tree.
TI2: Differentiate Classification and Regression.
TI3: Explain the Expressiveness of decision Trees.
TI4: Describe inducing trees from examples.
TI5: Define Training set.
TI6: How you choose the attributes for testing in decision trees?
TI7: What is information gain?
TI8: How do you assessing the performance of the learning algorithm?
TI9: What is a happy graph?
T10: Explain Noise and Overfitting.
T11: Explain broadening the applicability of decision trees?
2.2 Develop a methods for extracting general rules from individual
observations by Explanation based Learning.
TI1: Define memoization.
TI2: Explain the Extracting general rules from examples.
TI3: What are the basic EBL process works?
TI4: What is branching factor?
TI5: What is operationality?
TI6: Define Pruning.

20
C2: Learning as a form of uncertain reasoning from observations.
1. Describes the Learning methods that store and recall specific instances.
(Remember)
1.1 Introduction about the concepts of Statistical Learning.
TI1: What are data and hypotheses?
TI2: Define Bayesian Learning?
TI3: What is maximum-likelihood?
TI4: Define overfitting.
TI5: What is maximum of posteriori?
1.2 Analyse the concepts of learning methods with complete data.
TI1: What is log likelihood?
TI2: What is the standard model for maximum-likelihood parameter
learning?
TI3: Explain Nave Bayes models?
TI4: Explain the Maximum-likelihood parameter Learning?
TI5: What is Linear-Gaussian model?
TI6: What is conjugate prior?
TI7: What is parameter independence?
TI8: Explain the learning Bayes net structures?
1.3 Explain the concepts of parametric learning with Hidden variables.
TI1: What is Expectation Maximization?
TI2: Explain the unsupervised clustering.
TI3: Describe the process of Learning Bayesian Networks with hidden
variables.
TI4: Derive the techniques of Learning with hidden Markov models.
TI5: Write the general form of EM Algorithm.
TI6: Explain Learning concepts in Bayes net structures with hidden
variables.
1.4 Compare the concepts of non-parametric learning with instance based
learning.
TI1: What do you mean by non-parametric learning?
TI2: What is instance based or memory based learning?
TI3: Explain Nearest-neighbor models.
TI4: What is Mahalanobis distance?
TI5: Why Hamming distance is used in discrete features?
TI6: What are kernel model and kernel functions?
2. Describes the neural network learning and introduces kernel machines
concept. (Remember)
2.1 Introduction about the concepts of Neural Networks.
TI1: What is neural Network?
TI2: Write the other research fields of Neural Networks?
TI3: What are all the units in Neural Networks?

21
TI4: Define Bias Weight.
TI5: Define Threshold function and sigmoid function.
TI6: Explain the single layer feed forward neural Networks
(perceptrons).
TI7: Explain the multi layer feed forward neural Networks.
2.2 Explore a relatively new family of learning methods called support vector
machines
TI1: Define Kernel Machines.
TI2: What is quadratic programming?
TI3: What is kernel functions?
TI4: Define Mercers theorem.
TI5: What is polynomial kernel?
TI6: What is kernalization?
C3: Evaluate the concepts of reinforcement learning.
1. Describes how an agent can learn from success and failure from reward
and punishment in reinforment learning. (Remember)
1.1 Describes the concept of Passive reinforcement Learning.
TI1: What is passive learning?
TI2: What is policy evaluation?
TI3: What is discount factor?
TI4: What is direct Utility estimation?
TI5: Define adaptive control theory.
TI6: Describe Adaptive dynamic programming.
TI7: Write the algorithm for PASSIVE-ADP-AGENT in passive
reinforcement.
TI8: Write the algorithm for PASSIVE-TD-AGENT in passive
reinforcement.
TI9: What is prioritized sweeping?
1.2 Describes the concept of Active reinforcement Learning.
TI1: What is active learning?
TI2: What is greedy agent?
TI3: Write the bandit problems.
TI4: Differentiate Exploitation & Exploration.
TI5: What is Exploration Function?
TI6: Describe Learning an Action-Value Function.
TI7: What is Q-Learning?
TI8: Write the algorithm for Q-LEARNING-AGENT in active
reinforcement.
TI9: What is model free method?
2. Evaluate the concept of Generalized reinforcement Learning. (Analyze)
2.1 Various methods for reinforcement learning.
TI1: Define function approximation?

22
TI2: Derive the Basis functions?
TI3: Derive the Widrow-Hoff rule.
TI4: Identify the Application to Game Playing.
TI5: Identify the Application to Robot Control.
TI6: Justify that Generalized learning is best in reinforcement Learning?

23
CS62 PRINCIPLES OF COMPILER
DESIGN

Course Details:
Subject Code : CS62
Subject Name : PRINCIPLES OF COMPILER DESIGN
Semester : BE(CSE) VI Semester
Prepared By : Mrs. S.Vanitha Sivagami and Ms.G.Jenifa
Approved By : Dr.K.Muneeswaran
Effective Date : 02.01.2012
Revision No. : 0

Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysi s and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modeling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive
clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural


issues and the consequent responsibilities relevant to engineering practice.

24
9. Understand and commit to professional ethics and responsibilities and norms of
engineering practice.

10. Understand the impact of engineering solutions in a societal context and


demonstrate knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business


practices, such as risk and change management, and understand their
limitations.

12. Recognize the need for, and have the ability to engage in independent and life-
long learning.

Competencies
1. Inspect the basics about compiler functions (2)
2. Carry out lexical analysis (1,5)
3. Identify the role of the parser (2,10)
4. Construct the LR parser for the given grammar (1,3,12)
5. Select the appropriate storage organization (2,10)
6. Practice the intermediate languages representation (2,10)
7. Generate semantic actions for the declarations, assignment statements (1,2,10)
8. Construct intermediate code for the parse tree (1,3,12)
9. Analyze the issues arise during the design of a code generator (2)
10. Design a code generator (1,3,4,5)
11. Identify the principle sources of optimization (2)

25
Concept Map

26
Course Assessment Matrix

Course Title : Principles of Compiler Design


S. Programme Outcomes
No. Competencies (Washington Accord)
1 2 3 4 5 6 7 8 9 10 11 12
Inspect the basics about compiler
1. X X
Functions

2. Carry out lexical analysis X X

3. Identify the role of the parser X X

Construct the LR parser for the given


4. X X X
grammar
Select the appropriate storage
5. X X
Organization
Practice the intermediate languages
6. X X
Representation
Generate semantic actions for the
7. X X
declarations, assignment statements
Construct intermediate code for the
8. X X X
parse tree
Analyze the issues arise during the
9. X X X
design of a code generator
10. Design a code generator X X X X
Identify the principle sources of
11. X
optimization

Syllabus (As prescribed by Anna University, Tirunelveli)


UNIT I LEXICAL ANALYSIS 9
Introduction to Compiling- Compilers-Analysis of the source program-The phases-Cousins-The
grouping of phases-Compiler construction tools. The role of the lexical analyzer- Input buffering-
Specification of tokens-Recognition of tokens-A language for specifying lexical analyzer.

UNIT II SYNTAX ANALYSIS and RUN-TIME ENVIRONMENTS 9


Syntax Analysis- The role of the parser-Context-free grammars-Writing a grammar-Topdown
parsing-Bottom-up Parsing-LR parsers-Constructing an SLR(1) parsing table. Type Checking- Type
Systems-Specification of a simple type checker. Run-Time Environments-Source language issues-
Storage organization-Storage-allocation strategies.

UNIT III INTERMEDIATE CODE GENERATION 9


Intermediate languages-Declarations-Assignment statements - Boolean expressions- Case
statements- Backpatching-Procedure calls

UNIT IV CODE GENERATION 9


Issues in the design of a code generator- The target machine-Run-time storage management-Basic
blocks and flow graphs- Next-use information-A simple code generator-Register allocation and
assignment-The dag representation of basic blocks - Generating code from dags.

27
UNIT V CODE OPTIMIZATION 9
Introduction-The principle sources of optimization-Peephole optimization- Optimization of basic
blocks-Loops in flow graphs- Introduction to global data-flow analysis-Code improving
transformations.

1. TEXT BOOK:
1. Alfred V. Aho, Ravi Sethi Jeffrey D. Ullman, Compilers- Principles, Techniques, and Tools,
Pearson Education Asia, 2007.
2. REFERENCES:
1. David Galles, Modern Compiler Design, Pearson Education Asia, 2007
2. Steven S. Muchnick, Advanced Compiler Design & Implementation, Morgan Kaufmann
Pulishers,2000.
3. C. N. Fisher and R. J. LeBlanc Crafting a Compiler with C, Pearson Education, 2000.
4. Alfred Aho, Monica S.Lam, Ravi Sethi and Jeffrey D Ullman, Compilers Principles, Techniques
and Tools, Pearson Education Asia, 2007.

ONLINE MATERIALS
1. http://www.onesmartclick.com/engineering/compiler-design.html
2. http://citeseer.ist.psu.edu/Programming/CompilerDesign/hubs.html
3. http://www1.cs.columbia.edu/~aho
4. http://infolab.stanford.edu/~ullman/
5. http://dinosaur.compilertools.net/
6. http://epaperpress.com/lexandyacc/
COURSE PLAN

No.of
S.No Topics Reference to Text Remarks
Periods

MODULE I (Lexical Analysis)

Introduction to Compiling-
T Ch1.1, 1.2
1. Compilers-Analysis of the 1
R4 Ch1.1
source program

T Ch 1.3
2. Phases of a Compiler 1
R4 Ch1.2.1 1.2.7

Cousins of the compiler - T Ch 1.4, 1.5


3. 1
Grouping of phases R4 Ch1.2.8

T Ch 1.6
4. Compiler construction tools 1
R4 Ch1.2.9

Lexical analysis - Role of lexical T Ch 3.1


5. 1
analyzer R4 Ch3.1

T Ch 3.2
6. Input Buffering 1
R4 Ch3.2

T Ch 3.3
7. Specification of Tokens. 1
R4 Ch3.3

Token Recognition Finite T Ch3.4, 3.6, 3.7, 3.9


8. 3
Automata R4 Ch3.4,3.6, 3.7, 3.9

A language for specifying T Ch3.5, 3.8


9. 2
lexical analyzer R4 Ch3.5, 3.8

10. Tutorial/Lab 3

28
No.of
S.No Topics Reference to Text Remarks
Periods

Total No of periods for MODULE I 15

MODULE II (Syntax Analysis and Run-Time Environments)

Role of the parser Writing


T Ch 4.1 4.3
11. Grammars Context-Free 1
R4 Ch4.1 4.3
Grammars

T Ch 4.4
12. Top Down parsing 2
R4 Ch4.4.1 4.4.5

Bottom-up parsing Shift


T Ch4.5, 4.6
13. Reduce Parsing, Operator 2
R4 Ch4.5
Precedent Parsing

T Ch 4.7
14. LR Parsers SLR Parser 1
R4 Ch4.6

Canonical LR Parser LALR T Ch 4.7


15. 2
Parser R4 Ch4.7

Type Checking- Type Systems-


T Ch6.1, 6.2
16. Specification of a simple type 1
R4 Ch6.3, 6.5
checker

Runtime Environments
17. T Ch 7.1 1
Source Language issues

Storage Organization - Storage T Ch 7.2, 7.3


18. 1
Allocation strategies R4 Ch7.1, 7.2

19. Tutorial/Lab 3

Total No of periods for MODULE II 14

MODULE III (Intermediate Code Generation)

T Ch 8.1
20. Intermediate languages 2
R4 Ch6.1, 6.2

T Ch 8.2
21. Declarations 1
R4 Ch6.3

T Ch 8.3
22. Assignment Statements 3
R4 Ch6.4, 6.5.1, 6.5.2

T Ch 8.4
23. Boolean Expressions 2
R4 Ch6.6

T Ch 8.5
24. Case Statements 1
R4 Ch6.8

T Ch 8.6
25. Back patching 1
R4 Ch6.7

T Ch 8.7
26. Procedure calls 1
R4 Ch6.9

27. Tutorial/Lab 3

29
No.of
S.No Topics Reference to Text Remarks
Periods

Total No of periods for MODULE III 14

MODULE IV (Code Generation)

Issues in the design of code


T Ch 9.1, 9.2
28. generator - The target 1
R4 Ch8.1, 8.2
machine

T Ch 9.3
29. Runtime Storage management 1
R4 Ch8.3

Basic Blocks and Flow Graphs - T Ch 9.4, 9.5


30. 1
Next-use Information R4 Ch8.4

T Ch 9.6
31. A simple Code generator 2
R4 Ch8.6

Register allocation and T Ch 9.7


32. 2
assignment R4 Ch8.8
DAG representation of Basic
T Ch 9.8, 9.10
33. Blocks - Generating code from 2
R4 Ch8.5.1
dags.
34. Tutorial/Lab 3

Total No of periods for MODULE IV 12

MODULE V (Code Optimization)

Introduction - Principal Sources T Ch 10.1, 10.2


35. 1
of Optimization R4 Ch9.1

T Ch 9.9
36. Peephole optimization 1
R4 Ch8.7

T Ch 10.3
37. Optimization of basic Blocks 1
R4 Ch8.5.2 -8.5.7

T Ch 10.4
38. Loops in flow graphs 2
R4 Ch9.6

Introduction to Global Data T Ch 10.5


39. 2
Flow Analysis R4 Ch9.2

Code improving T Ch 10.7


40. 2
transformations.

41. Tutorial/Lab 3

Total No of periods for MODULE V 12

Total No of periods 67

MODULE-I Lexical Analysis


Module Overview
In this module we have discussed about the introduction to compiling process and its necessity. It
deals with the phases of compiler and the grouping of those phases. It lists some of the compiler
construction tools such as Parser generators, Scanner generators, Syntax-directed translation

30
engines, Automatic code generators, Data-flow engines. It also deals about the role of a lexical
analyzer and input buffering.

Module Competencies
1. Demonstrate the basics of compiling.
2. Examine the phases of compiler.
3. Identify the role of the lexical analyzer.
4. Carry out the lexical analysis.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes)
C1. Demonstrate the basics of compiling.
1. Define Compiler (Remember)
1.1 Name the classification of compilers
TI1. What are the classifications of compilers?
TI2. What are the phases of compiler?
1.2 List out the parts of compilation
TI1. Define analysis.
TI2. Define synthesis
TI3. Differentiate analysis and synthesis.
C2. Comprehend the phases of compiler.
1. List out the phases of a compiler (Understand)
1.1 Enumerate the role of lexical analyzer
TI1. What is the output form of the lexical analyzer?
TI2. Perform the lexical analysis for the statement
if(x==y)
{
x=x+2;
}
2. Define syntax analysis. (Understand)
2.1 Construction of the syntax tree.
TI1. Construct a syntax tree for the following.
x = a*b+a*c
2.2 Define semantic analysis.
TI1. What is the use of type checking?
2.3 Define intermediate code generation.
TI1. What are the properties of intermediate representation?
TI2. Define three-address code.
TI3. Construct a three address code for the statement x = a*b+c.
2.4 Define code optimization.
TI1. What are the objectives of code optimization?
TI2. Define code generation.

31
3. Use of symbol table in compiling (Remember)
3.1 Define symbol table.
TI1. What is the use of symbol table in compiler?
TI2. How does the error detection and reporting can be done?
C3. Identify the role of the lexical analyzer.
1. Tasks that are done by the lexical analyzer other than
identification of lexemes (Remember)
1.1 Indicate the terms associated with lexical analysis
TI1. Define token.
TI2. Define pattern.
TI3. Define lexeme.
TI4. What is the need for the lexical analyzer to return an attribute
value
along with the token name?
TI5. What are the error-recovery actions in lexical analysis?
2. Define Input Buffering
2.1 State the need for specialized buffering techniques
TI1. What are the two pointers that are maintained for the input?
TI2. What is the use of look ahead pointer?
C4. Carry out the lexical analysis (Apply)
1. Issues to be considered in the design of lexical analyzer
1.1 Design a lexical analyzer.
TI1. Perform the lexical analysis to remove comments defined as
follows:
a. A comment begins with // and includes all characters until the
end of the line.
b. A comment begins with /* and includes all characters through
the next occurrence of the character sequence */.
TI2. Perform the lexical analysis to recognize the relational operators <,
<=, ==, ! =, >=, >.
T13. Perform the lexical analysis to recognize the floating point numbers
such as 2., 3.14, .5.
T14. Divide the following C++ program
float limitedSquare(x) float x
{
/* returns x-squared, but never more than 100 */
return (x <= -10.0 || x>= 10.0) ? 100: x*x;
} into appropriate lexemes.
T15. Suggest how to divide the following HTML document into
appropriate lexemes.
Here is a photo of <B> my house </B>:
<P><IMG SRC =hs1.gif><BR>

32
MODULE-II - Syntax Analysis and Run-Time Environments
Module Overview
In this module we are discussing about the syntax analyzer and syntax tree structure or parse
tree. It also deals with the role of the parser in the process of compilation. Then it deals with some
of the parser types such as Top down parsing-Bottom-up Parsing-LR parsers. It briefly explains
about the type checking, specification of a simple type checker and run-time environment. It also
discusses about the storage organization and storage allocation strategies.
Module Competencies
1. Interpret the syntax analysis.
2. Analyze the context-Free Grammar.
3. Identify the role of the parser and perform various parsing.
4. Schedule the specification of a simple type checker.
5. Analyze the run-time environment.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
C1: Interpret the syntax analysis.
1. Define syntax analysis. (Understand)
1.1 State the benefits of grammars?
TI1. Define terminals.
TI2. Define non-terminals.
TI3. What is meant by productions in grammar?
TI4. Consider the grammar
S (L) | a
L L,S | S
a. What are the terminals, non-terminals and start symbol?
b. Find the parse tree for the following sentences:
i. (a,a)
ii. (a,(a,a))
c. Construct a leftmost derivation for each of the sentences in
(b).
C2: Analyze the context-Free Grammar.
1. Define context-Free Grammar (Analyze)
TI1. List out some of the notational conventions of CFG.
TI2. Define derivation.
TI3. What is meant by ambiguous grammar?
TI4. When a grammar is said to be left recursive?
TI5. How to remove the left recursion?
TI6. Remove the left recursion in the following grammar.
E E + T, T T * F, F (E) | id
TI7. What is meant by left factoring?
TI8. Consider the grammar S aSbS | bSaS |

33
a. Show that this grammar is ambiguous by constructing two
different leftmost derivations for the sentence abab.
b. Construct the corresponding rightmost derivations for abab.
c. Consider the grammar
bexpr bexpr or bterm | bterm
bterm bterm and bfactor | bfactor
bfactor not bfactor | (bexpr) | true | false
Is this grammar ambiguous? Justify your answer.
C3: Identify the role of the parser and perform various parsing.
1. Tabulate the general types of parsers (Remember)
1.1 Quote the error-recovery strategies in syntax analysis
TI1. Define panic-mode recovery.
TI2. Define phrase-level recovery.
2. Apply the top-down parsing method to parse a grammar (Apply)
2.1 Perform the recursive-descent parsing
TI1. List the factors to be considered for top-down parsing.
TI2. How to compute the first and follow of a grammar?
TI3. When a grammar is said to be LL(1) grammar?
TI4. Consider the grammar E->E+T,T->T*F,F->(E)\id. Use predictive
parsing and check whether the string id+id*id is syntactically
correct or not.
TI5. The grammar S aSa | aa generates all even length strings of as
except for the empty string. Construct the recursive-descent parser
with backtracking for this grammar that tries the alternative aSa
before aa. Show that the procedure for S succeeds on 2,4, or 8
as but fails on 6 as.
TI6. Check whether the following grammar is a LL(1) grammar
S->iEtS | iEtSeS | a
E->b
TI7. Construct a predictive parser for the grammar:
bexpr bexpr or bterm | bterm
bterm bterm and bfactor | bfactor
bfactor not bfactor | (bexpr) | true | false
TI8. How does the error-recovery process takes place in predictive
parsing?
3. Apply the bottom-up parsing to parse a grammar (Apply)
3.1 Handle pruning in bottom-up parsing.
TI1. How does the shift-reduce parsing can be performed?
TI2. Construct the shift-reduce parser for the following grammar.
E E + T, T T * F, F (E) | id
TI3. What are the conflicts that occur during shift-reduce parsing?
TI4. Consider the operator precedence relations for the grammar

34
S (L) | a
L L,S | S

a ( ) , $
a .> .> .>
( <. <. = <.
) .> .> .>
, <. <. .> .>
$ <. <.
Using these precedence relations, parse the sentences,
i. (a,((a,a),(a,a)))
ii. (a,(a,a))

4. Apply LR parsing to parse a grammar (Apply)


4.1 Importance of LR parsers to parse a grammar.
TI1. Given the following grammar S->AS|b,A->SA|a Construct a SLR
parsing table for the string baab
TI2. Check whether the following grammar is SLR(1) or not. Explain
with reasons.
S->L=R
S->R
L->*R
L->id
R -> L
TI3. Justify how LALR parsing is efficient over SLR parsing.
TI4. Consider the following grammar
E E+T | T
T TF | F
F F* | a | b
a. Construct the SLR parsing table for this grammar.
b. Construct the LALR parsing table.
TI5. What are the different strategies that a parser can employ to
recover from syntax error?
C4: Schedule the specification of a simple type checker.
1. Need for type checking (Understand and Apply)
1.1 Enumarate the two forms of type checking
TI1. What is the need for type conversion?
TI2. Write type expressions for the following types
a. An array of pointers to real, where the array index range from
1 to 100.
b. A two-dimensional array of integers whose rows are indexed
from 0 to 9 and whose columns are indexed from -10 to 10.

35
TI3. The following grammar defines the list of lists and literals as
follows:
P D ; E
D D ; D | id : T
T list of T | char | integer
E ( L ) | literal | num | id
L E, L | E
Write translation rules to determine the types of expressions (E)
and lists (L).
C5: Analyze the run-time environment.
1. Methods to manage the storage allocation (Analyze and Apply)
1.1 List out the two strategies of dynamic storage allocation
TI1. What is meant by activation trees?
TI2. What is meant by activation records?
TI3. List out the kind of data that may appear in an activation record?
TI4. The three kinds of environments that could be associated with a
procedure passed as a parameter are illustrated by the Pascal
program as follows:
program param (input, output);
procedure b (function h ( n: integer) : integer);
var m : integer;
begin m:= 3; writeln (h(2)) end {b};
procedure c;
var m: integer;
function f( n : integer) : integer;
begin f := m + n end { f };
procedure r;
var m: integer;
begin m := 7; b (f) end { r };
begin m := 0; rend { c };
begin
c
End
Using the lexical, passing and activation environments for f, nonlocal
m on line 8 is in the scope of the declarations of m on lines 6, 10 and
3 respectively.
a. Draw the activation tree for this program.
b. Modify the display implementation of a lexically scoped
language to set up the lexical environment correctly
when a procedure passed as a parameter is activated.

36
MODULE-III Intermediate Code Generation
Module Overview
This Module explains about the intermediate languages and its importance. It helps to identify the
various declaration methods, assignment statements, Boolean expressions, and case statements
that are used to construct the intermediate languages. It also explains about the backpatching and
the procedure calls.
Module Competencies
1. Construct intermediate code representation.
2. Make the intermediate code representation for the declaration.
3. Produce intermediate code for the assignment statements.
4. Examine Boolean expressions, backpatching procedure calls.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
C1: Construct intermediate code representation.
1. Draw the intermediate representation used by the compiler. (Apply)
1.1 Define three-address code
TI1. Define address.
TI2. List out the common three-address instruction forms.
TI3. What is meant by quadruples?
TI4. What is meant by triples?
TI5. Why is it necessary to generate intermediate code instead of
generating target program itself?
TI6. Write the properties of intermediate language.
TI7. What is the intermediate code representation for expression a or b
and not c.
TI8. Translate the arithmetic expression a*-(b+c) into
a. a syntax tree
b. postfix notation
c. three-address code
TI9. Translate the expression (a+b) * (c+d) + (a+b+c) into
a. quadruples
b. triples
c. indirect triples
TI10. Translate the executable statements of the following C program
main()
{
int i;
int a[10]; i = 1;
while ( i <= 10) {
a[i] = 0; i = i+1; }
}
into

37
a. a syntax tree
b. postfix notation
c. three-address code
C2: Make the intermediate code representation for the declaration.
1. Describe the grouping of applications of types (Remember and Apply)
1.1 Define type checking and declarations.
TI1. Define translation applications.
TI2. Explain the role of declaration statements in intermediate code
generation.
TI3. How the type and width of the basic and array types can be
computed?
TI4. Name the variable that is used to keep track of the next available
relative address.
TI5. List out the semantic rules.
TI6. Some languages such as PL/I, permit a list of names to be given a
list of attributes and also permit declarations to be nested within
one another. The following grammar abstracts the problem:
D namelist attrlist | (D) attrlist
namelist id , namelist | id
attrlist A attrlist | A
A decimal | fixed | float | real
Give a syntax-directed definition for declarations defined by this
grammar.
C3: Produce intermediate code for the assignment statements.
1. Describe assignment statements (Remember)
1.1 Translate the assignment statement to an intermediate code representation
TI1. How a name can be checked for its presence in the symbol table?
TI2. How does the renaming of temporary names can be done?
TI3. Construct three address code for the statement
x := a * b + c * d e * f
TI4. Write down the translation scheme for addressing array elements.
TI5. How does the type conversions within assignments can be done?
C4: Examine Boolean expressions, backpatching procedure calls.
1. Define Backpatching (Remember and Apply)
1.1 Describe the need for backpatching
TI1. How the backpatching can be used in Boolean expressions?
TI2. How the backpatching can be used to translate the flow control
statements into one pass?
TI3. What is procedure call?
TI4. How the procedure calls used in intermediate code?
1.2 Explain the importance of Boolean expressions
TI1. What is meant by type expression?

38
TI2. What is the need for Boolean expressions?
TI3. What are the methods available for translating Boolean
expressions?
TI4. In C, the for statement has the following form:
for ( e1 ; e2; e3)
Taking its meaning to be
e1;
while ( e2) {
stmt;
e3;
}
construct a syntax-directed definition to translate C-style for
statements into three-address code.

MODULE-IV Code Generation


Module Overview
This Module explains the issues to be considered to design a good code generator. It also details a
sample code generator and its various operations like register allocation, dag representation etc. It
also helps us to know about runtime storage management.
Module Competencies
1. Identify issues in designing a code generator.
2. Analyze various run time storage management techniques
3. Design a simple code generator
4. Apply DAG in code generation
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
C1. Identify issues in designing a code generator.
1. Designing a good Code Generator (Analyze)
1.1 List the issues in designing a good code generator.
TI1. List the issues in designing a good code generator.
TI2. Name the types of object code.
TI3. Analyze the trade off between efficiency and simplicity of
instruction selection.
TI4. State the two steps in register allocation process.
1.2 Introduce a sample Target Machine
TI1. Specify the instruction format of the sample target machine.
TI2. Discuss how the instruction cost is computed.
TI3. Which factors of the target machine affect the code generator
design?
C2. Analyze various run time storage management techniques
1. Knowledge of run time storage management techniques (Understand)
1.1 Discuss various run time storage management techniques

39
TI1. List the run time storage management techniques.
TI2. Explain in detail about static storage allocation.
TI3. Discuss about the dangling references problem.
TI4. Compare and contrast various parameter passing mechanisms.
1.2 Issues in Source Language
TI1. With a neat diagram, outline the contents of the activation record.
TI2. Write a procedure for quick sort and draw activation tree for the
code.
TI3. Differentiate scope and persistence of a variable.
TI4. List the two state mappings done from name to values.
TI5. How can we find a procedure is recursive?
2. Compare Various storage management techniques. (Analyze)
2.1 Pros and cons of storage management methods.
TI1. What are the limitations of static storage allocation?
TI2. Discuss the advantages of stack based storage allocation.
TI3. Describe the limitations of stack based storage allocation and how
heap based allocation is used for overcoming that limitation.
TI4. Explain about symbol table.
C3. Design a simple code generator.
1. Represent code using basic block and flow graphs(Understand)
1.1 Knowledge of basic blocks
TI1. Define basic block
TI2. Write the algorithm for partitioning a sequence of three address
statements into basic blocks.
TI3. State the method used for computing next use information about
names in basic blocks.
1.2 Construct flow graphs
TI1. What is a flow graph?
TI2. Explain about how basic blocks are represented as flow graphs.
TI3. Discuss about the data structures used for representing flow
graphs.
TI4. How can we detect loop and nested loops in flow graphs?

2. Model a simple code generator (Apply)


2.1 Design a simple code generator
TI1. Explain in detail the algorithm for a sample code generator.
TI2. Modify the function getreg in code generator algorithm to return
register pairs if needed.
TI3. What are the two pointers that are maintained for the input?
main()
{
int i;

40
int a[10];
while (i <= 10)
a[i] = 0;
}
TI4. Generate optimal code for the following assignment statement:
X = (a * - b) + (c + (d + e))
TI5. Discuss the data structures used in code generator algorithm.
2.2 Know register allocation and assignment
TI1. Describe special issues to be considered in global register
allocation.
TI2. Differentiate register allocation and register assignment.
TI3. Write notes on procedure to compute usage count of a variable x.
TI4. Give brief description on register allocation by graph coloring.
C4. Apply DAG in code generation
1. Represent Basic Blocks(Understand)
1.1 Know DAG for Basic Blocks
TI1. Define DAG.
TI2. State briefly about DAG for basic blocks.
TI3. Differentiate DAGs and flow graphs.
1.2 Constructing DAGs
TI1. Outline the algorithm for DAG construction for basic blocks.
TI2. State few applications of DAGs.
TI3. Discuss in detail about generating code from DAGs.

MODULE-V Code Optimization


Module Overview
This module discusses about the principle sources of optimization. It also describes optimization of
basic blocks, loops. In this module, global data flow analysis is introduced. It also highlights
various code improving transformations.
Module Competencies
1. Review principle sources of optimization
2. Perform optimization of basic blocks
3. Apply optimization in loops
4. Enhance code using code improving transformations
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
C1. Review principle sources of optimization
1. Introduce code optimization (Understand)
1.1 Methods to improve code efficiency
TI1. What are the factors that improve the efficiency of code?
TI2. In which all phases of compilation, code efficiency can be
improved?

41
TI3. Discuss about the various phases of code optimization.
TI4. State the advantages in performing machine independent code
optimization.
1.2 Knowledge of principle sources of optimization
TI1. List the various function preserving transformations.
TI2. Differentiate local and global transformations.
TI3. Explain about common sub expression elimination.
TI4. Define dead code.
TI5. What are induction variables?
TI6. Write notes on constant folding.
C2. Perform optimization of basic blocks
1. Understand basic block optimization (Understand)
1.1 Usage of DAGs in basic block optimization
TI1. How common subexpressions can be identified using DAG
representation for basic blocks?
TI2. Discuss in detail about algebraic optimization.
TI3. State the method of identifying b*c and c *b as common
subexpressions.
TI4. List the advantages of using DAG for code optimization.
C3. Apply optimization in loops
1. Represent loops using flow graphs(Understand)
1.1 Knowledge of flow graphs
TI1. Define dominator.
TI2. What is a dominator tree?
1.2 Identify loops in flow graphs
TI1. What is a header of a loop?
TI2. How dominator information can be used to find loops in flow
graphs?
TI3. Explain the algorithm for constructing natural loop.
TI4. What is the need for creating a block called preheader?
2. Review Optimization in loops (Apply)
2.1 Loop optimization
TI1. When a flow graph is reducible?
TI2. Why a flow graph is rarely non reducible?
TI3. State the significance of loop optimization compared to
optimization of statements outside loop.
2.2 Introduce Data Flow Analysis
TI1. State the equation that denotes the data flow information of a
statement.
TI2. Define Point, Path.
TI3. What are reaching definitions?

42
TI4. Explain how data flow analysis is performed on structured
programs.
TI5. Discuss about live variable analysis.
C4. Enhance code using code improving transformations
1. Describe code improving transformations(Understand)
1.1 Write procedures for code improving transformations
TI1. Explain the algorithm for global common subexpression
elimination.
TI2. How ud-chains are used in finding redundant copy statements?
TI3. Write the procedure to detect loop invariant computations.
TI4. Give the algorithm for performing code motion.
TI5. State the method for detecting induction variables in loops.
TI6. How induction variable elimination is implemented?

43
CS63 Object Oriented Analysis and Design

Course Details:
Subject Code : CS63
Subject Name : Object Oriented Analysis and Design
Semester : B.E (CSE) VI Semester
Prepared By : Mr.C.Balasubramanian and Mr.B.Lakshmanan
Approved By : Dr.K.Muneeswaran
Effective Date : 02.01.2012
Revision No : 1.2

Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysis and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modelling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write
effective reports and design documentation, make effective presentations, and
give and receive clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural


issues and the consequent responsibilities relevant to engineering practice.

9. Understand and commit to professional ethics and responsibilities and norms of


engineering practice.

44
10. Understand the impact of engineering solutions in a societal context and demonstrate
knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business


practices, such as risk and change management, and understand their
limitations.

12. Recognize the need for, and have the ability to engage in independent and life-
long learning.

Competencies
1. Capable of distinguish the relationship between Structured Approach and OOA (1,2)
2. Model the objects with real world problems(1,2)
3. Identify the Unified Process(UP) phases (1,2,3,4,5)
4. Model the diagrams with UML notations(1,2)
5. Analyze the use cases and attributes(1,2,3,4,5)
6. Interpret the concepts of Design patterns, Cohesion and Coupling.(4,7,8)
7. Capable of designing User Interface and Mapping design to code (5,8,9,11,12)

Concept Map

45
46
Course Assessment Matrix

Course Title : Object Oriented Analysis and Design


S. Programme Outcomes
No. Competencies (Washington Accord)
1 2 3 4 5 6 7 8 9 10 11 12
1. Capable of distinguish the relationship
between Structured Approach and OOA X X
2. Model the objects with real world X X
problems
3. Identify the Unified Process(UP) phases X X X X X

4. Model the diagrams with UML notations X X

5. Analyze the use cases and attributes X X X X X

6. Interpret the concepts of Design X X X


patterns, Cohesion and Coupling
7. Capable of designing User Interface and X X X X X
Mapping design to code

Syllabus (As prescribed by Anna University,Tirunelveli)

UNIT I 9

Introduction to OOAD What is OOAD? What is UML? What are the Unified process(UP) phases -
Case study the NextGen POS system, Inception -Use case Modeling - Relating Use cases
include, extend and generalization.

UNIT II 9

Elaboration - Domain Models - Finding conceptual classes and description classes Associations
Attributes Domain model refinement Finding conceptual class hierarchies- Aggregation and
Composition- UML activity diagrams and modeling

UNIT III 9

System sequence diagrams - Relationship between sequence diagrams and use cases Logical
architecture and UML package diagram Logical architecture refinement UML class diagrams -
UML interaction diagrams

UNIT IV 9

GRASP: Designing objects with responsibilities Creator Information expert Low Coupling
Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter,
singleton, factory and observer patterns.

UNIT V 9

UML state diagrams and modeling - Operation contracts- Mapping design to code UML
deployment and component diagrams

Total :45 periods

47
Course Plan:
Sl.No. Subject Reference Hours Remarks

Module-I
1 Introduction to OOAD T1 Ch- 1 1
2 What is OOAD? T1 Ch-1 1
3 What is UML? T1 Ch-1 1
4 What are the Unified Process(UP) phases T1 Ch-2 1
5 Case study: the NextGen POS system T1 Ch-3 1
6 Inception T1 Ch-4 1
7 Use case modeling T1 Ch-6 1
8 Relating Use cases-include and extend T1 Ch-30 1
9 Generalization in Use case modeling T1 Ch-30 1

10 Tutorial Problems 1
Total Hours 10

Module-II
11 Elaboration T1 Ch-8 1
12 Domain models-Introduction T1 Ch-9 1
13 Finding conceptual classes and description classes T1 Ch-9 1
14 Associations and Attributes T1 Ch-9 1
15 Domain model refinement T1 Ch-31 1
16 Finding conceptual class hierarchies T1 Ch-31 1
17 Aggregation and Composition T1 Ch-31 1
18 UML Activity diagrams and Modeling T1 Ch-28 1
19 Problems in UML modeling 1
Total Hours 9
Module-III
20 System Sequence diagrams T1 Ch-10 2
21 Relationship between sequence diagrams and use T1 Ch-10 1
cases
22 Logical architecture and UML Package diagram T1 Ch-13 1
23 Logical architecture refinement T1 Ch-34 1
24 UML Class diagrams T1 Ch-16 2

25 UML Interaction diagrams T1 Ch-15 2


Total Hours 9
Module-IV
26 GRASP: Designing Objects with Responsibilities T1 Ch-17 1
27 Creator T1 Ch-17 1
28 Information Expert T1 Ch-17 1
29 Low Coupling T1 Ch-17 1
30 Controller T1 Ch-17 1
31 High Cohesion and Designing for Visibility T1 1
Ch-17,19
32 Applying GoF design patterns-Adapter T1 Ch-26 1
33 Singleton T1 Ch-26 1
34 Factory T1 Ch-26 1
35 Observer T1 Ch-26 1
Total Hours 10
Module-V
36 UML State Machine Diagrams and Modeling T1 Ch-29 2
37 Operation Contracts T1 Ch-11 2
38 Mapping Designs to Code T1 Ch-20 2
39 UML Deployment and Component diagrams T1 Ch-38 2
40 Tutorial Problems 1
Total Hours 9
Total Hours: 47

48
TEXT BOOK:

1. Craig Larman,"Applying UML and Patterns: An Introduction to object-oriented Analysis and


Design and iterative development, Third Edition, Pearson Education, 2005

REFERENCES:
1. Mike ODocherty, Object-Oriented Analysis & Design: Understanding System Development with
UML 2.0, John Wiley & Sons, 2005.
2. James W- Cooper, Addison-Wesley, Java Design Patterns A Tutorial, 2000.
3. Michael Blaha, James Rambaugh, Object-Oriented Modeling and Design with UML, Second
Edition, Prentice Hall of India Private Limited, 2007
4. Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, Design patterns: Elements of
Reusable object-oriented software, Addison-Wesley, 1995.

MODULE-I
Module Overview
This module helps to understand the need of object oriented analysis and design and also provide
the overview of the UML diagrams and notations that deals with the design. The module elaborates
the four phases of Unified process. This module helps to understand the Inception phase and Use
case modeling with the real world case study.
Module Competencies
1. Model and analyse the real world problems in terms of objects.
2. Justify the need for UML.
3. Identify the four phases in Unified process (UP).
4. Capable of generating use cases during inception.
5. Design the system with object based technologies for simple applications
Instructional objectives of a course in Gronlund format:
General Instructional Objectives (GIO) and Specific Learning Outcomes (SLO) and the
Test Items (TI)
C1: Model and analyse the real world problems in terms of objects
1. Define the object-oriented philosophy (Remember)
1.1 List the two orthogonal views of the software
TI1: Differentiate between the traditional and object-oriented views of
software.
TI2: List the merits of object-oriented approach in software
development.
TI3: What is meant by OOA and OOD?

2. Explain the object-oriented systems development methodology


(Understand)
2.1 State the need for object orientation in the software construction

49
TI1: Do you agree that object orientation emphasizes representation of
objects? Justify your answer.
C2: Justify the need for UML
1. Understand the Perspectives of UML (Understand)
1.1 Explain the conceptual perspective.
TI1: What is need for UML in the present scenario?
TI2: What do you meant by visualizing the domain model?
TI3: How Agile modelling emphasizes UML as sketch?
TI4: What is meant by reverse engineering?
1.2 Elaborate on Implementation software.
TI1: What are all the diagrams describe the software implementations
in java technology?
TI2: Is the lower representational gap improves models of domain?
C3: Identify the four phases in Unified process (UP)
1. Define iterative development (Remember)
1.1 Explain about iterative and evolutionary development
TI1: Define life cycle approach.
TI2: State the difference between iterative and incremental
development vs iterative and evolutionary development.
TI3: List out the ways to handle change on an iterative project.
TI4: List the benefits of Iterative development.
TI5: What is meant by time boxed?
TI6: What is risk-driven and client-driven iterative planning?
1.2 Explain about waterfall life cycle
TI1: List the limitations in waterfall modelling
TI2: State the need for feedback and adaptation in the development
process.
2. Understand the need for Agile development (Understand)
2.1 Explain the Agile methods and Attributes
TI1: List out the practices in Agile modelling.
TI2: What is Agile UP?
TI3: Name the few best practices and key concepts in the UP.

3. Explain about the unified approach for understanding of ooad concepts


(Understand)
3.1 State the importance of UP phases
TI1: What are the uses of layered architecture to develop applications?
TI2: What is the heart of the unified approach?
TI3: What is meant by inception and elaboration phases?

4. Explain the Relationship between the Disciplines and Phases.


(Understand)

50
4.1 State the work and iterations across the major phases.
TI1: Are there any optional artifacts or practises in the UP?
TI2: What is the development case?
TI3: How to customize the process?
C4: Capable of generating use cases during inception
1. Define Inception (Remember)
1.1 Understand the inception phase.
TI1: List the common inception artifacts and comment their issues.
TI2: How much UML during Inception phase?
2. State the importance of Use case modelling(Understand)
2.1 Explain the use case modelling
TI1: What are actors, scenarios and use cases?
TI2: What is meant by use cases and the use case model?
TI3: Define use cases.
TI4: What are three kinds of actors?
TI5: What are three common use case formats?
2.2 Understand the relating use cases
TI1: What is meant by include, extend and generalize relationship
TI2: Draw the use case include relationship in the use-case model for
NextGen
POS system
3. Draw the Use-case diagram(Apply)
TI1: Draw the use case diagram (with actors) for the following problem
statement:
A Ticket Vending Machine (TVM) dispenses tickets to passengers at
a railway station. Passengers use the front panel to specify their
Boarding and destination place, details of passenger (number of
adults & children) and date of travel. The machine displays the fare
for the requested ticket. The passengers then deposits cash in the
bin provided and presses accept cash. The machine checks the
cash, if it is more, the balance cash is paid out. And the ticket
requested is printed. The system is also used by the operator who
might want to know the cash held in the machine, the break-up of
small change available in the machine, withdraw or deposit cash
when needed. And the report options also include the detailed
report of transactions, summary report of the number of tickets
sold for each destination, opening balance, cash collected, cash
dispensed and current balance in the machine.
4. Identify the actors and use cases (Analyze)
TI1: Following is a Use-case diagram for the Ware House Management
System (Figure-1). Identify the Actors/ Use cases for labels A-F
from the given list.

51
Customer, Warehouse Worker, Foreman, Check Space Availability,
Cancel Reserved Space, Reserve Space, Check Truck Availability,
Assign Containers, Reject Order, Accept Order.

Figure-1 Use case diagram for Ware House Management System

C5: Design the system with object based technologies for simple applications
1. Create the NextGen POS system (Design)
1.1 Understand the project scenario
TI1: Create the Point of Sale (POS) system is a computerized
application used to record sales and handle payments; it is
typically used in a retail store. It includes hardware components
such as a computer and bar code scanner, and software to run the
system. The system interfaces to various service applications, such
as a third party tax calculator and inventory control. The systems
must be relatively fault-tolerant; that is, even if remote services
are temporarily unavailable (such as inventory system), they must
capable of capturing sales and handling at least cash payments.

MODULE-II
Module Overview
This module explains about the elaboration phase in Unified process and describes about domain
models through finding conceptual classes and description classes. This module elaborates the
concept of association, it is a relationship between classes that indicates the meaningful and
interesting connection. This module explains about the attribute requirements in conceptual
classes. This module states the importance of aggregation, composition and UML activity diagram.
Module Competencies
1. Model the elaboration phase in UP.
2. Justify the need of domain models.

52
3. Analyse about Domain model refinement.
4. Identify the features of UML activity diagrams and modelling.
GIO SLO TI
C1: Model the elaboration phase in UP
1. Define elaboration (Remember)
1.1 Understand the elaboration phase
TI1: List the key ideas and best practises followed in elaboration.
TI2: Give the sample artifacts may be started in elaboration phase.
1.2 Explain the first iteration in the elaboration phase
TI1: List out the requirements for the first iteration of the NextGen POS
application and Monopoly application.
C2: Justify the need of domain models
1. Understand the domain model (Understand)
1.1 Explain the Domain model in UP
TI1: What is meant by domain model in UP?
TI2: State whether the domain model a Visual dictionary?
TI3: Is a domain model a picture of software business objects?
TI4: What are the two traditional meanings of domain model?
TI5: Give the guidelines to create a domain model?
1.2 Elaborate on Conceptual classes and description classes
TI1: Explain the terms: Symbol, Intension, Extension
TI2: What is difference between domain and data model?
TI3: What are three strategies to find conceptual classes?
TI4: Explain the usage of description classes?
TI5: When are description classes useful?
2. Explain about associations and attributes (Understand)
2.1 Understand about association
TI1: Give the guidelines for associations in a domain model.
TI2: Give the guideline to name an association in UML.
TI3: Define role.
TI4: What is meant by multiplicity?
2.2 Discuss on attributes
TI1: When to show attributes?
TI2: Give the attribute notation by applying UML.
TI3: What are suitable attribute types?
TI4: What is meant by derived attributes?

3. Create a domain model (Design)


3.1 Case study: Grocery store problem
TI1: A store wants to automate its inventory. It has point-of-sale
terminals that can record all of the items and quantities that a
customer purchases. Another terminal is also available for the

53
customer service desk to handle returns. It has a similar terminal
in the loading dock to handle arriving shipments from suppliers.
The meat department and produce departments have terminals to
enter losses/discounts due to spoilage.
C3: Analyse about Domain model refinement
1. State the conceptual class hierarchies (Understand)
1.1 Discuss fundamental concepts in domain modelling
TI1: Illustrate the generalization concept with an example.
TI2: What is the relationship of a conceptual super class to a subclass?
TI3: Write down 100% rule and Is-a rule.
TI4: What is a correct conceptual subclass?
TI5: Discuss some of the motivations to partition a class into
subclasses.
TI6: When to define a conceptual super class?
1.2 Summarize abstract conceptual classes and modelling changing states
TI1: Give an example for abstract class notation in the UML.
TI2: Write down the guidelines for modelling changing states.
1.3 Exemplify association classes
TI1: Write down the modelling principle of association classes.
TI2: Give the guidelines for adding association classes.
2. Explain the concept on Aggregation and Composition (Understand)
2.1 State the importance of composition
TI1: Write down the benefits of showing composition in domain model.
TI2: Give the guidelines for composition and aggregation.
TI3: Give the examples for qualified association, reflexive association.
C4: Identify the features of UML activity diagrams and modelling
1. Illustrate the importance of UML activity diagram (Understand)
1.1 Interpret the need of activity diagrams
TI1: How to apply activity diagrams?
TI2: What is meant by business process modeling and data flow
modeling?
TI3: Give the guidelines in activity modeling
1.2 Compare the use of the two guards
TI1: The two guards (has neighbour and talked enough) in the
following fragment of activity diagram (Figure-2) (defining the
normal activities of OOAD lab class groups). Explain the difference
in the effect the two guards have concerning the (concurrent) flow
of control.

54
Figure-2 The normal activities of OOAD lab class groups
1.3 Give the interpretation for the activity diagram
TI1: Explain the workflow of the activities that is shown in the following
figure-3.

Figure-3 The workflow of ATM transactions

MODULE-III
Module Overview
This module elaborates system sequence diagrams and its relationship between sequence
diagrams and use cases. The module explains the logical architecture and layers with guidelines
for design with layers and model view separation principle. This module exemplifies UML package,
UML class and UML interaction diagrams. This module illustrates logical architecture refinement
which generalizes collaborations with the layers pattern, layer pattern issues, model-view
separation and Upward communication.
Module Competencies
1. Model the system sequence diagrams and its relationship with use cases.
2. Analyse about Logic architecture and its refinement.
3. Justify the need of UML package, UML class and UML interaction diagrams.

55
GIO SLO TI
C1: Model the system sequence diagrams and its relationship with use cases
1. Explain the System Sequence Diagram (Understand)
1.1 Express the motivation behind SSD
TI1: Give the guideline to draw an SSD.
TI2: What is the relationship between SSDs and Use cases?
TI3: How to name system events and operations?
C2: Analyse about Logical architecture and its refinement
1. Explain the Logical architecture (Understand)
1.1 Describe the logical architecture with layers
TI1: Discuss the typical layers in an OO system
TI2: What is software architecture?
TI3: List the essential need of using layers.
TI4: List out the problems that are addressed by using layers.
1.2 Explain about key concept in OO design
TI1: What is the relationship between the domain layer and domain
model?
TI2: What is meant by tiers, layers and partitions?
TI3: Explain model-view separation principle.
TI4: What is the connection between SSDs, System operations and
layers?
2. Understand about logical architecture refinement(Understand)
2.1 Discuss the issues in logical architecture and the layers pattern
TI1: Explain the inter-layer and inter-package coupling.
TI2: Describe about inter-layer and inter-package interaction scenarios.
TI3: Elaborate in detail about collaborations with the layers pattern.
TI4: Explain the other layer pattern issues.
C3: Justify the need of UML package, UML class and UML interaction diagrams
1. Illustrate the importance of UML package and class diagram (Understand)
1.1 Discuss about package diagram
TI1: What is the importance of using package diagram.
TI2: Draw the package diagram for RMO system
1.2. Explain the class diagrams
TI1: What are the key principles in OO design?
TI2: Draw the UML class diagram in conceptual and software
perspective.
TI3: What is meant by classifier?
TI4: What are the several representation for attributes of a classifier?
TI5: Write down the format of the attribute text notation
2. Explain about dynamic object modelling (Understand)
2.1 State the importance of interaction diagram

56
TI1: Differentiate between the sequence diagram and collaboration
diagram
TI2: What are the strengths and weaknesses of sequence vs
communication diagrams?
TI3: Write down the basic sequence diagram notation.
TI4: What is meant by asynchronous and synchronous calls?
TI5: List out the basic communication diagram notation

MODULE-IV
Module Overview
This module helps to understand the designing the objects and assigning responsibilities. In other
words, designing objects with responsibilities. This module also introduces five types of patterns
which come under the category GRASP and their uses. In addition to the GRASP patterns, this
module helps to understand a few of the patterns which come under GoF.
Module Competencies
1. Model the concept of designing objects with responsibilities
2. Justify the need of patterns.
3. Identify and apply the GRASP patterns wherever needed.
4. Identify and apply the GoF patterns wherever needed.
GIO SLO TI
C1: Model the concept of designing objects with responsibilities
1. Define Objects with responsibilities (Remember)
1.1 The basic techniques of meeting the user requirements
TI1: What are the inputs and outputs of object design?
TI2: Differentiate between doing and knowing responsibilities
1.2 The activities of object design
TI1: List out the steps involved designing the object
2. Explain in detail about designing objects with responsibilities
(Understand)
2.1 Inputs, outputs and activities involved in designing an object
TI1: Explain in detail about designing objects with responsibilities
C2: Justify the need of patterns
1. Understand the basic concept of patterns (Understand)
1.1 List the terminologies in patterns.
TI1: Define patterns
TI2: What are GRASP and GoF patterns?
1.3 Explain about patterns.
TI1: What are the concepts related to patterns?
TI2: What is meant by anti pattern?
C3: Identify and apply the GRASP patterns wherever needed
1. Define the GRASP and GoF patterns (Understand)
1.1 List the GRASP patterns
TI1: What is meant by GRASP?

57
TI2: List out the patterns that comes under GRASP
1.2 List the GoF patterns
TI1: What is meant by GoF?
TI2: List out the patterns that comes under GoF

2. Identify the scenario for GRASP patterns (Remember)


2.1 Explain about the scenario for Creator
TI1: What is Creator pattern?
TI2: Write down the problem that to be considered in order to use
creator?
TI3: Explain the structure of Creator.
2.2 Explain about the scenario for Information Expert
TI1: What is Information Expert pattern?
TI2: Write down the problem that to be considered in order to use
Information
Expert?
TI3: Explain the structure of Information Expert.
2.3 Explain about the scenario for Low Coupling
TI1: What is Low Coupling pattern?
TI2: Write down the problem that to be considered in order to use Low
coupling?
TI3: Explain the structure of Low Coupling.
2.4 Explain about the scenario for Controller
TI1: What is Controller pattern?
TI2: Write down the problem that to be considered in order to use
controller?
TI3: Explain the structure of Controller.
2.5 Explain about the scenario for High Cohesion
TI1: What is High Cohesion pattern?
TI2: Write down the problem that to be considered in order to use High
cohesion?
TI3: Explain the structure of High Cohesion.
3. Analyse the situations where a particular pattern can be used while
designing
object for a system(Apply)
3.1 Identify which pattern to be used based on requirement
TI1: Consider the Next Gen Pos system objects and try to find the
responsibilities of each object with respect to fulfilling the user
requirements. Analyse the requirements and identify which GRASP
patterns are suitable to the objects.
TI2: Justify your ideas regarding the issues and shortcomings in
applying the patterns

58
C4: Identify and apply the GoF patterns wherever needed
1. Defining the GOF and GoF patterns (Understand)
1.1 List the GOF patterns
TI1: What is meant by GOF?
TI2: List out the patterns that comes under GOF
1.2 List the GoF patterns
TI1: What is meant by GoF?
TI2: List out the patterns that comes under GoF
2. Identify the scenario for GOF patterns (Remember)
2.1 Explain about the scenario for Adapter
TI1: What is Adapter pattern?
TI2: Write down the problem that to be considered in order to use
adapter?
TI3: Explain the structure of Adapter.
2.2 Explain about the scenario for Singleton
TI1: What is Singleton pattern?
TI2: Write down the problem that to be considered in order to use
Singleton?
TI3: Explain the structure of Singleton.
2.3 Explain about the scenario for Factory
TI1: What is Factory pattern?
TI2: Write down the problem that to be considered in order to use
Factory?
TI3: Explain the structure of Factory.
2.4 Explain about the scenario for Observer
TI1: What is Observer pattern?
TI2: Write down the problem that to be considered in order to use
Observer?
TI3: Explain the structure of Observer.
3. Analyse the situations where a particular pattern can be used while
designing
object for a system (Apply)
3.1 Identify which pattern to be used based on requirement
TI1: Consider the Next Gen Pos system objects and try to find the
responsibilities of each object with respect to fulfilling the user
requirements. Analyse the requirements and identify which GOF
patterns are suitable to the objects.
TI2: Justify your ideas regarding the issues and shortcomings in
applying the patterns

59
MODULE-V
Module Overview
This module explains about generating State Diagrams for a system and Operation Contracts. It
also give the basic techniques for mapping the design to code. It gives the basic idea about
Deployment and Component diagrams.
Module Competencies
1. Capable of generating State diagrams.
2. Model the concept of Operation Contracts.
3. Identify the methods for mapping design to the code.
4. Analyse the concept of generating Deployment and Component Diagrams.
GIO SLO TI
C1: Capable of generating State Diagrams
1. Defining the Components of State Diagrams (Remember)
1.1 Defining Events, States and Transitions
TI1: What is meant by State?
TI2: Define State Transitions
TI3: What are events that cause transitions?
2. Understand the guidelines for generating State Diagrams (Understand)
2.1 Explain the basic guidelines for generating the State Diagrams
TI1: Explain in detail about State Diagram generation
2.2 Generate State Diagram for a given problem
TI1: Consider the steps involved in logging into a mailbox of a mail
system. Draw state transition Diagrams for the page navigations
involved.
C2: Model the concept of Operation Contracts
1. Defining Operation Contract (Remember)
1.1 Defining basic terminologies of operation contract
TI1: What is meant by Operation Contract?
TI2: What is system operation?
TI3: What is meant by pre condition and post condition?
2. Understand the concept and usefulness of Operation Contracts
(Understand)
2.1 Explain the basic guidelines for writing operation contract
TI1: How will you write a contract?
TI2: What are the common mistakes committed?
TI3: What are the uses of contracts?
3. Produce operation constract for the given problem (Create)
TI1: Consider the NextGen POS system. Write down system Operation
Contract for the enter Item
C3: Identify the methods for mapping design to the code
1. Methods involved in mapping design to the code (Understand)
1.1 Creating class definitions

60
TI1: Explain in detail about creating class definitions
1.2 Creating Methods
TI1: How interaction Diagrams are useful in creating methods?
TI2: Give suitable example for creating methods from interaction
Diagrams.
1.3 Explaining other issues
TI1: How will you handle errors and exceptions while generating code?
TI2: How will you decide the order for implementing the classes?
C4: Analyse the concept of generating Deployment and Component Diagrams
1. Defining the Component and Deployment Diagrams (Remember)
1.1 Defining elements of Component and Deployment Diagrams
TI1: What is meant by device node?
TI2: What is meant by execution environment node?
TI3: Define Component?
2. Understand the guidelines for generating Component and Deployment
Diagrams (Understand)
2.1 Explain the basic guidelines for generating the Component and Deployment
Diagrams
TI1: Explain in detail about Component diagram generation
TI2: Explain in detail about Deployment diagram generation
2.2 Generate Component and Deployment diagram for a given problem
TI1: Consider the operations of a web server. Generate Component and
Deployment diagram for the given scenario.

61
CS64 ADVANCED COMPUTER ARCHITECTURE

Course Details:
Subject Code : CS64
Subject Name : ADVANCED COMPUTER ARCHITECTURE
Semester : BE(CSE) VI Semester
Prepared By : Mrs. G. Ananthi and Ms. K. Nila
Effective Date : 02.01.2012
Revision No. : 1

Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysis and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modeling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive
clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to engineering practice.

9. Understand and commit to professional ethics and responsibilities and norms of


engineering practice.

62
10. Understand the impact of engineering solutions in a societal context and
demonstrate knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business practices,


such as risk and change management, and understand their limitations.

12. Recognize the need for, and have the ability to engage in independent and life-
long learning.

Competencies
8. Deploy the principles of code scheduling(1,2)
9. Apply the concepts of compiler technique for exposing ILP(1,2)
10. Design branch prediction methods.(1,2,3)
11. Compare the performance of IA64 and Itanium processors.(1,2,9,10)
12. Analyze the limitations of ILP(1,2,4)
13. Design the symmetric and distributed shared memory system.(2,3,4,5)
14. Apply the concept of multithreading.(1,2,4,5,10,11,12)
15. Design an I/O system.(1,2,3,12)
16. Apply the methods to reduce cache miss penalty and miss rate(1,2,4,5,11,12)
17. Design the CMP architecture(1,2,3,12)
18. Design an IBM cell processor based architecture. (2,3,4,5)

Concept Map

63
Course Assessment Matrix
Course Title : Data Structures and Object Oriented Programming in C++
S. Competencies Programme Outcomes
No (Washington Accord)
1 2 3 4 5 6 7 8 9 10 11 12
1. Deploy the principles of code
scheduling(1,2) x X
2. Apply the concepts of compiler x X
technique for exposing ILP(1,2)
3. Design branch prediction x x X
methods.(1,2,3)
4. Compare the performance of IA64 and X X x X
Itanium processors.(1,2,9,10)
5. Analyze the limitation of ILP(1,2,4) x X x

6. Design the symmetric and distributed X X X X


shared memory system.(2,3,4,5)
7. Apply the concept of X X X X x x x
multithreading.(1,2,4,5,10,11,12)
8. Design an I/O system.(1,2,3,12) x X X X

9. Apply the methods to reduce cache X x X X x X


miss penalty and miss
rate(1,2,4,5,11,12)
10. Design the CMP architecture(1,2,3,12) x X X x
11. Design an IBM cell processor based X X X X
architecture. (2,3,4,5)

Syllabus (As prescribed by Anna University,Tirunelveli)

UNIT I INSTRUCTION LEVEL PARALLELISM 9


ILP Concepts and challenges, Hardware and software approaches Dynamic scheduling
Speculation, Compiler techniques for exposing ILP, Branch prediction.

UNIT II MULTIPLE ISSUE PROCESSORS 9


VLIW & EPIC, Advanced compiler support, Hardware support for exposing parallelism,
Hardware versus software speculation mechanisms, IA 64 and Itanium processors, Limits on ILP.

UNIT III MULTIPROCESSORS AND THREAD LEVEL PARALLELISM 9


Symmetric and distributed shared memory architectures, Performance issues,
Synchronization, Models of memory consistency, Introduction to Multithreading.

UNIT IV MEMORY AND I/O 9

64
Cache performance Reducing cache miss penalty and miss rate Reducing hit time, Main
memory and performance Memory technology, Types of storage devices Buses, RAID
Reliability, availability and dependability, I/O performance measures, Designing an I/O system.

UNIT V MULTI-CORE ARCHITECTURES 9


Software and hardware multithreading SMT and CMP architectures Design issues, Case
studies: Intel Multi-core architecture SUN CMP architecture, heterogeneous multi-core
processors, case study: IBM Cell Processor.

TOTAL: 45 HOURS

TEXT BOOKS:
1. John L. Hennessey and David A. Patterson, Computer architecture A quantitative
approach, Morgan Kaufmann / Elsevier Publishers, 4th edition, 2007.

REFERENCES:
1. David E. Culler, Jaswinder Pal Singh, Parallel computing architecture : A
hardware/software
approach , Morgan Kaufmann /Elsevier Publishers, 1999.
2. Kai Hwang and Zhi.Wei Xu, Scalable Parallel Computing, Tata McGraw Hill, New Delhi,
2003.
WEB REFERENCES:
1. http://www.intel.com/technology/itj/2006/volume10issue02/art02_CMP_Implementation/p
03_implementation.htm
2. http://www.stanford.edu/~mlinderm/papers/Linderman_Thesis.pdf
3. http://www.research.ibm.com/cell/

Course Plan

Sl.No. Subject Reference Hours Remarks

UNIT I
1 ILP Concepts and challenges T1 2
2 Hardware based Dynamic scheduling T1 2
Tomasulos approach
3 Hardware based speculation T1 2
4 Compiler techniques for exposing ILP T1 2
5 Branch prediction T1 2
Total Hours 10

UNIT II
6 VLIW & EPIC T1 2
7 Advanced compiler support T1 2
8 Hardware support for exposing parallelism T1 2
9 Hardware versus software speculation T1 1
mechanisms
10 IA 64 and Itanium processors T1 2
11 Limits on ILP T1 2
Total Hours 11
UNIT III
12 Symmetric and distributed shared memory T1 2
architectures
13 Performance issues T1 2
14 Synchronization T1 2
15 Models of memory consistency T1 2
16 Introduction to Multithreading T1 1
Total Hours 9
UNIT IV

65
Sl.No. Subject Reference Hours Remarks
17 Cache performance T1 1

18 Reducing cache miss penalty, miss rate and T1 2


hit time
19 Main memory and performance T1 2
20 Memory technology, Types of storage devices T1 2
Buses
21 RAID Reliability, availability and T1 1
dependability
22 I/O performance measures T1 2
23 Designing an I/O system T1 2
Total Hours 12

UNIT V
24 SMT architecture Design issues T1 1
25 CMP architecture Design issues WR1 1
26 SUN CMP architecture WR4 2
27 Heterogeneous multi-core processors WR2 1
28 IBM Cell Processor WR3 2
Total Hours 7
Total Hours: 49

MODULE-I INSTRUCTION LEVEL PARALLELISM

Module Overview:
This Module explains the concepts and challenges of Instruction level parallelism. It explains the
hardware and software approaches for exposing ILP. It deals with the code scheduling and
speculation methods and branch prediction methods.
Module Competencies
1. Analyze the concepts and challenges of Instruction level parallelism and different
approaches for exposing ILP.
2. Apply the code scheduling and speculation methods.
3. Apply compiler technique for exposing ILP.
4. Select among different branch prediction methods.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes)

C1: Analyze the concepts and challenges of Instruction level parallelism and different
approaches for exposing ILP.
1. Define Instruction Level Parallelism. (Remember)
1.1 What is meant by Instruction Level Parallelism?
TI1: Define ILP
TI2: Give the formula for pipeline CPI
1.2 Define loop level parallelism
TI1: What is meant by loop level parallelism?
TI2: What are the different techniques to convert loop level parallelism
into ILP?

66
TI3: Define vector processor.
2. Mention different types of data dependences. (Understand)
2.1 What are the kinds of data dependences?
TI1: What is a true data dependence?
TI2: What does the true data dependence indicate?
TI3: What does the control dependence mean? Mention the constraints
imposed by control dependences.
2.2 Can you mention different name dependences?
TI1: Differentiate antidependence and output dependence.
TI2: Define register renaming.
TI3: Whether name dependence is a true dependence? If yes or no,
reason it out.
3. Determine the type of dependence that exists (Apply)
3.1 Determine the type of dependence that exists in the program.
TI1: Consider the following four MIPS code fragments, each containing
two instructions:
DADDI R1,R1,#4
LD R2,7(R1)
DADD R3,R1,R2
SD R2,7(R1)
SD R2,7(R1)
S.D F2,200(R7)
iv. BEZ R1,place
SD R1,7(R1)
Identify each type of dependence that exists or that may exist (a
fragment may have no dependences) and describe what data flow,
name reuse, or control structure causes or would cause the
dependence.
TI2: Find out the hazard that may arise in the following code sequence
when the pipeline performs out of order execution:
ADD.D F4, F2, F0
DIV.D F8, F4, F10
SUB.D F8, F12, F10
TI3: For the following code fragment, assume that all data references
are shown, that all values are defined before use, and that only b
and c are used again after this segment. You may ignore any
possible exceptions. The individual statements are numbered to
provide an easy reference.
1. if (a>c) {
2. d = d + 5;
3. a = b + d + e; }
4. else{

67
5. e = e + 2;
6. f = f + 2;
7. c = c + f; }
8. b = a + f;
List the control dependences. For each control dependence, tell
whether the dependent statement can be scheduled before the if
statement based on data references.
4. Compare true data dependence and name dependence. (Analyze)
4.1 Compare true data dependence and name dependence and find which is
more hazardous.
TI1: Can you mention different types of data hazards?
TI2: Is Read After Read (RAR) a hazard?
4.2 Check whether code in one form can be changed to another.
TI1: Consider the following code:
if p1{
S1;
S2;
};
Whether this code can be changed as follows:
S1;
if p1{
S2;
};
Justify your answer.
5. Design a MIPS assembly code fragment for the given code (Create)
5.1 Generate the MIPS code
TI1: For the following code fragment, design the MIPS assembly code:
for ( i = 0; i <= 100; i++ )
x[i] = x[i] + 20

C2: Apply the code scheduling and speculation methods


1. To schedule the code. (Remember)
1.1 Mention different code scheduling methods.
TI1: Define dynamic scheduling.
TI2: Define score-boarding.
TI3: What are the common characteristics of Tomasulos approach.
1.2 How register renaming is done in Tomasulos scheme?
TI1: What is meant by register renaming?
TI2: How it takes place?
2. To differentiate dynamic scheduling and hardware based speculation.
(Understand)
2.1 How speculation differs from dynamic scheduling?

68
TI1: What are the key ideas that are combined together in hardware
based speculation?
TI2: What are the significance of reorder buffer?
TI3: With neat sketch, explain hardware based speculation with an
example.
2.2 Explain why register renaming takes place during speculation.
TI1: Differentiate reorder buffer from reservation station.
TI2: What are the fields that each entry in ROB has?
3. To compare the steps involved in Tomasulos approach and hardware
based speculation. (Analyse)
3.1 How hardware based speculation is performed?
TI1: What are the steps that each of the instruction goes through in
dynamic Scheduling?
TI2: What are the steps involved in instruction execution during
speculation of code?
4. Show what the status tables look like when MUL.D is ready to go to
commit (Apply & Analyze)
4.1 For the given specification, find out the contents of status table.
TI1: Consider the following MIPS code and show the contents of status
table when MUL.D is ready to go to commit (During hardware
based speculation ):
L.D F6,34(R2)
L.D F2,45(R3)
MUL.D F0,F2,F4
SUB.D F8,F6,F2
DIV.D F10,F0,F6
ADD.D F6,F8,F2
TI2: Show what the information tables look like for the above MIPS
code when only the first load has completed and written its result.
C3: Apply compiler technique for exposing ILP.
1. Mention the compiler techniques to expose ILP. (Remember)
1.1 Define code scheduling.
TI1: What is meant by code scheduling?
TI2: Define loop unrolling.
TI3: List out the latencies of some FP operations.
2. To know about loop unrolling and scheduling. (Understand)
2.1 Explain loop unrolling and scheduling with an example.
TI1: Explain basic compiler techniques for exposing ILP with an
example.
TI2: Mention the need for loop unrolling and scheduling.
3. Write the MIPS code as required. (Apply)
3.1 Show the MIPS code as mentioned.

69
TI1: Show how the loop would like on MIPS, both scheduled and
unscheduled, including any stalls or idle clock cycles for the
following code fragment:
for ( i = 1000; i>0; i = i 1)
x[i] = x[i] + s;
TI2: For the above code fragment, show loop unrolled so that there are
four copies of the loop body.
TI3: Show the unrolled loop obtained in the previous test item, after it
has been scheduled for the pipeline.
C4: Select among different branch prediction methods.
1. List the different types of branch prediction methods. (Remember)
1.1 State the different kinds of branch prediction
TI1: What are the different kinds of branch prediction?
TI2: What is meant by static branch prediction?
TI3: Define correlating branch predictor.
1.2 State the need for branch prediction
TI1: What is the need for having branch prediction?
2. Find out the number of branch selected entries in the correlating branch
predictor. (Apply)
2.1 Find number of bits in the predictor or number of branch selected entries
in the branch predictor as required.
TI1: How many bits are in the (0,2) branch predictor?
TI2: How many bits are in the (2,2) branch predictor?
TI3: How many branch selected entries are in a (2,2) predictor that
has a total of 8K bits in the prediction buffer?
3. Compare the different methods to statically predict the branch behavior.
(Remember)
3.1 Compare the pros & cons of each of the static branch prediction scheme.
TI1: List down the methods to statically predict the branch.
TI2: What are the drawbacks of simplest scheme ie., always taking the
branch as taken?
TI3: List down the advantages of profile based scheme.
4. Justify the use of global and local predictor. (Understand)
4.1 Is it possible to use a global branch prediction for certain branches and a
local branch prediction for others? If so, how? If not, why not? Justify your
answer.

MODULE-II MULTIPLE ISSUE PROCESSORS


Module Overview:
This Module explains the multiple issue processors such as VLIW and EPIC. It explains the
Concept of exposing parallelism through hardware support. It deals with IA64 and Itanium
processors. It also explains limitations of ILP.

70
Module Competencies
1. Compare the performance of the architectures VLIW & EPIC.
2. Apply advanced compiler technique for exposing and exploiting ILP.
3. Deploy the hardware support for exposing parallelism.
4. Compare IA64 and Itanium processors and identify the limits on ILP

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes)

C1: Compare the performance of the architectures VLIW & EPIC.


1. Write about VLIW processor. (Remember)
1.1 What is the speciality of VLIW?
TI1: How does the VLIW processor work?
TI2: What are the advantages of VLIW?
TI3: List out and explain the drawbacks of VLIW.
1.2 Why EPIC processor?
TI1: What is the major problem addressed by EPIC?
TI2: What is an instruction bundle?
TI3: List some EPIC bundle template. Give the structure of EPIC bundle.
1.3 Mention different static issue processors.
TI1: Define static issue processors.
TI2: Define dynamic issue processors.
TI3: Differentiate static and dynamic issue processors.
TI4. Give examples for static multiple issue processors.
2. To differentiate the VLIW differ from any single issue processor.
(Understand)
2.1 Explain about the VLIW approach.
TI1: What is the major logistical problem for VLIW? What is the solution
or it?
TI2: Write about lockstep mode.
3. Show the unrolled version of the loop for the specific VLIW processor.
(Apply)
3.1 Suppose we have a VLIW that could issue two memory references, two FP
operations, and one integer operation or branch in every clock cycle. Show
an unrolled version of the loop x[i] = x[i] + s for such a processor. Unroll
as many times as necessary to eliminate any stalls. Ignore the branch
delay slot.

C2: Apply advanced compiler technique for exposing and exploiting ILP.
1. Differentiate loop carried and loop level dependence. (Remember)
1.1 When can you say that there exists loop carried dependence?
TI1: What is meant by loop carried dependence?

71
TI2: Define loop level dependence.
1.2 What does the loop carried dependence insist?
TI1: Suppose there exists carried dependence. Is it possible to execute
statements from different iterations parallel?
TI2: Suppose there exists loop level dependence. Is it possible to
execute statements of the loop body in parallel?
1.3 What do you know about software pipelining?
TI1: Define software pipelining.
TI2: What is meant by start-up code and finish-up code?
1.4 What is meant by global code scheduling?
TI1: Define trace scheduling.
TI2: What is meant by tail duplication?
TI3: Differentiate trace scheduling and super block scheduling.
2. Find out the dependences in the given loop. (Apply)
2.1 Find and eliminate the dependences.
TI1: Determine the kind of dependence in the following loop:
for ( i = 1; i <= 100; i = i + 1)
{
A[i+1] = A[i] + C[i]; // s1
B[i+1] = B[i] + A[i+1]; //s2
}
TI2: Consider the loop like this one:
for ( i = 1; i <= 100; i++ )
{
A[i] = A[i] + B[i]; /* S1 */
B[i+1] = C[i] + D[i]; /* S2 */
}
What are the dependences between S1 and S2? Is this loop
parallel? If not, show how to make it parallel.
TI3: Use the GCD test to determine whether dependences exist in the
following loop:
for( i=1;i<=100;i=i+1)
{
X[2*i+3] = X[2*i] * 5.0;
}
3. Design a method to eliminate dependences using advanced compiler
technique. (Apply)
3.1 Find out the dependences and eliminate them in the given piece of code.
TI1: The following loop has multiple types of dependences. Find all the
true data dependences, output dependences and antidependences,
and eliminate the output dependence and antidependences using
renaming.

72
for(i=1;i<=100;i=i+1)
{
Y[i] = X[i] + c; /* S1 */
X[i] = X[i] + c; /* S2 */
Z[i] = Y[i] + c; /* S3 */
Y[i] = c- Y[i]; /* S4 */
}
TI2: Show a software-pipelined version of this loop, which increments
all the elements of an array whose starting address is in R1 by the
contents of F2:
Loop: L.D F0,0(R1)
ADD.D F4,F0,F2
S.D F4,0(R1)
DADDUI R1,R1,#-8
BNE R1,R2,Loop
You may omit the start-up and clean-up code.
C3: Deploy the hardware support for exposing parallelism.
1. To know about predicated instruction. (Remember)
1.1 Define conditional instruction.
TI1: Consider the following code:
if(A==0) { S = T;}
Show the MIPS code for this statement with branch and conditional
move instruction.
TI2: With the conditional move instruction, is there data dependence or
control dependence?
TI3: What does the instruction CMOVZ R1, R2, R3 insist?
2. Show how the code can be improved? (Apply)
2.1 Given the scenario, improve the code.
TI1: Here is a code sequence for a two-issue superscalar that can issue
a combination of one memory reference and one ALU operation, or
a branch by itself, every cycle:
First instruction slot Second instruction
slot
LW R1,40(R2) ADD R3,R4,R5
ADD R6,R3,R7
BEQZ R10,L
LW R8,0(R10)
LW R9,0(R8)
This sequence wastes a memory operation slot in the second cycle
and will incur a data dependence stall if the branch is not taken,
since the second LW after the branch depends on the prior load.

73
Show how the code can be improved using a predicated form of
LW.
TI2: Consider the following code:
LD R1,0(R3) ;load A
sLD R14,0(R2) ;speculative, no termination
BNEZ R1,L1 ;test A
SPECCK 0(R2) ;perform speculation check
J L2 ;skip else
L1: DADDI R14,R1,#4 ;else clause
L2: SD 0(R3),R14 ;store A
Show how it would be compiled with speculative instructions and
poison bits. Show where an exception for the speculative memory
reference would be recognized. Assume R14, is unused and
available.
C4: Compare IA64 and Itanium processors and identify the limits on ILP
1. Define IA64 register model. (Remember)
1.1 State the components of IA64 register model.
TI1: What are the components of IA64 register state?
TI2: What is current frame pointer (CFM)?
TI3: What is a register stack engine? What it does?
1.2 Define the instruction format and explicit parallelism.
TI1: Define instruction group and bundle.
TI2: What are the five execution slots in IA64 architecture?
TI3: What are the instruction types that the execution unit slot may
hold?
1.3 Explain Itanium processor.
TI1: Define Itanium processor.
TI2: What are the functional units in Itanium processor?
TI3: Give the latency of some typical instructions on Itanium.
TI4: Explain the performance of Itanium processor.
2. Determine the type of limitations that may occur due to ILP. (Apply)
2.1 Find out the limits on ILP.
TI1: What are the assumptions made for an ideal or perfect processor?
TI2: What is the limitation on the window size and maximum issue
count?
TI3: State the effects of realistic branch and jump prediction.
TI4: Mention the effects of finite registers and imperfect alias analysis.
TI5: Explain the limitation on ILP for realizable processors.

MODULE-III MULTIPROCESSORS AND THREAD LEVEL PARALLELISM


Module Overview:
This Module explains the architecture of multiprocessors such as Symmetric and

74
distributed shared memory architecture. It also describes the performance issues of those
processors. It deals with synchronization and different memory consistency models. It also
explains multithreading.

Module Competencies
1. Design Symmetric and distributed shared memory architectures.
2. Apply synchronization.
3. Analyze different memory consistency models.
4. Create multiple threads.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes)

C1: Design Symmetric and distributed shared memory architecture


1. Define the concept of multiprocessor. (Remember)
1.1 State different categories of multiprocessor.
TI1: What is meant by MIMD?
TI2: What are the different kinds of MIMD?
1.2 Define symmetric shared memory multiprocessor.
TI1: Define UMA & SMP. Why it is called so?
TI2: Define migration and replication
TI3: List the advantages of distributed shared memory architectures
over SMP.
2. Determine whether the memory has to be updated or not. (Apply)
2.1 For the given setup find out whether the memory has to be updated or not.
TI1: Consider the situation: There is a symmetric shared memory
multiprocessor with write back cache. One processor writes the
shared data and that processor is the only processor having the
cached copy of that shared data. Whether that write has to be
updated in memory or not? Justify your answer.
TI2: Fill in the following table when write back cache is used. Assume x
is available in memory with the initial value 1 and no cached
copies.

S.No Event Bus Content of Content of Memory


activity CPU As CPU Bs content for
cache cache x
1. CPU A reads x
2. CPU A writes 0 to x
3. CPU B reads x
4. CPU B writes 1 to x
5. CPU B reads x

75
6. CPU A reads x
3. Compare different cache coherence protocols. (Analyze)
3.1 Compare the cache coherence protocols: snooping protocol and directory
protocol
TI1: How snooping protocol is implemented?
TI2: Compare the two different cache coherence protocols: Write
invalidate and Write update protocol. How write invalidate protocol
is better than write update protocol?
TI3: What is the protocol used to maintain cache coherence in
distributed shared memory multiprocessor? Explain the basics of it.
TI4: Compare the performance metrics of shared memory
multiprocessor.
5. Justify your answer for the following scenario. (Evaluate)
5.1 Compare the efficiency of both symmetric and distributed shared memory
multiprocessor and justify your answer.
TI1: Which one is better whether symmetric shared memory
multiprocessor or distributed shared memory multiprocessor?
Justify your answer.
TI2: There are ten number of processor units to construct a
multiprocessor. Constructing whether symmetric shared memory
multiprocessor or distributed shared memory multiprocessor will be
efficient? Justify your answer.
6. Design a distributed shared memory multiprocessor with 100 processors.
(Create)
C2: Apply synchronization.
1. Define the concepts regarding synchronization. (Remember)
1.1 Define synchronization.
TI1: What is meant by synchronization?
TI2: What are the different hardware primitives available?
TI3: Define atomic exchange.
TI4: What is test and set hardware primitive?
2. To implement lock synchronization function. (Understand)
2.1 How can you implement lock function?
TI1: How the instruction pair LL and SC is used to implement LOCK
function.
TI2: Implement different hardware primitives using LL and SC
instruction pair.
2.2 How does the LL and SC instruction pair work?
TI1: How the LL instruction is used?
TI2: How can you implement spin lock using this instruction pair?
3. Create the synchronization function to implement test-and-set hardware
primitive. (Create).

76
C3: Analyze different memory consistency models.
1. To know about memory consistency. (Remember)
1.1 Define memory consistency.
TI1: What is meant by relaxed consistency?
TI2: What is meant by sequential consistency?
2. Determine the outcome of sequential consistency and relaxed consistency.
(Apply)
2.1 Find the outcome of sequential consistency.
TI1: What is meant by sequential consistency?
TI2: How sequential consistency is implemented?
TI3: When the program is said to be synchronized?
TI4: Which is called as data race free program? Find why it is called so.
2.2 Determine the result of relaxed consistency model.
TI1: What is the idea behind relaxed consistency model?
TI2: What are the three major sets of relaxed orderings?
3. Compare sequential consistency and relaxed consistency models.
(Analyze)
3.1 What does the W->R ordering denote?
TI1: What is processor consistency or total store order?
TI2: What is meant by partial store order?
TI3: What do the orderings R->W and R->R denote?
3.2 How sequential consistency is implemented?
TI1: What are the ways to implement sequential consistency?
TI2: What are the two different routes to provide better performance?
4. Find the needs of synchronization & memory consistency models. Evaluate
to get the correct value of the shared data whether synchronization or
consistency model or both is necessary. Justify your answer. (Evaluate)
C4: Create multiple threads.
1. To know about multithreading. (Remember)
1.1 Define multithreading.
TI1: What is meant by multithreading?
TI2: What are the two approaches in multithreading?
TI3: Define fine grained multithreading.
TI4: Define coarse grained multithreading.
2. For the given scenario, determine which kind of multithreading is suitable.
(Apply)
2.1 Find and apply the suitable multithreading scheme.
TI1: Assume that there are five threads. One third of the threads are
having costlier stalls. In this situation which kind of multithreading
is suitable?
TI2: There are six threads. You have to increase the throughput.
Determine which kind of multithreading is apt for this situation.

77
2.2 Compare fine grained and coarse grained multithreading. (Analyze)
TI1: State the advantages and disadvantages of fine grained
multithreading.
TI2: State the advantages and disadvantages of coarse grained
multithreading.
TI3: Compare fine and coarse grained multithreading.
3. Design a multithreaded environment. (Create)

MODULE-IV MEMORY AND IO


Module Overview:
This Module explains the performance of cache, the performance of main memory. It explains the
various types of storage devices, busses. It also explains the various techniques to reduce miss
penalty, miss rate and hit time.
Module Competencies
1. Analyze the performance of cache.
2. Evaluate the performance of main memory.
3. Apply the memory technology.
4. Design the IO system.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
C1: Analyze the performance of cache.
1. Define memory hierarchy system (Remember)
1.1 Define cache.
T11: Define cache hit.
T12: Define cache miss.
T13: What are the categories of cache miss?
1.2 What are the techniques to reduce cache miss?
T11: Define miss rate.
T12: Define miss penalty.
T13: Define hit time.
T14: Specify the CPU performance equation.
2. Explain the steps involved in improving cache performance.(understand)
2.1 How is the conflict miss divided?
TI1: What are the techniques to divide miss rate?
TI2: Why cache miss is to be reduced?
2.2 Discuss various attributes that affect performance of CA.
TI1: What is meant by cache coherence? How this problem can be
avoided?
T12: How miss penalty can be reduced to improve the performance?
T13: What are the registers used for MIPS processors?
3. Solve the problems. (Evaluate)

78
3.1 Given the data below, what is the impact of 2nd level cache
associativity on its miss penalty?
TI1: Hit timeL2 for direct mapped is 10cc 2-way set associativity
increases hit time by 0.1cc to 10.1cc Local miss rate L2 for
direct mapped is 25% Local miss rate L2 for 2-way set
associative is 20% Miss penalty L2 is 100cc
TI2: Suppose that we are considering an enhancement to the
processor of a server system used for web serving. The new
CPU is 10 times faster on computation in the web serving
application than the original processor. Assuming that the
original CPU is busy with computation 40% of the time and
is waiting for I/O 60% of the time. What is the overall
speedup gained by incorporating the enhancement? Fraction
enhanced = 0.4 Speedup
TI3: Assume the cache miss penalty is 100cc, and all instruction
normally takes 1.0cc. Assume the average miss rate is
2%, there is an average of 1.5 memory reference per
instruction. What is the impact on performance when
behavior of the cache is included?
C2: Evaluate the performance of main memory.
1. To know about the functions of main memory. (Remember)
1.1 What are the different techniques to improve the memory
performance?
T11: What is wider main memory?
T12: What is interleaved main memory?
T13: What is independent memory bank?
1.2 What are the performance measures of main memory?
T11: What is memory bank?
T12: What is virtual memory?
T13: What is physical memory?
2. To know about memory interleaving and their types. (Understand)
2.1 Give various parameters of memory performance?
T11: Discuss various parameters for detecting performance of
architecture.
T12: What are the different main memory performance measures?
2.2 Discuss and differentiate the models of memory.
TI1: What are the techniques to improve the main memory bandwidth?
T12: Write about different memory technology?
T13: Discuss the organization of main memory to improve performance.

79
3. We have a computer, where miss rate per 1000 instruction of 30,
miss penalty is 25cc. What is memory stall time in terms of
instruction count? (Evaluate)
C3: Apply the memory technology.
1. Draw the memory hierarchy system. (Remember)
1.1 What are the different types of storage devices?
T11: What is optical disk?
T12: What are tracks?
T13: What are sectors?
1.2 What is latency time?
T11: What is seek time?
T12: What is SRAM?
T13: What is DRAM?
2. Discuss various models of multiprocessor. (Understand)
2.1 Write short notes on prefetch buffers.
T11: How multiple functions will improve the performance of
main memory?
T12: What is write transaction?
T13: What is read transaction?
2.2 What is memory mapping?
T11: Give the concept of multiport memory.
T12: Explain the concept of fetch and add operation.
T13: What is Write back operation?
T14: What is Write through operation?
2.3 Define RAID.
TI1: Define data formatting.
T12: Differentiate stripping and mirroring.
T13: What is redundancy?
TI4: Differentiate bit interleaved parity and block interleaved
parity.
T15: What is distributed interleaved parity?
2.4 Explain different block replacement technique.
T11: What is block identification technique?
T12: What is block placement technique?
3. Compare optical disk and magnetic disk (Analyze)
C4: Design the IO system
1. Define Bus (Remember)
1.1 What are the various standards of bus?
T11: What is bus master?

80
T12: What is split transaction?
1.2 Define Reliability.
T11: Define Availability.
T12: Define Dependability.
T13: Define MTTF.
T14: Define MTTR.
2. Mention the steps to improve the IO performance measures?
(Understand)
2.1 Define Diversity.
T11: Define Capacity.
T12: Compare Throughput and response time.
2.2 What is transaction time?
T11: How the mean number of task in the system can be
calculated?
T12: How the server can be utilized by the processor?
T13: Explain about bus transaction.
T14: Mention the advantages of using bus master.
T15: Explain how the busses can be classified.
3. Solve the problems. (Evaluate)
3.1 Compute the MTTF of the whole system.
TI1: Assume a disk subsystem with the following components and
MTTF. Given 10 disk, each rated at 10, 00000 hr MTTF 1 SCSI
controller 500000 hr MTTF 1 power supply 200000 hr MTTF
1 fan 200000 hr MTTF 1 SCSI cable 10, 00000 hr MTTF.
Compute the MTTF of the whole system.
TI2: Assume we have a computer where the clock per instruction is 1.0
when all memory accesses hit in the cache. The only data accesses
are loads and stores, and these total 50% of the instruction. If the
miss penalty is 25cc and the miss rate is 2%, how much faster
would the computer be if all instruction were cache hits?
TI3: For an organization, calculate the MTTF. Make the following
assumptions, assuming exponential lifetimes.
CPU/memory MTTF is 1000000 hr.
24 disks MTTF is 1000000 hr.
3 SCSI controllers MTTF is 500000 hr.
3 power supply MTTF is 200000 hr.
3 fan MTTF is 200000 hr.
3 SCSI cable MTTF is 1000000 hr.
3 enclosure MTTF is 1000000 hr. (not including MTTF of 1 fan and
1 power supply)

81
The smaller, more numerous drives have almost twice the cost
performance but the reliability is only about 1% of a single disk.
4. Enumerate the steps in designing the IO system. (Understand)
4.1 Mention the steps to design an IO system?
TI1: Mention the factors that measure the I/O performance.
TI2: How the average memory access time can be calculated?

MODULE-V MULTI-CORE ARCHITECTURES


Module Overview:
This Module explains the concept of multithreading including the simultaneous and chip
multithreading. It also describes the architecture of Intel Multi-core with SUN CMP architecture. It
also explains the heterogeneous multi-core processors like IBM cell processor.
Module Competencies
1. Select among different multithreading methods.
2. Design the architecture of Intel multi-core processor.
3. Design a heterogeneous multi-core processor based system.

Instructional objectives of a course in Gronlund format (General Instructional Objectives


and Specific Learning Outcomes)

C1: Select among different multithreading methods.


1. Define multithreading. (Remember)
1.1 What are the types of multithreading?
TI1: Define hardware multithreading.
TI2: Define software multithreading.
TI3: Define simultaneous multithreading.
TI4: Define Chip multithreading.
1.2 What are threads?
TI1: What is fine grained multithreading?
TI2: What is coarse grained multithreading?
2. Differentiate hardware multithreading and software multithreading.
(Understand)
2.1 List out the approaches in hardware multithreading.
TI1: Explain about software multithreading?
TI2: Give the taxonomy of MIMD computers.
TI3: Give the architectural details of SIMD computers.
2.2 Give the evolution for advanced processor.
TI1: What are the classifications of simultaneous multithreading?
TI2: Compare the superscalar with the SMT.
TI3: Explain the types of messages that can be sent between the processor
and the directories.
C2: Design the architecture of Intel multi-core processor.

82
1. Define multiprocessor. (Remember)
1.1 What is multicore multiprocessor?
TI1: Define Intel multicore architecture.
2. Discuss various models for multiprocessors. (Understand)
2.1 Differentiate between multiprocessors and multicomputers.
TI1: What is the design space for processor?
TI2: Discuss the different generations of multicomputer.
C3: Design a heterogeneous multi-core processor based system.
1. Define heterogeneous multithreading. (Remember)
1.1 Define processor?
TI1: Define IBM architecture.
TI2: Differentiate PPU and SPU.
TI3: Explain SPE and EIB.
2. Give the architecture for IBM 360 model. (Understand)
2.1 What are the components of IBM cell architecture?
TI1: Explain about IBM cell processor.
TI2: What is the difference between cell processor and multiprocessor?
TI3: What is the architecture used in USB?
3. To enumerate the Design steps of the IBM cell processor. (Understand)
3.1 Listing the function of PPU
TI1: Draw the architecture of IBM cell architecture.
TI2: How PPE and SPE are connected?
TI3: What is DMA engine?
TI4: Explain the relation between the PPU and PPE.
3.2 Mention the functions of SPU.
TI1: Define SPE & MFC.
TI2: What is the relation between MFC and SPE?
TI3: How the data are transferred between different parts of the
processor?
3.3 What is EIB?
TI1: What is MIC?
TI2: Explain the function of EIB in the IBM cell architecture.

83
IT63 Web Technology

Course Details:
Subject Code : IT63
Subject Name : Web Technology
Semester : B.E. (CSE) VI Semester
Prepared By : Mrs. M.S.Bhuvaneswari & Mr. K. Thirumoorthy
Approved By : Dr.K.Muneeswaran
Effective Date : 02.01.2012
Revision No. : 1

Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysis and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modeling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive
clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural


issues and the consequent responsibilities relevant to engineering practice.

84
9. Understand and commit to professional ethics and responsibilities and norms of
engineering practice.

10. Understand the impact of engineering solutions in a societal context and demonstrate
knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business practices, such
as risk and change management, and understand their limitations.

12. Recognize the need for, and have the ability to engage in independent and life-
long learning.

Competencies
19. Identify the protocols in Internet applications(1,2,12)
20. Identify the key components of HTML document.(1,2)
21. Capable of writing Client side programming .(1,2,3,4,5)
22. Create interactive web pages using DOM.(3,5,8,12)
23. Represent web data using XML(1,2,3,4,5)
24. Capable of writing Server side programming .(1,2,3,4,5)
25. Create increasingly appealing and powerful web pages(5,8,12)
26. Develop Web Services.(5,8,12)

Concept Map

85
Course Assessment Matrix
Course Title : Internet Programming
Programme Outcomes
S.No Competencies (Washington Accord)
1 2 3 4 5 6 7 8 9 10 11 12
1. Understand the basic Internet Protocols. X X X
2. Identify the key components of HTML
X X
document
3. Capable of writing Client side
X X X X X
programming
4. Understand how to create interactive
X X X X
web pages using Dynamic HTML
5. Represent web data using XML X X X X X
6. Capable of writing Server side
X X X X X
programming.
7. Create increasingly appealing and
X X X
powerful web pages
8. Develop Web Services X X X

Syllabus (As prescribed by Anna University,Tirunelveli)


Unit I
Web Essentials: Clients, Servers, and Communication. The Internet-Basic Internet Protocols -The
World Wide Web-HTTP request message-response message-Web Clients Web Servers-Case Study.
Markup Languages: XHTML. An Introduction to HTML History-Versions-Basic XHTML Syntax and
Semantics-Some Fundamental HTML Elements-Relative URLs-Lists-tables-Frames-Forms-XML
Creating HTML Documents Case Study. 9
Unit II
Style Sheets: CSS-Introduction to Cascading Style Sheets-Features-Core Syntax-Style Sheets and
HTML Style Rule Cascading and Inheritance-Text Properties-Box Model Normal Flow Box Layout-
Beyond the Normal Flow-Other Properties-Case Study. Client-Side Programming: The JavaScript
Language-History and Versions Introduction JavaScript in Perspective-Syntax-Variables and Data
Types-Statements-Operators- Literals-Functions-Objects-Arrays- Built-in Objects-JavaScript
Debuggers. 9
Unit III
Host Objects : Browsers and the DOM-Introduction to the Document Object Model DOM History
and Levels-Intrinsic Event Handling-Modifying Element Style-The Document Tree-DOM Event
Handling-Accommodating Noncompliant Browsers Properties of window-Case Study. Server-Side
Programming: Java Servlets- Architecture -Overview-A Servlet-Generating Dynamic Content-Life
Cycle- Parameter Data-Sessions-Cookies- URL Rewriting-Other Capabilities-Data Storage Servlets
and Concurrency-Case Study- Related Technologies. 9
Unit IV
Representing Web Data: XML-Documents and Vocabularies-Versions and Declaration- Namespaces
JavaScript and XML: Ajax-DOM based XML processing Event-oriented Parsing: SAX-Transforming
XML Documents-Selecting XML Data:XPATH-Templatebased Transformations: XSLT-Displaying XML
Documments in Browsers-Case Study- Related Technologies. Separating Programming and
Presentation: JSP Technology Introduction-JSP and Servlets-Running JSP Applications Basic JSP-
JavaBeans Classes and JSP-Tag Libraries and Files-Support for the Model-View-Controller
Paradigm-Case Study-Related Technologies. 9

86
Unit V
Web Services: JAX-RPC-Concepts-Writing a Java Web Service-Writing a Java Web Service Client-
Describing Web Services: WSDL- Representing Data Types: XML Schema-Communicating Object
Data: SOAP Related Technologies-Software Installation-Storing Java Objects as Files-Databases
and Java Servlets. 9
Course Plan

No. of
Sl.No Topics Reference Remarks
hours

UNIT-I

1. Basic Internet Protocols T1: Ch 1,W1,W2 1


2. The World Wide Web T1: Ch 1 1
3. HTTP request message, HTTP T1: Ch 1 2
response message
4. WebClients T1: Ch 1 1
5. Web Servers, Case Study T1: Ch 1 1
6. An Introduction to HTML,HTMLs T1: Ch 2 1
History andVersions
7. Basic XHTML Syntax and T1: Ch 2,W3 1
Semantics
8. Some Fundamental HTML T1: Ch 2 1
Elements
9. Relative URLs, Lists, tables T1: Ch 2 1
10. Frames, Forms T1: Ch 2 1
11. XML Creating HTML Documents, T1: Ch 2 2
Case Study
TOTAL HOURS 13

UNIT II

1. Introduction to Cascading Style T1: Ch 3,W4 1


Sheets,Features
2. Core Syntax-Style Sheets and T1: Ch 3 1
HTML Style Rule
3. Cascading and Inheritance T1: Ch 3 1
4. Text Properties,Box Model T1: Ch 3 1
5. Normal Flow Box Layout T1: Ch 3 1
6. Beyond the Normal Flow,Other T1: Ch 3 1
Properties,Case Study
7. History and Versions of T1: Ch 4,W5 1
Javascript, Introduction to
JavaScript, JavaScript in
Perspective
8. Syntax, Variables and Data T1: Ch 4 1
Types, Statements, Operators
9. Literals,Functions,Objects T1: Ch 4 1
10. Arrays,Built-in T1: Ch 4 2
Objects,JavaScript Debuggers

87
No. of
Sl.No Topics Reference Remarks
hours

TOTAL HOURS
11

UNIT-III

1. Introduction to the Document T1: Ch 5 1


Object Model, DOM History and
Levels, Intrinsic Event Handling
2. Modifying Element Style, The T1: Ch 5 1
Document Tree
3. DOM Event Handling T1: Ch 5 1
4. Accommodating Noncompliant T1: Ch 5 1
Browsers, Properties of window,
Case Study
5. Java Servlets Architecture T1: Ch 6 1
Overview, A Hello World
Servlet
6. Servlets Generating Dynamic T1: Ch 6 1
Content, Life Cycle
7. Parameter Data T1: Ch 6 1
8. Sessions T1: Ch 6 1
9. Cookies, URL Rewriting T1: Ch 6 1
10. Other Servlet Capabilities T1: Ch 6 1
11. Data Storage , Servlets and T1: Ch 6 1
Concurrency
12. Case Study, Related T1: Ch 6 1
Technologies
TOTAL HOURS
12

UNIT-IV

1. XML Documents and T1: Ch 7


Vocabularies, Versions and 1
Declaration
2. Namespaces T1: Ch 7 1
3. JavaScript and XML: Ajax T1: Ch 7 1
4. DOM based XML processing T1: Ch 7 1
5. Event-oriented Parsing: SAX T1: Ch 7 1
6. Transforming XML Documents T1: Ch 7 1
7. Selecting XML Data:XPATH T1: Ch 7 1
8. Template based T1: Ch 7 1
Transformations: XSLT,
9. Displaying XML Documents in T1: Ch 7 1
Browsers, Case Study, Related
Technologies
10. Introduction to JSP, JSP and T1: Ch 8 1
Servlets
11. Running JSP Applications, Basic T1: Ch 8 1
JSP

88
No. of
Sl.No Topics Reference Remarks
hours

12. JavaBeans Classes and JSP T1: Ch 8 1


13. Tag Libraries and Files T1: Ch 8 1
14. Support for the Model-View- T1: Ch 8 1
Controller Paradigm,Case Study
15. Related Technologies T1: Ch 8 1
TOTAL HOURS
15

UNIT-V

1. Web Services: JAX-RPC T1: Ch 9 1


Concepts
2. Writing a Java Web Service T1: Ch 9 1
3. Writing a Java Web Service T1: Ch 9 1
Client
4. Describing Web Services: WSDL T1: Ch 9 1
5. Representing Data Types: XML T1: Ch 9 1
Schema
6. Communicating Object Data: T1: Ch 9 2
SOAP, Related Technologies
7. Software Installation T1: Appendix A 1
8. Storing Java Objects as Files T1: Appendix B 1
9. Databases and Java Servlets T1: Appendix C,W6 1
TOTAL HOURS
10
TOTAL NO. OF HOURS 61

TEXT BOOKS

1. Jeffrey C. Jackson, "Web Technologies--A Computer Science Perspective", Pearson Education,


2006.

REFERENCES
1. Robert. W. Sebesta, "Programming the World Wide Web", Fourth Edition, Pearson Education,
2007 .
2. Deitel, Deitel, Goldberg, "Internet & World Wide Web How To Program", Third Edition, Pearson
Education, 2006.
3. Marty Hall and Larry Brown,Core Web Programming Second Edition, Volume I and II, Pearson
Education, 2001.
4. Bates, Developing Web Applications, Wiley, 2006.

WEB REFERENCES

1. http://fab.cba.mit.edu/classes/MIT/961.04/people/neil/ip.pdf
2. http://www.protocols.com/pbook/tcpip1.htm
3. http://www.w3schools.com/xhtml/xhtml_intro.asp
4. http://www.w3.org/Style/Examples/011/firstcss.en.html
5. http://www.webdeveloper.com/javascript/javascript_js_tutorial.html
6. http://www.unix.org.ua/orelly/java-ent/servlet/ch09_02.htm

89
MODULE-I
Module Overview
This module deals what we need to know about networks in general, the IP, TCP and UDP
Protocols, the essential elements of World wide web, how computers communicate over Internet.
It enables to create static HTML documents and determine relationship between XML,HTML and
XHTML
Module Competencies
1. Identify various protocols over internet.
2. Sharing of information publically over Internet.
3. Explore the concept of Web Client and Web Server.
4. Working with Markup language and basic HTML tags used for web designing.
5. Create web pages accessible to search engines
6. Analyze relationship between HTML,XML and XHTML
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
Module: Web Essentials
C1. Identify various protocols over internet.
1. Explain in detail the various Internet standard protocols.(Understand)
1.1 Illustrate about the TCP protocol
TI1. Give the structure of TCP.
TI2. Write about the three phases involved in TCP protocol operation
1.2 Write down in detail about the UDP protocol
TI1. Give the packet structure of UDP protocols
TI2. Compare TCP and UDP protocol.
TI3. Write about the UDP connections.
T14. Discuss about an Internet Application that is run using UDP.
2. Examine whether a web browser can load an HTML document from a web
server running on a different host if DNS is not operational.(Understand)
2.1 Describe about the working of DNS.
TI1. Write the different types of top-level domain.
TI2. How the domain names are allocated?
C2. Sharing of information publically over Internet
1. Illustrate how web clients and web servers communicate.(Understand)
1.1 Discuss in detail the overall structure of HTTP Request Message.
TI1. List out basic parts of the HTTP Request Message.
TI2. What are the parts of start line?
TI3. Write down the standard top level MIME content types.
1.2 Explain the different parts of the HTTP Response message
TI1. What are different fields of status line?
TI2. How many digits are there in a status code. What does each digit
represent?
1.3 Illustrate how characters are represented in web documents.
TI1. Define character set.

90
TI2. Write the purpose of Accept-Charset header field.

C3. Explore the concept of Web Client and Web Server.


1. Discuss about the functionality provided by Web Clients and Web Server.
(Understand)
1.1 Write down the functionalities provided by web clients.
TI1. List out the basic tasks performed by the browser.
TI2. Mention the different parts of URL.
1.2 Discuss about the functionalities of Web Server
TI1. Write about the salient features of a web server.
TI2. List out the steps for configuring a web server.
2. Create a virtual host and a context within the virtual host. (Understand,
Apply)
2.1 Discuss in detail about Virtual host.
TI1. Define virtual host.
TI2. List out the key fields of a host component.
TI3. Create a virtual host named www.virtualh.com in Tomcat server
with Application base virtual host. Create a Context within this
virtual host with Document base docs and VirtualPath/.
C4. Working with Markup language and basic HTML tags used for web designing.
1. Describe the structure of HTML and the basic tags used(Remember)
1.1 Design a web page using HTML elements.
TI1. Write the structure of the HTML.
TI2. How will you represent the title of a document?
TI3. How will you maintain the identification and classification
information for each page visited.

2. Create a web page using basic HTML tags (Apply)


2.1 Design a web page using basic HTML tags
TI1. Make a text to act as anchors to link to other pages on web.
TI2. How will you add color and formatting to a given text?
TI3. Display a text in Times New Roman, underline it and bold it.
TI4. Write HTML code to display H20 and (a+b)2.
TI5. Write HTML code to display an image and to display a message if
the image is not available.
C5. Create web pages accessible to search engines
1. Explain the concept of forms, frames and tables (Understand)
1.1 Describe about the elements used in the forms
TI1. Write the difference between password box and text box.
TI2. Write the difference between textbox and textarea
TI3. How will you add a list of options in the web page?

91
TI4. How will you upload a image from a specific location into the web
page using the form element?
T15. List out the various form elements.
1.2 State the need for a frame
TI1. List out the attributes used in a frame tag.
TI2. Why frames are being used?
1.3 Write down the attributes of a table
TI1. Write the structure of table.
TI3. What is the use of the attributes rowspan and colspan?
2. Create a web page using forms, frames and tables (Apply)
2.1 Design a web page to collect information from people viewing the website.
TI1. Write down the difference between get method and post method
TI2. Create a feedback form containing text box, text area, password
box and button
TI3. Create a pull down menu consisting of minimum 4 elements
2.2 Create a web page using frames
TI1. Create a web page with two horizontal frames and two vertical
frames
TI2. Create a HTML page with 3 frames as follows
Frame 1 contains the name of the college aligned at center.
Frame 2 contains the departments in college with hyperlink.
Frame 3 is used to display the details about each department
on clicking the links in frame 2.
2.3 Create a web page using tables
TI1. Display the following table in a web page

STATES
TAMILNADU
KARNATAKA
KERALA

3. Design a web page to link one web page to another using textual and
image anchors (Create)
3.1 Create a web page to link one web page to another using textual anchors.
TI1. How will you make use of internal linking to make your web page
more navigable?
3.2 Design a web page to link one web page to another using image anchors
TI1. Create image maps to designate certain section of the image as
hotspots by using all possible shapes available.
C6. Analyze relationship between HTML,XML and XHTML
1. Illustrate how the abstract syntax for each flavor of XHTML 1.0 is defined .
(Understand)
1.1 How abstract syntax of a version of XHTML is defined using XML.
TI1. Define DTD.
TI2. How will define a set of valid elements?

92
TI3. List out the attribute types used in XHTML 1.0.

MODULE-II
Module Overview
This module gives introduction about different style sheets to specify style of web pages, methods
to have control over the presentation of the page by having access to web page elements, ways to
respond to user actions and change web pages accordingly. It gives introduction to JavaScript
scripting language which facilitate a disciplined approach to design computer programs that
enhance the functionality and appearance of Web pages.
Module Competencies
1. Control the appearance of the website by creating own style sheets.
2. Solve the appearance based problem using style sheets.
3. Identify how the visibility of identifiers is limited to specific regions of programs.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
Module: Style Sheets and Client Side Programming
C1. Control the appearance of the website by creating own style sheets.
1. Explain about inline, embedded and external style sheets(Understand)
1.1 Discuss about inline style sheet
TI1. Define CSS.
TI2. How to specify style for an individual element?
1.2 Describe about the embedded style sheet.
TI1. How to set style for a set of elements?
1.3 Explain the need for external style sheet.
TI1. How to give the whole website the same uniform look?
2. Apply the concepts of style sheets.(Apply)
2.1 Apply inline style sheet to design a web page.
TI1. Design a web page to display one paragraph in red color and
another in blue color.
2.2 Apply embedded style sheet to design a web page.
TI1. Design a web page to display all paragraphs in red color.
2.3 Apply external style sheet to design a web page.
TI1. Design a website such paragraph in all web pages are displayed in
green color
3. Illustrate the steps involved in CSS cascade.(Understand)
3.1 When more than one rule is applied to an element and those rules provide
declaration for same properties which rule would be applied to that
element?
TI1. Classify the origin of a declaration.
TI2. How the origin and weight applied to an element are prioritized?
4. Give the significance of CSS Box Model.(Understand).
4.1 Write in detail the different areas and edges in the CSS box model.

93
TI1. Define Margin area.
TI2. In which area will you place the contents?
4.2 Describe the basic CSS style properties associated with Box Model.
TI1. List out properties associated with padding area.
TI2. Write down the properties that can be applied to border.
C2. Solve the appearance based problem using style sheets.
1. Differentiate the various scripting languages used.(Understand)
1.1 Illustrate the concept of client side scripting
TI1. List out the client side scripting languages.
TI2. What is the need for client side scripting language
1.2 Discuss in detail the need for server side scripting
TI1. List out the server side scripting languages.
TI2. Write the difference between server side scripting language and
client side scripting language.
2. Create user interactive web pages.(Apply)
2.1 Design a web page that performs data validation by applying concepts of
single selection structure and multiple selection structure
TI1. Design a web page to display the grade of the students given their
mark.
TI2. Design a web page to get order from a customer and give discount
based on the number of books he orders.
2.2 Design a web page that performs calculation by applying the concept of
repetition structure
TI1. Design a web page to check whether a given number is palindrome
or not.
2.3 Design a web page that performs calculation by applying the concept of
Counter Controlled Repetition
TI1. Design a web page to generate n prime numbers.
TI2. Design a web page to display odd numbers from 1 to n.
C3. Identify how the visibility of identifiers is limited to specific regions of programs
1. Describe about the concept of modular programming.(Understand)
1.1 Explain about the programmer defined functions
TI1. Define local variables.
TI2. Purpose of modularizing a program.
1.1 Mention the various inbuilt functions available.
TI1. List out some of the mathematical functions provided by Math
MODULE-III
Module Overview
This module gives detailed overview about the document object model and deals with different
event handling methods to respond to user actions. It describes in detail how to write servlet,
track session using cookies and URL rewriting.

94
Module Competencies
1. Access and Manipulate HTML documents displayed by a browser using JavaScript
2. Recognize and respond to most popular events
3. Enhance the functionality of World Wide Web Server using Servlet.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
Module: DOM and Sever Side Programming
C1. Access and Manipulate HTML documents displayed by a browser using JavaScript
1. Can we extract the content of a paragraph element from a web page
displayed. Justify your answer.(Understand)
1.1 Discuss in detail the DOM2 support for document tree access and
modification within a browser that has loaded an HTML document.
TI1. Write a JavaScript program to produce a tree of elements present
within a document.
TI2. Write a JavaScript program to display a list that can reordered by
a user using tree modifying methods.
C2. Recognize and respond to most popular events
1. Illustrate the concepts of events, event handlers and event
bubbling(Understand)
1.1 Discuss in detail about events and event handling
TI1. How to make a web page user friendly?
TI2. Display a message on clicking a button.
TI3. Display the seconds elapsed since the document has been loaded.
TI4. Display the error, line no. and file in which error occurred.
TI5. How to cancel the default action of submit and reset button?
1.2 Explain the concept of event bubbling
TI1. Define event bubbling.
TI2. How to cancel event bubbling to its parent?

2. Apply the concept of event and event handling(Apply)


2.1 Design a web page handling various events.
TI1. Display the mouse coordinates wherever the mouse moves in the
web page.
TI2. Swap two images whenever the mouse moves over and out of the
image.
C3. Enhance the functionality of World Wide Web Server using Servlet.
1. Discuss about the servlet technology.(Remember)
1.1 Describe how servlet respond to HttpRequest.
TI1. Life cycle methods of servlet.
TI2. Difference between get and post request.
TI3. List out the methods of HttpServlet class that respond to User
request.

95
2. Discuss in detail how Session Tracking takes place in Servlet(Understand)
2.1 Describe how session tracking is done using Cookies.
TI1. Define cookies.
TI2. Write about the important methods of the Cookies class.
TI3. How to add cookies to the client request?
2.2 Explain how HttpSession can be used for session tracking.
TI1. How to get session object for a client using HttpSession class?
TI2. How to add data to the HttpSession object?
2.3 Is there any way to pass session information from client to server other
passing through HTTP headers. Justify your answer.()
TI1. Design a Web Page and track session using URL rewriting.
TI2. What is the purpose of path parameter?
3. Apply the concepts of Servlet to design a web page.(Apply)
3.1 Design a web page and track session using cookies.
TI1. Write a java servlet program to track the things purchased by a
customer using cookies.
TI2. List out the methods used for creating cookies and setting expiry
time for the cookies.
3.2 Design a web page and track session using HttpSession.
TI1. Write a java servlet program to track the books ordered by a
customer using HttpSession
TI2. How will you terminate a session?
MODULE-IV
Module Overview
This module gives overview about various technologies related to XML and JSP. It deals with
concepts like XML namespace which allows XML vocabularies to be mixed within a single XML
document, XSL to associate style sheet information with XML documents, Ajax, DOM and SAX for
parsing and processing XML documents, Transforming XML documents between XML
representations and XML Components. It describes about JSP technology that facilitate separate
development of a web sites presentation and logic.
Module Competencies
1. Identify different technologies related to XML.
2. Update contents of a document without reloading.
3. Process and Transform XML documents.
4. Develop websites by separating presentation and logic.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
Module: XML and JSP
C1. Identify different technologies related to XML.
1. Discuss about the significance of XML namespace in a XML
document(Remember)
1.1 Identify the steps involved in processing an XML document.

96
TI1. How will you describe the elements and attributes for a specific
type of an XML document?
TI2. List out the different ways of specifying the vocabulary.
2. Compare and Contrast Validating parser and Non-Validating
parser.(Understand)
2.1 Discuss about the advantages of validating parser.
TI1. Define Validating parser.
TI2. What is the basic requirement for a parser to be a validating
parser?
2.2 Write the importance of non validating parser.
TI1. What is a non-validating parser?
TI2. When it is appropriate to use a non-validating parser?
C2. Update contents of a document without reloading
1. Develop programs to update contents without reloading using AJAX.
(Understand & Apply)
1.1 State the purpose of XMLHttpRequest in writing AJAX program and develop
an application using it.
TI1. List down the methods of XMLHttpRequest
TI2. How will you send the request to the server?
TI3. How the query string can be sent to the server?
TI4. Why the name AJAX?
TI5. Write an AJAX program to display details about a course based on
the course selected by the user.
C3. Process and Transform XML documents.
1. Describe the elements of parser and parse the given XML document using
it.(Remember, Apply)
1.1 How will you create a parser in JAXP?
TI1. Write the purpose of DocumentBuilderFactory.
TI2. Why factory mechanism is used instead of standard object creation
using a constructor and new keyword?
TI3. Define pluggability.
1.2 Write the steps to input a XML document and parse it.
TI1. Write the purpose of parse method.
TI2. What is the drawback of processing a XML document using DOM
approach?
TI3. Write a DOM based program for counting the number of branches
in a given bank xml document. bank is the root element, bname,
bid are the child elements. (bname - branch name, bno- branch id)
2. Create a XML document and parse it using SAX based parser.
(Understand)
1.1 Differentiate SAX based processing from DOM based processing of XML
document.

97
TI1. Write down the steps involded in SAX based XML parsing.
TI2. How will you create a SAX based parser?
TI3. Write down the steps to input an XML document to the parser.
TI4. How to define the event handling methods that should be used by
the parser?
TI5. Create a XML document for employee details with ename, eno as
child elements with employee element as root element. Write a
SAX program for displaying the character data contained within
ename element.
TI6. Why the XMReader produced by JAXP be made namespace-aware?
C4. Develop websites by separating presentation and logic
1. Explain in detail about MVC paradigm.(Understand)
1.1 Discuss in detail how a Java Servlet can pass control to other components
of a system.
TI1. How does a Java Servlet forwards a HTTP request to a view
component?
TI2. Specify an approach for oraganizing various components of a web
application.
TI3. Write down the ways for passing data to a view component.
TI4. Describe how the controller determines where to forward a request
in a large application.
1.2 Give an overview of the MVC related facilities within JSP.
TI1. How to call one JSP document from within another JSP document?
TI2. Can we pass additional parameters to the request object? If yes
how?
2. Describe the usage of EL implicit objects (Remember)
2.1 Discuss in detail about the EL implicit objects.
TI1. Define web application.
TI2. When we say a JSP document as a valid one?
TI3. How an EL expression can be invoked?
TI4. How a variable reference within an EL expression is resolved?
TI5: Develop an EL expression that evaluates to true if value is within
the range 10 to 100 and to false if not within the range by making
use of needed objects.
3. Develop a Web application using JSP.(Understand,Apply)
3.1 Explain in detail about the different categories of JSP element types.
TI1. List down the types of directives available for use within a JSP
document.
TI2. Define translation unit.
TI3. Write the purpose of action element.
3.2 Describe the basic features of the JSTL functional areas.
TI1. How to assign a value to a scoped variable?

98
TI2. List some of the functions provided by functions area.
TI3. Write the purpose of url action.
3.3 Write a class so that it can be recognized as a Java Bean class by JSP?
TI1. When we say a Java class confirms with the Java Bean specification
for JSP
TI2. How an EL expression can access a Java Bean method as a
property of an object?
TI3. Write about the Java Bean simple property design pattern.
TI4. How to instantiate a bean object within a JSP document?
TI5. How to set or get the properties of a Java Bean object?
3.4 Write the purpose of Tag libraries and files.
TI1. What is a tag file?
TI2. How to define a collection of definitions of custom actions?
3.5 Write a JSP Application
TI1: Develop a JSP application program to get
marks(mark1,mark2,mark3) of a student, compute grade of the
student using Java Bean and display grade of the student.
MODULE-V
Module Overview
This module describes transmitting XML documents between clients and servers through HTTP,
vocabulary used for these documents i.e., SOAP, develop web services, describes operation
provided by a web service using WSDL and describes how to define a data within WSDL using XML
Schema. It deals with technologies such as JAX-RPC to automatically produce web service clients
and servers from Java code that does not have any data communication or XML processing
commands explicitly.
Module Competencies
1. Represent data and schema within the document.
2. Identify the technologies used for communicating object data
3. Develop web services.
Instructional objectives of a course in Gronlund format (General Instructional Objectives
and Specific Learning Outcomes)
Module: Web Services
C1. Represent data and schema within the document.
1. Design a WSDL document for a given web service.(Understand)
1.1 Explain in detail the various elements used in the WSDL document.
TI1. Write the purpose of types element.
TI2. List down the elements used to represent the content.
TI3. Why the message element is used in a WSDL document?
TI4. Name the element used to define the operations provided by a web
service.
TI5. Design a WSDL document for a given web service for the Grade
Calculation web service given the marks of the students.

99
2. Write a XML Schema markup for a given structure.(Understand, Apply)
2.1 How to create a simple and complex data type?
TI1. Create a complex type element name containing three elements
first name, middle name, last name of type string.
TI2. Define a element name of type string.
TI3. Give the structure for XML Schema markup.
TI4. Define an element range that can take integer value between 1
and 100.
TI5. How to represent a white space separated lists?
TI6. What are the namespaces that can be used within XML Schema?
TI7. Write a XML Schema markup that could be used to add a definition
for a complex type named student to the types element. Elements
of this type should contain the elements name of built-in type
string and a marks element of user-defined type stmarks which
contains elements mark1,mark2 of type integer.
C2. Identify the technologies used for communicating object data.
1. Develop the body of the SOAP request representing a call to web service
operation.(Apply)
1.1 Make use of SOAP for communicating structured data.
TI1. Give the element structure defined by SOAP.
TI2. Describe the functionality of each and every element defined by
SOAP.
TI3. Develop the body of the SOAP request representing a call to web
service operation named translator that takes three string
parameters. First param represents the from language, second
param represents to language, third param represents text to be
translated. Assume that these param are named in the WSDL and
the translator is in the namespace associated with the namespace
prefix nstrans.The call should represent an RPC to translate a given
text from English to Tamil.
TI4. Can a structured data be communicated? Justify your answer.
1.2 How a client makes a call to a method that resides on another machine?
TI1. Define accessors of the struct.
TI2. How a call for a service operation is modeled in the SOAP specified
representation of RPC calls?
TI3. Differentiate document operation style from RPC operation style.
2. Encode XML elements using SOAP.(Understand,Apply)
2.1 Explain how struct data and arrays can be encoded.
TI1. How XML elements representing RPC request and response structs
are encoded?
TI2. Represent SOAP encoded array types in a WSDL document.

100
TI3. Give a SOAP data encoding of a struct details of complex type
empdetails.The data type has two elements-a string named name
and next element of type details.the value details name ancestor
is John and next is a reference to the details struct itself.Assume
that details and empdetails are both defined in the namespace
associated with prefix nsemp.
C3. Develop web services.
1. Write down the steps for developing a web service (Understand)
1.1 Illustrate in detail the steps to write the server for the web service.
TI1. Write down the initial steps for creating a web service server.
TI2. Describe about the wsdeploy and wscompile tools used in
developing web service.
TI3. List down the basic rules for the service end point interface.
TI4. What are the informations provided by service element?
1.2 Explain the steps to write the client for the web service.
TI1. Write down the initial steps for creating a web service client.
TI2. How will you create a proxy object? What is its purpose?
TI3. List down the key difference between the class generated by
wscompile in client and the server side class.
TI4. Develop a web service that accepts two large integers(min 15
digits) from the user and find product of the integers.

101
CS606 Advanced database technology

Course Details:
Subject Code : CS606
Subject Name : Advanced database technology
Semester : B.E(CSE) VI Semester
Prepared By : Mrs. S. Amutha, Ms. A. Kiruthika
Approved by : Dr. K. Muneeswaran
Effective Date : 02.01.2012
Program Outcomes Selected (Washington Accord)

1. Apply knowledge of mathematics, science, engineering fundamentals and an


engineering specialization to the conceptualization of engineering models.

2. Identify, formulate, research literature and solve complex engineering problems


reaching substantiated conclusions using first principles of mathematics and
engineering sciences.

3. Design solutions for complex engineering problems and design systems,


components or processes that meet specified needs with appropriate
consideration for public health and safety, cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems including design of experiments,


analysis and interpretation of data, and synthesis of information to provide valid
conclusions.

5. Create, select and apply appropriate techniques, resources, and modern


engineering tools, including prediction and modeling, to complex engineering
activities, with an understanding of the limitations.

6. Function effectively as an individual, and as a member or leader in diverse teams and in


multi-disciplinary settings.

7. Communicate effectively on complex engineering activities with the engineering


community and with society at large, such as being able to comprehend and write
effective reports and design documentation, make effective presentations, and
give and receive clear instructions.

8. Demonstrate understanding of the societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to engineering practice.

102
9. Understand and commit to professional ethics and responsibilities and norms of
engineering practice.

10. Understand the impact of engineering solutions in a societal context and demonstrate
knowledge of and need for sustainable development.

11. Demonstrate a knowledge and understanding of management and business


practices, such as risk and change management, and understand their
limitations.

12. Recognize the need for, and have the ability to engage in independent and life-long
learning.

Competencies
1. Model relational database in a top-down fashion using ER diagram. (1,2)
2. Apply normalization techniques to minimize redundancy of data. (1,3,5,7)
3. Apply algorithms for efficient processing of queries.(1,2,3,4,5)
4. Identify the recovery measures to be taken in case of failure. (4,5,11)
5. Design and implementation of a query system using inter and intra query parallelism
concepts (4,5,11)
6. Analyse the distributed database query processing issues (1,3,4,5)
7. Apply protocols to maintain concurrency and recovery in distributed database. (1,3,5)
8. Work with object oriented query languages. (1,2)
9. Design of database applications using POSTGRES,JASMINE and GEMSTONE(1,3,4,5,7)
10. To have an expertise with XML databases (1,3,4,5,7)
11. Demonstrate active, deductive and knowledge bases. (1,3,4,5)

Course Assessment Matrix


Course Title : Object Oriented Programming
S. Programme Outcomes
No. Competencies (Washington Accord)
1 2 3 4 5 6 7 8 9 10 11 12
Model relational database in a top- X X
1.
down fashion using ER diagram.
Apply normalization techniques to X X X X
2.
minimize redundancy of data.
Apply algorithms for efficient X X X X X
3.
processing of queries
Identify the recovery measures to be X X X
4.
taken in case of failure
Design and implementation of a query X X X
5.
system using inter and intra query

103
parallelism concepts
Analyse the distributed database query X X X X
6.
processing issues
Apply protocols to maintain X X X
7. concurrency and recovery in
distributed database
Work with object oriented query X X
8.
languages
Design of database applications using X X X X X
9.
POSTGRES,JASMINE and GEMSTONE
To have an expertise with XML X X X X X
10.
databases
Demonstrate active, deductive and X X X X
11.
knowledge bases

UNIT I RELATIONAL MODEL ISSUES 9


ER Model - Normalization Query Processing Query Optimization - Transaction
Processing - Concurrency Control Recovery - Database Tuning.

UNIT II DISTRIBUTED DATABASES 9


Parallel Databases Inter and Intra Query Parallelism Distributed Database Features
Distributed Database Architecture Fragmentation Distributed Query Processing
Distributed Transactions Processing Concurrency Control Recovery Commit
Protocols.

UNIT III OBJECT ORIENTED DATABASES 9


Introduction to Object Oriented Data Bases - Approaches - Modeling and Design -
Persistence Query Languages - Transaction - Concurrency Multi Version Locks
Recovery POSTGRES JASMINE GEMSTONE - ODMG Model.

UNIT IV EMERGING SYSTEMS 9


Enhanced Data Models - Client/Server Model - Data Warehousing and Data Mining -
Web Databases Mobile Databases- XML and Web Databases.

UNIT V CURRENT ISSUES 9


Rules - Knowledge Bases - Active and Deductive Databases - Multimedia Databases
Multimedia Data Structures Multimedia Query languages - Spatial Databases.

Total hours = 45
TEXT BOOKS:

104
1. Thomas Connolly and Carlolyn Begg, Database Systems, A Practical Approach to Design,
Implementation and Management, Third Edition, Pearson Education 2003.
REFERENCES:
1. R. Elmasri, S.B. Navathe, Fundamentals of Database Systems, Fifth Edition, Pearson
Education, 2006.
2. Abraham Silberschatz, Henry F. Korth, S. Sudharshan, Database System Concepts, Fifth
Edition, Tata McGraw Hill, 2006.
3. C.J.Date, A.Kannan, S.Swamynathan, An Introduction to Database Systems,Eighth Edition,
Pearson Education, 2006.

Course Plan:

S.No. Subject Reference Hours Remarks


MODULE I
1 ER Model T1-11 1
2 Normalization T1-13,14 1
3 Query Processing R2-13,14 1
4 Query Optimization R2-13,14 1
5 Transaction Processing T1-20 1
6 Concurrency Control T1-20 1
7 Recovery T1-20 1
8 Database Tuning. R2-21.2 1
Total Hours 10
MODULE II
11 Parallel Databases R2- 1
Inter and Intra Query Parallelism 20.1,20.4
12 Distributed Database Features R3-21.3 1
13 Distributed Database Architecture T1-22.3 1
14 Fragmentation T1-22.4 1
15 Distributed Query Processing R2-19.7 1
16 Distributed Transactions Processing 1
17 Concurrency Control T1-23 1
18 Recovery Commit Protocols. 1
Total Hours 10
MODULE III
21 Introduction to Object Oriented Data Bases- T1-25 1
Approaches
22 Modeling and Design T1 1
23 Persistence T1-26.3 1
24 Query Languages R2-8,T1- 1
27.2.4

105
S.No. Subject Reference Hours Remarks
25 Transaction T1-26.4.1 1
26 Concurrency 1
27 Multi Version Locks T1-20.2.6 1
28 Recovery 1
29 POSTGRES JASMINE GEMSTONE - ODMG Model T1- 1
28.3,T1-
27.2
Total Hours 10
MODULE IV
30 Enhanced Data Models T1 1
31 Client/Server Model R3-21.5 1
32 Data Warehousing T1-31 1
33 Data Mining T1-34 1
34 Web Databases T1-29 1
35 Mobile Databases T1- 1
24.7,R1-
18.1
36 XML and Web Databases. T1-30 2
Total Hours 10
MODULE V
37 Rules - Knowledge Bases WR6 1
38 Active and Deductive Databases R1- 2
13.4,13.7
39 Multimedia Databases R1-18.2 2
40 Multimedia Data Structures WR1,WR2 1
41 Multimedia Query languages 2
42 Spatial Databases WR5 1
Total 10
Hours

Total Hours: 50

106
Concept Map

MODULE-I(Relational Model Issues)


Module Overview
This module gives details about the database modeling technique like ER model and also discusses
in detail about various normalization techniques. It also talks about the transaction and
concurrency control in relational database management system. It also discusses about the
relational database query processing and optimization techniques.
Module Competencies
1. Model the database using ER diagram.
2. Apply normalization techniques to reduce redundancy of data.
3. Process and Optimize database queries.
4. Identify the methods to control concurrency.
5. Identify the measures to be taken in case of failures.
Instructional objectives of a course in Gronlund format:
General Instructional Objectives (GIO) and Specific Learning Outcomes (SLO) and the
Test Items (TI)
C1: Model the database using ER diagram.
1. Describe various data models (Remember)
1.1 Understand the data models.
TI1: What is data modeling?
TI2: What is the role of data model?
TI3: What are the types of data model?
TI4: What is logical data modeling?

107
TI5: What is relational data modeling?
TI6: What is conceptual database modeling?

1.2 Distinguish various database modeling techniques.


TI1: What is the difference between logical data model and physical
data model?
TI2: State the difference between ERD and logical data modeling.
TI3: Give the difference between object relational model and object o
riented model.
2. Illustrate the concepts of Entity and relation sets (Understand)
2.1 Understand about Entity sets and relation sets.
TI1: What is an entity? Give example.
TI2: Define entity sets.
TI3: What is weak entity set?
TI4: Define relationship
TI5: Define relationship sets
TI6: Explain the difference between weak entity set and strong entity
set.
TI7: Show the symbols used to represent the relationship sets and weak
relationship sets.
TI8: Explain the distinction among the terms: Primary key, candidate
key and super key.
2.2 Understand various types of attributes.
TI1: Define attributes.
TI2: What are derived attributes?
TI3: Explain about multi-valued attributes. Give an example.
2.3. Identify various constraints in relational database model
TI1: Understand various relational integrity constraints
TI2: What is a constraint and give any three types of constraints?
TI3: Brief about key constraints.
TI4: Write about domain constraints.
TI5: Identify any two relational integrity constraints in an ordering
system.
TI6: Explain the distinction between total and partial constraints.
3. Model the given database using ER modeling technique. (Design)
3.1 Draw diagrams in top down fashion for the given data bases.
TI1: Draw the E-R diagram for the following relation schemas:
Worker (worker_id, worker_name, hourly_rate, skill_type,
supervisor_id)
Assignment (worker_id, building_id, start_date, num_days)
Building (building_id, address, building_type)
TI2: Give the E-R diagram for the following database:

108
person (driver-id, name, address)
car (license, model, year)
accident (report-no, date, location)
owns (driver-id, license)
participated (driver-id, license, report-no, damage-amount)
TI3: A database is being constructed to keep track of the teams and
games of a football league. A team has a number of players. For
the team, we are interested to store team id, team name, address,
date established, name of manager, and name of coach. For the
player, we will store player id in team, date of birth, date joined,
position etc. Each team plays games against other team in a round
robin fashion. For each game, we will store game id, date held,
score and attendance (an attribute to designate whether the
participating teams have attended the game). Games are generally
taking place at various stadiums of the country. For each stadium,
we will keep its size, name and location.
i. Develop a complete E-R diagram (including cardinalities). Make
reasonable assumptions during your development phases, if
needed and state them clearly.
ii. Translate the E-R diagram into relations (tables).
TI4: A database for a local garage is needed. The database contains
data items for customer's name, customer's address, customer's
home telephone number, customer's work telephone number, the
vehicle's make, the vehicle's model, description of the work done,
cost of the work, date of work done, part number, part name, cost
of each part and the total cost. Draw an Entity-Relationship
Diagram to depict this enterprise, noting any assumptions made.

C2: Apply normalization techniques to reduce redundancy of data.


1. Identify database anomalies (Apply)
1.1 Understand the types of anomalies
TI1: What are database anomalies?
TI2: What are the types of database anomalies?
TI3: What is insertion anomaly?
TI4: What are deletion and update anomalies?
TI5: How to avoid anomalies in database?
2. Identify functional dependency in the relation. (Apply)
2.1 Understand functional dependency.
TI1: What is functional dependency?
TI2: Why is certain functional dependencies called trivial dependencies?
TI3: Explain how functional dependencies can be used to indicate the
following:

109
a. One to one relationship set
b. One to many relationship sets.

2.2 Identify the functional dependencies in the relation.


TI1: List all the functional dependencies satisfied by the relation of
following relation.
A B C

a1 b1 c1

a1 b1 c2

a2 b1 c1

a2 b1 c3

TI2: Suppose you are given a relation R = (A,B,C,D,E) with the


following functional dependencies: {CE -> D,D -> B,C -> A}.Find
all the candidate keys.
TI3: Name SSN Phone Number
Fred 123-321-99 (201) 555-1234
Fred 123-321-99 (206) 572-4312
Joe 909-438-44 (908) 464-0028
Joe 909-438-44 (212) 555-4000
Find the dependencies and keys in the above table.
3. Normalize databases to minimize redundancy. (Apply)
3.1 Understand various normal forms.
TI1: Define normalization.
TI2: Define First normal form.
TI3: When a domain is atomic? Give example.
TI4. Define second normal form.
TI5. Define third normal form.
TI6. Define BCNF normal forms
TI7: How to perform 1st and 2nd normalization? Explain with example.
TI8: How to perform 3NF?
TI9: State the differences between 3NF and BCNF.
TI10: What is 4NF?
TI11: Explain why 4NF is a normal form more desirable than BCNF.
3.3 Creation of normalized database.
TI1: Normalize the database given below.

Customer First Telephone


Surname
ID Name Numbers

110
123 Robert Ingram 555-861-2025

555-403-1659,
456 Jane Wright
555-776-4100

TI2: Normalize the following table and explain up to 3NF.

Order Date Cust Customer Cust Item Item Item Item Item Order
No. no name addr Id Description Qty Price Total total
Price

TI3: Explain fourth normal form and normalize the following table to
4NF.

Pizza Variety
Restaurant Delivery Area

A1 Pizza Thick Crust Capital City


A1 Pizza Stuffed Crust Springfield
Elite Pizza Thick Crust Capital City
Elite Pizza Stuffed Crust Springfield

C3: Process and Optimize database queries.


1. Discuss the steps and algorithms involved in query
processing.(Understand)
1.1 Understand query processing
TI1: What are the basic steps involved in query processing?
TI2: Brief about evaluation plan.
1.2 Understand the algorithms involved in processing a query.
TI1: List down various search algorithms.
TI2: Explain nested join loop algorithm with an example.
TI3: What is the role of indexes in query processing?
TI4: Explain indexed nested loop algorithms.
2. Analyze various algorithms involved in processing of queries. (Analyze)
2.1 Analysis of algorithms that help to process the queries based on time and
cost.
TI1: Let r and s be relations with no indices, and assume that the
relations are not sorted. Assuming infinite memory, what is the
lowest cost way(interms of I/o) to compute r join s? What is the
amount of memory required for this algorithm?

111
TI2: Consider join of two relations, r and s. Relation r uses sequential
organization and is sorted on primarykey. r uses 1000 disk
blocks. 500 memory blocks are available to perform the join.
Choose the best algorithm to perform equijoin of of r and s where
join attribute is the primary key of r.
1. s uses 1000 disk blocks and heap organization
2. s uses 100 blocks and hash organization
3. s uses 100000 blocks and hash organization. Maximum
frequency of a value of the join attribute is 2.
s uses 100000 blocks and hash organization. Number of distinct
values of the join attribute is 20.

TI3: What is the cost of sorting a relation which uses 1000000 blocks if
1. 100 main memory blocks are available
2. 1000 main memory blocks are available
3. 1000000 main memory blocks are available
TI4: Consider the following query for a bank database
Select T.branch_name from branch T, branch S where
T.assets>S.assests and S.branch_city=Brooklyn
Write an efficient relational algebra expression that is equivalent to
this query. Justify your choice.
TI5: Why is it not desirable to force users to make an explicit choice of
query-processing strategy? Are there cases in which it is desirable
for users to be aware of the costs of competing query-processing
strategies? Explain your answer.
3. Optimize the query (Apply)
3.1 Understand query optimization techniques
TI1: Define query optimization
TI2: Explain about the transformation of relational expressions
TI3: Explain the estimation of size of projection, aggregation and outer
join.
TI4: Explain about cost based optimization
TI5: How to optimize nested query.
3.2 Identify efficient query evaluation plan
TI1: Consider the relations r1(A,B,C), r2(C,D,E) and r3(E,F) with
primary keys A, C, E respectively. Assume that r1 has 1000 tuples,
r2 has 1500 tuples, and r3 has 750 tuples. Estimate the cost of r1
join r2 join r3 and give an efficient strategy for computing the join
TI2: Describe how to incrementally maintain the results of the following
operations, on both insertion and deletions.
a. Union and set difference
b. Left outer join.

112
C4: Identify the methods to control transaction and to maintain concurrency.
1. Understand transaction control (Understand)
1.1 Understand Properties of transactions.
TI1: What is transaction?
TI2: What are ACID properties?
T13: What with an example how ACID properties are satisfied in
transaction control?
1.2 Understand transaction states
TI1: Explain the transaction states.
TI2: What is roll back? Give an example.
TI3: When a transaction is said to be terminated?
TI4: Draw the state diagram of transaction processing.
TI5: Explain serailizability.
2. Apply transaction control mechanism (Apply)
2.1 Applying transaction control mechanisms in various transactions
TI1: During execution, a transaction passes through several states,
until it finally commits or aborts. List all possible sequences of
states through which a transaction may pass. Explain why each
state transaction may occur.
TI2: Justify the following statement: Concurrent execution of
transactions is more important when that must be fetched from
(slow) disk or when transactions are long , and is less important
when data is in memory and transactions are very short.
TI3: Consider the following two transactions:
T1: read(A);
read (B);
if A=0 then B:=B+1;
write(B);
T2: read(B);
read(A);
if B=0 then A:=A+1;
write(A);
Let the consistent requirement be A=0 v B=0, with A=B=0 the
initial values.
Show a concurrent execution of T1 and T2 that produces a non
serializable schedule.
Apply mechanisms to maintain concurrency in transaction.
3. Apply various concurrency protocols. (Apply)
3.1 Understand concurrency Protocols
TI1: What are the various protocols for concurrency control?
TI2: Explain Lock based protocols

113
TI3: Explain Graph based protocols.
TI4: Explain time stamp based protocols.
TI5: Explain Thomas Write rule.
TI6: Explain dead lock handling mechanism.
TI7: Under what conditions is it less expensive to avoid deadlock than
to allow deadlocks to occur and then to detect them?
3.2 Apply concurrency control mechanism in transactions
TI1: Consider the following two transactions:
T31: read(A);
read (B);
if A=0 then B=B+1;
write(B);
T32: read(B);
read(A);
if B=0 then A=A+1;
write(A)
Add lock and unlock instructions to transactions T31 and T32, so
that they observe the two-phase locking protocol. Can the
execution of these transactions result in dead lock?
TI2: Consider a database organized in the form of rooted tree. Suppose
that we insert a dummy vertex between each pair of vertices.
Show that, if we follow the tree protocol on the new tree, we get
better concurrency that if we follow the tree protocol on the
original tree.
TI3: Consider the following locking protocol: All items are numbered,
and once an item is locked only higher numbered items may be
locked. Locks may be released at any time. Only X-locks are used.
Show by an example that this protocol does not guarantee
serializability.

C5: Identify the measures to be taken in case of failures.


1. Classify types of failures (Remember)
1.1 Understand the failure situations.
TI1: Explain the types of failures.
TI2: What is transaction failure?
TI3: What is disk failure?
TI4: What do u mean by fail stop assumption?
2. Apply mechanisms to recover from failure. (Apply)
2.1 Understand various recovery mechanisms
TI1: Explain about Log-based recovery.
TI2: What is meant by check point? How recovery is done by check
point mechanism.?

114
TI3: Compare the deferred and immediate modification versions of the
log-based recovery scheme in terms of ease of implementation and
overhead cost.
2.2 Apply various recovery mechanisms
TI1: When a system recovers from a crash, it constructs an undo-list
and a redo-list. Explain why log records for transactions on undo-
list must be processed in reverse order, while those log records for
transactions on the redo-list are processed in a forward direction.
TI2: Explain the purpose of the check point mechanism. How often
should check points be performed? How does the frequency of
checkpoints affect
System performance when no failure occurs?
The time it takes to recover from system crash?
The time it takes to recover from a disk crash?
TI3: Sometimes a transaction has to be undone after it has committed,
because it was erroneously executed, for example because of
erroneous input by a bank teller.
Give an example to show that using the normal transaction undo
mechanism to undo such a transaction could lead to an
inconsistent state.
MODULE-II (Distributed databases)
Module Overview
This Module explains about the parallel databases and inter and intra query parallelism. It also
discusses about features of distributed databases. It also shows the architecture of distributed
database. It explains about fragmentation and processing of distributed queries. It explains about
the transaction, concurrency and commit protocols.

Module Competencies
1. Apply query parallelism to enhance performance.
2. Classify distributed database based on its architecture.
3. Process distributed queries.
4. Apply mechanisms to control distributed transaction and maintain concurrency.
5. Identify protocols to recover from failures.

GIO-SLO-TI
C1: Apply query parallelism to enhance performance.
1. Describe parallel databases. (Understand)
1.1 Understand databases that support parallel execution of instructions
TI1: Explain parallel databases.
TI2: What is parallel processing?
TI3: What are the advantages and disadvantages of parallel databases?
TI4: State the difference between parallel and distributed databases.

115
TI5: Which database support parallel processing across multiple server?
TI6: What are the key elements of parallel processing?
TI7: Explain the general architecture of parallel DB systems.
TI8: Why we need parallel access to data?
1.2 Classification of parallel database architecture
TI1 Explain about shared memory architecture.
TI2 Brief about shared disk architecture.
TI3 Write about shared nothing architecture.
TI4 Give the difference between shared memory and shared disk
architecture.
2. Apply inter and intra query parallelism to enhance the performance
(Apply)
2.1 Apply suitable parallelism technique to improve the performance of
operation.
TI1. Identify good ways to parallelize each of the following operations.
i. Different operations.
ii. Aggregation by count operation.
iii. Aggregation by avg operation.
iv. Left outer join if the join condition involves
comparisons other than equality.
v. For each of the three partitioning techniques, namely
round-robin, hash partitioning, and range partitioning,
give an example of a query for which that partitioning
technique would provide the fastest response.

TI2. What form of parallelism (interquery, interoperation or intra


operation) is likely to be the most important for each of the
following tasks.
a. Increasing the throughput of a system with many
small queries.
b. Increasing the throughput of a system with a few
large queries, when the number of disks and
processors is large.

C2. Classify distributed database based on its architecture.


1. Define distributed database features (Understand)
1.1 Understand the features of distributed database.
TI1: What is distributed database?
TI2: Explain how distributed database differs from centralized database.
TI3: Explain the need of distributing a database.
TI4: Explain the advantages and disadvantages of distributed database.
TI5: List some problems unique to distributed databases.

116
1.2 Differentiate architectures of distributed database.
TI1: Differentiate homogenous and heterogeneous databases.
TI2: Differentiate distributed database and client server database.
2. Identify techniques to break up the database into logical units. (Apply)
2.1 Understand fragmentation techniques and replication.
TI1. Explain about data fragmentation.
TI2. With an example explain vertical and horizontal fragmentation.
TI3. Write about mixed fragmentation.
TI4. How is a vertical fragmentation of a relation specified? How can a
relation be put together n from a complete vertical partitioning?

2.2 Apply fragmentation techniques to distribute the database.


TI1. Consider a company has three computer sites, one for each current
department. At each of these sites, we expect frequent access to
the Employee and project information for the employees who work
in that department and the projects controlled by that department.
Site 1 contains all the details and is accessed by head quarter.
Fragment this database and replicate the necessary fragments on
site 2 and 3 so that it satisfies the above needs. (Specify all your
assumptions)

C3. Process distributed query.


1. Processing the distributed query (Apply)
TI1: What is distributed query processing?
TI2: Explain the phases of distributed query processing with a semi join
operator.
TI3: Explain the characteristics of distributed query processors.
TI4: State the query processing problem.
TI5: Describe the layer architecture of query processing.
TI6: Describe query optimization.
TI7: A company has branches in Brisbane, Sydney and Melbourne. Its company
database consists of two tables:
branch(name, location, manager)
employee(name, office, salary, home_address)
where primary keys are underlined, branch. Manager is a foreign key to
employee.name and employee. office is a foreign key to branch.name.
The database is fragmented as the following:

Brisbane site: location = Brisbane branch, name, office,

home_address employee

Sydney site: location = Sydney branch

117
Melbourne site: location Brisbane and location Sydney branch,

name, salary employee


For the following query select e.name, salary from branch b, employee e
where location = Brisbane and e.name = manager.
Give operator trees for the above query 1) after query decomposition (i.e.,
on global relations), 2) after localization, and 3) after reduction.
2. Evaluate the cost of executing the query and optimize based on it.
(Evaluate)
2.1 Optimize the query based on cost metric.
TI1. Consider two relations employee and department which are
distributed in two different sites. Each employee record is of length
100 and there are 10000 employees. Also, each department record
is of length 35 and there are 100 departments. Write a query to
retrieve the employee name and the name of the department for
which the employee works. Find a suitable strategy to evaluate the
query with minimum cost.

C4. Apply mechanisms to control distributed transaction and maintain concurrency.


1. Discuss issues related to distributed concurrency control.(Understand)
1.1 Recognize the issues related to distributed concurrency control
TI1: Explain the difference between distributed and centralized
transaction processing.
TI2: Discuss the factors that do not appear in centralized systems that
affect concurrency and recovery in distributed systems.
TI3: How will you deal with multiple copies of data items?
2. Illustrate the concept of distributed concurrency control. (Understand)
2.2 Understand concurrency control based on distinguished copy of data item.
TI1: What is concurrency control in distributed environment?
TI2: Explain about primary site technique.
TI3: Differentiate primary site technique and primary site from backup
technique.
TI4: Brief about primary copy technique.
TI5: Explain distributed concurrency based on voting.
2.1 Understand the concept of concurrency control in distributed environment
TI2: Explain about locking protocols.
TI3: Give the advantages and disadvantages of primary copy 2 phase
locking protocol and distributed 2PL protocol.
TI4: Write about time stamp based protocols with example.
TI5: Explain distributed dead lock management and also discuss how it
differs from centralized deadlock management.
TI6: Explain the types of distributed deadlock detection.
C5. Identify protocols to recover from failures.

118
1. Discuss protocols for distributed recovery.
1.1 Understanding the concepts of recovery protocol in distributed
environment.
TI1: What are the types of failures particular to distributed databases?
TI2: Explain distributed recovery mechanism and show how it differs
from centralized protocols.
TI3: Draw the state diagram of 2PC recovery.
1.2 Compare commit protocols for recovery.
TI1: What is 2 phase commit protocol? Explain the 2 phases in that.
TI2: What is 3-phase commit protocol? Explain the phases in that and
also show the difference between 2-phase commit and 3-phase
commit protocols.
TI3: What is replication server? Explain its functionality.

MODULE-III (Object oriented database)

Module Overview
This module gives introduction about object oriented data bases. It discusses about modeling and
design of object oriented databases. It provides information about the transaction and concurrency
control in object oriented database. It discusses about model like POSTGRES, JASMINE,
GEMSTONE and OMDG Model
Module Competencies
1. Analyze Object Oriented Data Bases.
2. Model and design object oriented databases.
3. Assess the models like POSTGRES, JASMINE, GEMSTONE and ODMG model.

GIO-SLO-TI
C1. Analyze Object oriented database
1. Review the basic concepts of the structure of object oriented databases.
(Apply)
1.1 Demonstrate object oriented databases
TI1: Define object oriented database
TI2: What are the goals of object oriented database?
TI3: What are the two components of object?
TI4: What are identical objects and equal objects?
TI5: What are the methods for creating persistent objects?
TI6: What are the two types of complex objects and explain its types?
TI7: Write the formal structure of an object.
TI8: Explain the object constructor, destructor and object modifier.
TI9: Assume that we have an object of class order with an object id of
123. Write the object oriented call to compute the total of order
TI10: What are persistent objects and transient objects?

119
TI11: What is OID and what are its properties?
TI12: Explain the requirements of object oriented databases.
TI13: Explain the need of object oriented database.
TI14: Give some examples where object-oriented database is currently
used.
TI15: State the difference between object oriented database and object
relational database.
1.2 Identify the approaches for object oriented databases.
TI1: Determine the types of approaches for object oriented databases
TI2: How will you extend the relational database to support object
oriented database?
TI3: What is the role of persistent programming language to support
object oriented concepts?
2. Examine the persistence concepts of databases (Apply)
2.1 Illustrate the persistence concepts
TI1: What do you mean by persistent objects?
TI2: Distinguish between transient object and persistent object
TI3: What are the persistence schemas? Discuss in detail.
TI4: Discuss the concepts of orthogonal persistence.
TI5: Explain the challenges in building persistence languages
TI6: State different mechanisms to make objects persistent.
2.2 Select the appropriate persistent programming language for ODBMS
TI1: List down the persistent programming languages
TI2: Explain how a persistent pointer is created. Contrast this
implementation with that of pointers as they exist in general
purpose languages such as C,C++ or Pascal
TI3: Consider a system that provides persistent objects. Is such system
necessarily a database? Justify your answer.
TI4: If an object is created without any reference, how can that object
be deleted?
TI5: Examine the persistence feature supported by JAVA.
TI6: Is C++ a persistent programming language? Justify you answer.

C2. Model and design object oriented database


1. Inspect the models object oriented databases. (Analyze)
1.1. Review the models of object oriented databases
TI1: What are the origins of functional data model(FDM)?
TI2: What do you mean by functional data model?
TI3: How do you represent entities in FDM?
TI4: Write down the specification for NAME entity using functional data
model.
TI5: Discuss the syntax for representing inheritance with example.

120
TI6: Explain the functional query languages
TI7: Bring out the advantages of functional data model.
1.2 Infer the concepts of Object oriented data model
TI1: What is the origin of the object oriented data model proposed by
object data management group?
TI2: List down the object services of OMG.
TI3: Discuss the architecture of ODMG for am OODBMS.
TI4: Consider the following Hotel relational database)
Hotel (hotelNo, hotelname,city)
Room (roomNo,hotelNo,type,price)
Booking(hotelNo,guestNo,dateFrom,dateTo,roomNo)
Guest(guestNo,guestName,guestAddress)
Answer the following queries using OQL
1. List all hotels
2. List all single rooms with a price below 20$
3. List the names and cities of all guests
4. List the price and type of all rooms at the Grosvenor
Hotel
5. List all guests currently staying at Grosvenor Hotel
6. List the details of all rooms at the Grosvenor Hotel,
including the name of the guest staying in the room
7. List the guest details (guestNo,guestName and
guestAddress) of all guests staying at the Grosvenor
Hotel.
Compare the OQL answers with the equivalent relational algebra
and relational calculus.
TI5: How does the ODMG GROUP BY clause differ from SQL GROUP BY
claues?
2. Design some case studies using object oriented data models(Design)
1.1 Develop real time applications for implementing object oriented databases
TI1. Consider the AIRPORT database. Specify a number of
operations/methods that you think should be applicable to that application.
Specify the ODL classes and methods for the database.
TI2. Design an OO schema for the below given application. First
construct an EER schema for the application; then create the
corresponding classes in ODL. Specify a number of methods for each class,
and then specify queries in OQL for your database application.
Hotel reservation system which consists of the following relations
Hotel (hotelNo, hotelname,city)
Room (roomNo,hotelNo,type,price)
Booking(hotelNo,guestNo,dateFrom,dateTo,roomNo)
Guest(guestNo,guestName,guestAddress)

121
TI3. Consider the art museum application. Assume that the following
requirements were collected:
The museum has a collection of ART_OBJECTs. Each
ART_OBJECT has a unique IdNo, an Artist (if known), a Year
(when it was created, if known), a Title, and a Description.
The art objects are categorized in several ways as discussed
below.
ART_OBJECTs are categorized based on their type. There are
three main types: PAINTING, SCULPTURE, and STATUE, plus
another type called OTHER to accommodate objects that do
not fall into one of the three main types.
A PAINTING has a PaintType (oil, watercolor, etc.), material
on which it is DrawnOn (paper, canvas, wood, etc.), and Style
(modern, abstract, etc.).
A SCULPTURE has a Material from which it was created (wood,
stone, etc.), Height, Weight, and Style.
An art object in the OTHER category has a Type (print, photo,
etc.) and Style.
ART_OBJECTs are also categorized as
PERMANENT_COLLECTION that are owned by the museum
(which has information on the DateAcquired, whether it is
OnDisplay or stored, and Cost) or BORROWED, which has
information on the Collection (from which it was borrowed),
DateBorrowed, and DateReturned.
ART_OBJECTs also have information describing their
country/culture using information on country/culture of Origin
(Italian, Egyptian, American, Indian, etc.), Epoch
(Renaissance, Modern, Ancient, etc.).
The museum keeps track of ARTISTs information, if known:
Name, DateBorn, DateDied (if not living), CountryOfOrigin,
Epoch, MainStyle, Description. The Name is assumed to be
unique.
Different EXHIBITIONs occur, each having a Name,
StartDate, EndDate, and is related to all the art objects that were
on display during the exhibition.
Information is kept on other COLLECTIONs with which the
museum interacts, including Name (unique), Type (museum,
personal, etc.), Description, Address, Phone, and current
ContactPerson.
Specify a number of operations/methods that you think should be
applicable to that application. Specify ODL classes, methods for the
database.

122
C3. Assess the models like POSTGRES, JASMINE, GEMSTONE and ODMG model
1. Discuss Object oriented database models.(Understand)
1.1 Understand models like Ingres, Postgres and Jasmine
TI1: Explain the components of INGRESS.
TI2: Explain the design goals of Postgres.
TI3: State the query language supported by POSTGRES
TI4: What are the built in data type used in POSTQUEL?
TI5: Show with example how complex objects can be created using
POSTQUEL.
TI6: Give the overview of JASMINE ODB
TI7: Explain the steps involved in setting up JASMINE environment
TI8: Write about the query language used in JASMINE ODB.

MODULE-IV (Emerging systems)


Module Overview
This module concentrates on the enhanced data models like EER model. To enable the access of
databases in a networking environment, this module gives a detailed view on client server data
model also. As the size of real world database is increasing, data mining concept emerged. This
module deals with mining and data warehousing concepts also. Due to the innovations on online
applications mobile and web databases also came into existence. There is also a contribution on
XML database also.
Module Competencies
1. Work with enhanced data models and client server models.
2. Model database that can be connected by a mobile device over a mobile network.
3. Demonstrate data warehousing and data mining.
4. To have an expertise in using XML and web databases
GIO-SLO-TI
C1. Work with enhanced data models and client server models.
1. Discuss enhanced data models.(Understand)
1.1 Understand features that are needed by advanced applications.
(Understand)
TI1: Define Attribute and relationship inheritance
TI2: What are the main reasons for introducing the concepts of super
classes and subclasses into an ER model
TI3: Describe and contrast the process of specialization with the process
of generalization
TI4: Describe and contrast the concepts of aggregation and composition
and provide an example of each
TI5: What are the enhancements that distinguish the EER model from
the ER model.

123
TI6: What is type inheritance? How does super class/subclass
relationship exemplify type inheritance?
TI7: What is generalization? Illustrate how it is helpful with an example
1.2 The architecture of client-server data model
TI1: Bring out the importance of client server architecture distributed
database environment
TI2: Analyse the role of the three layers in the 3 tier architecture.
TI3: Give the general structure of client server system.
TI4: In typical client server systems the server machine is much more
powerful than the clients. That is its processor is faster, it may
have multiple processors, and it has more memory and disk
capacity. Consider instead, a scenario where client and server
machines have exactly the same power. Would it make sense to
build a client server system in such a scenario? Why? Which
scenario would be better suited to data-server architecture?
TI5: Consider a network based on dial up phone lines, where sites
communicate periodically, such as every night. Such networks are
often configured with a server site and multiple client sites. The
client sites connect only to the server, and exchange data with
other clients by storing data at the server and retrieving data
stored at the server by other clients. What is the advantage of
such architecture over one where a site can exchange data with
other site only by dialing it up?

C2. Model database that can be connected by a mobile device over a mobile network.
1. Discuss issues of database that can be connected by mobile device
(Understand)
1.1 Understand data in mobile environment, mobile transactions and commit
protocols.
TI1: Give some key functionality required by mobile databases.
TI2: What is the need of mobile database?
TI3: Give some advantages of using mobile database.
TI4: Discuss some issues related to mobile data management.
TI5: Query the database to retrieve information.
TI6: Write about the transaction models in mobile database systems.
TI7: Explain Timeout-based Mobile Transaction Commit Protocol
C3. Demonstrate data warehousing and data mining.
1. Discuss the concepts of data warehouse and data mining. (Understand)
1.1 Understand the concept of data warehouse.
TI1: What is data warehouse and how does it differ from database?
TI2: Define the terms: OLAP, ROLAP, DSS.

124
TI3: Describe the characteristics of a data warehouse. Divide them into
functionality of a warehouse and advantages users derive from it.
TI4: Define the following terms: Star schema, snowflake schema, Fact
constellation, Data marts.
TI5: Explain the important design considerations for a data warehouse
environment.
TI6: Describe the steps of building a warehouse.
TI7: What types of indexes are built for a warehouse?
TI8: List the open issues and research problems in data warehousing.
TI9: Discuss the difficulties encountered in implementing a data ware
house.
TI10: Give the difference between data warehouse database and OLTP
database.
1.2 Understand the concept of data mining.
TI1: How does data mining differ from and extend the functionality of a
typical database Management System?
TI2: What type of information is obtained as a result of data mining?
TI3: What are the five types of knowledge produced from data mining?

C4. To have an expertise in using XML and web databases.


1. Apply the concepts of HTML and XML in database applications.(Apply)
1.1 Understand data used in web applications.
TI1: When are HTML,XML and XSL used?
TI2: What are the three main types of XML documents? Explain.
TI3: What is the difference between XML schema and XML DTD?
TI4: Discuss the different notations used for specifying elements in DTD
files.
TI5: What are the differences between structured, semi structured and
unstructured data? Give examples of data models for each type of
data.
TI6: Explain in detail about web database architecture.
1.2 Practise with Web and XML databases. (Apply)
TI1: Consider a website to perform online auction. Create a relational
database to store all the necessary details. Write scripts to
implement this online auction website.Also, perform the following
functions.
a. A buyer should be able to search items by entering a
keyword. The result of the search should be a list of
items each with a hyperlink.
b. A seller should be able to place an item for sale by
providing product details, auction details and so on.

125
c. Buyers and sellers should be able to place a rating and
view rating for transactions they are involved in.
TI2: Write program to create web forms for entering the information
about a new borrower entity in a library database.
TI3: Consider the library relational database schema. Create an XML
schema that corresponds to this database schema.
TI4: Create an XML schema for a company and specify the following
views as queries in XQuery on that schema.
a. A view that has dept name, manager name and
manager salary for every department.
b. A view that has the employee name, supervisor name
and employee salary for each employee who works in
research department.
c. A view that has the project name, controlling dept
name, number of employees, and total hours worked
per week for each project with more than one
employee working on it.

MODULE-V(Current issues)
Module Overview
This Module deals about the recent trends in database technologies. It gives information about
how the knowledge and rules are stored and retrieved from a database. It also talks about the
active databases and deductive databases. It also shows how the multimedia contents are stored
and retrieved from the multimedia database and the data structures used for that. It also tells
about the query languages. It also gives information about the spatial databases.
Module Competencies
1. Illustrate knowledge bases and representations.
2. Demonstrate active databases and deductive databases.
3. Create triggers for automatic actions in case of certain events.
4. Identify suitable data structures to store multimedia data.
5. Work with spatial databases and spatial query language.

GIO-SLO-TI
C1: Illustrate knowledge bases and representations.
1. Describe the knowledge rules and knowledge bases.(Remember)
1.1 Understand knowledge bases
TI1: What is knowledge base?
TI2: Give some applications that use knowledge base.
TI3: What is knowledge representation?
TI4: What are the ways to represent knowledge?
TI5: Give some approaches for knowledge acquisition.

126
2. Infer from the rules of knowledge bases using inference engine.(Analyze)
2.1 Infer new rules and to conclude certain facts from the rules and knowledge
from database
TI1: What is inference engine?
TI2: Explain about forward and backward inference chains.
TI3: Conclude the color of Fritz, given that he croaks and eats flies, and
that the rule base contains the following four rules:
1. If X croaks and eats flies Then X is a frog
2. If X chirps and sings Then X is a canary
3. If X is a frog Then X is green
4. If X is a canary Then X is yellow
Use forward and backward inference chains.

C2: Demonstrate active databases and deductive databases.


1. Discuss the features of active databases.(Remember)
1.1 To understand active databases and ECA model.
TI1: Difference between active and passive database. Explain with
example.
TI2: What is active database?
TI3: Explain ECA model.
TI4: What is an event?
TI5: Give some examples of events that occur in database.
TI6: Why is it useful to have events in rules?
TI7: What are the types of events?
TI8: What is a condition?
TI9: What is an action? Explain the types of action.
2. Explain the concepts of triggers.(Understand)
2.1 Understand the syntax of trigger creation, deletion etc.
TI1: What is a trigger? Give the syntax to create a trigger.
TI2: What are the types of triggers?
TI3: Compare statement level and row level triggers.
TI4: What is referencing clause?
TI5: How to choose a rule from a set of activated rules?
TI6: What are the coupling modes?
TI7: Which are the tuples that are visible during the evaluation of the
condition and the execution of the action?
TI8: Explain how the rule termination is being handled.
TI9: Give the syntax to drop a trigger.
3. Apply rules and facts to update deductive database (Apply)
3.1 Query deductive databases using the rules and facts.
TI1. Consider the following set of facts for the relation PARENT(X,Y)
where Y is the parent of X:

127
PARENT (a,aa), PARENT(a,ab),PARENT(aa,aaa),
PARENT(aa,aab),PARENT(aaa,aaaa),PARENT(aaa,aaab).
Consider the following rules
R1: ANCESTOR(X,Y):-PARENT(X,Y)
R2: ANCESTOR(X,Y):- PARENT(X,Z),ANCESTOR(Z,Y)
Which define ancestor Y of X as above.
Show how to solve the Datalog query ANCESTOR(aa, X)? using the
native strategy. Show your work at each step.

C3. Create triggers for automatic actions in case of certain events.


1. Activate database using triggers. (Create)
1.1 Create various triggers based on specified conditions.
TI1: Consider that the table Departments has a Dept_no, Dept_Name,
No. of employees, Budget etc.and that the budget of a department
cannot be modified after 5 pm. Write a trigger to do the same.
TI2: Consider the following tables:
Prime Ministers (Name, Popularity,)
Taxpayers (Name_Tax_Payer, Tax_Amount)
National Debts (, Amount,)
TI3: Suppose that the first time Bob is elected, the taxes are decreased
of 1%; in addition each modification to the taxes influences the
national debt and reduces the popularity of Bob
TI4: Consider an employee database.
Create a trigger to update the salary of each employee by 20% of
managers salary increment. Also create a trigger to intimate the
manager if the salary increment of employees exceed 20%.
TI5: CREATE TRIGGER Trigger1 AFTER UPDATE ON Table1 ;
CREATE TRIGGER Trigger2 BEFORE UPDATE ON Table1 ;
CREATE TRIGGER Trigger3 AFTER UPDATE ON Table1 ;
ALTER TABLE Table1 ADD CONSTRAINT Constraint1;
(assume that this constraint is an immediate constraint)
What happens when we execute an UPDATE on Table1?

C4. Identify suitable data structures to store multimedia data.


1. Discuss multimedia databases and query languages.(Understand)
1.1 Understand multimedia databases.
TI1: Give some examples of multimedia data.
TI2: Write about issues related to handle multimedia data.
TI3: Explain about problems in text retrieval.
TI4: Give some applications of multimedia database.
C5. Work with spatial databases and spatial query language.
1. Describe spatial databases and queries. (Apply)

128
1.1 Understand spatial databases.
TI1: What is spatial database?
TI2: How do spatial databases differ from regular databases?
TI3: Brief about Spatial architecture
TI4: Explain the ways to represent spatial data.
TI5: What are the things need to be represented in spatial database.?
TI6: Give the basic abstractions for modeling single objects.
TI7: Specify the basic abstractions for spatially related collection of
objects.
TI8: Write the Issues related to spatial queries
TI9: Basic operations in spatial database
1.2 Query spatial database to retrieve spatial information.
TI1: Create database to store spatial information of rivers and the
states. Write queries for the following.
Find all cities in Bavaria.
Find all big cities no more than 100 km from Hagen.
For each river, find all cities within less than 50 kms.

129
CS66 Object Oriented Analysis and Design Lab.

Subject Code : CS66

Subject Name : Object Oriented Analysis and Design Lab.


Class : III year CSE
Prepared By : Dr.K.Mala, Mrs.R.Beaulah Jeyavathana,
Mr.C.Balasubramanian, Mr.B.Lakshmanan
Approved By : Dr. K.Muneeswaran.
Effective Date : 02.01.2012
Revision No : 0

SYLLABUS (As prescribed by Anna University)

Objective:

To develop a mini-project based on the following 12 exercises

1. To develop a problem statement.


2. Develop an IEEE standard SRS document. Also develop risk management and project plan
(Gantt chart).
3. Identify Use Cases and develop the Use Case model.
4. Identify the business activities and develop an UML Activity diagram.
5. Identity the conceptual classes and develop a domain model with UML Class diagram.
6. Using the identified scenarios find the interaction between objects and represent them
using UML Interaction diagrams.
7. Draw the State Chart diagram.
8. Identify the User Interface, Domain objects, and Technical services. Draw the partial
layered, logical architecture diagram with UML package diagram notation.
9. Implement the Technical services layer.
10. Implement the Domain objects layer.
11. Implement the User Interface layer.
12. Draw Component and Deployment diagrams.

Suggested domains for Mini-project.

1. Passport automation system.


2. Book bank
3. Exam Registration
4. Stock maintenance system.
5. Online course reservation system
6. E-ticketing
7. Software personnel management system
8. Credit card processing
9. e-book management system
10. Recruitment system
11. Foreign trading system
12. Conference Management System
13. BPO Management System

Suggested Software Tools

ArgoUML, Eclipse IDE, Visual Paradigm, Visual case, and Rational Suite

COURSE PLAN:

Laboratory
Ex.No Document
hours

Allocation of Mini Projects & Preparation of Problem


1 statement with IEEE standard SRS document for the 3 hours
allotted projects (One experiment in the suggested

130
domain & One Miniproject from the list)

Develop risk management and project plan (Gantt chart).


2 3 hours
Identify Use Cases and develop the Use Case model.
Identify the business activities and develop an UML
3 3 hours
Activity diagram.
Identity the conceptual classes and develop a domain
4 3 hours
model with UML Class diagram.
Using the identified scenarios find the interaction between
5 objects and represent them using UML Interaction 3 hours
diagrams.
6 Evaluatory Lab 3 hours
Draw the State Chart diagram. Identify the User
Interface, Domain objects, and Technical services. Draw
7 3 hours
the partial layered, logical architecture diagram with UML
package diagram notation.
8 Draw Component and Deployment diagrams 3 hours
9 Implement the Technical services layer. 3 hours
Implement the Domain objects layer and User Interface
10 3 hours
layer .
11 Model Lab 3 hours
12 Project Demonstration & Project report submission 3 hours

Miniproject is developed using software engineering methodology concept.

SOFTWARE ENGINEERING METHODOLOGY

1. Problem Analysis
The problem statement contains introduction to the problem, scope of the problem,
requirements for solving the problem, methods for solving the problem.

2. Project Planning and Scheduling


a) Each project is divided into individual phases/modules.
b) Prepare a schedule for each module.

3. Data Modeling and implementation


a) Use case Diagram
b) Activity Diagram
c) Sequence diagrams and collaboration diagrams
d) Class diagram
e) Component diagram
f) Database design

4 Software Testing
a) Develop Test case hierarchy
b) Validation testing

5 Software debugging
Errors are corrected using the tools.

EXERCISES

Ex.1 Preparation of Problem Statement with IEEE Standard SRS Document

1. Scope:The following subsections describe the scope of the [application name] in terms
of its audience, organization, and its applicable documents.

131
1.1. Audience:The intended users are [user title] (with [prerequisite knowledge]).

1.2. Organization: This document describes the [application name] system


requirements in terms of [documentation organization headings].

1.3. Applicable documents: The following documents provide information necessary to


understand this document. [List of applicable documents].

2. Software requirements specification (IEEE SRS standard):


The following subsection describes the [application name] software requirements
specification in terms of the problem statement and feasibility studies.

2.1. Introduction to Problem


2.1.1. Purpose
2.1.2. Definitions
2.1.3. System Overview
2.1.4. References
2.2. Overall Description
2.2.1. Product Perspective
2.2.2. Product Functions
2.2.3. User Characteristics
2.2.4. Constraints, Assumptions and Dependencies

2.3.Functional Requirements: Statements of services the [application name] system


should provide.

2.4.Non-Functional Requirements: These are constraints on the services or functions


offered by the [application name] system.

2.5.Glossary: Definitions of technical terms used.

2.6. Infrastructure: Hardware and software requirements.

Ex.2 Develop risk management and project plan (Gantt chart)


Students should submit the plan and schedule for various phases of their project in the
form of a Gantt chart with risk management.

Identify Use Cases and develop the Use Case model.

Use case Diagram : Behavioral diagram that shows a set of use cases and
actors and their relationships.

Purpose : Addresses the static use case view of a system and


important in modeling the behavior of a system.
Symbols Used:

USE CASE

RELATION

ACTOR

132
SYSTEM BOUNDARY

Description of use case diagrams

For each use case that appears in the use case diagram the following details need to be
documented.

1. Use case name


2. Purpose
3. Actors
4. Detailed description
4.1 Main flow
4.2 Exception conditions
4.3 List of alternative flows
5. Preconditions
6. Post condition

Ex.3 Identify the business activities and develop an UML Activity diagram.

Activity Diagram : A Behavioral diagram that shows a state machine,


emphasizing the flow from activity to activity.

Purpose : Important in modeling the function of a system and


emphasize the flow of control among objects.

Symbols Used:

INITIAL STATE

FINAL STATE

STATE TRANSITION

SIMPLE STATE

BRANCHING

SYNCHRONIZATION BAR
(CONCURRENT FORK/JOIN)

133
Ex.4 Identity the conceptual classes and develop a domain model with UML Class
diagram.

Class diagram : A structural diagram that shows as set of classes, interfaces,


collaborations, and their relationships.

Purpose : Addresses the static design view of a system.

Description of Class Diagram:

For each class that appears in the class diagram the following details must be documented.

1. Class Name
2. Responsibility
3. Super class / Sub class names
4. Attributes specification
5. Methods specification
6. Interfaces implemented

Symbols Used:

134
NAME

CLASS
Attribute

Operation()

Name OBJECT

DEPENDENCY RELATION

GENERALIZATION RELATION

ASSOCIATION RELATION

REALIZATION RELATION

COMPOSITIION RELATION

AGGREGATION RELATION

Ex.5 Using the identified scenarios find the interaction between objects and represent
them using UML Interaction diagrams.

Sequence diagram: A behavioral diagram that shows an interaction, emphasizing


the time ordering of messages.

Purpose : Shows the dynamic view of the system.

135
Symbols Used:

OBJECT
<<Name>>

OBJECT LIFELINE

<<Name>> MESSAGE

FOCUS OF CONTROL

SELF LOOP

Collaboration diagram: A behavioral diagram that shows an interaction,


emphasizing the structural organization of the objects that
send and receive messages.
Purpose : Shows the dynamic view of the system.

Symbols Used:

<<Name>> OBJECT

FLOW OF MESSAGE

1.1. <<Name>> MESSAGE WITH SEQUENCE NUMBER

136
Ex.6 Draw the State Chart diagram. Identify the User Interface, Domain objects, and
Technical services. Draw the partial layered, logical architecture diagram with
UML package diagram notation.

State Chart Diagram : A state chart diagram shows the behavior of classes
in response to external stimuli.

Purpose : This diagram models the dynamic flow of control


from state to state within a system

Symbols Used:

Initial State

Final State

State

Transition

Synchronization and Splitting of Control

Different layers like User interface, Domain objects and Technical services are identified.

User Interface : GUI Windows, Reports, Speech Interface, HTML, XML, XSLT,
Javascript, JSP

Domain Objects : Business logic, Application logic

Technical Services : Interfacing with a database and error logging

137
Package Diagram : Package diagrams organize the elements of a system into
related groups to minimize dependencies among them.

Purpose : Shows logical architecture of the system

Symbols Used:

Package

Dependency

Ex.7 Draw Component and Deployment diagrams

Component diagram: A Structural diagram that shows a set of components and their
relationships.

Purpose : Addresses the static implementation view of a system

138
Symbols Used:

COMPONENT

INTERFACE

DLL FILE

HELP DOCUMENT

FILE

TABLE

Deployment diagram: Deployment diagrams depict the physical resources in a


system including nodes, components, and connections.

Purpose : Shows deployment details

139
Symbols Used:
Node

Association

Component and Nodes

Ex.8 Implement the Technical services layer, Domain objects layer and User Interface
layer.

Procedure for Java code generation from class diagrams in Rational Rose

1. Make sure that c:\jdk1.3\lib\tools.jar is in the CLASSPATH environment variable.

2. Select option Tools-Java-Project Specification and check the following:

Class Path tab:


The above directory should be in the Environment Settings box.
Add the directory where you want the generated code to be placed in the
Directories box.
Style tab:
Check Use Spaces and enter 4 in Number to Use in the Indentation box
Check both boxes in the Opening Brace box.
Check Javadoc style, @author, @param, @return, @exception, and @version
in the Comment Style box.

3. Select the class for which you want to generate code and select the option Tools-Java-
Syntax Check.

4. Fix the syntax errors. Examples of syntax errors are:

Variables specified as an array dimension


Return type not specified for a method

140
5. Select the class for which you want to generate code and select the option Tools-Java-
Generate Java. Make sure to select the class for which you want to generate code and
the directory where the code should be place, and click on the Assign button. This
step might produce errors that can be seen in the Log window. If there is an error, it
will not generate code. It will generate code if there are only warnings. An examples of
an error during code generation is when a role name the same as an attribute name

The code that is generated is not much. It needs to be formatted to the documentation
format required by the coding standard. For example, some of the documentation is
not on a new line, it generates a @roseuid tag that needs to be deleted, the first line
can also be deleted. Also, the preconditions and postconditions have to be copied and
pasted.

Because the Rose model is going to serve as technical documentation, it is important


that it reflects the changes being made during this process.

Check out the Rose model.


Make necessary changes due to code generation.
Check in the Rose model.

MINIPROJECT

A group of 3 students have to choose one topic in the following list. As per the theory they learnt
regarding object oriented analysis and design in the class and the practical experience gained in
the lab session, the mini project topic has to be implemented and documented.

Date of submission (on or before)


Specification, Use case diagram, Activity diagram and
Class Diagram Feb 2nd, 2012
Interaction Diagrams, Component diagram, Deployment
Diagram and Documentation Feb 16th, 2012
Implementation March 23rd, 2012
Demonstration and Miniproject Report Submission April 2nd, 2012

List of Miniprojects

1. Hospital Management System


2. Platform Assignment System (Train)
3. Digital library Journal paper access through keywords
4. Address Maintenance (staff, student, and vendor)
5. Glossary Index (Encyclopedia)
6. Question Bank Creation (Part A, Part B, Objective with pictures and equations)
Administrator mode
Author Mode
7. Assignment Uploading and evaluation
8. Car Parking Control System
9. System log maintenance
10. Screen Designing
11. Elevator Control System
12. Automatic Beverage System
13. Airline Reservation System
14. Missile Control System
15. Life Insurance Policy Tracking System
16. Leave Management System
17. University Admission System
18. Telebug
19. PharmaDrug Warehouse
20. Workshop/course Participant Registration
21. Airtele Prepaid Services
22. Call Taxi Service
23. Event Registration System
24. Cellular Phone Network Service mobile database

141
25. Ticket Vending Machine
26. Online Job Application
27. Traffic Management System
28. Weather Monitoring System
29. Online Shopping
30. ActiveCityAdministration
31. Ashray Online Child Abuse Database
32. Blood Donor Database
33. Corruption control through budget maintenance
34. Cybernetics Protector
35. Document Management & Collaboration System
36. E Gas sewa
37. E-Elcon
38. E-Farming
39. Unique ID management
40. Emergency Vehicles Recognition System (EVRS)
41. Hospital Device Management using ITM
42. Income Tax Returns Processing Made Easy
43. Indian Wildlife
44. IT Service Help Desk
45. Knowledge Based Community Sharing System

142
CS67 Internet Programming Lab

Subject code : CS67


Subject name : Internet Programming Lab
Staff in-charges : Mr. J. Raja Sekar, Mrs. M.S. Bhuvaneswari,
Mr. K. Thirumoorthy, Mr. M. Arun,
Mrs. R. Beulah Jeyavathana
Approved by : Dr. K. Muneeswaran
Effective Date : 02.01.2012
Revision No. : 0

LIST OF EXPERIMENTS

SYLLABUS (as prescribed by Anna University)

1. Create a web page with the following using HTML


i) To embed an image map in a web page
ii) To fix the hot spots
iii) Show all the related information when the hot spots are clicked.
2. Create a web page with all types of Cascading style sheets.
3. Client Side Scripts for Validating Web Form Controls using DHTML
4. Write programs in Java to create applets incorporating the following features:
i) Create a color palette with matrix of buttons
ii) Set background and foreground of the control text area by selecting a color from color
palette.
iii) In order to select Foreground or background use check box control as radio buttons
iv) To set background images
5. Write programs in Java using Servlets:
i) To invoke servlets from HTML forms
ii) To invoke servlets from Applets
6. Write programs in Java to create three-tier applications using JSP and Databases
i) for conducting on-line examination.
ii) for displaying student mark list.
Assume that student information is available in a database which has been stored in a
database server.
7. Programs using XML Schema XSLT/XSL
8. Programs using AJAX
9. Consider a case where we have two web Services- an airline service and a travel agent and the
travel agent is searching for an airline. Implement this scenario using Web Services and
Database.

TEXT BOOK:
Robert W. Sebesta, Programming the World Wide Web, Pearson Education, 2006

REFERENCES:
Deitel, Internet and World Wide Web, How to Program, PHI, 3rd Edition, 2005

Web References:
http://www.w3schools.com
http://roseindia.net/webdevelopment/
http://roseindia.net/servlets/

143
Course Schedule

S. No. of
Topic Theory
No. Sessions
1. Working with Colors and Text (Using Applets) 1 2
2. Introduction to HTML, CSS 2
3. Working with Images in HTML 1
4. Web page creation (Using HTML & CSS) 1
5. Introduction to JavaScript 2
6. Web Form controls - client-side validation (Using DHTML) 2
7. Introduction to Servlets and JSPs 3
8. Working with Java Servlets (Using HTML and Applets) 2
9. Evaluatory 2
10. Creating three-tier application (Using JSP and MySQL) 2
11. Introduction to XML, XML Schema, XSLT 2
12. XML to HTML Transformation (Using XSLT) 1
13. Introduction to AJAX 2
14. Program using AJAX 1
15. Introduction to Web Services 2
16. Implementing Web services with database 2
Total 15 15

Internal Assessment Marks (Max.) : 100 Marks


The assessment will be strictly based on the following criteria
Evaluatory : 25 Marks
Regular Performance in Lab : 25 Marks
Record Work Completion : 25 Marks
Attendance : 25 Marks

Mini-Project Details

1. Online Book purchase Mr. KT


2. Online Public Access Catalogs (OPAC) Mr. KT
3. Online System tracking details Mr. KT
4. University Marks Retrieval System (HTML Parser) Mr. KT
5. Alumni Website Mr. JR
6. Students information in College Website Mrs. RB
7. Faculty information in College Website Mrs. RB
8. Staff information in college website Mrs. MSB
9. Academic Placement Details Mrs. MSB
10. Online Shopping Details Mrs. MSB
11. Online Examination System Mr. KT
12. City Taxi Call Service Centre Management Mr. MA
13. Material Management for a medium-sized organization Mr. JR
14. Front-office management for a Large Luxury Hotel Mr. JR
15. Sales Management System for a retail outlet Mr. MA
16. Front-office management for a Large Bank Mr. MA
17. Patient and Services Management for a Large Hospital Mrs. RB
18. Admissions Management for a Large University Mrs. RB

144
19. Automation of a Regional Transport Office Mr. MA
20. Subscription Management System for a Subscription Agency Mr. MA
21. Database of Software Professionals and Skill-Set Requirements Mr. MA
22. Peripheral Management System for a Large Organization Mr. JR
23. Payroll Processing System for a Large Corporate Organization Mrs. RB
24. Financial Accounting System for a medium-size organization Mrs. RB
25. Class timetable management system Mr. JR
26. STTP/Workshop/Seminar registration system Mrs. MSB
27. Visiting cards details maintenance system Mrs. MSB
28. Students leave management system Mr. KT

Note:
1. At the end of six weeks, the students should show the documented design
2. At the end of eight weeks, the student should identify prototype declaration
3. At the end of ten weeks, the student must complete the coding
4. At the end of twelve weeks, the demonstration of the mini project work must be done

LAB MANUAL

HTML
Hyper Text Markup Language (HTML) is the standard used for programming in World Wide Web
documents. We use a program called browser to view the HTML documents. The basic elements of
an HTML Page and therefore any document on the Web is ASCII Text.HTML uses what is called as
tags and it is represented by The angle brackets < and >. Any text which is enclosed in the
angle brackets is considered as an HTML tag by the web browser and is interpreted accordingly.

Document tags
These are the tags that are required for every html page you create. They define the different
Parts of the document. An html document has two distinct parts a head and a body. We can enter
the title of the page, the author name and comments in the head of the Html document.
The body is where you will do most of the work like entering text, headlines, graphics etc.

Container Tags
The tags which have the form <tag> and </tag> are called container tags. They hold or contain
the text and other html elements between the two tags.
The <html>, <head>, <title> and <body> tags are called as container tags.

Empty tags
The tags which do not require </> tags are called empty tags. Examples are <hr> horizontal rule
tag and <br> line break tags.

Links
Links are used to link various web resources to the web documents. Links uses the container tags
<a> and </a> which are termed as anchor tags

Relative and Absolute links


Relative links are those that reference documents in the current directory or within the same page
on which the link is used. Absolute links are used to reference documents in the remote directory.

Frames
Frames provide an effective way to organize web documents, visually and also logically by dividing
the page into different parts <noframes> and </noframes> tag is used to report the presence of
frames to users whose browsers does not support frames.

HTML Images
HTML image tags show how to insert an image, how to align an image. It also shows how to create
an image-map with click-able regions. In HTML, images are defined with the <img> tag.

145
Image Tags

Tag Description

<img> Defines an image

<map> Defines an image map

<area> Defines an area inside an image map

The <img> tag is empty, which means that it contains attributes only and it has no closing tag. To
display an image on a page, we need to use the src attribute. The value of the src attribute is the
URL of the image we want to display on our page.

The Alt Attribute


The alt attribute is used to define an "alternate text" for an image. The value of the alt
attribute is an author-defined text:
<img src=xyz.gif alt=xyf>
The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load
images. The browser will then display the alternate text instead of the image. It is a good practice
to include the "alt" attribute for each image on a page, to improve the display and usefulness of
our document for people who have text-only browsers.

The background attribute


<html>
<body background="background.jpg">


</body>
</html>

Image alignment with the text

<html>
<body>

<p>
<img src ="/images/xhtml.gif" align ="left" width="100" height="50">
A paragraph with an image. The align attribute of the image is set to "left". The
image will float to the left of this text.
</p>

<p>
<img src ="/images/xhtml.gif" align ="right" width="100" height="50">
A paragraph with an image. The align attribute of the image is set to "right". The
image will float to the right of this text.
</p>
</body>
</html>

Image float

<html>
<body>
<p>
An image <img src ="/images/xhtml.gif" align="bottom" width="100" height="50">
in the text
</p>

<p>

146
An image <img src ="/images/xhtml.gif" align="middle" width="100" height="50">
in the text
</p>

<p>
An image <img src ="/images/xhtml.gif" align="top" width="100" height="50"> in the
text
</p>

<p>Note that bottom alignment is the default alignment</p>

<p>
An image <img src ="/images/xhtml.gif" width="100" height="50"> in the text
</p>

<p>
<img src ="/images/xhtml.gif" width="100" height="50"> An image before the text
</p>

<p>
An image after the text <img src ="/images/xhtml.gif" width="100" height="50">
</p>
</body>
</html>

Image Hyperlink
<html>
<body>
<p> We can also use an image as a link
<a href="lastpage.htm">
<img border="0" src="buttonnext.gif" width="65" height="38">
</a>
</p>
</body>
</html>

Usage of ImageMap

<html>
<body>
<p> Click on one of the planets to watch it closer: </p>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">

<map id="planetmap" name="planetmap">


<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
</body>
</html>

Forms in HTML

Forms are html elements which allow web users to interact with the website developer by
sending the requested information in the form of text, menus, check boxes, radio Buttons and
other command buttons. Forms are supported only by graphical Browsers and hence text based
browsers cannot support forms.

The method attribute of the <form> tag has two values POST or GET. POST allows a user to send
data to a remote host whereas get retrieves data from the web server. The <action> attribute of
the form tag simply takes the URL to the CGI script which handles the data

147
CASCADING STYLE SHEETS (CSS)

We have to specify the attributes again and again within the html tags at each point where the
style is to be changed. Again if there is more than one page then style definition redundancy
occurs.
The style sheet helps the web designer to separate the content of the web page from the
style to be applied. Again if you want to make a change in appearance across hundreds of pages,
you just have to change one style sheet document and the new effects will be applied to each and
every page.

CSS Syntax
A CSS rule has two main parts: a selector, and one or more declarations:
Selector Declaration(s)
h1 {color: blue; font-size: 16 px; }
The selector is normally the HTML element you want to style. Each declaration consists of a
property and a value. The property is the style attribute you want to change. Each property has a
value.

There are three ways of inserting a style sheet:


Inline style
Internal / Embedded style sheet
External style sheet

Inline Style Sheets


The style information can be added to individual HTML elements using the STYLE attribute, which
is available for several HTML documents.
<p style = "color: red; margin-left: 20px">This is a text. </p>

Internal / Embedded Style sheets


Here the style sheet is to be embedded within the HTML document. It involves using the <style>
element placed within the <head> element of a HTML document. The style rules has to be placed
between the <style> and </style> tags and it should be enclosed within the <head> and
</head> tag sections of the HTML document.

<head>
<style type="text/css">
hr {color: red;}
p {margin-left: 20px;}
body {background-image: url("tetxture1.gif");}
</style>
</head>

External Style Sheets


An external style sheet is a plain text file containing file specifications for HTML tags or classes,
stored with an extension .css.
For example,
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>

CSS3 is the latest standard for CSS. CSS3 is not yet a W3C standard, but all the major browsers
are already supporting many of the new features.

CSS3 Modules
CSS3 is split up into "modules". The old specification has been split into smaller pieces, and new
ones are also added.
Some of the most important CSS3 modules are:
Selectors
Box Model

148
Backgrounds and Borders
Text Effects
2D/3D Transformations
Animations
Multiple Column Layout
User Interface

DYNAMIC HTML (DHTML)


Dynamic HTML (DHTML) is used for designing Dynamic web pages. DHTML is combination of
technologies like HTML, style sheets, the HTML DOM and java script to make the web page
dynamic and animated. Using DHTML, a web developer can control the positioning and displaying
of HTML elements in the browser window. Browsers that do not support JavaScript, will display
JavaScript as page content.
To prevent them from doing this, just add an HTML comment tag <!-- before the first JavaScript
statement, and a --> (end of comment) after the last JavaScript statement, like this:

<html>
<head></head>
<body>
<script type="text/javascript">
<!--
document.write(<p> + Date() + </p>);
//-->
</script>
</body>
</html>

A JavaScript can also be used to change the content or attributes of HTML elements.
To change the content of an HTML element:
document.getElementById(id).innerHTML = new HTML

To change the attribute of an HTML element:


document.getElementById(id).attribute = new value

<html>
<head>
<script type="text/javascript">
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
<h1>My First Web Page</h1>
<p id="demo">This is a text.</p>
<button type="button" onclick="displayDate()">Display Date</button>
</body>
</html>

E-mail Validation
The function below checks if the content has the general syntax of an email. This means that the
input data must contain an @ sign and at least one dot (.). Also, the @ must not be the first
character of the email address, and the last dot must be present after the @ sign, and minimum 2
characters before the end:
<html>
<head>
<script type="text/javascript">
function validateForm( )

149
{
var x =document.forms["myForm"]["email"].value;
var atpos =x.indexOf("@");
var dotpos =x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
}
</script>
</head>
<body>
<form name="myForm" method="post" action="myForm.asp"
onsubmit="return validateForm();">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
</html>

JAVA APPLETS
An applet is defined as an dynamic and interactive program that can run inside a webpage
displayed by a Java capable browser such as Hot Java or Netscape.

Differences between Applets and Applications


Java applications are simple stand-alone programs that can run using the Java interpreter
from the command line. Java applets are run from a World Wide Web browser that supports Java
applets.

Restrictions of Applets
1. Applets cannot read or write to the file system
2. Applets cannot communicate with any other server than the one in which they are
stored originally

Life cycle of an applet


init ( ) method
This method gets called as soon as an applet is started. Initialization of all variables,
creation of objects, setting of Parameters etc can be done in this method.
start ( ) method
This method is executed after the init method. It is Used to run the applet, the
execution begins from the Start ( ) method.
stop ( ) method
The stop method is used to halt the running of an Applet
destroy ( ) method
It is used to free the memory occupied by the Variables and objects initialized in the
applet
paint (Graphics g ) method
It helps in drawing, writing and creating a colored Background or an image into the
applets.
repaint ( ) method
The repaint ( ) calls the update ( ) method to clear The screen of any existing
contents.

AWT
The Abstract Window ToolKit (AWT) contains numerous classes and methods that allows you to
create and manage windows although the main purpose of the AWT is to support applet windows,
it can also be used to create stand alone windows that run in a GUI environment such as windows

150
Window Fundamentals

Component
At the top of the AWT hierarchy is the component class. Component is an abstract class that
encapsulates all of the attributes of a visual component. All user interface elements that are
displayed on the screen and that interact with the user are subclasses of component

Container
The container class is a subclass of component. A container is responsible for laying out (that is,
positioning) any components that it contains

Panel
The panel class is a concrete subclass of container. A panel may be thought of as a recursively
nestable, concrete screen component

Frame
It is a subclass of window and has a title bar, menu bar, borders and resizing corners.

Canvas
It encapsulates a blank window upon which you can draw.

Layout Managers
All the components have been positioned by the default Layout manager. Each container object
has a layout manager associated with it. A layout manager is an instance of any class that
implements the LayoutManager interface. The layout manager is set by the setLayout() method.
The setLayout() method has the following general form
void setLayout(LayoutManager layoutObj)

Flow Layout
It is the default layout manager. It implements a simple layout style which is similar to how words
flow in a text editor. Here components are laid from left-right and top-bottom.

Border Layout
It implements a Layout style for top level windows. It has four narrow fixed width components at
the edges and one large area in the center. The four areas are referred to as north, south, east
and west. The middle area is called the center. Border Layout defines the following constants that
specify the regions

BorderLayout.CENTER
BorderLayout.EAST

Grid Layout
It layouts the components in a two dimensional grid. When you instantiate a Grid Layout you
define the number of rows and columns

151
GridLayout(int numRows, int numColumns )

Card Layout
The card Layout class is unique among the other layout managers in that it stores several different
layouts. Each layout can be taught as being on a separate index cards in a duck that can be
shuffled so that any card is on top at a given time. This can be useful for user interfaces with
optional components that can be dynamically enabled or disabled upon user input.

Java Applets in HTML

A java applet is a program that appears embedded in a web document and is meant. To be run by
a web browser, which provides a home for the applet? Any applet depends on the java capable
browser in order to run itself. It can also viewed by using a tool called Applet viewer. A java applet
receives a lot of information from the web browser (ex.) Initialization, Loading, starting, stopping
etc.

JAVA SERVLETS
Servlets are server side applets that are loaded and executed by a web server in the same manner
that applets are loaded and executed in a web browser. Servlets are fast since they are loaded
only once, they offer better performance and they are platform independent as they are written in
java.

Life Cycle of a Servlet

There are three methods central to the life cycle of a servlet namely init( ),service( ) and
destroy ( ). When the user enters a Uniform Resource Locator (URL) to a Web browser it generates
a HTTP request for this URL and sends it To the appropriate server. The HTTP request is received
by the web server. The Server maps this request to a particular servlet. The servlet is dynamically
retrieved and loaded into the address space of the server. The server invokes the init ( ) method of
the servlet. This Method is invoked only when the servlet is first loaded into memory. Here the
initialization of parameters can be passed to the servlet so that It may configure itself. The server
then invokes the servlets service ( ) method, which Is called to process the HTTP request. The
servlet can read the data that has been provided in the HTTP request, and may also formulate an
HTTP Response for a client. The servlet remains in the server s address space And is available to
process any other HTTP requests received from Clients. The service ( ) method is called for each
HTTP request.

Finally the server may decide to unload the servlet from its memory. The algorithms by
which this determinations is made are specific to each server. The server calls the destroy ( )
method to relinquish any resources, such as file handles that are allocated for a servlet. Important
data may be saved to a persistent store. The memory allocated for the servlet and its objects can
then be garbage-collected.

The Java Servlet Development Kit (JSDK) 2.1 contains the class libraries that you will need
to create servlets.

<form method=get | post action = http://localhost:8080/servlet/servletclassname>



</form>

JAVA SERVER PAGES


JSP helps the web designers and developers quickly incorporate dynamic elements into
web pages using embedded java and simple markup tags. JSP offers several benefits as a system
for dynamic content generation. As a Java based technology, it enjoys all of the advantages that
the java language provides With respect to development and deployment. By taking advantage of
JSPs built in support for Java Beans, it becomes possible to maintain a strict separation between
data presentation, the display of information To the end user and program implementation

152
JSP execution starts with a request for a JSP page and the processing is done based on the
JSP tags present in the page in order to generate content dynamically, and the output of that
processing, combined with the pages static HTML, must be returned to the Web browser. The
container is configured to call the servlets for all requests with URL that match the jsp file
extension, and it is the presence of this servlets and its associated java classes that turns a servlet
container into a jsp container. The task of this servlet is not just finding jsp pages in response to
such requests, but actually compiling them. Each jsp page is compiled into a page specific servlet
whose purpose is to generate the dynamic content specified by the original jsp document.

To start compiling, the JSP page compiler parses through its contents, looking for jsp tags.
As it parses the file, it translates its content into the equivalent java source Code which, when
executed, will generate the output indicated by the contents of the Original file.jsp tags are
translated into java code for generating dynamic content Once all the servlet code has been
constructed, the page compiler servlet calls The java compiler to compile this source code and add
the resulting java class file to the Appropriate directory in the jsp containers class path. Once the
compiled JSP page servlet is in place, the page compiler servlet then invokes this new servlet to
generate the Response for the original request. These steps are required only the first time a given
JSP page is received. All subsequent requests can be passed directly to the already compiled page
servlet for immediate processing.

JavaServerPages include built-in support for session management, by taking advantages of


the capabilities provided by the java servlet API. JSP provides an implicit object named session,
which represents an individual users interactive session with the Web server.

XML and XSL


XML stands for EXtensible Markup Language. It is a markup language like HTML. XML was
designed to describe data, and to focus on what data is. It is about describing information. The
tags are not predefined in XML. We can define our own tags.XML uses a DTD (Document Type
Definition) to describe the data. XML with a DTD is designed to be self-descriptive.XML will be the
most common tool for all data manipulation and data transmission in future. It is important to
know that XML was designed to store, carry and exchange data and not to display data.

Usage of XML

1. With XML, data can be exchanged between incompatible systems. Converting the data to
XML can greatly reduce this complexity and create data that can be read by many different
types of applications.

2. XML is going to be the main language for exchanging financial information between
businesses over the Internet. A lot of interesting B2B applications are under development

3. In XML data is stored in plain text format, XML provides a software- and hardware-
independent way of sharing data.

4. XML can be used to Create new Languages. The Wireless Markup Language (WML), used to
markup Internet applications for handheld devices like mobile phones, is written in XML.

Advantages of XML
The advantages of XML over other Markup Languages are

1. XML provides a way of creating domain specific vocabulary


2. It allows data interchange between different computer systems
3. XML enables smart searches
4. It provides user a selected view of data
5. It allows granular updates

153
XML Syntax
The syntax rules of XML are very simple and very strict. The rules are very easy to learn,
and very easy to use. Because of this, creating software that can read and manipulate XML is very
easy to do.

An example XML document

<?xml version="1.0" encoding="ISO-8859-1"?>


<note>
<to>noticeboard</to>
<from>mepcoadmin</from>
<heading>Notice</heading>
<body>The university exams will start from the first week of April</body>
</note>

The first line in the document - the XML declaration - defines the XML version and the character
encoding used in the document. In this case the document conforms to the 1.0 specification of
XML and uses the ISO-8859-1 (Latin-1/West European) character set.

The next line describes the root element of the document (like it was saying: "this document is a
note". The next 4 lines describe 4 child elements of the root (to, from, heading, and body) and
finally the last line defines the end of the root element:

XML Elements

XML documents can be extended to carry more information. XML Elements have Relationships and
are related as parents and children and they can have different content types.

For example this XML document describes the book:

<book>
<title>My First XML</title>
<prod id="33-657" media="paper"></prod>
<chapter>Introduction to XML
<para>What is HTML</para>
<para>What is XML</para>
</chapter>

<chapter>XML Syntax
<para>Elements must have a closing tag</para>
<para>Elements must be properly nested</para>
</chapter>
</book>

Book is the root element. Title, prod, and chapter are child elements of book. Book is the parent
element of title, prod, and chapter. Title, prod, and chapter are siblings (or sister elements)
because they have the same parent.

XML Attributes

XML elements can have attributes in the start tag, just like HTML. Attributes are used to provide
additional information about elements.

XML Validation

A "Well Formed" XML document has correct XML syntax. A "Valid" XML document is a "Well
Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD).
The purpose of a DTD is to define the legal building blocks of an XML document. It defines the
document structure with a list of legal elements.

154
Errors in XML documents will stop the XML program. The W3C XML specification states that a
program should not continue to process an XML document if it finds a validation error. The reason
is that XML software should be easy to write, and that all XML documents should be compatible.

With HTML it was possible to create documents with lots of errors (like when you forget an end
tag). One of the main reasons that HTML browsers are so big and incompatible, is that they have
their own ways to figure out what a document should look like when they encounter an HTML
error.

XSL stands for EXtensible Stylesheet Language, XML-based Stylesheet Language. It describes how
the XML document should be displayed!

For example, consider the XML document Catalog.xml:


<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Payanam</title>
<artist>Prakashraj</artist>
<country>India</country>
<company> </company>
<price>40.00</price>
<year>2010</year>
</cd>
<cd>
<title>Siruththai</title>
<artist>Karthik</artist>
<country>India</country>
<company>Sun Pictures</company>
<price>50.00</price>
<year>2010</year>
</cd>
</catalog>

XSL consists of three parts:


XSLT - a language for transforming XML documents
XPath - a language for navigating in XML documents
XSL-FO - a language for formatting XML documents

XSLT is a language for transforming XML documents into XHTML documents or to other XML
documents. XSLT transforms an XML source-tree into an XML result-tree.

XPath is a language for navigating in XML documents i.e., used to navigate through elements and
attributes in XML documents.

XSL-Formatting Object describes the formatting of XML data for output to screen, paper or other
media.

The <xsl:template> Element


An XSL style sheet consists of one or more set of rules that are called templates. A
template contains rules to apply when a specified node is matched.
The <xsl:template> element is used to build templates. The match attribute is used to
associate a template with an XML element. The match attribute can also be used to define a
template for the entire XML document. The value of the match attribute is an XPath expression
(i.e. match = /" defines the whole document).

<?xml version = 1.0" encoding = ISO-8859-1"?>


<xsl:stylesheet version = 1.0" xmlns:xsl = http://www.w3.org/1999/XSL/Transform">
<xsl:template match = /">
<html>

</html>
</xsl:template>

155
</xsl:stylesheet>

The <xsl:value-of> Element

The <xsl:value-of> element can be used to extract the value of an XML element and add it to the
output stream of the transformation:
<tr>
<td><xsl:value-of select = catalog/cd/title" /></td>
<td><xsl:value-of select = catalog/cd/artist" /></td>
</tr>
The select attribute contains an XPath expression. An XPath expression works like navigating a
file system; a forward slash (/) selects subdirectories. Only one line of data was copied from the
XML document to the output.

The <xsl:for-each> Element

The <xsl:for-each> element allows you to do looping in XSLT. It can be used to select every XML
element of a specified node-set:
<xsl:for-each select = catalog/cd">
<tr>
<td><xsl:value-of select = title /></td>
<td><xsl:value-of select = artist /></td>
</tr>
</xsl:for-each>

It is also possible to filter the output from the XML file by adding a criterion to the select attribute
in the <xsl:for-each> element.
<xsl:for-each select = catalog/cd[artist='Bob Dylan']">

Legal filter operators are:


= (equal)
!= (not equal)
&lt; less than
&gt; greater than

The <xsl:sort> Element


The <xsl:sort> element is used to sort the output by simply adding this element inside the
<xsl:for-each> element in the XSL file:
<xsl:for-each select = catalog/cd">
<xsl:sort select = artist" />
<tr>
<td><xsl:value-of select = title /></td>
<td><xsl:value-of select = artist /></td>
</tr>
</xsl:for-each>

The <xsl:if> Element


To put a conditional if test against the content of the XML file, add an <xsl:if> element to
the XSL document. The syntax is
<xsl:if test = expression">
...some output if the expression is true...
</xsl:if>

To add a conditional test, add the <xsl:if> element inside the <xsl:for-each> element in the XSL
file:

156
<xsl:for-each select = catalog/cd">
<xsl:if test = price &gt; 10">
<tr>
<td><xsl:value-of select = title /></td>
<td><xsl:value-of select = artist /></td>
</tr>
</xsl:if>
</xsl:for-each>

The <xsl:choose> Element


The <xsl:choose> element is used in conjunction with <xsl:when> and <xsl:otherwise> to
express multiple conditional tests. The syntax is
<xsl:choose>
<xsl:when test = expression">
... some output ...
</xsl:when>
<xsl:otherwise>
... some output ....
</xsl:otherwise>
</xsl:choose>

To insert a multiple conditional test against the XML file, add the <xsl:choose>, <xsl:when>, and
<xsl:otherwise> elements to the XSL file:

<xsl:for-each select = catalog/cd">


<tr>
<td><xsl:value-of select = title /></td>
<xsl:choose>
<xsl:when test = price &gt; 10">
<td bgcolor = #ff00ff">
<xsl:value-of select = artist /></td>
</xsl:when>
<xsl:when test = price &gt; 9">
<td bgcolor = #cccccc">
<xsl:value-of select = artist /></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select = artist /></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>

The <xsl:apply-templates> Element


The <xsl:apply-templates> element applies a template to the current element or to the
current element's child nodes. We can use the select attribute to specify the order in which the
child nodes are processed.

<?xml version = 1.0" encoding = ISO-8859-1"?>


<xsl:stylesheet version = 1.0" xmlns:xsl = http://www.w3.org/1999/XSL/Transform">
<xsl:template match = /">
<html>
<body>
<h2>My CD Collection</h2>
<xsl:apply-templates />
</body>
</html>
</xsl:template>

157
<xsl:template match = cd">
<p>
<xsl:apply-templates select = title />
<xsl:apply-templates select = artist />
</p>
</xsl:template>
<xsl:template match = title">
Title: <span style = color:#ff0000">
<xsl:value-of select = . /></span> <br />
</xsl:template>
<xsl:template match = artist">
Artist: <span style = color:#00ff00">
<xsl:value-of select = . /></span><br />
</xsl:template>
</xsl:stylesheet>

Example:
Student.xml
<?xml version = 1.0"?>
<?xml-stylesheet type = "text/xsl" href = "Student.xsl"?>
<class>
<name>III CSE A</name>
<student>
<name>Ram Kumar</name>
<age>20</age>
<gender>Male</gender>
<dob>
<date>11</date>
<month>07</month>
<year>1990</month>
</dob>

</student>

</class>

Student.xsl
<?xml version = 1.0" ?>
<xsl:stylesheet version = 1.0" xmlns:xsl = http://www.w3.org/1999/XSL/Transform">
<xsl:template match = /">
<html>
<body>
<h2>Students Detail</h2>
<table border = "1">
<tr bgcolor = "#0088ee">
<th>Name</th>
<th>Age</th>
</tr>
<xsl:for-each select = "class/student">
<tr>
<td><xsl:value-of select = "name"/></td>
<td><xsl:value-of select = "age"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

158

You might also like