-- prize.csp
--
-- Simon Gay, Royal Holloway, January 1999
--
--
MAIN = SYSTEM

channel year1, year2, year3, pass, fail, graduate, present, prize

S = {| year1, year2, year3, pass, fail, graduate |}

P = {| pass, present |}

C = {| pass, fail, prize |}

STUDENT = year1 -> (pass -> YEAR2 [] fail -> STUDENT)

YEAR2 = year2 -> (pass -> YEAR3 [] fail -> YEAR2)

YEAR3 = year3 -> (pass -> graduate -> STOP [] fail -> YEAR3)

PARENT = pass -> present -> PARENT

COLLEGE = fail -> STOP [] pass -> C1

C1 = fail -> STOP [] pass -> C2

C2 = fail -> STOP [] pass -> prize -> STOP

SYSTEM = (STUDENT [ S || P ] PARENT) [ union(S,P) || C ] COLLEGE

-- Trace Check Generated by ProB:
PROB_TEST_TRACE = year1 -> pass -> year2 -> present -> pass -> year3 -> present -> pass -> graduate -> prize -> present -> STOP

assert MAIN [T= PROB_TEST_TRACE


-- ProB State Space Encoded for FDR in CSP
--

assert MAIN [FD= PROB_STATE_SPACE
assert PROB_STATE_SPACE [FD= MAIN

PROB_STATE_SPACE = N32


N32 = year1->N33


N33 = fail->N34
 [] pass->N35


N34 = year1->N36


N35 = year2->N37
 [] present->N38


N36 = STOP

N37 = present->N39
 [] fail->N40


N38 = year2->N39


N39 = fail->N42
 [] pass->N44


N40 = year2->N41
 [] present->N42


N41 = present->N43


N42 = year2->N43


N43 = STOP

N44 = year3->N45
 [] present->N46


N45 = present->N47
 [] fail->N50


N46 = year3->N47


N47 = fail->N48
 [] pass->N49


N48 = year3->N51


N49 = graduate->N52
 [] present->N53
 [] prize->N54


N50 = year3->N55
 [] present->N48


N51 = STOP

N52 = present->N56
 [] prize->N57


N53 = graduate->N56
 [] prize->N58


N54 = graduate->N57
 [] present->N58


N55 = present->N51


N56 = prize->N59


N57 = present->N59


N58 = graduate->N59


N59 = STOP

-- end of ProB Encoding
