Poor use of 'else' in combination with i / o, saw ';' next to "if"

Below is the code causing this.

        if 
            :: ((fromProc[0] == MSG_SLEEP) && nempty(proc2clk[0])) -> 
              proc2clk[0] ? fromProc[0]; // Woke up
            :: (!(fromProc[0] == MSG_SLEEP) && !(fromProc[0] == MSG_FIN)) ->
              clk2proc[0] ! 0;  
            ::else -> 
              time = time + 1; // just for debugging
        fi; 

If I remove the nonempty call in the first condition, the error will disappear. From what I read, you cannot use the else statement if you use the receive or send statement in state, but from what I know, non-empty is not a send or receive operator, but just check if the channel is empty. So what kind of mistake am I making, and how can I solve it.

+3
source share
1 answer

, , , Spin else if, , nempty(), if !nempty(), . :

if
:: (p1) ->
:: (p2) ->
:: else -> … 
if

if
:: (p1) ->
:: (p2) ->
:: (!p1 && !p2) ->if

p1 p2 full(), nfull(), empty() nempty(), !p1 !p1 / , . . Www.spinroot.com .

, else , , , . , :

if
:: a == b && nempty(q) -> …
:: else
fi

else ( ):

!(a==b &&  nempty(q))   => DeMorgan Laws
 (a!=b || !nempty(q))   
 (a!=b ||  empty(q))

, , !nempty() "":

if
:: a == b && nempty(q) -> …
:: a != b ||  empty(q))-> …
fi

, "" else . , .

+7

All Articles