SlideShare a Scribd company logo
Formal methods in
software engineering
Lecture on Structure:Element of Z
Prof Engr. Faiz ul haque Zeya
Topics
 Structure:
 Tuple,
 Records,
 Relations,
 Tables,
 Databases,
 Pairs
 Binary Relations,
 Functions,
 Sequences and
 Operators
Tuple
 Tuples associate particular elements of any type, in a fixed order
 If we use set (2,11,11) and (11,2,11) won’t be different.
 Tuples are instances of Cartesian product types, sometimes called cross
product types. We define product types using the cross product symbol x. This
abbreviation definition introduces a set of tuples named DATE
 DATE=DAY X MONTH X YEAR
 DATE has product type P(Z X Z X Z)
Structure of Z Formal methods Lecture
Relation, Table and Database
 A set of tuples is called a relation. Relations can model tables and databases.
You have probably heard of the relational database, which is just a database
where the data are stored in one or more relations
Structure of Z Formal methods Lecture
Pair and binary relation
 It has two components.
 . We can use a pair to associate a name with a telephone extension number,
as in (aki, 4117). Z provides an alternate syntax for pairs that uses the maplet
arrow ---> to emphasize the asymmetry between the two components. The
pair (aki, 4117) can also be written aki -->4117
 Z also provides the first and second operators for extracting each component
from a pair: first(aki,41) = aki second(aki,41) = 41 operators like these that
extract components from structures are called projection operators.
Structure of Z Formal methods Lecture
Domain and range
Operators for relations
The relation image operator
 The relational image operator can model table lookup. Its first argument is a
relation, its second argument is a set of elements from the domain, and its
value is the set of corresponding elements from the range. It is notated in an
unusual mixfix syntax: Thick brackets (]...[) surround the second argument.
To look up the numbers for Doug and Philip in the phone relation, we use the
relational image: phone
Domain restriction operator
Range restriction operator
Combination of domain and range
restriction
Anti restriction operator
Override operator
Structure of Z Formal methods Lecture
Inverse operator
Composition relation
 Relational composition formalizes this kind of reasoning: It merges two
relations into one by combining pairs that share a matching component.
Binary relation and linked data
structure.
 Relations are not just for modelling tables and flat databases. They can model
linked data structures as well. Linked data structures are often pictured as
graphs: networks of nodes connected by arcs. Data flow diagrams, state
transition diagrams, and syntax trees are all examples of graphs.
Structure of Z Formal methods Lecture
Function
 Sometimes we need to associate a single item with each element in a set. For
this we use a special kind of relation, called & function. A function is a binary
relation where an element can appear only once as the first element in a pair.
Structure of Z Formal methods Lecture
Function application
Partial and total function
 The domain of a partial function might not include every element of the
source set.
 Total function apply to every element of the source set
 Square of x.
Injections
 every element of the function's codomain is the image of at most one element
of its domain.
SEQUENCES
 Sequences are ordered collection
 Another way to declare sequence is:
Operators
Structure of Z Formal methods Lecture

More Related Content

PPTX
BCS403 DBMS MODULE-2 4th sem engineering.pptx
PDF
Formal methods 4 - Z notation
PPTX
introduction to database system concepts 2
PDF
Bt0066 database management system2
PPTX
Relational Data Model Introduction
PPT
relational model in Database Management.ppt.ppt
PPTX
Esoteric LINQ and Structural Madness
PPTX
Relational Model,relational calulus.pptx
BCS403 DBMS MODULE-2 4th sem engineering.pptx
Formal methods 4 - Z notation
introduction to database system concepts 2
Bt0066 database management system2
Relational Data Model Introduction
relational model in Database Management.ppt.ppt
Esoteric LINQ and Structural Madness
Relational Model,relational calulus.pptx

Similar to Structure of Z Formal methods Lecture (20)

PPT
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
PPTX
Relational algebra calculus
PPTX
Module 2 2022 scheme BCS403 database management system
PPT
Intro to relational model
PPTX
Relation model part 1
PPT
Relational Algebra
PPT
Mca ii-dbms- u-iii-sql concepts
PPTX
DBMS Module-2 notes for engineering BE vtu
PDF
RelationalAlgebra-RelationalCalculus-SQL.pdf
PPTX
Class 15_Introduction to Relational Algebra and Relational Calculus_19.11.202...
PDF
Realtime Analytics
PPTX
uniT 4 (1).pptx
PDF
Object oriented programming15 control structures relational operators
PDF
Relational Algebra and MapReduce
PDF
DBMS Unit-2.pdf
PPTX
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
PPT
2 rel-algebra
PPTX
Slide For Database Management System Relational Model.pptx
PDF
19IS305_U2_LP4_LM4-22-23.pdf
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Relational algebra calculus
Module 2 2022 scheme BCS403 database management system
Intro to relational model
Relation model part 1
Relational Algebra
Mca ii-dbms- u-iii-sql concepts
DBMS Module-2 notes for engineering BE vtu
RelationalAlgebra-RelationalCalculus-SQL.pdf
Class 15_Introduction to Relational Algebra and Relational Calculus_19.11.202...
Realtime Analytics
uniT 4 (1).pptx
Object oriented programming15 control structures relational operators
Relational Algebra and MapReduce
DBMS Unit-2.pdf
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
2 rel-algebra
Slide For Database Management System Relational Model.pptx
19IS305_U2_LP4_LM4-22-23.pdf

More from Faiz Zeya (17)

PPTX
FUNCTIONAL SIZE MEASURE AND ESTIMATES. SOFTWARE METRICS COURSE
PPTX
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
PPTX
Line of code metrics. Software metrics and estimation
PPTX
Software metrics lecture 4 Usability metrics
PPTX
Lecture 2 software metrics and estimation.
PPTX
Software metrics and estimation lecture 1
PPTX
Reinforcement learning through human feedback
PPTX
Artificial Intelligence- lecture 1 BUKC lecture
PPTX
Elements of Z. Formal methods lecture
PPTX
Text editor in Z
PPTX
First order logic
PPTX
Word2vec Lecture. NLP BUKC lecture.
PPTX
Code completion using OpenAI APIs.pptx
PPTX
Types of machine learning.pptx
PPTX
Linear algebraweek2
PPTX
Query expansion for search improvement by faizulhaque
PPTX
Big data introduction
FUNCTIONAL SIZE MEASURE AND ESTIMATES. SOFTWARE METRICS COURSE
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
Line of code metrics. Software metrics and estimation
Software metrics lecture 4 Usability metrics
Lecture 2 software metrics and estimation.
Software metrics and estimation lecture 1
Reinforcement learning through human feedback
Artificial Intelligence- lecture 1 BUKC lecture
Elements of Z. Formal methods lecture
Text editor in Z
First order logic
Word2vec Lecture. NLP BUKC lecture.
Code completion using OpenAI APIs.pptx
Types of machine learning.pptx
Linear algebraweek2
Query expansion for search improvement by faizulhaque
Big data introduction

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Introduction to Artificial Intelligence
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
AI in Product Development-omnex systems
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Nekopoi APK 2025 free lastest update
PDF
medical staffing services at VALiNTRY
PDF
top salesforce developer skills in 2025.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Operating system designcfffgfgggggggvggggggggg
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Introduction to Artificial Intelligence
PTS Company Brochure 2025 (1).pdf.......
AI in Product Development-omnex systems
Essential Infomation Tech presentation.pptx
Odoo POS Development Services by CandidRoot Solutions
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
L1 - Introduction to python Backend.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Nekopoi APK 2025 free lastest update
medical staffing services at VALiNTRY
top salesforce developer skills in 2025.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Operating system designcfffgfgggggggvggggggggg

Structure of Z Formal methods Lecture

  • 1. Formal methods in software engineering Lecture on Structure:Element of Z Prof Engr. Faiz ul haque Zeya
  • 2. Topics  Structure:  Tuple,  Records,  Relations,  Tables,  Databases,  Pairs  Binary Relations,  Functions,  Sequences and  Operators
  • 3. Tuple  Tuples associate particular elements of any type, in a fixed order  If we use set (2,11,11) and (11,2,11) won’t be different.  Tuples are instances of Cartesian product types, sometimes called cross product types. We define product types using the cross product symbol x. This abbreviation definition introduces a set of tuples named DATE  DATE=DAY X MONTH X YEAR  DATE has product type P(Z X Z X Z)
  • 5. Relation, Table and Database  A set of tuples is called a relation. Relations can model tables and databases. You have probably heard of the relational database, which is just a database where the data are stored in one or more relations
  • 7. Pair and binary relation  It has two components.  . We can use a pair to associate a name with a telephone extension number, as in (aki, 4117). Z provides an alternate syntax for pairs that uses the maplet arrow ---> to emphasize the asymmetry between the two components. The pair (aki, 4117) can also be written aki -->4117  Z also provides the first and second operators for extracting each component from a pair: first(aki,41) = aki second(aki,41) = 41 operators like these that extract components from structures are called projection operators.
  • 10. Operators for relations The relation image operator  The relational image operator can model table lookup. Its first argument is a relation, its second argument is a set of elements from the domain, and its value is the set of corresponding elements from the range. It is notated in an unusual mixfix syntax: Thick brackets (]...[) surround the second argument. To look up the numbers for Doug and Philip in the phone relation, we use the relational image: phone
  • 13. Combination of domain and range restriction
  • 18. Composition relation  Relational composition formalizes this kind of reasoning: It merges two relations into one by combining pairs that share a matching component.
  • 19. Binary relation and linked data structure.  Relations are not just for modelling tables and flat databases. They can model linked data structures as well. Linked data structures are often pictured as graphs: networks of nodes connected by arcs. Data flow diagrams, state transition diagrams, and syntax trees are all examples of graphs.
  • 21. Function  Sometimes we need to associate a single item with each element in a set. For this we use a special kind of relation, called & function. A function is a binary relation where an element can appear only once as the first element in a pair.
  • 24. Partial and total function  The domain of a partial function might not include every element of the source set.  Total function apply to every element of the source set  Square of x.
  • 25. Injections  every element of the function's codomain is the image of at most one element of its domain.
  • 26. SEQUENCES  Sequences are ordered collection
  • 27.  Another way to declare sequence is: