Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Let's say I have this piece of PROMELA code

active proctype A(){

   do
      :: !x -> break
      :: else -> skip
   od

   … //more code
}


What exactly does break and skip do in this instance? Does break break out the whole process A() so that "more code" wouldn't be reached or just the loop?

What I have tried:

Researched the net but it still isn't very clear to me.
Posted
Updated 3-Dec-18 1:36am

How is it you could not find Concise Promela Reference[^]? Both (and all other statements) are clearly explained.
 
Share this answer
 
Comments
Member 14075527 3-Dec-18 7:50am    
Thank you. I was reading that but like I said it wasn't 100% clear to me as my mother tongue is not english. Do I understand it right if I say that the break statement can only break out of the loop or in this case the do-repitation and not the entire proctype? And the skip doesn't really do anything?
Richard MacCutchan 3-Dec-18 8:31am    
Yes, that is correct.
[no name] 3-Dec-18 7:51am    
+5. What a funny language: "Skip: Has no effect and is mainly used to satisfy syntactic requirements". So a "high level NOP" :-)
Member 14075527 3-Dec-18 7:52am    
What do they mean by syntactic requirements?
[no name] 3-Dec-18 7:57am    
Maybe this helps: Promela Reference -- skip(1)[^]

and this: An Overview of PROMELA | Types of Objects | InformIT[^]

Have a look to the while(a!=b) example in the second link. This should explain the use of skip. It Looks also that mostly you can rewrite the code to avoid skip
Quote:
What exactly is the difference between skip and break in PROMELA?

This is probably not the best place to ask.
Why don't you ask the makers ?
Why don't you read documentation ?
Why don't you ask in a users forum ?
Why don't you try to use debugger to see what ir going on ?
 
Share this answer
 
Comments
Member 14075527 3-Dec-18 7:15am    
I researched but it still isn't clear to me. The users forum doesn't accept new members.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900