SlideShare a Scribd company logo
1 of 15
FROM Z TO CODE
STEPWISE CONVERSION INTO
CODE
• 1. Transformations
• 2. Refinement
• 3. Code templates
TRANSFORMATIONS
Z schemas allow us to infer preconditions and post conditions.
Means value of elements before and after the initialization.
WHAT IS REFINEMENT?
Development often proceeds from an abstract specification to a detailed design.
This process is called refinement.
CODE TEMPLATES
Most specifications have schema which exhibit the same basic patterns. For example:
1. adding or removing elements in a list.
2. handling a sequence of events.
3. ordering a set of values
FROM Z TO CODE
Declarations
Tuple
State schemas
DECLARATIONS
IN Z
• | d1, d2:DICE
int i; int j = 10;
enum Traffic { Red, Yellow, Green};
IN
CODE(C++)
OPERATORS
• In z Language
• <,>,^,v
• =,-,/,+
• In programming
Language
• <.>.&,|
• =,-,/,+
TUPLE
IN Z
Struct employee
{
Int id;
String name;
string department;
}
IN CODE(C++)
STATE SCHEMAS
State schemas are usually implemented by data structures
whose contents can change frequently.
S = [x,y:Z]
STATE SCHEMAS
becomes this declaration for two program variables
int x,y; /* state schema S */
ALTERNATIVELY, A STATE SCHEMA CAN BE IMPLEMENTED BY THE DECLARATION OF A C++ STRUCTURE
Struct s
{
Int x,y;
}
ADVANTAGES OF USING Z
• A Z specification forces the engineer to completely analyze the problem domain. (e.g. identify
the state space and pre and post conditions for all operations).
• A Z specification forces all major design decisions to be made prior to coding the
implementation.
• Coding should not commence until you are certain about what you should be coding.
• A Z specification is a valuable tool for generating test data, and the conformance testing of
completed systems.
DISADVANTAGES OF Z LANGUAGE
• By using Z language more time require for completing a project rather than expected
time.
• It increase the cost of project.
Z to code

More Related Content

What's hot (14)

New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
Algorithms & flowcharts
Algorithms & flowchartsAlgorithms & flowcharts
Algorithms & flowcharts
 
CAiSE 2015 - Montali - Declarative Process Modeling in BPMN
CAiSE 2015 - Montali - Declarative Process Modeling in BPMNCAiSE 2015 - Montali - Declarative Process Modeling in BPMN
CAiSE 2015 - Montali - Declarative Process Modeling in BPMN
 
Best Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing TechniquesBest Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing Techniques
 
Unit i
Unit iUnit i
Unit i
 
Introduction to algorithms
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
 
Computer Programming - Lecture 2
Computer Programming - Lecture 2Computer Programming - Lecture 2
Computer Programming - Lecture 2
 
Flow chart programming
Flow chart programmingFlow chart programming
Flow chart programming
 
Modular programming
Modular programmingModular programming
Modular programming
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Code optimisation presnted
Code optimisation presntedCode optimisation presnted
Code optimisation presnted
 
9. control statement
9. control statement9. control statement
9. control statement
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 
10. sub program
10. sub program10. sub program
10. sub program
 

Similar to Z to code (20)

ERTS UNIT 3.ppt
ERTS UNIT 3.pptERTS UNIT 3.ppt
ERTS UNIT 3.ppt
 
Evolutionary db development
Evolutionary db development Evolutionary db development
Evolutionary db development
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
C cpluplus 2
C cpluplus 2C cpluplus 2
C cpluplus 2
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
introductory concepts
introductory conceptsintroductory concepts
introductory concepts
 
C_plus_plus
C_plus_plusC_plus_plus
C_plus_plus
 
OODPunit1.pdf
OODPunit1.pdfOODPunit1.pdf
OODPunit1.pdf
 
C++ tutorials
C++ tutorialsC++ tutorials
C++ tutorials
 
c
cc
c
 
Differential Semantics
Differential SemanticsDifferential Semantics
Differential Semantics
 
Chap 2 c++
Chap 2 c++Chap 2 c++
Chap 2 c++
 
3 Function & Storage Class.pptx
3 Function & Storage Class.pptx3 Function & Storage Class.pptx
3 Function & Storage Class.pptx
 
C programming
C programmingC programming
C programming
 
C++ unit-1-part-9
C++ unit-1-part-9C++ unit-1-part-9
C++ unit-1-part-9
 
Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design Principal Sources of Optimization in compiler design
Principal Sources of Optimization in compiler design
 
Procedure Division & Basic Verbs
Procedure Division & Basic VerbsProcedure Division & Basic Verbs
Procedure Division & Basic Verbs
 
Object Oriented Programming using C++ - Part 1
Object Oriented Programming using C++ - Part 1Object Oriented Programming using C++ - Part 1
Object Oriented Programming using C++ - Part 1
 
C++ Notes PPT.ppt
C++ Notes PPT.pptC++ Notes PPT.ppt
C++ Notes PPT.ppt
 

More from Usama Fayyaz

Final year-project "Smart Sessional System with QR Code"
Final year-project "Smart Sessional System with QR Code"Final year-project "Smart Sessional System with QR Code"
Final year-project "Smart Sessional System with QR Code"Usama Fayyaz
 
Cocomo Cost Drivers
Cocomo Cost DriversCocomo Cost Drivers
Cocomo Cost DriversUsama Fayyaz
 
Planning risk responses and Risk Controlling
Planning risk responses and Risk ControllingPlanning risk responses and Risk Controlling
Planning risk responses and Risk ControllingUsama Fayyaz
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Usama Fayyaz
 
Health and Safety at Work
Health and Safety at WorkHealth and Safety at Work
Health and Safety at WorkUsama Fayyaz
 
KPI and Prioritization
KPI and PrioritizationKPI and Prioritization
KPI and PrioritizationUsama Fayyaz
 
Product Attributes Presentation
Product Attributes Presentation Product Attributes Presentation
Product Attributes Presentation Usama Fayyaz
 

More from Usama Fayyaz (7)

Final year-project "Smart Sessional System with QR Code"
Final year-project "Smart Sessional System with QR Code"Final year-project "Smart Sessional System with QR Code"
Final year-project "Smart Sessional System with QR Code"
 
Cocomo Cost Drivers
Cocomo Cost DriversCocomo Cost Drivers
Cocomo Cost Drivers
 
Planning risk responses and Risk Controlling
Planning risk responses and Risk ControllingPlanning risk responses and Risk Controlling
Planning risk responses and Risk Controlling
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning
 
Health and Safety at Work
Health and Safety at WorkHealth and Safety at Work
Health and Safety at Work
 
KPI and Prioritization
KPI and PrioritizationKPI and Prioritization
KPI and Prioritization
 
Product Attributes Presentation
Product Attributes Presentation Product Attributes Presentation
Product Attributes Presentation
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Z to code

  • 1. FROM Z TO CODE
  • 2. STEPWISE CONVERSION INTO CODE • 1. Transformations • 2. Refinement • 3. Code templates
  • 3. TRANSFORMATIONS Z schemas allow us to infer preconditions and post conditions. Means value of elements before and after the initialization.
  • 4. WHAT IS REFINEMENT? Development often proceeds from an abstract specification to a detailed design. This process is called refinement.
  • 5. CODE TEMPLATES Most specifications have schema which exhibit the same basic patterns. For example: 1. adding or removing elements in a list. 2. handling a sequence of events. 3. ordering a set of values
  • 6. FROM Z TO CODE Declarations Tuple State schemas
  • 7. DECLARATIONS IN Z • | d1, d2:DICE int i; int j = 10; enum Traffic { Red, Yellow, Green}; IN CODE(C++)
  • 8. OPERATORS • In z Language • <,>,^,v • =,-,/,+ • In programming Language • <.>.&,| • =,-,/,+
  • 10. IN Z Struct employee { Int id; String name; string department; } IN CODE(C++)
  • 11. STATE SCHEMAS State schemas are usually implemented by data structures whose contents can change frequently. S = [x,y:Z]
  • 12. STATE SCHEMAS becomes this declaration for two program variables int x,y; /* state schema S */ ALTERNATIVELY, A STATE SCHEMA CAN BE IMPLEMENTED BY THE DECLARATION OF A C++ STRUCTURE Struct s { Int x,y; }
  • 13. ADVANTAGES OF USING Z • A Z specification forces the engineer to completely analyze the problem domain. (e.g. identify the state space and pre and post conditions for all operations). • A Z specification forces all major design decisions to be made prior to coding the implementation. • Coding should not commence until you are certain about what you should be coding. • A Z specification is a valuable tool for generating test data, and the conformance testing of completed systems.
  • 14. DISADVANTAGES OF Z LANGUAGE • By using Z language more time require for completing a project rather than expected time. • It increase the cost of project.