SlideShare a Scribd company logo
2
Most read
4
Most read
8
Most read
Module 3
Requirements Analysis and
Specification
Lesson 7:
Algebraic Specification
Algebraic specification
In the algebraic specification technique an
object class or type is specified in terms
of relationships existing between the
operations defined on that type. It was
first brought into prominence by Guttag
[1980, 1985] in specification of abstract
data types.
Representation of algebraic specification
Essentially, algebraic specifications
define a system as a heterogeneous algebra.
A heterogeneous algebra is a collection of
different sets on which several operations
are defined. Traditional algebras are
homogeneous. A homogeneous algebra consists
of a single set and several operations; {I,
+, -, *, /}.
Types section:
• Exceptions section
This section gives the names of the
exceptional conditions that might occur when
different operations are carried out. These
exception conditions are used in the later
sections of an algebraic specification.
• Syntax section
This section defines the signatures of
the interface procedures. The collection of
sets that form input domain of an operator
and the sort where the output is produced are
called the signature of the operator.
For example:
append : queue x element → queue
• Equations section
This section gives a set of rewrite
rules (or equations) defining the meaning of
the interface procedures in terms of each
other. In general, this section is allowed
to contain conditional expressions.
For example:
isempty(create()) = true
Set Of Required Operations.
1. Basic construction operators.
These operators are used to create or
modify entities of a type. The basic
construction operators are essential to
generate all possible element of the type
being specified.
2. Extra construction operators.
These are the construction operators
other than the basic construction
operators.
3. Basic inspection operators.
These operators evaluate attributes
of a type without modifying them, e.g.,
eval, get, etc. Let S be the set of
operators whose range is not the data type
being specified. The set of the basic
operators S1 is a subset of S, such that
each operator from S-S1 can be expressed in
terms of the operators from S1.
“
4. Extra inspection operators.
These are the inspection operators that
are not basic inspectors.
Develop algebraic specification of simple problems
A simple way to determine whether an operator is
a constructor (basic or extra) or an inspector
(basic or extra) is to check the syntax
expression for the operator. If the type being
specified appears on the right hand side of the
expression then it is a constructor, otherwise it
is an inspection operator.
Example:
Let us specify a FIFO queue supporting the
operations create, append, remove, first, and
isempty where the operations have their usual
meaning.
Types:
defines queue
uses boolean, integer
Exceptions:
underflow, novalue
Syntax:
1. create : φ → queue
2. append : queue x element → queue
3. remove : queue → queue + {underflow}
4. first : queue → element + {novalue}
5. isempty : queue → boolean
Equations:
1. isempty(create()) = true
2. isempty((append(q,e)) = false
3. first(create()) = novalue
4. first(append(q,e)) = is isempty(q) then e else
first(q)
5. remove(create()) = underflow
6. remove(append(q,e)) = if isempty(q) then
create() else append(remove(q),e)
Properties of algebraic specifications
• Completeness: This property ensures that using
the equations, it should be possible to reduce
any arbitrary sequence of operations on the
interface procedures. There is no simple
procedure to ensure that an algebraic
specification is complete.
• Finite termination property: This property
essentially addresses the following question:
Do applications of the rewrite rules to
arbitrary expressions involving the interface
procedures always terminate? For arbitrary
algebraic equations, convergence (finite
termination) is undecidable. But, if the right
hand side of each rewrite rule has fewer terms
than the left, then the rewrite process must
terminate.
• Unique termination property: This property
indicates whether application of rewrite rules
in different orders always result in the same
answer.
Structured specification
• Incremental specification. The idea behind
incremental specification is to first
develop the specifications of the simple
types and then specify more complex types by
using the specifications of the simple
types.
• Specification instantiation. This involves
taking an existing specification which has
been developed using a generic parameter and
instantiating it with some other sort.
Advantages and disadvantages of algebraic
specifications
Algebraic specifications have a strong
mathematical basis and can be viewed as
heterogeneous algebra. Therefore, they are
unambiguous and precise. Using an algebraic
specification, the effect of any arbitrary
sequence of operations involving the
interface procedures can automatically be
studied.
Executable specification language (4GLs).
If the specification of a system is expressed
formally or by using a programming language,
then it becomes possible to directly execute the
specification. However, executable
specifications are usually slow and inefficient,
4GLs3 (4th Generation Languages) are examples of
executable specification languages. 4GLs are
successful because there is a lot of commonality
across data processing applications. 4GLs rely
on software reuse, where the common abstractions
have been identified and parameterized. Example
of a 4GL is Structured Query Language (SQL).

More Related Content

PPTX
Recurrent Neural Networks (RNNs)
DOCX
Uml Common Mechanism
PDF
Classes and Objects
PDF
The Object Model
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
PPTX
Greedy Algorithm - Knapsack Problem
PPTX
Sum of subset problem.pptx
PPTX
Lock based protocols
Recurrent Neural Networks (RNNs)
Uml Common Mechanism
Classes and Objects
The Object Model
Webinar : P, NP, NP-Hard , NP - Complete problems
Greedy Algorithm - Knapsack Problem
Sum of subset problem.pptx
Lock based protocols

What's hot (20)

PPTX
Density based methods
PDF
Identifying classes and objects ooad
PPTX
Feedforward neural network
PPTX
Asymptotic notations
PPT
backpropagation in neural networks
PPTX
PPTX
Water jug problem ai part 6
PPTX
States, state graphs and transition testing
PPTX
Object Oriented Programming
PDF
Major and Minor Elements of Object Model
PPTX
sum of subset problem using Backtracking
PPTX
And or graph
PPTX
Knowledge representation
PDF
P, NP, NP-Complete, and NP-Hard
PPTX
Hetro associative memory
PPT
Flow oriented modeling
PPTX
Multimedia Database
PPTX
Concurrency Control in Distributed Database.
PPSX
Parallel Database
PPTX
Bayesian Belief Network and its Applications.pptx
Density based methods
Identifying classes and objects ooad
Feedforward neural network
Asymptotic notations
backpropagation in neural networks
Water jug problem ai part 6
States, state graphs and transition testing
Object Oriented Programming
Major and Minor Elements of Object Model
sum of subset problem using Backtracking
And or graph
Knowledge representation
P, NP, NP-Complete, and NP-Hard
Hetro associative memory
Flow oriented modeling
Multimedia Database
Concurrency Control in Distributed Database.
Parallel Database
Bayesian Belief Network and its Applications.pptx
Ad

Similar to Software Engineering - Module 3: Lesson7 (20)

PPT
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
PDF
Implementation Of Parameterised Specifications
PDF
Invitation to Scala
PPT
Formal Specifications in Formal Methods
PDF
Isoiec 148822011 Information Technology Programming Languages C 3rd Edition Iso
PPT
Fundamentals of c programming techniques
PPT
Expressions in c++
PPTX
Funtional Programming
PDF
Sv data types and sv interface usage in uvm
PPT
Formal Specification in Software Engineering SE9
PDF
iRODS Rule Language Cheat Sheet
PDF
Bt0066 database management system2
PPT
Compiler Design in Engineering for Designing
PDF
International Standard Committee Draft 2011 C11 Itebooks
PDF
Lambda Zero Programming Language Introduction
PDF
Functional programming
PDF
Formal Method lecture_3 software Engineering.pdf
PPT
PPT
PDF
Linear Data Structures_SSD.pdf
formal method chapter 1 lecture_3_fm.pptlecture_3_fm.ppt
Implementation Of Parameterised Specifications
Invitation to Scala
Formal Specifications in Formal Methods
Isoiec 148822011 Information Technology Programming Languages C 3rd Edition Iso
Fundamentals of c programming techniques
Expressions in c++
Funtional Programming
Sv data types and sv interface usage in uvm
Formal Specification in Software Engineering SE9
iRODS Rule Language Cheat Sheet
Bt0066 database management system2
Compiler Design in Engineering for Designing
International Standard Committee Draft 2011 C11 Itebooks
Lambda Zero Programming Language Introduction
Functional programming
Formal Method lecture_3 software Engineering.pdf
Linear Data Structures_SSD.pdf
Ad

Recently uploaded (20)

PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Introduction to Artificial Intelligence
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Nekopoi APK 2025 free lastest update
PPTX
history of c programming in notes for students .pptx
PDF
Digital Strategies for Manufacturing Companies
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction to Artificial Intelligence
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Design an Analysis of Algorithms II-SECS-1021-03
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2
How to Choose the Right IT Partner for Your Business in Malaysia
Upgrade and Innovation Strategies for SAP ERP Customers
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms I-SECS-1021-03
Nekopoi APK 2025 free lastest update
history of c programming in notes for students .pptx
Digital Strategies for Manufacturing Companies

Software Engineering - Module 3: Lesson7

  • 1. Module 3 Requirements Analysis and Specification Lesson 7: Algebraic Specification
  • 2. Algebraic specification In the algebraic specification technique an object class or type is specified in terms of relationships existing between the operations defined on that type. It was first brought into prominence by Guttag [1980, 1985] in specification of abstract data types.
  • 3. Representation of algebraic specification Essentially, algebraic specifications define a system as a heterogeneous algebra. A heterogeneous algebra is a collection of different sets on which several operations are defined. Traditional algebras are homogeneous. A homogeneous algebra consists of a single set and several operations; {I, +, -, *, /}.
  • 4. Types section: • Exceptions section This section gives the names of the exceptional conditions that might occur when different operations are carried out. These exception conditions are used in the later sections of an algebraic specification. • Syntax section This section defines the signatures of the interface procedures. The collection of sets that form input domain of an operator and the sort where the output is produced are called the signature of the operator. For example: append : queue x element → queue
  • 5. • Equations section This section gives a set of rewrite rules (or equations) defining the meaning of the interface procedures in terms of each other. In general, this section is allowed to contain conditional expressions. For example: isempty(create()) = true Set Of Required Operations. 1. Basic construction operators. These operators are used to create or modify entities of a type. The basic construction operators are essential to generate all possible element of the type being specified.
  • 6. 2. Extra construction operators. These are the construction operators other than the basic construction operators. 3. Basic inspection operators. These operators evaluate attributes of a type without modifying them, e.g., eval, get, etc. Let S be the set of operators whose range is not the data type being specified. The set of the basic operators S1 is a subset of S, such that each operator from S-S1 can be expressed in terms of the operators from S1.
  • 7. “ 4. Extra inspection operators. These are the inspection operators that are not basic inspectors. Develop algebraic specification of simple problems A simple way to determine whether an operator is a constructor (basic or extra) or an inspector (basic or extra) is to check the syntax expression for the operator. If the type being specified appears on the right hand side of the expression then it is a constructor, otherwise it is an inspection operator.
  • 8. Example: Let us specify a FIFO queue supporting the operations create, append, remove, first, and isempty where the operations have their usual meaning. Types: defines queue uses boolean, integer Exceptions: underflow, novalue Syntax: 1. create : φ → queue 2. append : queue x element → queue 3. remove : queue → queue + {underflow} 4. first : queue → element + {novalue} 5. isempty : queue → boolean
  • 9. Equations: 1. isempty(create()) = true 2. isempty((append(q,e)) = false 3. first(create()) = novalue 4. first(append(q,e)) = is isempty(q) then e else first(q) 5. remove(create()) = underflow 6. remove(append(q,e)) = if isempty(q) then create() else append(remove(q),e) Properties of algebraic specifications • Completeness: This property ensures that using the equations, it should be possible to reduce any arbitrary sequence of operations on the interface procedures. There is no simple procedure to ensure that an algebraic specification is complete.
  • 10. • Finite termination property: This property essentially addresses the following question: Do applications of the rewrite rules to arbitrary expressions involving the interface procedures always terminate? For arbitrary algebraic equations, convergence (finite termination) is undecidable. But, if the right hand side of each rewrite rule has fewer terms than the left, then the rewrite process must terminate. • Unique termination property: This property indicates whether application of rewrite rules in different orders always result in the same answer.
  • 11. Structured specification • Incremental specification. The idea behind incremental specification is to first develop the specifications of the simple types and then specify more complex types by using the specifications of the simple types. • Specification instantiation. This involves taking an existing specification which has been developed using a generic parameter and instantiating it with some other sort.
  • 12. Advantages and disadvantages of algebraic specifications Algebraic specifications have a strong mathematical basis and can be viewed as heterogeneous algebra. Therefore, they are unambiguous and precise. Using an algebraic specification, the effect of any arbitrary sequence of operations involving the interface procedures can automatically be studied.
  • 13. Executable specification language (4GLs). If the specification of a system is expressed formally or by using a programming language, then it becomes possible to directly execute the specification. However, executable specifications are usually slow and inefficient, 4GLs3 (4th Generation Languages) are examples of executable specification languages. 4GLs are successful because there is a lot of commonality across data processing applications. 4GLs rely on software reuse, where the common abstractions have been identified and parameterized. Example of a 4GL is Structured Query Language (SQL).