Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

September 7, 2009

Coalgebraic Modal Logic

Posted by David Corfield

The key idea is to start from a dual adjunction between the semantics and syntax of propositional theories, as explained on page 3 of Exemplaric Expressivity of Modal Logics. Typically this is a Stone-style duality between (Lindenbaum algebras of) propositions and spaces of models or valuations for a propositional theory.

Modalities are then introduced on the syntactic side in the shape of an endofunctor, where the new modal propositional theories are algebras for this functor. Meanwhile, on the semantic side, we have a endofunctor whose coalgebras provide the semantics for the modal propositional theories. If all goes well, we end up lifting the Stone adjunction to one between coalgebras on one side and algebras on the other. It would be handy at this point if I’d learned how to draw suitable diagrams. As I haven’t you can see what’s going on on page 2 of Coalgebras and Their Logics.

To relate all this to something perhaps familiar, when you introduce the necessity operator □\square into a propositional theory, semantically you start thinking about the accessibility of one world from another. So, □P\square P (it is necessarily the case that PP) holds in my world if PP holds in all worlds accessible from my world. This accessibility relation is thus a relation RR between worlds, or in other words a coalgebra for the powerset functor:

R:X→P(X).
R: X \to P(X).

Properties of the modalities, such as □P⊢□□P\square P \vdash \square \square P, correspond to properties of the relation, here transitivity.

But there are many other modalities we might want to consider, as explained here:

One large class of logics is the vast and growing family of modal logics, which are characterised by having operators that qualify formulas as holding in a certain way, e.g. ‘necessarily’, ‘in the future’, ‘everywhere’, ‘probably’, ‘as everyone knows’, or ‘normally’. (p. 1)

All of these are needed to analyse typical statements:

In a seemingly simple piece of knowledge such as ‘Normally, the likelihood of road congestion is
smaller on weekends’, one implicitly makes use of default logics (‘normally’), probabilistic reasoning (‘the
likelihood’) and temporal knowledge (‘weekends’) under a quantitative regime (‘smaller’).

In the case of probabilistic modalities, we might want modal operators such as

it is at least p%p \% probable that at the next step ϕ\phi.

On the semantic side of this operator, we will need to revist our old friend the Giry monad which sends a set to the set of subprobability distributions it supports. Coalgebras for this functor are Markov chains. The resulting logic is Probabilistic modal logic.

we use the presheaf category NN of functors from finite sets (of channel names) with injective renamings to a certain category of domains (representing observable behaviour in the presence of recursion). (p. 5)

We read Pi as follows. The possible one-step behaviours of a process are non-deterministic (due to 𝒫\mathcal{P}) and may be one of the following alternatives: A silent step (the XX component), an input of a name (XN)(X^N) over a channel (N)(N), the output of a free name over a channel (due to N×N×XN \times N \times X) or the allocation and sending of a fresh name (the N×δ(X)N \times \delta(X)-part). (p. 5)

This results in a “new fully abstract, sound and complete modal logic for the π\pi-calculus”. For more details see Pi-Calculus in Logical Form.

Perhaps we can now start to glimpse connections between two pieces of work out of Carnegie-Mellon that we have commented on before. On the one hand, there’s the syntax-semantics duality of first-order theories due to Forssell. Here the dualising object is no longer 22 but rather the category SetSet. Just as 22 can be taken as equipped with many structures, so with SetSet.

For example, SetSet is a category with finite products, and an object in the category, ℱ𝒫\mathcal{F} \mathcal{P}, of such categories with finite product preserving functors. But it is also a category with all limits and colimits, and an object in the category, 𝒢\mathcal{G}, of such categories with functors which preserve limits, filtered colimits, and regular epimorphisms. This allows for the following duality, as Forssell explains,

He goes on to show the duality between Boolean coherent categories (corresponding to first-order theories) and topological groupoids (corresponding to their models). We might hope then for modalities acting on the first-order syntax and semantics to be functors (maybe 2-functors) of a certain kind on these Boolean coherent categories.

We can think of the transition systems between models or worlds of propositional theories as telling us which members of a set of worlds are close to one another. For any ordered pair can we move from the first to the second – Yes or No? Now with first-order theories we’re working in a category of worlds and we want to know for any objects not just whether we can get from one to another, but how.

The trivial choice of transition system for a set is where aRba R b if and only if a=ba = b. This corresponds to the coalgebra a↦{a}\a \mapsto \{a\}. The equivalent for categories is, I would guess, the Yoneda embedding as a 2-coalgebra. Here an object relates to another via the arrows in the category itself. But presumably there must be other transition systems to work with.

The second piece of Carnegie-Mellon work may give us a clue as to how to proceed. It’s Awodey and Kishida’s sheaf semantics for first order modal logic. Here we model first-order modal logic by a sheaf over a space of worlds. A fibre contains the individuals living in the world indexed by a point in the base space.

So the question is: can these sheaf models for a first-order modal theory be seen as (2)-coalgebras for some endofunctor on the category of models of the nonmodal first-order theory?

The thrust of the coalgebraic approach to modal propositional logic is summarised as:

First, the coalgebraic model is flexible. That is, it can incorporate many different types of behaviour and interaction, e.g. location awareness, mobility and quantitative uncertainty, to name but a few. Second, the coalgebraic model is compositional: both on the logical and the semantical level it allows us to combine computational features and reason about their interaction. Third, the coalgebraic model is uniform, i.e. all computational aspects of the model share the same meta-theory. This in particular leads to software tools that are easier to design, to maintain and to implement. Finally, the coalgebraic model is compatible in the sense that it subsumes nearly all existing formal notions of state based system as special cases. (p. 10)

It would fun to extend this to first-order theories. There must be quite a space of logics out there.

Posted at September 7, 2009 12:25 PM UTC

TrackBack URL for this Entry: http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2053

26 Comments & 2 Trackbacks

Re: Coalgebraic Modal Logic

When I was learning about monads, the monad for monoids was a particularly helpful example, as was seeing how ℤ2\mathbb{Z}_2 is an algebra of the monad. So, can you walk us through an example of coalgebras? Like, is there such a thing as a comonoid? If so, can you show how a particular comonoid (is there such a thing as co-ℤ2\mathbb{Z}_2?) arises as a coalgebra of the comonad for comonoids?

Jim Dolan made me solve this puzzle, and it made me stronger, so I feel good about inflicting it on everyone else.

Anyway, this is why nobody cares about comonoids in SetSet (or any other category with finite products). But comonoids in VectVect are great.

I think David and other people can give you piles of comonads with a computer science or logic flavor to them. The example he already mentioned is very nice. Suppose we have a poset, which is a simple sort of category. Let’s think of the elements of this poset as ‘propositions’, with the order relation as ‘implication’. Then any comonad on a poset can be thought of as saying ‘is necessarily true”. The definition of comonad simply says:

Epistemic Logic; Re: Coalgebraic Modal Logic

This is another way in which Epistemic Logic differs from plain vanilla Modal Logic. Because if Agent-A knows that P is true, formally K_A(P) it does not follow (depending on which axioms you accept) that Agent-A knows that Agent-A knows that P, formally K_A(K_A(P)). Once you have public announcements to all agents, there is the disturbing situation in which one can be forced to stop knowing P when told P.

Balbiani et al wrote: “One motivation to formalize the dynamics of knowledge is to characterize how truth or knowledge conditions can be realized by new information. From that perspective, it seems unfortunate that in public announcement logic a true formula may become false because it is announced.

Re: Epistemic Logic; Re: Coalgebraic Modal Logic

One of my pet projects has been to investigate this epistemic knowledge problem in a multi-agent system. You are trying to find out how the public announcement changes the knowledge of different `agents’. There are coalgebraic models corresponding to Kripke frames M=(F,π)M = (F,\pi) where FF is a set WW (of `possible worlds’) with a family of equivalence relations on it and π\pi is an `interpretation’ for the atoms of the language. The equivalence relations correspond to the ability or lack of it to distinguish the worlds apart.

The famous case of the `Muddy Children’ gives a nice example of updating the model of the situation following a public announcement. The Kripke frame is usually represented by a graph with edges (coloured by the labels of the agents) corresponding to the equivalence relations (world ww and world xx are linked by an edge labelled aa if agent aa can not tell the situations / worlds ww and xx apart from aas available knowledge. Public announcements update the graph.

A very nice problem is to give an adequate (and convincing) description of that update process. (That the Kripke frame is a nn-fold groupoid is a nice viewpoint that I always hoped would become useful but I do not know how to do it!)

The coalgebraic model here is a multiple one. There are as many cooperations as there are agents, so this is a more complex situation than David’s. It does give a nice semi-realistic use for Epistemic Modal Logics and Coalgebraic ideas.

There is a dual algebraic model using Boolean algebras with operators. I will describe that if someone is interested. (Perhaps the nLab needs some stuff on this!!!)

Re: Epistemic Logic; Re: Coalgebraic Modal Logic

Re: Epistemic Logic; Re: Coalgebraic Modal Logic

I was unable to continue this yesterday, so let me give a bit more precision to my ideas. I was trying to describe a multiagent system and as David pointed out you can do that coalgebraically if the number of agents is fixed (AA is the set of agent labels).

I was discussing this with Bill Teahan in Bangor and he asked what would model the more realistic agent based systems where an agent may `spawn’ a new agent who goes off to report back, seeking `knowledge’ in the network (say where certain information resources are held, certain programs are available, say in grid computing models, and so on). The set of agents AA thus changes in time.

A similar situation occurs if the agents are sensors communicating measurements back about conditions, say, on the sea bed. Here an agent has limited broadcast power so can only communicate with nearby others. Conditions on the sea bed can be quite extreme, they can change so that sensors may become disabled and go out of action, so again the network changes in time. Can one build network structure into the logic, and can the logic change with change of structure in the network.

(This has distant links to questions TQFTs and AQFTS I think, with creation and destruction of states.)

If there are nn agents then the logic will be something like the S5nS5_n epistemic logic, and the relational models will be sets with nn-equivalence relations on them. Now add in some new agents and eliminate others. How will the logic and its category of coalgebras react?

I got some basic results on this some years ago but could not refine my ideas enough so as to develop things further. Any thoughts???

For tractability to my limited Math powers, I also restricted the number of agents to a fixed value. Further assumptions, restrictions, are as summarized below. I do, as you indicated, use bisimulation and pointed Kripke model theory to prove to some results. But have I, with these restrictions, abstracted away what you feel needs to be n-categorified?

“The realization of knowledge (or truth) by new information can be seen as a specific form of what is called ‘knowability’ in philosophy.”

What do I mean, informally, by rational belief and knowledge in this context?
An agent can know (believe) these things:
(1) Axioms accepted by the agent;
(2) Theorems that the agent can prove from the axioms, under rules of deduction;
(3) Things announced by agents whom the given agent believes to always tell the truth;
(4) The negation of things announced by agents whom the given agent believes to always tell exactly the opposite of the truth (in a two-valued logic);
(5) Deductions made from announcements believed, or from those inverted by total skepticism of a pure liar.
(6) Things which the agent believed in the past, but now (in belief revision) retracted from belief and inverted, i.e. formerly believe to be true, now believe to be false;
(7) Things which the agent believed in the past, but now (in belief revision) retracted from belief and demoted, i.e. formerly believe to be true, now believe to be only possibly true;
(8) Deductions from revised beliefs.
An agent can NOT know these things:
(1) Since this is not a Paraconsistent logic, one cannot believe anything which one knows to be logically inconsistent or invalid, i.e. P and NOT P.
(2) Observations of the “real world.” The knower has no senses, and is not embedded in the real world, but in a “simulated” abstract logical world. We may later examine some traditional philosophical puzzles if we all a special agent, the Narrator, to announce to all other agents the circumstances of an abstract sensory world; or if there is an agent which represents the sensory knowledge of another agent, although this leads to both obvious problems of private versus public knowledge, and more subtle problem of sensory knowledge being incorrect, in the most extreme case, the radical doubt of Descartes;
(3) There are no explicitly irrational beliefs, hunches, feelings, as this is not a psychological model;
(4) The computational capability of agents is limited; there are no “oracles”, hence in this Post-Godelian world, an agent cannot know something which is provably undecidable. We defer discussion of whether one can believe something which is provably independent of the believed axioms.

Let me motivate this paper with the following definitions and examples, which will be made precise later. Assume a finite set of agents (people, creatures, computers, abstractly represented) A and a countably infinite set of logical atoms P (including those denotated Phi, Psi, and so forth).

We assume that the underlying Propositional Calculus is two-valued, that is, {True, False} as opposed to, say, {True, False, Unknown}, or [something with nice Lattice properties, Belknap] {None, True, False, Both}, as the unknown is handled instead by the truth value of a proposition which includes the Knowledge operator or its dual.

This last condition means says that for all x,x,m(0,x)=m(1,x)=x,m(0,x) = m(1,x) = x, which means that mm must be the projection onto M.M. So a monoid in (Set,+,0)(Set, +, 0) is “just” a set, since we don’t get anything new.

SetopSet^{op} is a monoidal category in two ways as well. The cartesian product in SetopSet^{op} is disjoint union of sets, so

A monoid object in (Setop,+,0)(Set^{op}, +, 0) is the empty set, because an arrow e:0→Me:0 \to M is a function e:M→0,e:M \to 0, which doesn’t exist unless MM is empty.

Now the only thing ee can be is deletion, the unique morphism into 1. The last equation says that after applying m,m, deleting either component leaves what we started with, so mm has to be duplication. Thus MM is “just” a set here, too.

Re: Coalgebraic Modal Logic

On the other hand, comonoids in noncartesian monoidal categories can be more interesting. In theory, the study of comonoids in monoidal categories is equivalent to the study of monoids in monoidal categories, since the opposite of a monoidal category is just another monoidal category. But in practice, we tend to concentrate on specific categories, and a comonoid in CC is usually very different from a monoid in CC.

Everyone knows that a monoid in AbAb is a (unital) ring, but what is a comonoid in AbAb? It's not a familiar concept to most people!

Re: Coalgebraic Modal Logic

Re: Coalgebraic Modal Logic

When you say “Ab”, which monoidal product do you mean?

I mean the usual closed monoidal tensor product, the one such that a monoid object is a ring.

Note that it's not offered as a puzzle to ask you what is a comonoid object in AbAb; you can describe it in more lowbrow language, of course, but you're not going to be able to say ‘Ah, that's just a […]’, because it really is something new.

Re: Coalgebraic Modal Logic

We never did hear the answer to Toby’s puzzle. If a comonoid object in AbAb is the same as a monoid object in AbopAb^{op}, and if AbopAb^{op} is equivalent to the category of compact Hausdorff abelian topological groups, might we expect the answer to be

Re: Coalgebraic Modal Logic

Remember that just as not all endofunctors are monads nor are they all comonads. All we need for coalgebra/algebra in this sense is an endofunctor. So we might take F(X)=1+X2F(X) = 1 + X^2 for SetSet. An algebra for this functor is merely a set XX equipped with a map f:1+X2→Xf: 1 + X^2 \to X, or in other words a set with a named element and a binary operation. There are no equations. Your typical algebraic structures like monoid require you to add in equations for binary operation with named element, etc.

Coalgebras have a different flavour. Now we want a map g:X→1+X2g: X \to 1 + X^2. We can think of this as a partially defined map which on an element of XX either is undefined or else sends back two elements of XX. A nice example of one of these sets is the set of binary trees. Either we have an empty tree or else there is a root with two (possibly empty) trees adjoined.

You can say that the algebraic way involves constructors, in the example, a term for the named element, and for every pair of elements a new element formed by the binary operation. Initial algebras are constructed using just this, modulo equations.

Coalgebras involve destructors. I give you a binary tree, you rip out the root and hand me back the left and right sub tree. Final/terminal coalgebras are often infinite - they need to capture all possible ways you destroy things of that kind. E.g., in the running example, you may go on ripping out and splitting trees forever, so the final algebra is the set of not necessarily finite binary trees.

Other functors give different flavours of coalgebra. A coalgebra for the power set functor is just a relation.

Re: Coalgebraic Modal Logic

If one thinks of a comonoid as a cogroupoid with one (co)object, it there as sense in which this generalises the old adage of Ronnie Brown about `subdivision as the inverse of composition’ (or something like that).

And perhaps a silly question: Are there logical versions of Hopf algebra type situations? I mean not based on vector spaces, so one gets a set of decompositions or destruction of an object not some sum of such things. More combinatorial / perhaps species based examples.

Re: Coalgebraic Modal Logic

All we need for coalgebra/algebra in this sense is an endofunctor.

So we’re not necessarily looking only at coalgebras of a comonad, but rather coalgebras of an arbitrary endofunctor T:C→CT:C \to C, which is just an object XX of CC and a morphism h:X→TXh:X \to TX. Is that right?

Coalgebras involve destructors. I give you a binary tree, you rip out the root and hand me back the left and right sub tree. Final/terminal coalgebras are often infinite - they need to capture all possible ways you destroy things of that kind. E.g., in the running example, you may go on ripping out and splitting trees forever, so the final algebra is the set of not necessarily finite binary trees.

Oh! I think I’ve seen something like this before, that data structures are dual to control flow. A bit is dual to if/then/else, and more generally a sum is dual to a switch/case statement. A pair is dual to doing two independent things; it’s not clear to me whether they can be done sequentially or not.

Correct me if I’m wrong, but isn’t part of the point of destructors a kind of irreversibility for infinite trees?

If you've really got a coinductive object, then its destructor will be invertible. In contrast, if you've merely got some coalgebra of an endofunctor, one which might not be final, then you cannot expect it to be invertible, although it might be.

It's a fun exercise for the categorially minded to prove that a final coalgebra of a functor FF, that is a terminal object of the category of objects AA equipped with morphisms A→F(A)A \to F(A) (all within a given ambient category), must be invertible, that is its morphism A→F(A)A \to F(A) must be an isomorphism. (The dual theorem holds for initial algebras.)

In David's example with binary trees, AA is the set of binary trees, FF maps XX to 1+X21 + X^2, and the map A→F(A)A \to F(A) really is invertible. This alone does not prove that AA is the final coalgebra of FF, but it is. In your example, AA is a set of forests, FF seems to be the identity (since F(A)F(A) is also a set of forests), and the map A→F(A)A \to F(A) is not invertible. This tells us that AA cannot be the final coalgebra of FF, although it is a coalgebra. (The actual final coalgebra of the identity is the singleton set, assuming that we're working in the category of sets.)