Questions tagged [promela]

Process/Protocol Meta Language is a verification modelling language used to verify the logic of parallel systems.

PROMELA is a process modeling language whose intended use is to verify the logic of parallel systems. Given a program in PROMELA, Spin can verify the model for correctness by performing random or iterative simulations of the modeled system's execution, or it can generate a C program that performs a fast exhaustive verification of the system state space. During simulations and verifications SPIN checks for the absence of deadlocks, unspecified receptions, and unexecutable code. The verifier can also be used to prove the correctness of system invariants and it can find non-progress execution cycles. Finally, it supports the verification of linear time temporal constraints; either with Promela never-claims or by directly formulating the constraints in temporal logic. Each model can be verified with Spin under different types of assumptions about the environment. Once the correctness of a model has been established with Spin, that fact can be used in the construction and verification of all subsequent models.

PROMELA programs consist of processes, message channels, and variables. Processes are global objects that represent the concurrent entities of the distributed system. Message channels and variables can be declared either globally or locally within a process. Processes specify behavior, channels and global variables define the environment in which the processes run.

via: Wikipedia

159 questions
1
vote
2 answers

Multiple Repeat..Until in Promela Spin

How can I write the following code in Promela: I tried the following but I do not think that it is correct: int c0 = 0; int d1 = 0; int d2 = 0; do :: true -> d1 = x1; d2 = x2; if :: (c0 == c) -> …
Jan
  • 747
  • 1
  • 10
  • 29
1
vote
1 answer

Get clang/llvm parser from yacc parser

I'm trying to build a parser for Promela in llvm. I have the parser SPIN uses, which is built using yacc, including the input that goes to yacc. Is there a way to use the yacc parser to quickly and painlessly generate a clang/llvm parser? I will be…
Brishna Batool
  • 445
  • 3
  • 15
1
vote
1 answer

How to check for an arbitrary condition in a message queue in Spin?

I'm trying to simulate the behaviour of other model-checkers using Spin. For that, I need to be able to test for some arbitrary condition in the message queue. For instance, I want to check if somewhere in the channel there exists some message with…
1
vote
1 answer

What does error: sensing to an uninitialized chan mean in ispin?

ispin is generating this message on the progress window (the mid bottom screen on the simulate tab): Error: sending to an uninitialized chan The weird thing is that the error message starts to appear in the middle of the simulation (I set the…
Moon
  • 31
  • 2
1
vote
1 answer

Promela randomly select two elements at the same time

Recently I started learning Promela and I want to model picking two balls from box where I have 10 black balls and 4 white balls, I can model box as array, but I have no idea how to select 2 balls at the same time. Picking one and then another one…
1
vote
1 answer

Promela: Why is not this atomic block equivalent to an assignment statement?

I wrote following Promela code. This code simulates the situation where two processes increment a shared counter. I expected the assert in the code must be true, but SPIN says "assertion violated". Strangely, when I replaced the atomic block with…
Yusuke NOJIMA
  • 255
  • 1
  • 7
1
vote
1 answer

How to change the order of the messages in a channel?

I have this code need to amend so that the channels can reorder the messages and I have to add mechanism to cope with this chan linkA = [10] of {byte}; chan linkB = [10] of {byte}; proctype sender () { byte n; do :: n<10 -> linkA!n*n;…
MANAL
  • 29
  • 1
  • 10
1
vote
1 answer

Promela model with spin - duplicate message and corrupt message

I have this promela code and I need to model message duplication and message corruption and also I need to add mechanisms to detect and cope with corrupted messages and duplicates message from my reading, I found that I need to add new processes…
Memo
  • 53
  • 6
1
vote
1 answer

When to use semaphore locks / unlocks vs. wait / notify?

I'm learning Promela and using SPIN to model some examples I found. This model involves a food ordering simulation. So the customer orders, cashier takes order, sends to server, back to customer etc. Here is a flow of the program. The specific…
ritter
  • 13
  • 5
1
vote
1 answer

SPIN assert not triggered

I am trying to understand why the assert in this model isn't triggered. ltl { !A@wa U B@sb && !B@wb U A@sa } byte p = 0 byte q = 0 int x = 0 inline signal(sem) { sem++ } inline wait (sem) { atomic { sem > 0 ; sem-- } } proctype A() { x =…
isekaijin
  • 19,076
  • 18
  • 85
  • 153
1
vote
1 answer

Spin model checker - Error: memory exhausted because of yacc stack size

I have created a rather large Promela model (2362 states, with a total of 29592 transitions among them) and I wish to verify an LTL property of the underlying system. The model is all defined in one process as follows: int state=1; bool p1a=true,…
ada
  • 31
  • 4
1
vote
1 answer

How to join processes in Promela?

I'm making a model with Promela and I need to wait 2 processes to end in order to continue. How can I achieve that with Promela?
Rafael Marinho
  • 100
  • 1
  • 10
1
vote
1 answer

Traffic light spin

First I need to say Im very new on this and I have to do a semaphore with some conditions. We will only model one traffic light per each direction (the second one just repeats the same behaviour). For instance, in the picture above, the vertical…
Urkidy
  • 97
  • 9
1
vote
1 answer

Process not terminated causing a "too many processes" error

It is my first time using spin and I am encountering an error that I do not understand. I am aware that the processes terminates in the same order they are created thus I don't understand why the process of the function I call in a loop does not…
guillau4
  • 177
  • 9
1
vote
1 answer

what is unconditional self loop in promela?

I am working on a project which involves SPIN Model checker.SPIN version 6.4.7 and ispin version 1.1.4 I am getting this error on ispin saying state 76: unconditional self loop proctype TDMAProtocol(byte id; chan P1, P2, PR) 54 { 55 …
Neha
  • 753
  • 1
  • 5
  • 18