Epistemic Logic with SMCDEL#
Author: John Mulhern
1. Idea#
Epistemic logic is the study of knowledge and belief using a formal logical language. Instead of only asking “is p true?”, we can ask:
“does agent
aknow thatpis true?” (K_a p)“does agent
abelieve thatpis true?” (B_a p)“does agent
aknow that agentbknows thatp?” (K_a K_b p)
This is useful in computer science because many systems are multi-agent or distributed. What an individual process, user, or node knows (or does not know) affects what it can safely and effectively do.
In this chapter we will:#
introduce the basics of (multi-agent) epistemic logic,
introduce dynamic epistemic logic (DEL) to handle information change,
show how to use SMCDEL (Symbolic Model Checker for Dynamic Epistemic Logic),
explain social networks through the lense of epistemic logic
2. Basic Epistemic Logic#
2.1 Syntax#
We assume:
a set of atomic propositions:
p, q, r, ...a finite set of agents:
a, b, c, ...
The language is built by:
every atomic proposition
pis a formulaif
φandψare formulas, then¬φ(φ ∧ ψ)(φ ∨ ψ)(φ → ψ)
are formulas
if
φis a formula andais an agent, thenK_a φis a formula, read “agentaknows thatφ”
Optionally we can also allow:
B_a φfor “agentabelieves thatφ”
Examples:
K_a pK_a K_b pK_a (p → q)K_a p ∧ K_b pK_a p → B_a p(knowledge implies belief)
2.2 Semantics (Possible Worlds)#
Epistemic logic uses possible worlds semantics (Kripke semantics).
A model is a triple:
M = (W, {R_a}_a, V)
where:
Wis a nonempty set of worldsfor each agent
a,R_ais a binary relation onW(w, w') ∈ R_ameans: at worldw, agentaconsiders worldw'possible
Vis a valuation assigning to every atomic proposition the set of worlds where it is true
We define truth at a world w inductively:
M, w ⊨ piffw ∈ V(p)M, w ⊨ ¬φiff not (M, w ⊨ φ)M, w ⊨ (φ ∧ ψ)iff (M, w ⊨ φandM, w ⊨ ψ)M, w ⊨ (φ ∨ ψ)iff (M, w ⊨ φorM, w ⊨ ψ)M, w ⊨ (φ → ψ)iff (ifM, w ⊨ φthenM, w ⊨ ψ)M, w ⊨ K_a φiff for allw'such that(w, w') ∈ R_a, we haveM, w' ⊨ φ
Key sentence:
K_a φis true atwiffφis true in all worlds that agentaconsiders possible fromw.
2.3 Example (Not Knowing Even When It’s True)#
Let there be 2 worlds: w1, w2.
in
w1,pis truein
w2,pis false
Let agent a be uncertain between these 2 worlds:
R_a = {(w1,w1), (w1,w2), (w2,w1), (w2,w2)}
Then:
M, w1 ⊨ p(becausepis true inw1)but
M, w1 ⊭ K_a p(because fromw1, agentaalso considersw2possible, and inw2pis false)
So: p is actually true, but agent a does not know p.
2.4 Properties of Knowledge (S5-style)#
In many CS applications, we model knowledge with S5-like properties. For each agent a, the relation R_a is:
reflexive
symmetric
transitive
This validates the following principles:
Factivity:
K_a φ → φPositive introspection:
K_a φ → K_a K_a φNegative introspection:
¬K_a φ → K_a ¬K_a φDistribution:
K_a (φ → ψ) → (K_a φ → K_a ψ)
These together make knowledge quite strong.
2.5 Belief#
Belief (B_a φ) is often taken to be weaker:
belief is not factive (we do not assume
B_a φ → φ)we can still assume doxastic introspection (depending on the logic)
often we assume:
K_a φ → B_a φ(knowledge implies belief)
Belief is handy for modeling mistakes or rumors in social networks.
3. Dynamic Epistemic Logic (DEL)#
So far: static epistemic logic — one model, we ask what is known.
But many real situations have information change:
a public announcement
a private message
an observation
an agent discovering a fact
Dynamic Epistemic Logic adds events and updates to represent such changes.
3.1 Public Announcement (Informal)#
Suppose we have a model M and we publicly announce φ.
every agent hears the same announcement
every agent trusts it (it becomes true, or was already true)
so they eliminate all worlds in which
φwas falseresult: a new epistemic model with fewer worlds
After this, many things that were not known become known, because there are fewer possibilities left.
This is exactly the kind of update SMCDEL is good at checking.
4. Using SMCDEL#
SMCDEL (Symbolic Model Checker for Dynamic Epistemic Logic) is a tool that:
lets you define agents, worlds, valuations, relations
lets you define event models (for announcements, private messages, etc.)
applies them with
updateand then lets you
checkwhether a certain epistemic formula holds
You can use the web version:
https://w4eg.de/malvin/illc/smcdelweb
or install it locally.
4.1 Installation (Illustrative)#
# Using Haskell Stack
stack install smcdel
After installation, you can run:
smcdel my_model.smcdel
where my_model.smcdel is a text file describing your epistemic model and the formulas you want to check.
4.2 Model Example#
Goal: two agents, a and b, one proposition p, two worlds, and both agents are uncertain.
File: simple_model.smcdel
# Agents and propositions
agents a b;
props p;
# Worlds
worlds w1 w2;
# Valuation: p is true in w1, false in w2
val p = {w1};
# Epistemic relations: both agents can't distinguish w1 and w2
rel a = {(w1,w1),(w1,w2),(w2,w1),(w2,w2)};
rel b = {(w1,w1),(w1,w2),(w2,w1),(w2,w2)};
# Check what they know in w1
check w1: Ka p;
check w1: Kb p;
What this does:
declares agents, props, worlds
says p is only true in w1
says both agents see the two worlds as indistinguishable
asks: “in world w1, does agent a know p?”, “does agent b know p?”
Intuition: both answers should be false because each agent still considers the world where p is false possible.
4.3 Adding a Public Announcement#
Now we show how a Public Announcement can impact an epistemic model.
We start from the previous model and then add an event where we publicly announce p.
File: announcement.smcdel
include "simple_model.smcdel";
# Define a public announcement event
event announce_p {
pre = p; # only applicable in worlds where p is true
post = {}; # no change to valuations
}
# Apply the event
update announce_p;
# Now check again
check w1: Ka p;
check w1: Kb p;
What happens:
since we publicly announced
p, all worlds wherepwas false are droppedonly
w1remainsin a model with a single world,
pis trivially known by everyoneso both
Ka pandKb pshould now betrue
This is the dynamic piece: before the update, they did not know; after the update, they do.
6. Current Works Using Epistemic Logic#
Aldini, A process algebraic framework for multi-agent dynamic epistemic systems (2024) — system-level DEL with agents and transitions.
van Benthem, van Eijck, Gattinger, Su, Symbolic Model Checking for Dynamic Epistemic Logic — the classic symbolic SMCDEL reference.
Fang, Heuristic Strategies for Accelerating Multi-Agent Epistemic Planning (KR 2024) — fast planning toward epistemic goals.
Velázquez-Quesada, Communication between agents in dynamic epistemic logic (2022) — nice for students interested in chat-style or partial-reveal actions.
7 Further Reading#
Jaakko Hintikka, Knowledge and Belief (1962)
Hans van Ditmarsch, Wiebe van der Hoek, Barteld Kooi, Dynamic Epistemic Logic
Y. Halpern and Y. Moses, “Knowledge and Common Knowledge in a Distributed Environment,” Journal of the ACM, 37(3), 1990
SMCDEL web interface: https://w4eg.de/malvin/illc/smcdelweb
8 Closing Thoughts#
Epistemic logic gives us a way to talk about who knows what. Dynamic epistemic logic lets us talk about how they come to know it. SMCDEL is a practical tool that makes these formalisms runnable — students can actually check their models and see whether a formula is true after a sequence of announcements or messages. This makes epistemic logic a natural, modern addition to a book on computer logic.
5. Social Networks and Epistemic Logic#
We can think of a social network as:
a set of agents (users, accounts, processes)
a set of connections (who can hear whom, who follows whom, who is in the same group chat)
a sequence of information events (DMs, posts, story updates, announcements)
Epistemic logic lets us ask:
after this sequence of events, who knows the information?
who only believes it?
who knows that others know it?
is it common knowledge to the group?
5.1 Conceptual Mapping#
Social concept
Epistemic logic counterpart
user / account
agent (e.g.
A,B,C)follow / friend
accessibility / visibility / communication link
public post
public announcement
private message
private event (visible to a subset of agents)
rumor
sequence of (possibly private) announcements
“everyone knows”
group knowledge (
E_G φ)“everyone knows that everyone knows”
common knowledge (
C_G φ)So: social-network reasoning is a natural application of DEL.
5.2 Example: Rumor Spread in a Small Network#
Agents:
A,B,C.only
Ainitially knows propositionpAprivately tellsBthen
Bpublicly says “I learnedp”we want to see what
Ccan now concludeFile:
social_network.smcdelagents A B C; props p; # two worlds: p is true / p is false worlds w1 w2; val p = {w1}; # everyone initially uncertain rel A = {(w1,w1),(w1,w2),(w2,w1),(w2,w2)}; rel B = {(w1,w1),(w1,w2),(w2,w1),(w2,w2)}; rel C = {(w1,w1),(w1,w2),(w2,w1),(w2,w2)}; # 1) A privately tells B event A_to_B { pre = p; rel = { (A,A), (B,B), (C,C) }; } # 2) B publicly announces "I learned p" event B_public { pre = p; rel = { (A,A), (B,B), (C,C) }; } # apply events in sequence update A_to_B; update B_public; # now ask: check w1: KA p; # does A know p? check w1: KB p; # does B know p? check w1: KC p; # does C know p now? check w1: KC KB p; # does C know that B knows p? check w1: KB KA p; # does B know that A knows p?What’s going on:
After
A_to_B, onlyBgains the info.After
B_public, everyone sees thatpmust be true (sinceBsaid so publicly and the precondition wasp).So now
Clearnsp, and also learns thatBknowsp.This shows that the second step (public announcement) is what makes the information spread to the whole network.
5.3 Private vs. Public (Why it matters)#
A public announcement reduces uncertainty for every agent. It is “broadcast.”
A private event reduces uncertainty only for the involved agents.
If we want something to become common knowledge, it almost always needs to be public (or something equivalent to a public event — e.g. everyone hears it, and everyone hears that everyone heard it, etc.).
This distinction is exactly what we need to study:
partial disclosure
data leaks
misinformation
who can deduce what after an observable action
5.4 Toward Common Knowledge#
In a group chat with agents
A,B,C, we might model:a message is posted publicly:
peveryone sees it
everyone knows that everyone sees it (because that’s how the channel works)
In epistemic logic we often define:
E_G(φ)= everyone in groupGknowsφE_G^2(φ)= everyone inGknows that everyone inGknowsφ…
C_G(φ)= for alln,E_G^n(φ)Public announcements are a classic way to get close to this kind of knowledge.
In SMCDEL, you can check several levels explicitly:
and so on.