--> **************************************************************** --> QLOCK Simulation with Search Predicate --> **************************************************************** --> ---------------------------------------------------------------- --> require qlock-sys require qlock-sys --> ---------------------------------------------------------------- --> SIMbySearch --> ---------------------------------------------------------------- mod SIMbySearch { inc(QLOCKsys) ops b1 b2 b3 b4 b5 b6 : -> Aid . } --> ---------------------------------------------------------------- select SIMbySearch . --> ================================================================ --> search all reachable states with one agent red [empQ r b1 w empS c empS] =(*,*)=>* S:State . #| [ empQ r b1 w empS c empS ] [ b1 r empS w b1 c empS ] [ b1 r empS w empS c b1 ] |# --> ================================================================ --> search all reachable states with two agents red [empQ r (b1 b2) w empS c empS] =(*,*)=>* S:State . #| [ empQ r (b1 b2) w empS c empS ] [ b1 r b2 w b1 c empS ] [ b2 r b1 w b2 c empS ] [ b1 r b2 w empS c b1 ] [ b2 r b1 w empS c b2 ] [ (b1 | b2) r empS w (b2 b1) c empS ] [ (b2 | b1) r empS w (b1 b2) c empS ] [ (b1 | b2) r empS w b2 c b1 ] [ (b2 | b1) r empS w b1 c b2 ] |# --> ================================================================ --> search all reachable states with three agents red [empQ r (b1 b2 b3) w empS c empS] =(*,*)=>* S:State . #| [ empQ r (b1 b2 b3) w empS c empS ] [ b1 r (b2 b3) w b1 c empS ] [ b2 r (b1 b3) w b2 c empS ] [ b3 r (b1 b2) w b3 c empS ] [ b1 r (b2 b3) w empS c b1 ] [ b2 r (b1 b3) w empS c b2 ] [ b3 r (b1 b2) w empS c b3 ] [ (b1 | b2) r b3 w (b2 b1) c empS ] [ (b1 | b3) r b2 w (b3 b1) c empS ] [ (b2 | b1) r b3 w (b1 b2) c empS ] [ (b2 | b3) r b1 w (b3 b2) c empS ] [ (b3 | b1) r b2 w (b1 b3) c empS ] [ (b3 | b2) r b1 w (b2 b3) c empS ] [ (b1 | b2) r b3 w b2 c b1 ] [ (b1 | b3) r b2 w b3 c b1 ] [ (b2 | b1) r b3 w b1 c b2 ] [ (b2 | b3) r b1 w b3 c b2 ] [ (b3 | b1) r b2 w b1 c b3 ] [ (b3 | b2) r b1 w b2 c b3 ] [ (b1 | b2 | b3) r empS w (b3 b2 b1) c empS ] [ (b1 | b3 | b2) r empS w (b2 b3 b1) c empS ] [ (b2 | b1 | b3) r empS w (b3 b1 b2) c empS ] [ (b2 | b3 | b1) r empS w (b1 b3 b2) c empS ] [ (b3 | b1 | b2) r empS w (b2 b1 b3) c empS ] [ (b3 | b2 | b1) r empS w (b1 b2 b3) c empS ] [ (b1 | b2 | b3) r empS w (b3 b2) c b1 ] [ (b1 | b3 | b2) r empS w (b2 b3) c b1 ] [ (b2 | b1 | b3) r empS w (b3 b1) c b2 ] [ (b2 | b3 | b1) r empS w (b1 b3) c b2 ] [ (b3 | b1 | b2) r empS w (b2 b1) c b3 ] [ (b3 | b2 | b1) r empS w (b1 b2) c b3 ] |# --> ================================================================ --> check whether mutual exclusion property holds for --> all reachable states with 2 agents red not([empQ r (b1 b2) w empS c empS] =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . --> ================================================================ --> check whether mutual exclusion property holds for --> all reachable states with 3 agents red not([empQ r (b1 b2 b3) w empS c empS] =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . --> ================================================================ --> check whether mutual exclusion property holds for --> all reachable states with 4 agents red not([empQ r (b1 b2 b3 b4) w empS c empS] =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . --> ================================================================ --> check whether mutual exclusion property holds for --> all reachable states with 5 agents red not([empQ r (b1 b2 b3 b4 b5) w empS c empS] =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . --> ================================================================ --> check whether mutual exclusion property holds for --> all reachable states with 6 agents red not([empQ r (b1 b2 b3 b4 b5 b6) w empS c empS] =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . --> **************************************************************** --> end of file eof --> **************************************************************** --> ================================================================ open SIMbySearch . pred qlockSim_ : State . eq qlockSim S:State = not(S =(*,*)=>* [AQ:Aq r ASr:As w ASw:As c ASc:As] suchThat (not((ASc = empS) or (ASc :is Aid)))) . red qlockSim [empQ r (b1 b2 b3 b4) w empS c empS] . red qlockSim [empQ r (b1 b2 b3 b4 b5) w empS c empS] . -- red qlockSim [empQ r (b1 b2 b3 b4 b5 b6) w empS c empS] . close