36 lines
602 B
Promela
36 lines
602 B
Promela
|
#define N 10
|
||
|
#define LENGTH 3
|
||
|
#define R 2
|
||
|
|
||
|
|
||
|
init {
|
||
|
int to_reverse[LENGTH];
|
||
|
|
||
|
// array initialization
|
||
|
{
|
||
|
int i;
|
||
|
for (i in to_reverse) {
|
||
|
int value;
|
||
|
select(value: 0 .. R);
|
||
|
to_reverse[i] = value;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int reversed[LENGTH];
|
||
|
|
||
|
// sequential reverser
|
||
|
{
|
||
|
int from = 0;
|
||
|
int to = LENGTH ;
|
||
|
|
||
|
int k;
|
||
|
for (k: from..to) {
|
||
|
reversed[LENGTH - k - 1] = to_reverse[k];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ltl test {
|
||
|
eventually (false) implies true
|
||
|
// eventually (a > b) implies len(q) == 0
|
||
|
}
|