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
• <.>.&,|
• =,-,/,+
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.