Giter Site home page Giter Site logo

gomoche's Introduction

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

gomoche's People

Contributors

m4lvin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

leopoulson

gomoche's Issues

wrong epistAlt results in ASync version

The definition of epistAlt for the asyncrhonous setting contains sequences which should not be considered.

λ> totalBound 
5
λ> mapM_ (\(_,_,s) -> putStrLn (charSequence  s)) $ epistAlt 0 (wlog anyCall) (ASync, totalInit 4, parseSequence "ab;bc;cd;ad;ab")
ab;cd;ad;ab
cd;ab;ad;ab
ab;bc;bd;ad;ab
ab;bc;cd;ad;ab
ab;bd;cd;ad;ab
ab;cd;ad;ab;bc
ab;cd;ad;ab;bd
ab;cd;ad;ab;cd
ab;cd;ad;bc;ab
ab;cd;ad;bd;ab
ab;cd;ad;cd;ab
ab;cd;bc;ad;ab
ab;cd;bd;ad;ab
ab;cd;cd;ad;ab
cd;ab;ad;ab;bc
cd;ab;ad;ab;bd
cd;ab;ad;ab;cd
cd;ab;ad;bc;ab
cd;ab;ad;bd;ab
cd;ab;ad;cd;ab
cd;ab;bc;ad;ab
cd;ab;bd;ad;ab
cd;ab;cd;ad;ab
cd;cd;ab;ad;ab
λ> knowledgeOverview (ASync, totalInit 4, parseSequence "ab;bc;cd;ad;ab") (wlog anyCall)
    a           b           c           d     
ab  ab         ab           c           d     
bc  ab         abc        abc           d     
cd  ab         abc        abcd   CD  abcd   CD
ad  abcd A  D  abc        abcd   CD  abcd A CD
ab  abcd AB D  abcd AB    abcd   CD  abcd A CD
λ> knowledgeOverview (ASync, totalInit 4, parseSequence "cd;ab;ad;ab") (wlog anyCall)
    a           b           c           d     
cd  a           b           cd         cd     
ab  ab         ab           cd         cd     
ad  abcd A  D  ab           cd       abcd A  D
ab  abcd AB D  abcd AB      cd       abcd A  D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.