module LAI15 where 

import List
import Char
import LAI9
import LAI10
import LAI11
import LAI12
import LAI13
import LAI14

hexa :: EpistM State 
hexa = Mo
       [0..5] [a..c]
       [(0,[P 1, Q 2, R 3]),(1,[P 1, R 2, Q 3]),
        (2,[Q 1, P 2, R 3]),(3,[Q 1, R 2, P 3]),
        (4,[R 1, P 2, Q 3]),(5,[R 1, Q 2, P 3])]
       ([(ag,x,x) | ag <- [a..c], x  <- [0..5]]
         ++ [(a,0,1),(a,1,0),(a,2,3),
             (a,3,2),(a,4,5),(a,5,4)]
         ++ [(b,0,5),(b,5,0),(b,1,3),
             (b,3,1),(b,2,4),(b,4,2)]
         ++ [(c,0,2),(c,2,0),(c,1,4),
             (c,4,1),(c,3,5),(c,5,3)])
       [0]

q1,q2,q3,r1,r2,r3 :: Form 
q1 = Prop (Q 1); q2 = Prop (Q 2); q3 = Prop (Q 3)
r1 = Prop (R 1); r2 = Prop (R 2); r3 = Prop (R 3)

showABp :: FAM State
showABp = \ ags -> 
 Am [0,1] ags pre susp [0] 
  where
    pre = [(0,p1),(1,q1)] 
    susp = [(a,0,0),(a,1,1),(b,0,0),(b,1,1),
            (c,0,0),(c,0,1),(c,1,0),(c,1,1)]

reveal :: [Agent] -> [Form] -> FAM State
reveal gr forms ags =
   Am 
   states ags pre 
   ([ (ag,s,s) | s <- states, ag <- gr ]
     ++
    [ (ag,s,s') | s <- states, s' <- states, 
                  ag <- others ])
   states
     where pre    = zip [0..] forms
           states = map fst pre 
           others = ags \\ gr

revealBpqr :: FAM State
revealBpqr = reveal [b] [p1,q1,r1]

hexa2 = upd hexa revealBpqr


