Skip to content
/ GoMoChe Public

🗣️📞 Gossip Model Checking

License

Notifications You must be signed in to change notification settings

m4lvin/GoMoChe

Repository files navigation

GoMoChe - Gossip Model Checking

CI status Gitpod Ready-to-Code

A Haskell tool to analyse (dynamic) gossip protocols, including an epistemic model checker.

Getting Started

Option A: For a quick try-out, click here to use GoMoChe in your browser via GitPod, wait and use the terminal there.

Option B: To use GoMoChe locally, you need the Haskell Tool Stack. Then do stack build and stack ghci inside this folder.

Usage Examples

List all call sequences permitted by the protocol lns on the graph threeExample defined in the module Gossip.Examples:

GoMoChe> mapM_ print $ sequences lns (threeExample,[])
[(0,1),(0,2),(1,2)]
[(0,1),(1,2),(0,2)]
[(0,1),(2,1),(0,2)]
[(1,2),(0,1)]
[(2,1),(0,1)]

Count how many of these call sequences are successful and unsuccessful:

GoMoChe> statistics lns (threeExample,[])
(3,2)

The same, for another gossip graph given in short notation:

GoMoChe> statistics lns (parseGraph "01-12-231-3 I4",[])
(57,20)

Evaluate a formula at a gossip state:

GoMoChe> eval (threeExample,[(0,1)]) (S 1 0)
True
GoMoChe> eval (threeExample,[(0,1)]) (S 1 2)
False
GoMoChe> eval (threeExample,[(0,1)]) (K 2 anyCall (S 1 0))
True
GoMoChe> eval (threeExample,[(0,1)]) (K 2 lns (S 1 0))
True
GoMoChe> eval (threeExample,[(0,1),(1,2)]) (S 0 2)
False
GoMoChe> eval (threeExample,[(0,1),(1,2)]) (S 2 0)
True

If you have graphviz installed, you can visualize gossip graphs like this:

GoMoChe> dispDot $ diamondExample

Also execution trees can be visualized, for example:

GoMoChe> dispTreeWith [2] 2 1 lns (tree lns (nExample,[]))

Note: In GitPod, use pdf and pdfTreeWith instead of dispDot and dispTreeWidth.

Tests

The file test/results.hs contains a test suite that also covers most examples. You can run it with stack clean; stack test --coverage.

References

Other Tools