SlideShare a Scribd company logo
1 of 29
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)
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
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.
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
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.
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.
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
structureformal1.ppt

More Related Content

Similar to structureformal1.ppt

Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1JEAN-MICHEL LETENNIER
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases Tharindu Weerasinghe
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Introduction to Relational Database Management Systems
Introduction to Relational Database Management SystemsIntroduction to Relational Database Management Systems
Introduction to Relational Database Management SystemsAdri Jovin
 
Cross domain sentiment classification via spectral feature alignment
Cross domain sentiment classification via spectral feature alignmentCross domain sentiment classification via spectral feature alignment
Cross domain sentiment classification via spectral feature alignmentlau
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship modelasmitaanpat
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMSAbhishekRajpoot8
 
Data resource management
Data resource managementData resource management
Data resource managementNirajan Silwal
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Mobarok Hossen
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS Adams Sidibe
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 RelationalSarmad Ali
 

Similar to structureformal1.ppt (20)

Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1Towards a New Data Modelling Architecture - Part 1
Towards a New Data Modelling Architecture - Part 1
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Introduction to Relational Database Management Systems
Introduction to Relational Database Management SystemsIntroduction to Relational Database Management Systems
Introduction to Relational Database Management Systems
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
Cross domain sentiment classification via spectral feature alignment
Cross domain sentiment classification via spectral feature alignmentCross domain sentiment classification via spectral feature alignment
Cross domain sentiment classification via spectral feature alignment
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship model
 
Unit 3
Unit 3Unit 3
Unit 3
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMS
 
Normalization1
Normalization1Normalization1
Normalization1
 
Data resource management
Data resource managementData resource management
Data resource management
 
Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...Schema Integration, View Integration and Database Integration, ER Model & Dia...
Schema Integration, View Integration and Database Integration, ER Model & Dia...
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 Relational
 
Rdbms
RdbmsRdbms
Rdbms
 

More from Faiz Zeya

elementsofZ.pptx
elementsofZ.pptxelementsofZ.pptx
elementsofZ.pptxFaiz Zeya
 
lec3forma.pptx
lec3forma.pptxlec3forma.pptx
lec3forma.pptxFaiz Zeya
 
FOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptxFOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptxFaiz Zeya
 
Word2vec-08032022-012238pm (1).pptx
Word2vec-08032022-012238pm (1).pptxWord2vec-08032022-012238pm (1).pptx
Word2vec-08032022-012238pm (1).pptxFaiz Zeya
 
Code completion using OpenAI APIs.pptx
Code completion using OpenAI APIs.pptxCode completion using OpenAI APIs.pptx
Code completion using OpenAI APIs.pptxFaiz Zeya
 
Types of machine learning.pptx
Types of machine learning.pptxTypes of machine learning.pptx
Types of machine learning.pptxFaiz Zeya
 
Linear algebraweek2
Linear algebraweek2Linear algebraweek2
Linear algebraweek2Faiz Zeya
 
Query expansion for search improvement by faizulhaque
Query expansion for search improvement by faizulhaque Query expansion for search improvement by faizulhaque
Query expansion for search improvement by faizulhaque Faiz Zeya
 
Big data introduction
Big data introductionBig data introduction
Big data introductionFaiz Zeya
 

More from Faiz Zeya (9)

elementsofZ.pptx
elementsofZ.pptxelementsofZ.pptx
elementsofZ.pptx
 
lec3forma.pptx
lec3forma.pptxlec3forma.pptx
lec3forma.pptx
 
FOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptxFOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptx
 
Word2vec-08032022-012238pm (1).pptx
Word2vec-08032022-012238pm (1).pptxWord2vec-08032022-012238pm (1).pptx
Word2vec-08032022-012238pm (1).pptx
 
Code completion using OpenAI APIs.pptx
Code completion using OpenAI APIs.pptxCode completion using OpenAI APIs.pptx
Code completion using OpenAI APIs.pptx
 
Types of machine learning.pptx
Types of machine learning.pptxTypes of machine learning.pptx
Types of machine learning.pptx
 
Linear algebraweek2
Linear algebraweek2Linear algebraweek2
Linear algebraweek2
 
Query expansion for search improvement by faizulhaque
Query expansion for search improvement by faizulhaque Query expansion for search improvement by faizulhaque
Query expansion for search improvement by faizulhaque
 
Big data introduction
Big data introductionBig data introduction
Big data introduction
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 

structureformal1.ppt

  • 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)
  • 4.
  • 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
  • 6.
  • 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.
  • 8.
  • 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
  • 16.
  • 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.
  • 20.
  • 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.
  • 22.
  • 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: