Professional Documents
Culture Documents
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
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
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.
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
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
1. Introduction to AI T1:ch.1 1
14. The Wumpus World and logic and Propositional logic: T1: ch.7 1
A Very Simple Logic
5
MODULE III PLANNING
31. review of probability Basic Probability Notation & The Axioms of T1:ch.13 1
Probability
MODULE V-LEARNING
6
47. Reinforcement Learning: T1:ch.21 1
Passive reinforcement learning - Active reinforcement learning
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.
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 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.
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?
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 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.
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
24
9. Understand and commit to professional ethics and responsibilities and norms of
engineering practice.
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
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
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
T Ch 1.6
4. Compiler construction tools 1
R4 Ch1.2.9
T Ch 3.2
6. Input Buffering 1
R4 Ch3.2
T Ch 3.3
7. Specification of Tokens. 1
R4 Ch3.3
10. Tutorial/Lab 3
28
No.of
S.No Topics Reference to Text Remarks
Periods
T Ch 4.4
12. Top Down parsing 2
R4 Ch4.4.1 4.4.5
T Ch 4.7
14. LR Parsers SLR Parser 1
R4 Ch4.6
Runtime Environments
17. T Ch 7.1 1
Source Language issues
19. Tutorial/Lab 3
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
T Ch 9.3
29. Runtime Storage management 1
R4 Ch8.3
T Ch 9.6
31. A simple Code generator 2
R4 Ch8.6
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
41. Tutorial/Lab 3
Total No of periods 67
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.
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))
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.
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?
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.
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
44
10. Understand the impact of engineering solutions in a societal context and demonstrate
knowledge of and need for sustainable development.
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
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
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
48
TEXT BOOK:
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?
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.
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.
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?
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.
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
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
8. Demonstrate understanding of the societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to engineering practice.
62
10. Understand the impact of engineering solutions in a societal context and
demonstrate knowledge of and need for sustainable development.
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
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.
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
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
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 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.
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
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.
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
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.
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.
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)
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?
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
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
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
UNIT II
87
No. of
Sl.No Topics Reference Remarks
hours
TOTAL HOURS
11
UNIT-III
UNIT-IV
88
No. of
Sl.No Topics Reference Remarks
hours
UNIT-V
TEXT BOOKS
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.
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?
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)
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.
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)
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
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:
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
107
TI5: What is relational data modeling?
TI6: What is conceptual database modeling?
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.
109
a. One to one relationship set
b. One to many relationship sets.
a1 b1 c1
a1 b1 c2
a2 b1 c1
a2 b1 c3
110
123 Robert Ingram 555-861-2025
555-403-1659,
456 Jane Wright
555-776-4100
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
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.
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.
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?
home_address employee
117
Melbourne site: location Brisbane and location Sydney branch,
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 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.
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.
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?
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.
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.
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.
Objective:
ArgoUML, Eclipse IDE, Visual Paradigm, Visual case, and Rational Suite
COURSE PLAN:
Laboratory
Ex.No Document
hours
130
domain & One Miniproject from the list)
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.
4 Software Testing
a) Develop Test case hierarchy
b) Validation testing
5 Software debugging
Errors are corrected using the tools.
EXERCISES
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]).
Use case Diagram : Behavioral diagram that shows a set of use cases and
actors and their relationships.
USE CASE
RELATION
ACTOR
132
SYSTEM BOUNDARY
For each use case that appears in the use case diagram the following details need to be
documented.
Ex.3 Identify the business activities and develop an UML Activity diagram.
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.
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.
135
Symbols Used:
OBJECT
<<Name>>
OBJECT LIFELINE
<<Name>> MESSAGE
FOCUS OF CONTROL
SELF LOOP
Symbols Used:
<<Name>> OBJECT
FLOW OF MESSAGE
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.
Symbols Used:
Initial State
Final State
State
Transition
Different layers like User interface, Domain objects and Technical services are identified.
User Interface : GUI Windows, Reports, Speech Interface, HTML, XML, XSLT,
Javascript, JSP
137
Package Diagram : Package diagrams organize the elements of a system into
related groups to minimize dependencies among them.
Symbols Used:
Package
Dependency
Component diagram: A Structural diagram that shows a set of components and their
relationships.
138
Symbols Used:
COMPONENT
INTERFACE
DLL FILE
HELP DOCUMENT
FILE
TABLE
139
Symbols Used:
Node
Association
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
3. Select the class for which you want to generate code and select the option Tools-Java-
Syntax Check.
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.
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.
List of Miniprojects
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
LIST OF EXPERIMENTS
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
Mini-Project Details
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
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
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.
<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>
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">
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.
<head>
<style type="text/css">
hr {color: red;}
p {margin-left: 20px;}
body {background-image: url("tetxture1.gif");}
</style>
</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
<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
<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.
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
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.
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.
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.
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.
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
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.
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.
<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!
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.
155
</xsl:stylesheet>
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 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']">
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 > 10">
<tr>
<td><xsl:value-of select = title /></td>
<td><xsl:value-of select = artist /></td>
</tr>
</xsl:if>
</xsl:for-each>
To insert a multiple conditional test against the XML file, add the <xsl:choose>, <xsl:when>, and
<xsl:otherwise> elements to the XSL file:
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