A forum for Spin users
You are not logged in.
Pages: 1
It seems there is a problem with the spin interpreter and with iSpin (spin version 6.2.5)
Please note the following excerpt from a larger program:
//
#define p 1
#define q 2
#define r 4
byte i0205 = 0;
byte i0305 = p;
byte i0404 = 0;
byte i0405 = q;
byte i0505 = 0;
init {
do
:: ( ((i0404 & p) == p) && ((i0405 & r) != r) ) -> d_step{ i0404 = i0404 & (~p); i0405 = i0405 | p };
:: ( ((i0405 & p) == p) && ((i0404 & r) != r) ) -> d_step{ i0405 = i0405 & (~p); i0404 = i0404 | p };
:: ( ((i0305 & p) == p) && ((i0405 & r) != r) ) -> d_step{ i0305 = i0305 & (~p); i0405 = i0405 | p };
:: ( ((i0505 & p) == p) && ((i0405 & r) != r) ) -> d_step{ i0505 = i0505 & (~p); i0405 = i0405 | p };
:: ( ((i0405 & p) == p) && ((i0505 & r) != r) ) -> d_step{ i0405 = i0405 & (~p); i0505 = i0505 | p };
:: ( ((i0405 & p) == p) && ((i0305 & r) != r) ) -> d_step{ i0405 = i0405 & (~p); i0305 = i0305 | p };
:: ( ((i0305 & p) == p) && ((i0205 & r) != r) ) -> d_step{ i0305 = i0305 & (~p); i0205 = i0205 | p };
od;
}
Start the program from the command line with 'spin -i test.pml'.
You start in position 0305; there are 2 transitions enabled (OK).
Take choice 3; this brings you from position 0305 to position 0405.
Note that there are 3 transitions enabled now (OK).
Take choice 2: this brings you from position 0405 to 0404.
As there exists only one transition out of 0404 (back to 0405) the interpreter will proceed automatically to 0405.
However, there are now _4_ transitions enabled; 3 from 0405 (OK) one from 0404 (not OK).
The wrong transition probably is the one from the 0404 position you have just left, which is still enabled (try to take it).
When running the same program with iSpin in interpretative mode, one also sees 4 transitions being enabled.
When running in iSPin it seems that some "instruction pointer" in the interpreter is staying behind (the yellow line#).
Is it a bug, or is it a misinterpretation?
Regards, Kees Pronk
PS
I haven't checked if the verifyer works correctly on this example.
I had a difficulty when compilingthe new 6.2.0 version of spin on a 64-bit Linux system.
The difficulty was solved by putting "extern YYSTYPE yylval" at the beginning of the file "reprosrc.c" .
Strangely enough, the error did not occur on two Ubuntu systems.
Kees Pronk
=================================================================
Here is the compilation error:
yacc -v -d spin.y
gcc -c y?tab.c
rm -f y?tab.c
mv y?tab.o spin.o
gcc -O2 -DNXT -c -o spinlex.o spinlex.c
gcc -O2 -DNXT -c -o sym.o sym.c
gcc -O2 -DNXT -c -o vars.o vars.c
gcc -O2 -DNXT -c -o main.o main.c
gcc -O2 -DNXT -c -o ps_msc.o ps_msc.c
gcc -O2 -DNXT -c -o mesg.o mesg.c
gcc -O2 -DNXT -c -o flow.o flow.c
gcc -O2 -DNXT -c -o sched.o sched.c
gcc -O2 -DNXT -c -o run.o run.c
gcc -O2 -DNXT -c -o pangen1.o pangen1.c
gcc -O2 -DNXT -c -o pangen2.o pangen2.c
gcc -O2 -DNXT -c -o pangen3.o pangen3.c
gcc -O2 -DNXT -c -o pangen4.o pangen4.c
gcc -O2 -DNXT -c -o pangen5.o pangen5.c
gcc -O2 -DNXT -c -o guided.o guided.c
gcc -O2 -DNXT -c -o dstep.o dstep.c
gcc -O2 -DNXT -c -o structs.o structs.c
gcc -O2 -DNXT -c -o pc_zpp.o pc_zpp.c
gcc -O2 -DNXT -c -o pangen6.o pangen6.c
gcc -O2 -DNXT -c -o pangen7.o pangen7.c
gcc -O2 -DNXT -c -o reprosrc.o reprosrc.c
reprosrc.c: In function 'blip':
reprosrc.c:190: error: 'yylval' undeclared (first use in this function)
reprosrc.c:190: error: (Each undeclared identifier is reported only once
reprosrc.c:190: error: for each function it appears in.)
reprosrc.c: In function 'pretty_print':
reprosrc.c:341: error: 'yylval' undeclared (first use in this function)
make: *** [reprosrc.o] Error 1
Here is how "gcc -v" identifies itself:
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC)
==================================================================
When doing 'spin -a p3c.pml' on the following (not so useful) program, the spin compiler seems to hang.
bool p;
bool q;
bool z;
ltl p3c {p V q V z W q W q W z}
init{skip;}
Kees Pronk
// Problem detected while working on the Epispin environment
The following program, when translated with spin -a p7.pml
byte p;
byte q;
ltl p7 {p equivalent q}
ltl p7a {p <-> q}
init{skip;}
will give the following unexpected error message:
ltl p7: (p) <-> (q)
ltl p7a: (p) <-> (q)
spin: _spin_nvr.tmp:4, Error: syntax error saw ';'
spin: _spin_nvr.tmp:13, Error: syntax error saw ';'
spin: p7.pml:18, Error: proctype p7a not found
Kees
In the manual page on _pid it is stated:
_pid - a predefined, local, read-only variable ....
and
It is an error to attempt to assign a new value to this variable,
However, spin will happily accept the following program:
active proctype(){
_pid = _pid + 3;
}
init{
_pid = _pid * 2;
}
When I print the value of _pid before/after the assignment, I notice that the value has not changed which is OK semantically.
But that seems a bit different from "It is an error" ?
I am having the following (very stupid) program divzero.pml:
init{
int k;
k = k + 1;
k = k / 0;
skip;
}
When I work from the command prompt:
spin -a divzero.pml // is ok
gcc -w -o pan pan.c // is ok; BTW leaving out the -w will draw my attention to the error made
./pan // will report a floating point exception, which is OK.
However, when running from iSpin:
- the simulator is silent
- the verifier is silent; the only action I notice is that the processor load is increased.
So it seems exceptions are not propagated back into iSpin?
In the documentation on the never clause it is stated that
Almost all PROMELA constructs can be used inside a claim declaration.
The only exceptions are those statements that can have a side effect on the system state.
When compiling the following program
init{
int i;
}
never{
int k;
}
I get an error saying: error: never_0 defines local k
Well, a declaration is not a statement, but I can understand why it may not be allowed.
When we turn to the trace documentation, it is stated:
An event trace declaration may contain only ....
This means that no global or local variables can be declared or referred to.
This is much stricter that the never claim.
However, the following program is happily accepted by the compiler:
init{
int i;
}
trace{
int k;
}
Is there a problem/misunderstanding here?
As far as i understand things:
The second line in the grammar
range : varref ':' expr '..' expr
| varref ':' varref // this line may be deleted now
| varref IN varref
may now be deleted.
When I run ' spin -v for.pml' on the following program:
int i;
init{
for (i : 5 .. 8) {printf(" %d \n", i)}
};
Spin gives me the following , somewhat unexpected, warning:
spin -v for.pml
spin: warning, for.pml, global, 'int i' variable is never used
Kees
In [url]http://spinroot.com/spin/Man/for.html[/url] the second grammar line states that one should use the colon in the for statement for arrays:
for '(' varref ':' array ')' '{' sequence '}' .
However, the example given a little later shows that one should use the 'in' keyword.
int a[10];
for (i in a) {
printf("i = %d\n", i)
}
This problem is also in the grammar in [url]http://spinroot.com/spin/Man/grammar.html[/url] .
As an aside, the examples would be slightly more self-explanatory if they would show that one needs to declare the loop control variable.
Kees.
The problem mentioned is solved in the new ispin of Jan 4.
Hoewever, the source distribution (spin601.tar.gz) still contains the old version of ispin.
Kees
I'm having a problem with the new ispin:
When I load a promela program and start a verification I get the error message
invalid command name ".f.fVp.top.right.row0.ent"
invalid command name ".f.fVp.top.right.row0.ent"
while executing
"$t.top.right.row0.ent get"
(procedure "run_ver" line 67)
invoked from within
"run_ver .f.fVp "
invoked from within
".f.fVp.top.fourth.row6.go invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke]"
(procedure "tk::ButtonUp" line 22)
invoked from within
"tk::ButtonUp .f.fVp.top.fourth.row6.go"
(command bound to event)
The problem disappears if I open the "Show advanced parameter setting" window, and reoccurs when I close that window.
It seems the tcl-code cannot read from a closed window?
The problem occurs both on 64-bit Fedora Linux with Gnome and on a 64-bit Suse installation.
Kees
Pages: 1