smcdel-1.3.0: Symbolic Model Checking for Dynamic Epistemic Logic
Safe HaskellSafe-Inferred
LanguageHaskell2010

SMCDEL.Other.MCTRIANGLE

Description

This module implements an alternative representation of the Muddy Children, as proposed in:

The main idea is to not distinguish individual children who are in the same state which also means that their observations are the same. Sections of Pascal's triangle can then be used to solve the Muddy Children puzzle in a Kripke model with less worlds than needed in the classical analysis, namely \(2n+1\) instead of \(2^n\) for \(n\) children.

Synopsis

Documentation

data Kind Source #

A child can be muddy or clean.

Constructors

Muddy 
Clean 

type State = (Int, Int) Source #

States are pairs of integers indicating how many children are (clean,muddy).

data McModel Source #

A muddy children model consists of three things: A list of observational states, a list of factual states and a current state.

Constructors

McM [State] [State] State 

Instances

Instances details
Show McModel Source # 
Instance details

Defined in SMCDEL.Other.MCTRIANGLE

mcModel :: State -> McModel Source #

Create a muddy children model

posFrom :: McModel -> State -> [State] Source #

Get the available successors of a state in a model

obsFor :: McModel -> Kind -> State Source #

Get the observational state of an agent

posFor :: McModel -> Kind -> [State] Source #

Get all states deemed possible by an agent

type Quantifier = State -> Bool Source #

Note that instead of naming or enumerating agents we only distinguish two Kind`s, the muddy and non-muddy ones, represented by Haskells constants Muddy` and Clean` which allow pattern matching.

Quantifiers on the number triangle, e.g. some.

some :: Quantifier Source #

The "some" quantifier.

data McFormula Source #

The paper does not give a formal language definition, so here is our suggestion: \[ \phi ::= \lnot \phi \mid \bigwedge \Phi \mid Q \mid K_b \mid \overline{K}_b \] where $Phi$ ranges over finite sets of formulas, $b$ over ${0,1}$ and $Q$ over generalized quantifiers. Note that when there are no agents of kind `b, the formulas `KnowSelf b` and `NotKnowSelf b` are both true. Hence `Neg (KnowSelf b)` and `NotKnowSelf b` are not the same!

nobodyknows :: McFormula Source #

Formula for ``Nobody knows their own state.''

everyoneKnows :: McFormula Source #

Formula for ``Everybody knows their own state.''

eval :: McModel -> McFormula -> Bool Source #

Note that in contrast to the standard DEL language the formulas are independent of how many children there are. This is due to our identification of agents with the same state and observations.

The semantics for the minimal language. The four nullary knowledge operators can be thought of as ``All agents who are (not) muddy do (not) know their own state.'' Hence they are vacuously true whenever there are no such agents. If there are, the agents do know their state iff they consider only one possibility (i.e. their observational state has only one successor).

mcUpdate :: McModel -> McFormula -> McModel Source #

Update models with a formula:

step :: State -> Int -> McModel Source #

Compute the n-th step of the puzzle, given an actual state.

showme :: State -> IO () Source #

Show all steps of the puzzle, given an actual state.