source: CIVL/examples/languageFeatures/atomicStatement.cvl@ 90dd7d7

1.23 2.0 main test-branch
Last change on this file since 90dd7d7 was 90dd7d7, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

corrected indentation.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@423 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 374 bytes
RevLine 
[2c448829]1$input int B;
2$input int N;
3$assume 0<N && N<B;
[d410676]4int n = 3;
[9705dfd]5
6void main(){
[2c448829]7 int x;
[9705dfd]8
[2c448829]9 $atomic{
[90dd7d7]10 $when(n > 1) n = 3;
11
12 $atomic{
13 x = N;
14 x = x * 2;
15 }
16 $assert x == 2*N;
17 // non-determinism allowed in $atomic block
18 $atomic{
19 x = 3;
20 $choose {
21 $when (n>2) { x=2; }
22 $when (n>1) { x=1; }
23 default: {x=0; }
24 }
[9705dfd]25 }
[90dd7d7]26 $assert (x == 2 || x == 1);
[9705dfd]27 }
28}
Note: See TracBrowser for help on using the repository browser.