epistemic-group-gossip-0.1.0.0
Copyright(c) Jesper Kuiper 2021
Leander van Boven 2021
Ramon Meffert 2021
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

GossipState

Description

 
Synopsis

State type

data State Source #

The gossip state.

Constructors

State 

Fields

printState :: State -> Bool -> IO () Source #

Prints the current state.

Call validation and execution

validCalls :: GossipGraph -> ([Call], [GroupCall]) Source #

Determines based on the current GossipGraph state which calls are actually allowed to be made. Note that no protocols are used for this, a call between a and b is valid iff a knows the number of b.

makeCall :: Call -> State -> State Source #

Makes a call and update the state.

executeCalls :: [Call] -> State -> IO State Source #

Makes multiple calls by repeatedly invoking makeCall.

Epistemic formula evaluation

evaluateGossipAtom :: State -> GossipAtom -> Bool Source #

Evaluates a gossip atom (N(x,y), S(x,y) or C(x,y)), given the current state

evaluateBddVar :: State -> Int -> Bool Source #

Evaluates a Bdd variable as Int, given the current state

evaluate :: State -> Form -> Bool Source #

Evaluates an epistemic formula, given the current state

(|=) :: State -> Form -> Bool infix 9 Source #

An infix operator of the evaluate function.

Legacy

evaluate' :: State -> GossipForm -> Bool Source #

Legacy method, evalute a GossipFormula (note, without knowledge) by naive recursion