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

SMCDEL.Symbolic.S5

Description

In this module we define a symbolic represenation of Kripke models, called knoweldge structures. To represent Boolean functions we use the CacBDD library via the Haskell bindings HasCacBDD. An alternative to this module here is S5_CUDD which uses CUDD instead of CacBDD.

Synopsis

Boolean Reasoning

boolBddOf :: Form -> Bdd Source #

Translate a Boolean formula to a BDD. The function will raise an error if it is given an epistemic or dynamic formula.

boolEvalViaBdd :: [Prp] -> Form -> Bool Source #

Given a set of true atomic propositions, evaluate a Boolean formula.

bddEval :: [Prp] -> Bdd -> Bool Source #

Given a set of true atomic propositions, evaluate a BDD.

size :: Bdd -> Int Source #

Size of a BDD, also counting terminal nodes (which CacBDD does not).

relabelWith :: [(Prp, Prp)] -> Bdd -> Bdd Source #

Given a mapping between atomic propositions, relabel them inside a BDD.

Knowledge Structures

data KnowStruct Source #

Knowledge structures are a compact representation of S5 Kripke models. Their set of states is defined by a Boolean formula. Instead of accessibility relations we use observational variables. Formal proofs that knowledge structures are indeed equivalent to S5 Kripke models can be found in the references from the Readme.

A knowledge structure is a tuple \(\mathcal{F} = (V,\theta,O_1,\dots,O_n)\) where \(V\) is the vocabulary, a finite set of propositional variables, \(\theta\) is the state law, a Boolean formula over $V$ (represented as its BDD) and for each agent \(i\), we have observational variables \(O_i \subseteq V\).

Constructors

KnS [Prp] Bdd [(Agent, [Prp])] 

Instances

Instances details
Arbitrary KnowStruct Source #

Generating random knowledge structures for QuickCheck. -- FIXME: not showing up in Haddock?

Instance details

Defined in SMCDEL.Symbolic.S5

Show KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Eq KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble KnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble MultipointedKnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasAgents KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasVocab KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Methods

vocabOf :: KnowStruct -> [Prp] Source #

Optimizable KnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Optimizable KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Optimizable MultipointedKnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Semantics KnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Methods

isTrue :: KnowScene -> Form -> Bool Source #

Semantics KnowStruct Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Methods

isTrue :: KnowStruct -> Form -> Bool Source #

Semantics MultipointedKnowScene Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasPerspective MultipointedKnowScene Source #

We can also make perspective shifts symbolically. In the S5 setting we can exploit symmetry as follows. Suppose we have a multipointed scene $(F,sigma)$ where $sigma in Lng_B(V)$ encodes the set of actual states. As usual, we assume that agent $i$ has the observational variables $O_i$. Then the perspective of $i$ is given by: \[ \sigma^i := \exists (V \setminus O_i) \sigma \] On purpose we do not use $theta$ in order to avoid redundancy in the resulting multipointed scene.

Instance details

Defined in SMCDEL.Other.Planning

Pointed KnowStruct Bdd Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Pointed KnowStruct State Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowScene Form Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowScene Event Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowStruct Form Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowStruct KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update MultipointedKnowScene MultipointedEvent Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Convertable KnowScene BelScene Source #

Every knowledge structure is also a belief structure. We replace each \(O_i\) with \(\Omega_i := \bigwedge_{p \in O_i} (p \leftrightarrow p')\).

Instance details

Defined in SMCDEL.Translations.Convert

type State = [Prp] Source #

A state of \(\mathcal{F}\) is a list of true atomic propositions. It should satisfy \(\theta\).

type KnowScene = (KnowStruct, State) Source #

A pair $(mathcal{F},s)$ where $s$ is a state of $mathcal{F}$, is a scene.

statesOf :: KnowStruct -> [State] Source #

Given a knowledge structure, generate the finite list of its states.

Semantics

Semantics on KnowScenes are defined inductively as follows.

  • \( (\mathcal{F},s)\vDash p\) iff \(s \vDash p\)
  • \( (\mathcal{F},s)\vDash \neg \varphi\) iff not \((\mathcal{F},s)\vDash \varphi\)
  • \( (\mathcal{F},s)\vDash \varphi \land \psi\) iff \((\mathcal{F},s)\vDash \varphi\) and \((\mathcal{F},s)\vDash \psi\)
  • \( (\mathcal{F},s)\vDash { K}_i \varphi\) iff for all \(t\) of \(\mathcal{F}\), if \(s\cap O_i=t\cap O_i\), then \((\mathcal{F},t)\vDash \varphi\)
  • \((\mathcal{F},s)\vDash {C}_\Delta \varphi\) iff for all \(t\) of \(\mathcal{F}\), if \((s,t)\in {\cal E}_\Delta^\ast\), then \(({\cal F},t)\vDash \varphi\)
  • \((\mathcal{F},s)\vDash [\psi] \varphi\) iff \((\mathcal{F},s)\vDash \psi\) implies \((\mathcal{F}^\psi, s) \vDash \varphi\) where \(\| \psi \|_\mathcal{F}\) is given by bddOf and \[\mathcal{F}^\psi:=(V,\theta \land \| \psi \|_\mathcal{F}, O_1, \dots, O_n)\]
  • \((\mathcal{F},s)\vDash [\psi]_\Delta \varphi\) iff \((\mathcal{F},s)\vDash \psi\) implies \((\mathcal{F}^\Delta_\psi, s\cup \{ p_\psi \} ) \vDash \varphi\) where \(p_\psi\) is a new propositional variable, \(\| \psi \|_\mathcal{F}\) is a boolean formula given by Definition~ref{def-boolEquiv} and \[\mathcal{F}^\Delta_\psi:= (V\cup \{ p_\psi \},\theta \land (p_\psi \leftrightarrow \| \psi \|_\mathcal{F}), O^\ast_1, \dots, O^\ast_n) \] where (O^ast_i := left{ begin{array}{ll} O_i cup { p_psi } & text{if } i in Delta \ O_i & text{otherwise} end{array} right. )

If we have \(({\cal F},s) \vDash \phi\) for all states \(s\) of \(\cal F\), then we say that \(\phi\) is valid on \(\cal F\) and write \(\cal F \vDash \phi\).

eval :: KnowScene -> Form -> Bool Source #

The function eval implements the semantics. An important warning: This function is not a symbolic algorithm! It is a direct translation of the Definition above. In particular it calls statesOf which means that the set of stats is explicitly generated. The symbolic (and much faster) counterpart of eval is evalViaBdd below.

Common Knowledge

To interpret common knowledge we use the following definitions. Given a knowledge structure \((V,\theta,O_1,\dots,O_n)\) and a set of agents \(\Delta\), let \(\mathcal{E}_\Delta\) be the relation on states of \(\mathcal{F}\) defined by \((s,t) \in {\cal E}_\Delta\) iff there exists an \(i\in {\Delta}\) with \(s \cap O_i = t \cap O_i\). and let \({\cal E}_{\cal V}^\ast\) to denote the transitive closure of \({\cal E}_{\cal V}\).

In our data type for knowledge structures we represent the state law \(\theta\) not as a formula but as a Binary Decision Diagram.

shareknow :: KnowStruct -> [[Prp]] -> [(State, State)] Source #

The relation for shared knowledge.

comknow :: KnowStruct -> [Agent] -> [(State, State)] Source #

The relation for common knowledge.

Announcements

We also have to define how knowledge structures are changed by public and group announcements. The following functions correspond to the last two points of the semantics Definition above.

Symbolic Evaluation

Minimization and Optimization

determinedVocabOf :: KnowStruct -> [Prp] Source #

Knowledge structures can contain unnecessary vocabulary, i.e. atomic propositions that are determined by the state law and not used as observational propositions.

withoutProps :: [Prp] -> KnowStruct -> KnowStruct Source #

Remove determined and unused atomic propositions from a structure to make the state law smaller.

Symbolic Bisimulations f

type Propulation = Tagged Quadrupel Bdd Source #

See Section 2.11 from https://malv.in/phdthesis for details.

To distinguish explicit and symbolic bisimulations in the implementation we call symbolic bisimulations propulations.

($$) :: Monad m => ([a] -> b) -> [m a] -> m b Source #

Knowledge Transformers

data KnowTransformer Source #

Constructors

KnTrf [Prp] Form [(Prp, Bdd)] [(Agent, [Prp])] 

Instances

Instances details
Show KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Eq KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble Event Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

TexAble MultipointedEvent Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasAgents KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasPrecondition Event Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Methods

preOf :: Event -> Form Source #

HasPrecondition KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

HasPrecondition MultipointedEvent Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Pointed KnowTransformer Bdd Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Pointed KnowTransformer State Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowScene Event Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update KnowStruct KnowTransformer Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Update MultipointedKnowScene MultipointedEvent Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

IsPlan (Plan MultipointedEvent) Source # 
Instance details

Defined in SMCDEL.Other.Planning

noChange :: ([Prp] -> Form -> [(Prp, Bdd)] -> [(Agent, [Prp])] -> KnowTransformer) -> [Prp] -> Form -> [(Agent, [Prp])] -> KnowTransformer Source #

publicAnnounce :: [Agent] -> Form -> Event Source #

A public announcement, the easiest example of a knowledge transformer.

shiftPrepare :: KnowStruct -> KnowTransformer -> (KnowTransformer, [(Prp, Prp)]) Source #

shift addprops to ensure that props and newprops are disjoint:

LaTeX functions

newtype WrapBdd Source #

Constructors

Wrap Bdd 

Instances

Instances details
TexAble WrapBdd Source # 
Instance details

Defined in SMCDEL.Symbolic.S5

Reduction axioms for knowledge transformers

reduce :: Event -> Form -> Maybe Form Source #

Adding knowledge transformers does not increase expressivity because we have the following reductions.

For now we do not implement a separate type of formulas with dynamic operators but instead implement the reduction axioms directly as a function which takes an event and ``pushes it through'' a formula.

The following takes an event $mathcal{X},x$ and a formula $phi$ and then `pushes' $[mathcal{X},x]$ through all boolean and epistemic operators in $phi$ until it disappears in front of atomic propositons. This translation is global, i.e. if there is a reduced formula, then it is equivalent to the original on all structures.

Random Knowledge Structures