Changes between Version 6 and Version 7 of Function_Contracts


Ignore:
Timestamp:
01/18/16 20:36:18 (10 years ago)
Author:
zmanchun
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Function_Contracts

    v6 v7  
    1515depends: 'depends' e (',' e)* ';' ;
    1616...
    17 behavior: 'behavior' id ':' behaviorBody ;
     17behavior: 'begin behavior' id ':' behaviorBody 'end behavior';
    1818behaviorBody: behaviorClause+;
    1919behaviorClause: assumes | requires | simple ;
     
    2727fun[atomic] sendRecv(Int cmd, Pointer buf): Integer
    2828  reads deref(buf);
    29   behavior send:
     29  begin behavior send:
    3030    depends writes(buf);
    3131    assigns nothing;
    32   behavior receive:
     32  end behavior
     33  begin behavior receive:
    3334    depends access(deref(buf));
    3435    assigns deref(buf);
     36  end behavior
    3537{
    3638  begin choose
     
    6769 * Note: `guards`, `depends` and `reads` are CIVL extension for ACSL
    6870* named behavior:
    69  * `behavior id : c0; c1; c2; ...`, where `id` is the name of this behavior, `c0, c1, c2, ...` are behavior clauses
     71 * `begin behavior id : c0; c1; c2; ... end behavior`, where `id` is the name of this behavior, `c0, c1, c2, ...` are behavior clauses
    7072 * behavior clause: a clause that can be used in the body of a behavior, and could be one of the following:
    7173  * assumes clause
     
    110112fun[atomic] sendRecv(Int cmd, Pointer buf): Integer
    111113  reads deref(buf);
    112   behavior send:
     114  begin behavior send:
    113115    depends writes(buf);
    114116    assigns nothing;
    115   behavior receive:
     117  end behavior
     118  begin behavior receive:
    116119    depends access(deref(buf));
    117120    assigns deref(buf);
     121  end behavior
    118122{
    119123  begin choose