A PROMELA application may be written in several different languages. It is typically designed for use with Java, using the Standard Library. However, there is also the option of using Prolog for a PROMELA program. Prolog programs are just as portable but require that an interpreter is used. Since Prolog is only available on UNIX-based systems, this is not a possibility with an interactive Java PROMELA program.
The standard library of PROMELA includes the following modules: modules for command validation, the specification of various command-line options, the definition of the different parallel processors, and an interface for programming the parallel processors. These modules also define several generic procedures which allow the programmers to define new parallel processors, as well as new command-line options. Many of these procedures are not part of Java and therefore will need to be written in another language.
Many people have found it difficult to get started with Promela programming. One of the main reasons for this is that the language is very abstract, requiring a great deal of background knowledge in computer science before it is even possible to get going. Fortunately, the language itself is very simple to learn, and anyone with a basic knowledge of computer science can write a basic program, but it is still important to be prepared to spend a considerable amount of time learning how the language works.
In order to become competent with the language of PROMELA, it is a good idea to acquire a working knowledge of the programming language C, and a working knowledge of Java. This will make it much easier to get a feel for how the parallel programming functions of the PROMELAs work. Once you have a basic working knowledge of these two languages, you should then be able to begin to work on developing a basic program. There is a wealth of information on the Internet about programming in PROMELAs, but the best information is available when programs are written in a simpler language.
To start with, it is important to understand the basic syntax of PROMELAs. A typical Promela program consists of a series of statements followed by a series of commands, called ‘jobs’. All statements in a single job are placed at the beginning of a job.
Each command can be executed sequentially or concurrently; either way, the results are guaranteed to be consistent with each other. If the first command completes, the job finishes, and its results are stored in the job’s return value. The job is said to be terminated, and the associated return value is the result of the job. Jobs are composed of a colon followed by a colon, followed by an equal sign, followed by a single or more commands.
The commands are not statements but are a series of procedures. They are written using a semicolon and followed by a command name, then by a colon, and finally followed by a colon and one or more arguments. The argument list is enclosed within braces. A semicolon connects the statement to the body of the command; the commas separate the commands into different jobs.