tailieunhanh - Lecture Formal methods in software engineering - Lecture 18: Abstract model specification
In this chapter, the following content will be discussed: Abstract model specification, notation, features( Z-notation), the state can occupy, the invariant relationships that are maintained as the system moves from state to state, the operations that are possible, the relationship between their inputs and outputs, the change of state that happen. | Formal Methods in SE Abstract Model Specification Lecture # 18 Abstract Model Specification Explicitly describes behavior in terms of a model using well-defined types (viz. set, sequences, relations, functions) & defines operations by showing effects on model Specification includes type - syntax of object being specified model - underlying structure invariant - properties of modeled object pre/post conditions – semantics of operations Notation Is used to test the results Independent of program code Mathematical Data model Represent both static and dynamic aspects of a system Features( Z-notation) Decompose specification into small pieces (Schemas) Schemas are used to describe both static and dynamic aspects of a system Data Refinement Direct Refinement You can ignore details in order to focus on the aspects of the problem you are interested in Schema Static Aspect The state can occupy. The invariant relationships that are maintained as the system moves from state to state Schema(cont.) Dynamic Aspect The operations that are possible The relationship between their inputs and outputs. The change of state that happen. Notation - Example Some variables are declared. Relationship between the values of the variables Name Init Birthday Book Known = Birthday Book Example Birthday book known: NAME birthday: NAME DATE Known : dom birthday Add Birthday Birthday Book name?: NAME date?: DATE name? known birthday’ = birthday { name? date} Example(cont.) Find Birthday Birthday book name?: NAME date? : DATE name? Known date != birthday(name?) Race condition We have not handled the condition when user tries to add a birthday, which is already known to the system, or tries to find the birthday of someone not known. Handle this by adding an extra result! To each operation. Result := of| already_known | not_known Success Result! : REPORT Result! = ok Operators (Conjunction of the two predicate parts) – any common variables of the | Formal Methods in SE Abstract Model Specification Lecture # 18 Abstract Model Specification Explicitly describes behavior in terms of a model using well-defined types (viz. set, sequences, relations, functions) & defines operations by showing effects on model Specification includes type - syntax of object being specified model - underlying structure invariant - properties of modeled object pre/post conditions – semantics of operations Notation Is used to test the results Independent of program code Mathematical Data model Represent both static and dynamic aspects of a system Features( Z-notation) Decompose specification into small pieces (Schemas) Schemas are used to describe both static and dynamic aspects of a system Data Refinement Direct Refinement You can ignore details in order to focus on the aspects of the problem you are interested in Schema Static Aspect The state can occupy. The invariant relationships that are maintained as the system moves from .
đang nạp các trang xem trước