File: for_example.pml

package info (click to toggle)
spin 6.4.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,136 kB
  • sloc: ansic: 39,791; yacc: 1,015; makefile: 40; sh: 8
file content (28 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
typedef m {
	bool b;
	int i;
	chan c;
}

init {
	m foo;
	chan x = [8] of { m };
	int i;

	foo.b = true;
	foo.i = 12;
	foo.c = x;
	x!foo;

	foo.b = false;
	foo.i = 10;
	foo.c = 0;
	x!foo; x!foo;

	i = 1;
	for (foo in x) {
		printf("%d: %d %d %d (len(x)=%d)\n",
			i, foo.b, foo.i, foo.c, len(x));
		i++
	}
}