view Samples/p105.2.pml @ 0:86e67be8bc5f draft

add some files
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Fri, 29 Jun 2012 01:14:43 +0900
parents
children
line wrap: on
line source

proctype fact(int n; chan p)
{	int result;
	chan child = [1] of { int };

	if
	:: (n <= 1) -> p!1
	:: (n >= 2) ->
		run fact(n-1, child);
		child?result;
		p!n*result
	fi
}
init
{	int result;
	chan child = [1] of { int };

	run fact(7, child);
	child?result;
	printf("result: %d\n", result)
}