17 May 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and...
-
Upload
leslie-doyle -
Category
Documents
-
view
215 -
download
2
Transcript of 17 May 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and...
17 May 2009 Instructor: Tasneem Darwish 1
University of PalestineFaculty of Applied Engineering and Urban Planning
Software Engineering Department
Formal Methods
Schema OperatorsPart1
17 May 2009 Instructor: Tasneem Darwish 2
Outlines
Conjunction
Decoration
Disjunction
Negation
17 May 2009 Instructor: Tasneem Darwish 3
ConjunctionWe may combine the information contained in two schemas using
conjunction
the conjunction of the previous two schemas is as follows:
If the same variable is declared in both schemas, then the types must match, or the schema S ^ T will be undefined.
17 May 2009 Instructor: Tasneem Darwish 4
ConjunctionExample 12.1 Our theatre company presents premieres: special performances of new productions. Only those customers who have signed up as friends of the theatre may buy seats for these shows. To include this information in our formal description, we add a new variable of type Status:Status == {Premiere, Standard}a set friends represent the set of all customers who are currently registered as friends of the theatre.
17 May 2009 Instructor: Tasneem Darwish 5
ConjunctionExample 12.1
17 May 2009 Instructor: Tasneem Darwish 6
ConjunctionWe may also conjoin two schemas by including one in the
declaration part of the other
Example 12.2 The friendly box office could have been introduced by including BoxOffice in the declaration part of a schema:
or by including both BoxOffice and Friends:
17 May 2009 Instructor: Tasneem Darwish 7
DecorationExample 12.6 One operation upon the state of the box office system is the purchasing of a single seat for the current performance. Suppose that this seat is denoted by s?, and that the customer buying it is c?. If the operation is to be a success, then s? must be available for sale beforehand:Afterwards, the sold relation should be modified to indicate that s? has been sold to customer c?
Finally, the collection of seats allocated for this performance should be unchanged by the operation.
17 May 2009 Instructor: Tasneem Darwish 8
DecorationSome operations, involve either input to the system or output
from it.If a component represents an input, then its name should end with
a query (?); if it represents output, then its name should end with a shriek (!)
Example 12.7 The operation of purchasing a seat requires two inputs: the name of the seat, and the name of the customer
17 May 2009 Instructor: Tasneem Darwish 9
DecorationIf Schema describes the state of a system, then ∆Schema is a schema including both Schema and Schema’:
Example 12.9 The operation schema Purchase0 could include ∆BoxOffice in place of BoxOffice and BoxOffice’: