LLM-Based Java Concurrent Program to ArkTS Converter

  • Abstract
  • Literature Map
  • Similar Papers
Abstract
Translate article icon Translate Article Star icon

HarmonyOS NEXT is a distributed operating system developed to support HarmonyOS native apps. To support the new and independent Harmony ecosystem, developers are required to migrate their applications from Android to HarmonyOS. However, HarmonyOS utilizes ArkTS, a superset of TypeScript, as the programming language for application development. Hence, migrating applications to HarmonyOS requires translating programs across different program languages, e.g., Java, which is known to be very challenging, especially for concurrency programs. Java utilizes shared memory to implement concurrency programs, while ArkTS relies on message passing (i.e., Actor model). This paper presents an LLM-based concurrent Java program to ArkTS converter.

Similar Papers
  • Book Chapter
  • Cite Count Icon 1
  • 10.1007/bfb0027795
CHESSBOARD: A synergy of object-oriented concurrent programming and program layering
  • Jan 1, 1996
  • Tzilla Elrad + 2 more

Language support to enable programming by contract offers a systematic approach to the development and verification of object oriented programs [M93]. An object behavior is locally defined in terms of obligations (preconditions) and benefits (postconditions). Concurrent object-oriented programming seems to be an appealing idea because it imposes structure on objects' communication. Since structure of a tightly-coupled, interprocess dependent concurrent program is more than the simple collection of its objects, set of local assertions is not enough to capture cooperation among the different objects. A complementary view which depicts the cooperation among different objects is needed. The concept of communication-closed layers [EF82] is extended for object-oriented concurrent programming. The synergy between concurrent object-oriented programming and layering enables dual reflections of a program as both a collection of objects and a sequence of subgoals achieved by inter-object cooperation. On top of Meyer's intra-object programming by contract we propose inter-object contracts. Intra-object contracts are used for the verification of object state consistency, and inter-object contracts, called teamwork assertions, are used for ensuring cooperation among objects. We view a concurrent program as a CHESSBOARD. The columns are the different objects/tasks and the rows are the program layers. Every square on the board is a logical component of both an object/task and a layer. Our proposal enables a horizontal decomposition of concurrent programs on top of its vertical decomposition into objects/tasks. This synergy, we believe, could make existing design and verification methods for concurrent programming more applicable as teamwork assertions are used to decompose complex programs. The concept neither introduces any physical synchronization barrier among layers nor relies on particular computer architecture and programming language. CHESSBOARD is most beneficial for applications where the objects/tasks are tightly bounded to compute a common objective. We present a simple example of a concurrent program viewed as a CHESSBOARD. The program runs on a Sun workstation using Concurrent C++.KeywordsParallel ProgramConcurrent ProgramVirtual TimeComputational PathVertical DecompositionThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

  • Research Article
  • Cite Count Icon 4
  • 10.1093/comjnl/35.2.157
Debugging Tools for Concurrent Logic Programming
  • Apr 1, 1992
  • The Computer Journal
  • T Conlon + 1 more

A problem which confronts the developers of concurrent logic programming (CLP) systems concerns the design of the programming environment, particularly the provision of debugging tools. Debugging tools are useful for many activities besides identifying bugs: they can help in program testing and demonstration, in software experiments, and in teaching the language semantics. For CLP languages the questions of what debugging tools should be provided, and of how they should be used, are still open. Although the languages are closely related to other logic programming and concurrent programming languages, they are sufficiently different that new debugging techniques are required. This paper describes a primarily channel-oriented debugging methodology and a set of debugging tools that we have developed in the light of our experience in using and teaching the CLP language Parlog. With these tools a programmer can test a program by observing communication on channels, opening up a process to examine the activity on internal channels and, if necessary, to check in detail the execution steps of a process. Almost all of the ideas, which are equally applicable to other CLP languages, have been implemented in two commercial Parlog systems. As well as fulfilling the needs of existing users of CLP languages, we believe that the tools emphasise the attractions of CLP as a concurrent programming paradigm, since they are made possible by the unique attributes of CLP.

  • Conference Article
  • Cite Count Icon 31
  • 10.1109/wpc.1998.693354
Design of a toolset for dynamic analysis of concurrent Java programs
  • Jun 24, 1998
  • A Bechini + 1 more

The Java language supports the use of monitors, sockets, and remote method invocation for concurrent programming. Also, Java classes can be defined to simulate other types of concurrent constructs. However, concurrent Java programs, like other concurrent programs, are difficult to specify, design, code, test and debug. In this paper, we describe the design of a toolset, called JaDA (Java Dynamic Analyzer), that provides testing and debugging tools for concurrent Java programs. To collect run-time information or control program execution, JaDA requires transformation of a concurrent Java program into a slightly different Java program. We show that by modifying Java classes that support concurrent programming, Java application programs only need minor modifications. We also present a novel approach to managing threads that are needed for testing and debugging of concurrent Java programs.

  • Book Chapter
  • Cite Count Icon 24
  • 10.1007/978-3-319-96145-3_5
Layered Concurrent Programs
  • Jan 1, 2018
  • Bernhard Kragl + 1 more

We present layered concurrent programs, a compact and expressive notation for specifying refinement proofs of concurrent programs. A layered concurrent program specifies a sequence of connected concurrent programs, from most concrete to most abstract, such that common parts of different programs are written exactly once. These programs are expressed in the ordinary syntax of imperative concurrent programs using gated atomic actions, sequencing, choice, and (recursive) procedure calls. Each concurrent program is automatically extracted from the layered program. We reduce refinement to the safety of a sequence of concurrent checker programs, one each to justify the connection between every two consecutive concurrent programs. These checker programs are also automatically extracted from the layered program. Layered concurrent programs have been implemented in the Civl verifier which has been successfully used for the verification of several complex concurrent programs.

  • Research Article
  • Cite Count Icon 7
  • 10.1109/32.965343
Apportioning: a technique for efficient reachability analysis of concurrent object-oriented programs
  • Jan 1, 2001
  • IEEE Transactions on Software Engineering
  • S Iyer + 1 more

The object-oriented paradigm in software engineering provides support for the construction of modular and reusable program components and is attractive for the design of large and complex distributed systems. Reachability analysis is an important and well-known tool for static analysis of critical properties in concurrent programs, such as deadlock freedom. It involves the systematic enumeration of all possible global states of program execution and provides the same level of assurance for properties of the synchronization structure in concurrent programs, such as formal verification. However, direct application of traditional reachability analysis to concurrent object-oriented programs has many problems, such as incomplete analysis for reusable classes (not safe) and increased computational complexity (not efficient). We have proposed a novel technique called apportioning, for safe and efficient reachability analysis of concurrent object-oriented programs, that is based upon a simple but powerful idea of classification of program analysis points as local (having influence within a class) and global (having possible influence outside a class). Given a program and a classification of its analysis points, reachability graphs are generated for 1) an abstract version of each class in the program having only local analysis points and 2) an abstract version of the whole program having only global analysis points. The error to be checked is decomposed into a number of subproperties, which are checked in the appropriate, reachability graphs. Different choices for the classification of analysis points, provide the flexibility to have many algorithms that are safe and efficient for different subclasses of programs. We have developed a number of apportioning-based algorithms, having different degrees of safety and efficiency. In this paper, we present the details of one of these algorithms, formally show its safety for an appropriate class of programs, and present experimental results to demonstrate its efficiency for various examples.

  • Conference Article
  • Cite Count Icon 6
  • 10.1109/ipps.1996.508065
Support for extensibility and reusability in a concurrent object-oriented programming language
  • Apr 15, 1996
  • R Pandey + 1 more

In many concurrent programming languages programs are difficult to extend and modify. This is because changes in a concurrent program (either through modification or extension) require re-implementation of some or all components. This paper presents the design of a concurrent object-oriented programming language based upon separate specifications of computations and interactions of programs. Separate specification of computations and interactions allows each to be separately modified and extended. We show that separation also facilitates extension of other language composition mechanisms such as class, inheritance, and template in order to define concurrent program abstractions. The resulting language supports extensibility and modifiability of concurrent programs as well as reusability of specifications of computations and interactions.

  • Research Article
  • Cite Count Icon 52
  • 10.1145/375431.375420
Slicing concurrent java programs
  • Apr 1, 2001
  • ACM SIGPLAN Notices
  • Zhenqiang Chen + 1 more

Program slicing is an important approach to testing, understanding and maintaining programs. The paper presents a slicing algorithm for concurrent Java programs. Because the execution process of concurrent programs is unpredictable, there are many problems to be solved when slicing. To slice concurrent Java programs, we present concurrent control flow graphs and concurrent program dependence graphs to representconcurrent Java programs. Based on these models, we design an efficient static slicing algorithm for concurrent Java programs. The algorithm may get more precise slices than previous approaches we know.

  • Book Chapter
  • Cite Count Icon 69
  • 10.1007/978-3-642-78545-0_3
Object-Oriented Concurrent Constraint Programming in Oz
  • Jan 1, 1993
  • Gert Smolka + 2 more

Oz is an experimental higher-order concurrent constraint programming system under development at DFKI. It combines ideas from logic and concurrent programming in a simple yet expressive language. From logic programming Oz inherits logic variables and logic data structures, which provide for a programming style where partial information about the values of variables is imposed concurrently and incrementally. A novel feature of Oz is that it accommodates higher-order programming without sacrificing that denotation and equality of variables are captured by first-order logic. Another new feature of Oz is constraint communication, a new form of asynchronous communication exploiting logic variables. Constraint communication avoids the problems of stream communication, the conventional communication mechanism employed in concurrent logic programming Constraint communication can be seen as providing a minimal form of state fully compatible with logic data structures.

  • Research Article
  • Cite Count Icon 168
  • 10.12694/scpe.v4i2.231
Distributed Computing: Fundamentals, Simulations and Advanced Topics
  • Jan 3, 2001
  • Scalable Computing Practice and Experience
  • Marcin Paprzycki

Stephen J. Hartley Oxford University Press, New York, 1998, 260 pp. ISBN 0-19-511315-2, $45.00 Concurrent Programming is a thorough treatment of Java multi-threaded programming for both a stand-alone and distributed environment. Designed mostly for students in concurrent or parallel programming classes, the text is also an excellent reference for the practicing professional developing multi-threaded programs or applets. Hartley first provides a complete explanation of the features of Java necessary to write concurrent programs, including topics such as exception handling, interfaces, and packages. He then gives the reader a solid background to write multi-threaded programs and also presents the problems introduced when writing concurrent programs—namely race conditions, mutual exclusion, and deadlock. Hartley also provides several software solutions that do not require the use of common process and thread mechanisms. Once the groundwork is laid for writing concurrent programs, Hartley then takes a different approach than most Java references. Rather than presenting how Java handles mutual exclusion with the synchronized keyword (although it is covered later), he first looks at semaphore-based solutions to classic concurrent problems such as bounded-buffer, readers-writers, and the dining philosophers. Hartley also uses the same approach to develop Java classes for monitors and message passing. This unique approach to introducing concurrency allows the readers to both understand how Java threads are synchronized and how the basic synchronization mechanism can be used to construct more abstract tools such as semaphores. If there is a shortcoming with the text it is with the lack of sufficient coverage of remote method invocation (RMI), although there is a section covering RMI. This is quite understandable as RMI is a fairly recent phenomenon with the Java community. Also, the classes that Hartley provides could easily implement RMI rather than sockets to handle communication. The strengths of the book include its ease in reading, several examples at the end of chapters, a package similar to Xtango that provides algorithm animation, and a supportive web site by the author (see www.mcs.drexel.edu/~shartley/ConcProgJava/index.html ) including compressed source code. As Java becomes more dominant on the server side of multi-tier applications, writing thread-safe concurrent applications becomes even more important. Concurrent Programming is a strong step towards teaching students and professionals such skills. Greg Gagne, Westminster College of Salt Lake City Salt Lake City, Utah

  • Conference Article
  • Cite Count Icon 13
  • 10.1109/ipdps.2003.1213262
Formal specification of Java concurrency to assist software verification
  • Apr 22, 2003
  • B Long + 1 more

The Java programming language is a modem object-oriented language that supports concurrency. Ensuring concurrent programs are correct is difficult. Additional problems encountered in concurrent programs, compared with sequential programs, include deadlock, livelock, starvation, and dormancy. Often these problems are related and are sometimes side effects of one another Furthermore, different programming languages attach different meanings to these terms. Sun Microsystems provides a textual description of the Java concurrency model which is inadequate for reasoning with such programs. Formal specifications are required for verifying concurrent programs through the use of tools and methods such as static analysis, dynamic analysis, model-checking, and theorem proving. It is clear that the behaviour of the Java concurrency model must be unambiguous and well-understood for these tools to operate effectively. This paper presents a formal specification of the Java concurrency model using the Z specification language. A number of important correctness properties of concurrent programs are constructed from the model, and their application to the implementation of verification and testing tools for concurrent Java programs is discussed.

  • Research Article
  • 10.12694/scpe.v4i2.230
Concurrent Programming:The Java Programming Language
  • Mar 1, 2001
  • Scalable Computing Practice and Experience
  • Greg Gagne

Stephen J. Hartley Oxford University Press, New York, 1998, 260 pp. ISBN 0-19-511315-2, $45.00 Concurrent Programming is a thorough treatment of Java multi-threaded programming for both a stand-alone and distributed environment. Designed mostly for students in concurrent or parallel programming classes, the text is also an excellent reference for the practicing professional developing multi-threaded programs or applets. Hartley first provides a complete explanation of the features of Java necessary to write concurrent programs, including topics such as exception handling, interfaces, and packages. He then gives the reader a solid background to write multi-threaded programs and also presents the problems introduced when writing concurrent programs—namely race conditions, mutual exclusion, and deadlock. Hartley also provides several software solutions that do not require the use of common process and thread mechanisms. Once the groundwork is laid for writing concurrent programs, Hartley then takes a different approach than most Java references. Rather than presenting how Java handles mutual exclusion with the synchronized keyword (although it is covered later), he first looks at semaphore-based solutions to classic concurrent problems such as bounded-buffer, readers-writers, and the dining philosophers. Hartley also uses the same approach to develop Java classes for monitors and message passing. This unique approach to introducing concurrency allows the readers to both understand how Java threads are synchronized and how the basic synchronization mechanism can be used to construct more abstract tools such as semaphores. If there is a shortcoming with the text it is with the lack of sufficient coverage of remote method invocation (RMI), although there is a section covering RMI. This is quite understandable as RMI is a fairly recent phenomenon with the Java community. Also, the classes that Hartley provides could easily implement RMI rather than sockets to handle communication. The strengths of the book include its ease in reading, several examples at the end of chapters, a package similar to Xtango that provides algorithm animation, and a supportive web site by the author (see www.mcs.drexel.edu/~shartley/ConcProgJava/index.html ) including compressed source code. As Java becomes more dominant on the server side of multi-tier applications, writing thread-safe concurrent applications becomes even more important. Concurrent Programming is a strong step towards teaching students and professionals such skills. Greg Gagne, Westminster College of Salt Lake City Salt Lake City, Utah

  • Research Article
  • Cite Count Icon 3
  • 10.1177/1063293x20958932
A survey of concurrency-oriented refactoring
  • Oct 8, 2020
  • Concurrent Engineering
  • Yang Zhang + 2 more

Refactoring has become an effective approach to convert sequential programs into concurrent programs. Many refactoring algorithms and tools are proposed to assist developers in writing high-performance concurrent programs. Although researchers actively conduct surveys on refactoring, we are not aware of any survey that summarizes, categorizes and discusses concurrency-oriented refactoring. To this end, this paper presents a survey that investigates how refactoring assists with concurrent programming. To the best of our knowledge, this paper is the first survey that summarizes the state-of-the-art, concurrency-oriented refactoring. First, we design six research questions addressing the concurrent structure, programming language, performance improvement and consistency evaluation. Second, we answer these questions by examining the related papers and then present the results to show how refactoring provides support for concurrent programming after a decade of development, such as transforming the concurrent structures, supporting parallel language, and improving performance. Finally, we summarize the related works and present the future trends.

  • Single Book
  • Cite Count Icon 578
  • 10.7551/mitpress/2086.001.0001
Concurrent Constraint Programming
  • Mar 22, 1993
  • Vijay A Saraswat

Concurrent Constraint Programming introduces a new and rich class of programming languages based on the notion of computing with partial information, or constraints, that synthesize and extend work on concurrent logic programming and that offer a promising approach for treating thorny issues in the semantics of concurrent, nondeterministic programming languages. Saraswat develops an elegant and semantically tractable framework for computing with constraints, emphasizing their importance for communication and control in concurrent, programming languages. He describes the basic paradigm, illustrates its structure, discusses various augmentations, gives a simple implementation of a concrete language, and specifies its connections with other formalisms. In this framework, concurrently executing agents communicate by placing and checking constraints on shared variables in a common store. The major form of concurrency control in the system is through the operations of Atomic Tell—an agent may instantaneously place constraints only if they are consistent with constraints that have already been placed—and Blocking Ask—an agent must block when it checks a constraint that is not yet known to hold. Other operations at a finer granularity of atomicity are also presented. Saraswat introduces and develops the concurrent constraint family of programming languages based on these ideas, shows how various constraint systems can naturally realize data structures common in computer science, and presents a formal operational semantics for many languages in the concurrent constraint family. In addition, he provides a concrete realization of the paradigm on a sequential machine by presenting a compiler for the concurrent constraint language Herbrand and demonstrates a number of constraint-based concurrent programming techniques that lead to novel presentations of algorithms for many concurrent programming problems.

  • Single Report
  • 10.21236/ada300868
Object-Oriented Design and Specification.
  • Dec 31, 1994
  • Jose Meseguer

: This final report summarizes the research performed for the Office of Naval Research under Contract N00014-90-C-0086 on the topic Object-Oriented Design and Specification. The project began on 1 January 1990 and ended on 31 December 1994. Dr. Jose Meseguer was the project leader. Drs. Patrick Lincoln, and Narciso Martf-Oliet and Mr. Timothy Winkler also worked on the project. Early in the project, an important breakthrough took place with the discovery of rewriting logic, which was then further developed 25, 23, 26. Rewriting logic has proved to be a very flexible multiparadigm logic 27 of great simplicity allowing the unification of equational programming, Horn logic programming, object-oriented programming, and concurrent programming. In particular, a very simple semantics can be given in rewriting logic to concurrent object-oriented programming 24, 29, 28 and to object- oriented databases 33. This is particularly encouraging given that concurrent object-oriented programming and object-oriented databases are disciplines generally considered to lack a precise semantics . Encouraged by these results, a preliminary language design for Maude, a wide-spectrum multiparadigm language based on rewriting logic and containing a subset called Simple Maude that can be efficiently compiled onto a wide variety of parallel machines has been developed 34, 27, 30, 28, 17; and very encouraging experience about its suitability for specifying concurrent systems, AI problems, programming languages, and logics has been gathered 30, 20, 21, 32, 22. In addition, some initial progress has been made on transformation and compilation techniques for the Simple Maude parallel programming sublanguage 17,18.

  • Conference Article
  • Cite Count Icon 11
  • 10.1109/apsec.2001.991458
A run-time deadlock detector for concurrent Java programs
  • Dec 4, 2001
  • Y Nonaka + 1 more

Deadlock is one of the most serious and complex problems concerning the reliability of concurrent Java programs. In this paper, we discuss how to dynamically detect deadlocks in concurrent Java programs at run-time, and propose a representation of synchronization waiting state in an execution of a Java program, which is named the Java thread-wait-for graph. We explicitly define all types of deadlocks in Java with this representation and present an algorithm to detect the deadlocks. Two implementation methods are also presented. We succeeded in detecting a deadlock from a concurrent program, including all types of synchronization waiting relations, using our tool.

Save Icon
Up Arrow
Open/Close