view Samples/p104.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

#define N    128
#define size  16

chan inp   = [size] of { short };
chan large = [size] of { short };
chan small = [size] of { short };

proctype split()
{	short cargo;

	do
	:: inp?cargo ->
		if
		:: (cargo >= N) -> large!cargo
		:: (cargo <  N) -> small!cargo
		fi
	od
}
proctype merge()
{	short cargo;

	do
	::	if
		:: large?cargo
		:: small?cargo
		fi;
		inp!cargo
	od
}
init
{	inp!345; inp!12; inp!6777; inp!32; inp!0;
	run split(); run merge()
}