PRISM Model Checker As an Eclipse-Plugin

PRISM Model Checker As an Eclipse-Plugin

MASARYK UNIVERSITY FACULTY}w¡¢£¤¥¦§¨ OF I !"#$%&'()+,-./012345<yA|NFORMATICS PRISM model checker as an Eclipse-plugin DIPLOMA THESIS Bc. Milan Malota Brno, Autumn 2015 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. In Brno, January 11, 2016 Bc. Milan Malota Advisor: RNDr. Vojtechˇ Rehˇ ak,´ Ph.D. ii Acknowledgement I would like to thank my advisor Vojtechˇ Rehˇ ak´ for valuable advice, com- ments, support and patience during the writing of this thesis. I also want to express my gratitude to my family and my girlfriend for their support during studies. iii Abstract PRISM is a probabilistic model checker and is used in many different ap- plication domains and is well known among scientists dealing with formal modeling and analysis of systems that exhibit random or probabilistic be- havior. PRISM’s GUI was developed in the beginning of the PRISM life cycle and technologies made great progress so it can seem obsolete. That is why the request for a new GUI was pronounced. One of the platforms suitable for integrating an application and preferred by the original development team is the Eclipse platform. In the scope of this thesis we analyze available Eclipse platforms and notable graphical user interface frameworks. On the basis of the analysis new graphical user interface allowing all funcionality of the current PRISM GUI is implemented. iv Keywords PRISM, Eclipse RCP, Eclipse e4, AWT, Swing, SWT, JFace, Albireo v Contents 1 Introduction ...............................3 1.1 Motivation .............................3 2 Preliminaries ..............................5 2.1 PRISM model checker ......................5 2.1.1 The PRISM language . .5 2.1.2 Properties . .6 2.1.3 Experiments . .7 2.1.4 Simulations . .7 2.2 The PRISM’s graphical user interface (GUI) ..........7 2.3 The model editor .........................8 2.4 The properties editor .......................9 2.5 The simulator environment and log ..............9 2.6 GUI conclusion .......................... 10 3 The Eclipse Rich Client Platform .................... 11 3.1 Eclipse ................................ 11 3.2 The Eclipse RCP ........................... 11 3.2.1 The OSGi framework . 12 3.2.2 The SWT framework . 13 3.2.3 JFace . 13 3.2.4 Other Eclipse APIs . 13 3.3 The Eclipse 3.x platform ..................... 13 3.4 The Eclipse e4 platform ...................... 14 3.5 Eclipse Public License ...................... 14 3.6 The Eclipse RCP conclusion ................... 14 4 The frameworks selection ....................... 16 4.1 The Eclipse RCP platform selection ............... 16 4.1.1 The framework . 16 4.1.2 Dependency injection . 17 4.1.3 The dynamic application model . 17 4.1.4 GUI independence . 17 4.2 The user interface framework selection ............. 17 4.2.1 Abstract Window Toolkit (AWT) . 18 1 4.2.2 The Swing framework . 19 4.2.3 The Standard Widget Toolkit (SWT) . 19 4.2.4 JFace and SWT . 19 4.2.5 The user interface frameworks conclusion . 20 5 Implementation of the PRISM Eclipse plugin ........... 22 5.1 IDE and installation of e4 tools ................. 22 5.2 New project creation ....................... 22 5.3 Application model ........................ 23 5.4 Annotations ............................ 25 5.5 GUI elements implementation .................. 26 5.5.1 SWT and JFace . 26 5.5.2 Swing . 27 5.6 Swing components integration ................. 28 5.6.1 Multiple Event Threads . 28 5.6.2 Look and feel . 29 5.6.3 Application Flickering . 29 5.6.4 Modal dialogs . 29 5.6.5 Pop-up menus dismissing . 30 5.6.6 Keystroke logging . 30 5.6.7 Albireo project . 30 5.7 Eclipse plugin packages ...................... 31 5.8 Plugin core classes ........................ 32 5.9 Cascading style sheets (CSS) ................... 33 5.10 Exporting and platform independency ............. 33 5.11 The Eclipse PRISM plugin conclusion ............. 34 6 Future work ............................... 36 6.1 Building via Maven ........................ 36 6.2 Continuous integration to SWT ................. 36 7 Conclusion ................................ 37 8 Source code information ........................ 38 2 Chapter 1 Introduction In a life cycle of a computer program we can find in the first position an idea for a program. In some cases the idea is pretty clear and there are no doubts, on the other hand in some cases the idea is slightly blurred. A difference is often in a motivation. Developers often does not know if their application is capable of addressing a potential user and if time invested in developing brings rewards or not. 1.1 Motivation The main goal of this thesis is to create a new graphical user interface (GUI) for an existing application called PRISM. PRISM is a probabilistic model checker and is used in many different application domains and is well known among scientists dealing with formal modeling and analysis of systems that exhibit random or probabilistic behavior [21]. The detailed information about PRISM is provided in the Section 2.1. PRISM is implemented as a standalone application, so a question why is a new GUI needed can come to the surface. The answer to the question is simple. The GUI was developed in the beginning of the PRISM life cycle and technologies made great progress so it can seem obsolete. One of the platforms suitable for integrating an application and pre- ferred by the original development team is the Eclipse platform. The Eclipse platform defines a set of frameworks and common services that allow devel- opers to create a rich client platform (RCP), we deal with RCP in Chapter 3 in detail. In Chapter 4 we describe notable Eclipse platforms and graphical user interface frameworks. We compare their advantages and disadvantages and on the basis of the comparison and test development of the possible approaches we select the most suitable Eclipse platform and GUI framework in which a new GUI for the PRISM model checker should be implemented. Further in Chapter 5 we describe issues we had to face during the de- 3 1. INTRODUCTION velopment of the selected approach; we also provide solutions for these issues. Finally in Chapter 6 we provide a list of suggestions for future work as the approach selected in the scope of this thesis usually presents transition point toward new implementation. 4 Chapter 2 Preliminaries In this chapter we provide basic information about the PRISM language and the PRISM model checker. 2.1 PRISM model checker PRISM is a probabilistic model checker. The latest version (4.2.1) provides support for formal modelling and analysis of systems that exhibit random or probabilistic behavior [21]. PRISM is used to analyse a wide range of case studies in many different application domains, including randomised distributed algorithms, communication, network and multimedia protocols, security, biology, planning and synthesis, game theory, performance and reliability, power management and CTMC benchmarks [34]. For more about case studies see [1]. 2.1.1 The PRISM language In order to understand PRISM works we have to introduce the PRISM lan- guage, a simple, state-based language. This is used for all types of model that PRISM supports: discrete-time Markov chains (DTMCs), continuous-time Markov chains (CTMCs), Markov decision processes (MDPs) and probabilis- tic automata (PAs), probabilistic timed automata (PTAs). [21] Every PRISM model comprises a set of modules which represent different components of the system being modelled. For representation of the state of each module a set of variables is introduced. In Figure 2.1 we can see an example of the PRISM modelling language. The example shows a simple case study based on a single cell in a wireless communication network. In order to specify additional measures of interest of modelled systems rewards can be utilized. The way of rewards specification is in our example in Figure 2.1. Rewards typically represent the rate at which a reward is accu- mulated, rewards usually represent an instantaneous measure of interest, at a 5 2. PRELIMINARIES // single cell in wireless communication network // gxn/dxp 5/3/01 ctmc const i n t N; // N − number of channels const double lambda1=49; // arrival rate of new calls const double lambda2=21; // arrival rate of hand−o f f c a l l s const double mu=1; // departure rate of calls module c e l l n : [0..N]; // number of calls in the cell // arrival of new call [ ] ( n<N∗ 0 . 8 ) −> lambda1 : (n’=n+1); // arrival of hand of call [ ] ( n<N) −> lambda2 : (n’=n+1); // completion of call or mobile departs cell [ ] ( n>0) −> n∗mu : ( n’=n−1); endmodule // number calls in the cell rewards ” c a l l s ” true : n ; endrewards Figure 2.1: A case study based on a single cell in a wireless communication network [37] particular time, in our case, number of calls in the cell. For more information about the semantic of the PRISM modelling language, see the manual [35]. 2.1.2 Properties We have discussed basic information about the PRISM modelling language, when we have a model, we have to specify one or more properties. Properties are based on temporal logic, which offers a flexible and unambiguous means of describing a wide range of properties. In order to specify properties of DTMCc, MDPs or PTAs PCTL is used; CSL is an extension of PCTL for CTMCs; LTL and PCTL* can be used to specify properties of DTMCs and MDPs (or untimed properties of CTMCs) [36]. 6 2. PRELIMINARIES const double T; // time bound // the maximum probability that a hand off call can be // dropped within t time units (assuming a guarded channel is free) P=?[ true U<=T ( n=N) fn<Ngfmaxg ] // the expected number of calls at time T Rf” c a l l s ”g=? [ I=T ] // the probability that in the long run any call can be dropped S=? [ n<N∗0.8 ] // the expected number calls in the cell in the long run Rf” c a l l s ”g=? [ S ] Figure 2.2: A definition of properties [37] In Figure 2.2 we offer an example of the properties specification.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    47 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us