Download stanford pascal verifier user manual

Transcript
Appendix B
Parser Error Messages
VARIABLE MUST APPEAR IN GLOBAL STATEMENT PRECEDED BY V A R
You have tried to change the value of a global variable. When you do this in a procedure, you
must put the name of the variable (or reference class, for pointer changes) into a G L O B A L
statement VAR list. The VAR list is necessary only when values are changed; not merely
referenced. If the global is merely referenced, it need not be preceded by VAR (and will simplify
proof problems for you if it isn’t). GLOBAL statements are not permitted in functions; in that
case you may have to convert the function into a procedure which returns its value as a VAR
parameter.
A global variable appearing in an INITIAL statement must also appear in a GLOBAL
statement. The assumption is that changing the value of the global is intended; if the global is
not changed, merely use the global name in assertions and drop the INITIAL statement.
Note that reference classes of pointer types may be globals, and thus may have to appear in the
GLOBAL statement.
VAR PARAMETER MAY NOT HAVE EXPRESSION PASSED TO IT
You have tried to pass an expression to a procedure in a position where a VAR parameter was
declared. This is not permitted, as it is not defined what it means to store into such an entity in
Pascal. You can pass an expression to a non-VAR parameter, but of course, such expression will
be strictly an input value to the procedure. Note also that GLOBAL statements are not permitted
in functions, which may not have side effects. Thus, getting this syntax error within a function
can require re-writing the function as a procedure.
VISIBLE BASE TYPE NOT DEFINED WITHIN MODULE
A type name appearing in a BASETYPE statement must be fully specified within t h e m o d u l e . I t
must appear in a normal TYPE statement therein.
-
WAIT-FOR STMT REQUIRES CONDITION VAR AS PARAMETER
T o use a wait-for statement, there can be only one Pa rameter. It must be declared as a condition
v a r iable within the class (concurrent version only).
WAIT-FOR STMT REQUIRES APPROPRIATE DECLARATION WITHIN SCHEDULER
To use a wait. for statement, there must be a scheduler containing a procedure named wait-for.
Further, that scheduler must have exactly two parameters: the first of type CVLINK, the second
of type SCHEDPROCNAME (concurrent version only).
B-13
*