From 22312be09b0e1eb0d9de7c858b672d617246dc90 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 15 Oct 2015 12:40:19 +0200 Subject: Start working on UPPAAL assignment; finished(?) model --- uppaalassignment/dining_savages.xml | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 uppaalassignment/dining_savages.xml (limited to 'uppaalassignment/dining_savages.xml') diff --git a/uppaalassignment/dining_savages.xml b/uppaalassignment/dining_savages.xml new file mode 100644 index 0000000..7563fba --- /dev/null +++ b/uppaalassignment/dining_savages.xml @@ -0,0 +1,77 @@ +//This model is an adaptation by Camil Staps of +//an adaption by Frits Vaandrager of +//a model made by Martijn Hendriks + +// Number of processes in system: +const int N = 5; + +const int emptyPot = 0; +const int fullPot = 1; +const int mutex = 2; +const int nr_sem = 3; // nr. of semaphores + +int servings = 5; +const int max_servings = 5; + +// The channels to synchronize with the semafores +// A call semWait(s) by process p translates to a sequence of two transitions labeled with +// semWait(s)(p)! +// semGo(s)(p)? +//A call semSignal(s) by process p translates to a transition labeled with +// semSignal(s)(p)! +chan semWait[nr_sem][N], semGo[nr_sem][N], semSignal[nr_sem][N];EmptyPot = Semaphore(emptyPot, N-1, 0); +FullPot = Semaphore(fullPot, N-1, 0); + +cook = Cook(0); + +Mutex = Semaphore(mutex, 5, 1); +s1 = Savage(0); +s2 = Savage(1); +s3 = Savage(2); +s4 = Savage(3); + +system EmptyPot, FullPot, Mutex, cook, s1, s2, s3, s4; \ No newline at end of file -- cgit v1.2.3