• 検索結果がありません。

JAIST Repository: Program development in Java based on CafeOBJ specifications [課題研究報告書]

N/A
N/A
Protected

Academic year: 2021

シェア "JAIST Repository: Program development in Java based on CafeOBJ specifications [課題研究報告書]"

Copied!
3
0
0

読み込み中.... (全文を見る)

全文

(1)

Japan Advanced Institute of Science and Technology

JAIST Repository

https://dspace.jaist.ac.jp/

Title Program development in Java based on CafeOBJ specifications [課題研究報告書]

Author(s) Ha, Xuan Linh Citation

Issue Date 2017-09

Type Thesis or Dissertation Text version author

URL http://hdl.handle.net/10119/14799 Rights

(2)

Program development in Java based on CafeOBJ specifications

Ha Xuan Linh (1510214) School of Information Science,

Japan Advanced Institute of Science and Technology July 26, 2017

Keywords: formal specification, CafeOBJ, OTS, Java, concurrent programming. In the formal specification, two basic styles that are often used to formally specify a system are the model-based and algebraic specification. In the model-based approach, the state of a system is represented by a set of data variables and transitions can be described by operations that manipulate these variables. All possible values of these variables, constrained by invariants over them define the state space of the system. Each operation playing the role of a transition is often defined with pre and post-conditions. This representation makes it likely easier for programmers to write programs as well as for automatic tools to generate codes in object-oriented programming languages from the specification. One of the well-known frameworks using this approach is VDM++, which has been applied to many industrial projects, such as the development of the “Mobile FeliCa” IC Chip Firmware, which is widely used in Japan. While it is convenient to implement specifications written in VDM++, there is one issue that can be dealt with algebraic specification languages better than VDM++: formal verification. Some model-based specification languages, such as Z and Event-B, are equipped with a model checker and/or an interactive theorem prover, but to the best of our knowledge, VDM++ is not. Testing is mainly used to check specifications written in VDM++.

In contrast, the algebraic specification is more powerful in applying verification tech-niques but it seems more difficult for programmers to read and implement it. OTS in CafeOBJ is a way of specifying systems in this approach, in which the semantics of a system is built from observers and transitions. From a certain point of view, the ob-servers can be seen as data variables in the system. OTSs can be used for writing formal specifications of various software systems and verifying properties of them. It implements equational logic by rewriting and can be used as a powerful interactive theorem proving system. Despite its usefulness, up to present, few researches and engineers have applied CafeOBJ specifications to software development, while object-oriented specification tech-niques such as VDM++, Event-B and Z are successfully applied to many projects.

In this project, we briefly introduce some specification techniques which have been suc-cessfully applied to software development nowadays, the pros and cons of each technique and compare them with CafeOBJ, an algebraic specification language currently used in our research group. In addition, we have proposed a possible way to write a concurrent Java program based on an OTS specification in CafeOBJ. By annotating the OTS speci-fications, programmers have more information about the concurrent programs they write

Copyright c 2017 by Ha Xuan Linh

(3)

such as the number of threads in the program, global and local variables and the methods in each thread. Because the systems specified in CafeOBJ are composed of several com-ponents interacting with each other, we have successfully applied state pattern in Java to design the programs where each component in the system can be developed as a separate state machine. This can help programmers easier to understand the programs. Some case studies on writing the simulator of communication protocols such as ABP, Simple Cloud and Qlock are also represented in this research project to demonstrate our method.

Besides, we also propose a method to test the concurrent programs based on their OTS specifications by applying some external support tools such as JPF and Maude. JPF can model check Java bytecode programs but one of the most serious problem when using a model checker like JPF is the state space explosion where the size of the system state space grows exponentially as the number of state variables in the system increases. Despite that, we could control JPF to model check a part of the whole state space. Maude is another model checker whose specifications can be converted from CafeOBJ ones by YAST. We have proposed a solution to combine these tools in our testing method to check if a trace from JPF can be a valid computation in Maude specification or not. From that result, we can have a conclusion to some extent that if the written program conform with the OTS specification.

参照

関連したドキュメント

Scholars in the last decade have done extensive studies on urban growth and urbanisation process. Studies about the urban corridor and related development, its effect on land use

The objectives of the model are maximizing the development density, maximizing the mixed land use, maximizing the biophilic open space, maximizing the bikeway accessibility,

The test cases are used to test whether an implementation satisfies the specification and the property verified by the proof score1. Since a proof score involves impor- tant

This study, as a case study of urban plan system of Pudong large-scale development project in Shanghai, China, examines how land use control has been planned by urban plan system

According to our new conception object-oriented methodology is based on the elimination of decision repetitions, that is, sorting the decisions to class hierarchy, so that the

A linear piecewise approximation of expected cost-to-go functions of stochastic dynamic programming approach to the long-term hydrothermal operation planning using Convex

NIST - Mitigating the Risk of Software Vulnerabilities by Adopting a Secure Software Development Framework (SSDF).

We have presented in this article (i) existence and uniqueness of the viscous-inviscid coupled problem with interfacial data, when suitable con- ditions are imposed on the