Temporal Logic of Actions (TLA) - STS - Software, Technology

24
1 Verified Software Systems 1 6. TLA Temporal Logic of Actions (TLA) Leslie Lamport Based on slides of John A. Akinyemi Department of Computer Science University of Manitoba and Stephan Merz INRIA Lorraine & LORIA Nancy, France Verified Software Systems 2 Introductional Example

Transcript of Temporal Logic of Actions (TLA) - STS - Software, Technology

Page 1: Temporal Logic of Actions (TLA) - STS - Software, Technology

1

Verified Software Systems 1

6. TLA

Temporal Logic of Actions (TLA)Leslie Lamport

Based on slides of

John A. AkinyemiDepartment of Computer Science

University of Manitoba

and

Stephan MerzINRIA Lorraine & LORIA

Nancy, France

Verified Software Systems 2

Introductional Example

Page 2: Temporal Logic of Actions (TLA) - STS - Software, Technology

2

Verified Software Systems 3

Explanation

Verified Software Systems 4

Structure

Page 3: Temporal Logic of Actions (TLA) - STS - Software, Technology

3

Verified Software Systems 5

Fairness

Verified Software Systems 6

Specifications

Page 4: Temporal Logic of Actions (TLA) - STS - Software, Technology

4

Verified Software Systems 7

TLA

Verified Software Systems 8

Anatomy of TLA

Page 5: Temporal Logic of Actions (TLA) - STS - Software, Technology

5

Verified Software Systems 9

...

Verified Software Systems 10

...

Page 6: Temporal Logic of Actions (TLA) - STS - Software, Technology

6

Verified Software Systems 11

...

Verified Software Systems 12

...

Page 7: Temporal Logic of Actions (TLA) - STS - Software, Technology

7

Verified Software Systems 13

...

Verified Software Systems 14

...

Page 8: Temporal Logic of Actions (TLA) - STS - Software, Technology

8

Verified Software Systems 15

Verification

Verified Software Systems 16

Deductive Verification

Page 9: Temporal Logic of Actions (TLA) - STS - Software, Technology

9

Verified Software Systems 17

Example

Verified Software Systems 18

TLC

Page 10: Temporal Logic of Actions (TLA) - STS - Software, Technology

10

Verified Software Systems 19

Output of TLC

Verified Software Systems 20

Comments

Page 11: Temporal Logic of Actions (TLA) - STS - Software, Technology

11

Verified Software Systems 21

The Language TLA+

Verified Software Systems 22

Specifying Data in TLA+

Page 12: Temporal Logic of Actions (TLA) - STS - Software, Technology

12

Verified Software Systems 23

Choice

Verified Software Systems 24

Choice vs. non-determinism

Page 13: Temporal Logic of Actions (TLA) - STS - Software, Technology

13

Verified Software Systems 25

Functional values in TLA+

Verified Software Systems 26

Recursion

Page 14: Temporal Logic of Actions (TLA) - STS - Software, Technology

14

Verified Software Systems 27

Modules in TLA+

Verified Software Systems 28

Principle of unique names

Page 15: Temporal Logic of Actions (TLA) - STS - Software, Technology

15

Verified Software Systems 29

Module Instantiation

Verified Software Systems 30

Case study: a resource allocator

Page 16: Temporal Logic of Actions (TLA) - STS - Software, Technology

16

Verified Software Systems 31

A first solution

Verified Software Systems 32

A first solution ...

Page 17: Temporal Logic of Actions (TLA) - STS - Software, Technology

17

Verified Software Systems 33

A first solution ...

Verified Software Systems 34

Checking some properties with TLC

Page 18: Temporal Logic of Actions (TLA) - STS - Software, Technology

18

Verified Software Systems 35

The specification SimpleAllocator is wrong.

Verified Software Systems 36

The specication SimpleAllocator is wrong.

Page 19: Temporal Logic of Actions (TLA) - STS - Software, Technology

19

Verified Software Systems 37

Second solution

Verified Software Systems 38

Second solution ...

Page 20: Temporal Logic of Actions (TLA) - STS - Software, Technology

20

Verified Software Systems 39

Second solution ...

Verified Software Systems 40

Second solution ...

Page 21: Temporal Logic of Actions (TLA) - STS - Software, Technology

21

Verified Software Systems 41

Second solution ...

Verified Software Systems 42

Second solution ...

Page 22: Temporal Logic of Actions (TLA) - STS - Software, Technology

22

Verified Software Systems 43

Comment

Verified Software Systems 44

Summary of case study

Page 23: Temporal Logic of Actions (TLA) - STS - Software, Technology

23

Verified Software Systems 45

Conclusion

� TLA formulas semantically follows the semantics of RTLA - a logic of actions.

� TLA is a language for writing predicates, state functions, and actions, and a logic for reasoningabout them.

� TLA is useful for specifying and verifying safetyand liveness properties of discrete systems.

� TLA has tools that aid program specifications and verifications.

Verified Software Systems 46

Conclusion

� A safety property asserts all constraints that ensure the system does not enter an undesired state, and a liveness property asserts that the system performs all specified actions.

� TLA makes it practical to describe a system by a single formula.

� TLA can be used to formalize the transitions and evolution of states in a dynamic system, e.g. I intend to use TLA to formalize the UML State diagrams in my thesis.

Page 24: Temporal Logic of Actions (TLA) - STS - Software, Technology

24

Verified Software Systems 47

Example and Software

� Get TLA+ fromhttp://research.microsoft.com/users/lamport/tla/tools.htmlJava Version for Windows available

� Get the TLA+ Eclipse plugin fromhttp://www.techjava.de/projects/etla-plugin/

Verified Software Systems 48

References

1. Leslie Lamport. Introduction to TLA. Technical Report# 1994-001, Digital Systems Research Center, 1994. Available at http://www.research.digital.com/SRC/

2. Leslie Lamport. Specifying Systems: The TLA+ Language and Tools for Hardware and Software Engineers, Addison-Wesley, 2003.

3. Leslie Lamport. The Temporal Logic of Actions. ACM Transactions on Programming Languages and Systems, 16(3):872-923, May 1994.

4. DisCo. http://disco.cs.tut.fi/index.html

5. TLA. http://research.microsoft.com/users/lamport/tla/tla.html

6. Work With and On Lamport's TLA. http://www.rvs.uni-bielefeld.de/publications/ abstracts.html#TLA