Next: Specification logic, Previous: C code, Up: Introduction to CINV
The Spl language is the input language of the Interproc tool Jeannet. Since Spl deals only with numeric (integer or real) variables, we encode our programs on lists as follows:
intlist
are coded by real variables.
LSUM-PRD
domain LSUM-PRD.
_data
, _free
, _len
, _new
, _next
, and _null
.
They are used to encode operations on list variables, e.g., the data
field access for a list variable x
, x->data
, is encoded by the expression x*_data
. Similarly, the _next
variable is used to encode the next
field access.
The _free
(resp. _new
) variable is used to encode the free
(resp. new
) statement for the memory deallocation (resp. allocation) of pointers.
The _len
variable cannot be used for the moment.
The _null
variable encodes the predefined NULL
constant in C.
x
, x->data
, and x->next
, and
the statements have as left hand side one of the terms above and when terms
x
and x->next
are assigned, they have to be NULL
.
x->data
encoded by x*_data
.
To encode such assignments we use the divisibility operation on reals, i.e.,
x->field=expr
is encode by x=expr/field
.
assume
statement of the form assume(x==<code>);
with the following semantics: