Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: theory: applied category theory

Topic: petri nets


view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:04):

Is there a notion of input and output for petri nets?

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:05):

Analogously, a discrete dynamical system is a set of states SS with an update rule u:SSu: S \to S. But an input/output discrete dynamical system would additionally have a set of inputs II, a set of outputs OO, an update u:S×ISu: S \times I \to S, and a readout r:SOr: S \to O

view this post on Zulip John Baez (Apr 09 2020 at 18:11):

There's not a notion for Petri nets per se, but this is probably just what open Petri nets give you!

view this post on Zulip John Baez (Apr 09 2020 at 18:12):

You may have another idea in mind, and there are various imaginable ideas, but our "input" and "output" are just functions i:ASi : A \to S, o:BSo: B \to S where our Petri net is TN[S]T \stackrel{\to}{\to} \mathbb{N}[S], so SS is the set of 'places'.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:13):

Hmmm...I think of open petri nets as "resource sharing" which feels distinct from inputs which parameterize the dynamics

view this post on Zulip John Baez (Apr 09 2020 at 18:14):

In the reachability semantics discussion in our paper, we consider starting off an input Petri net with some marking of the inputs, running it, and seeing if it can wind up with a marking that comes from a marking of the ouputs.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:15):

Marking of the inputs means some dots in the places?

view this post on Zulip John Baez (Apr 09 2020 at 18:15):

Note that a marking of the inputs is an element of N[A]\mathbb{N}[A]; we can use N[i]:N[A]N[S]\mathbb{N}[i] : \mathbb{N}[A] \to \mathbb{N}[S] to carry this to a marking of the places of our Petri net.

view this post on Zulip John Baez (Apr 09 2020 at 18:16):

Here AA is the set of inputs in our open Petri net (see above for my notation).

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:16):

got it

view this post on Zulip John Baez (Apr 09 2020 at 18:17):

So we can start with a marking of the inputs, map it to a marking of the place of our Petri net, "run" the Petri net and get other markings, and then ask if any of these other marking come from a given marking of the outputs (via N[o]:N[B]N[S]\mathbb{N}[o] : \mathbb{N}[B] \to \mathbb{N}[S]).

view this post on Zulip John Baez (Apr 09 2020 at 18:18):

The yes-or-no answer to this question gives a relation, the "reachability relation" between N[A]\mathbb{N}[A] and N[B]\mathbb{N}[B].

view this post on Zulip John Baez (Apr 09 2020 at 18:18):

So this is one thing you can do....

view this post on Zulip John Baez (Apr 09 2020 at 18:18):

One difference between this and what you're talking about is that we don't have a deterministic dynamics: we have a "possibilistic" dynamics.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:19):

I just want to make sure I understand this! This is an example of a marking of the inputs image.png

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:19):

from your talk

view this post on Zulip John Baez (Apr 09 2020 at 18:19):

But that picture doesn't show any "inputs".

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:19):

I'm imagining the inputs are the two places on the left

view this post on Zulip John Baez (Apr 09 2020 at 18:20):

Okay, so let's say AA has two elements and they're getting mapped into the 2 places on the left in a bijective way.

view this post on Zulip John Baez (Apr 09 2020 at 18:20):

We can do that.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:20):

and let's say OO has one element getting mapped to the 1 place on the right

view this post on Zulip John Baez (Apr 09 2020 at 18:21):

In my notation it's BB that's mapped by o:BSo : B \to S , but fine.

view this post on Zulip John Baez (Apr 09 2020 at 18:21):

I'm not trying to be a notation boss, honest.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:21):

Hmm... I'm running this in my head and I'm worried that it never ends up with only markings in the output

view this post on Zulip John Baez (Apr 09 2020 at 18:21):

This one might not.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:21):

I'm happy to use your notation!

view this post on Zulip John Baez (Apr 09 2020 at 18:22):

Actually I think this one can get to a marking with just one dot at right...

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:22):

Really? I'm not seeing it

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:22):

I keep ending up with a lone dot in the bottom left place

view this post on Zulip John Baez (Apr 09 2020 at 18:22):

Umm, in my slides I "run" this Petri net for a while:

view this post on Zulip John Baez (Apr 09 2020 at 18:23):

structured_2_talk.pdf

view this post on Zulip John Baez (Apr 09 2020 at 18:23):

Let's see what it does... I think it's the same one: on the first slide I think.

view this post on Zulip John Baez (Apr 09 2020 at 18:24):

Yeah, eventually I get to a marking with two dots at right.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:24):

I'm actually confused about how you get from slide 5 to slide 6

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:24):

I expected the transition eat the marking in the top left

view this post on Zulip John Baez (Apr 09 2020 at 18:28):

Whoops, maybe I made a mistake! Let me look.

view this post on Zulip John Baez (Apr 09 2020 at 18:29):

Ha! That was a mistake! Thanks for catching it.

view this post on Zulip John Baez (Apr 09 2020 at 18:29):

I'll fix my slides. :blushing:

view this post on Zulip John Baez (Apr 09 2020 at 18:29):

Hmm, I don't like the look of that "blushing" emoticon.

view this post on Zulip John Baez (Apr 09 2020 at 18:29):

It looks too bug-eyed.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:30):

haha, it's actually one of my favorites

view this post on Zulip John Baez (Apr 09 2020 at 18:30):

I guess writing code in TikZ made it hard for me to pay attention to whether my tokens were doing the right things.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:31):

I think if we start with three in the upper left then it will have the behavior that ends up with 2 on the right

view this post on Zulip John Baez (Apr 09 2020 at 18:31):

Okay. Now I'm tempted to start fixing my TikZ, but I guess the wrong version is immortalized on YouTube.

view this post on Zulip John Baez (Apr 09 2020 at 18:32):

Anyway, I can sort of half-listen to you while I start fixing this TikZ.

view this post on Zulip John Baez (Apr 09 2020 at 18:32):

Were you getting at some point, about reachability?

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:33):

I'm still musing if this input/output scheme matches up with what I want. But first I'm making sure I understand it

view this post on Zulip John Baez (Apr 09 2020 at 18:35):

Okay.

view this post on Zulip John Baez (Apr 09 2020 at 18:35):

I bet there are a number of schemes.

view this post on Zulip John Baez (Apr 09 2020 at 18:36):

In particular the demand that all tokens wind up at places mapped to by outputs is rather restrictive. One could also consider allowing "leftover junk" at other places, at the end. But then you have to ask if starting with "leftover junk" at other places at the beginning is allowed.

view this post on Zulip John Baez (Apr 09 2020 at 18:37):

I like time-symmetric schemes since I'm a physicist at heart.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:37):

I think that matches the analogy with discrete dynamical systems where the starting and ending with leftover junk is the internal state

view this post on Zulip John Baez (Apr 09 2020 at 18:39):

Those dynamical systems you're talking about... are they called "Moore machines" or "Mealy machines"?

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:39):

moore machine

view this post on Zulip John Baez (Apr 09 2020 at 18:40):

Okay, good.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:40):

Thinking out loud: Can I turn a petri net into a moore machine by taking states to be markings of the petri net?

view this post on Zulip John Baez (Apr 09 2020 at 18:41):

Eugenio Moggi was trying to create a decorated cospan category of "open Moore machines".

view this post on Zulip John Baez (Apr 09 2020 at 18:41):

We found that some obvious-seeming way to do it gave rise to a setup different from some "usual" way to do things.

view this post on Zulip John Baez (Apr 09 2020 at 18:42):

I guess composition worked differently.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:42):

oh interesting! I've been thinking about this as well and had convinced myself it's not possible without some extra structure

view this post on Zulip John Baez (Apr 09 2020 at 18:42):

I think his Moore machines had a bit more stuff... maybe a "read-in" as well as a "read-out"????

view this post on Zulip John Baez (Apr 09 2020 at 18:43):

Or maybe some "start" and "end" states???

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:44):

neat!

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:45):

is there a place to read more?

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:47):

I did a quick internet search but didn't find anything

view this post on Zulip John Baez (Apr 09 2020 at 18:48):

I don't know where. Moggi would know.

view this post on Zulip John Baez (Apr 09 2020 at 18:49):

There's a big literature on automata, and he knows it... I don't. He was just showing me stuff on the blackboard, and we were trying to work stuff out, and we gave up because decorated cospans wasn't matching the "usual" approach, even though he admitted that decorated cospans was giving something reasonable.

view this post on Zulip John Baez (Apr 09 2020 at 18:50):

If you really want to work on this stuff, I could ask him.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 18:54):

That would be great!

view this post on Zulip John Baez (Apr 09 2020 at 18:56):

Umm, okay.

view this post on Zulip Sophie Libkind (Apr 09 2020 at 19:33):

Thank you so much! But please only if its comfortable and convenient for you :smile:

view this post on Zulip Fabrizio Genovese (Apr 09 2020 at 19:41):

Just a small aside: The notation input/output may be misleading. Gluing along places is an asynchronous operation, meaning that it does not have directionality per se. So suppose you compose nets N and M, where the output of N matches the input of M. You would expect then that tokens in the output of N get consumed by M, but N could as well "take them back" (e.g if the output place of N is also the input of one of its transitions). For this reason it's probably better to say left and right ports

view this post on Zulip Fabrizio Genovese (Apr 09 2020 at 19:42):

Also, there is some work about composing automata using operads and lenses. Maybe this is closer to what you want: https://www.youtube.com/watch?v=dEDtaJhgQOY

view this post on Zulip Fabrizio Genovese (Apr 09 2020 at 19:44):

Fabrizio Genovese said:

Just a small aside: The notation input/output may be misleading. Gluing along places is an asynchronous operation, meaning that it does not have directionality per se. So suppose you compose nets N and M, where the output of N matches the input of M. You would expect then that tokens in the output of N get consumed by M, but N could as well "take them back" (e.g if the output place of N is also the input of one of its transitions). For this reason it's probably better to say left and right ports

Also, this sort of behavior is what makes difficult to compositionally evaluate the reachability relation starting from the reachability relation of the components. That is, when you compose along places you can, for instance, create new loops in the composed net, which make the reachability relation richer

view this post on Zulip Fabrizio Genovese (Apr 09 2020 at 19:46):

Another notion of composition which is somehow friendlier wrt reachability is composing along transitions, as it's done here: https://arxiv.org/abs/1307.0204
In this case, the point of view is very different: composition is observational and synchronous, so you can interpret left and right ports not as carrying tokens around, but as carrying observational data. In this respect, ports connect things at a "message level": When something on the port happens, it instructs transitions connected to that port to fire. The problem with this approach is that now nets are not sharing resources anymore (which is exactly why the impact on the reachability relation is somehow friendlier to manage)

view this post on Zulip James Fairbanks (Apr 10 2020 at 11:26):

I agree with Fabrizio on this. I know that I struggled for a while on the open petri nets until I realized that the input/output structure of the decorated/structured cospans need not be related to where the tokens go when the net fires. My initial impression was that the inputs needed to be the "reagent" places and the outputs were the "product" tokens, but that isn't a requirement. That is why I've come to think of decorated cospans as a model of model fusion rather than a model of the dynamics. A morphism in FinSet Cospans is a recipe for gluing models together on variables. The way you do that gluing introduces left and right ports but those don't need to map onto the understanding of a PetriNet as a chemical reaction with reagents and products as inputs and outputs.

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 11:29):

Precisely. The way I think about cospans is as a tool that allows you to "punch connections into a structure" that allow you to compose things, but this happens in a way that is often unrelated to what the underlying structure does. This is, imho, the inevitable price you have to pay if you want a compositional framework at this level of generality

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 11:30):

The result is that you have a compositional way of gluing things, but not necessarily a compositional way to compose their properties. This is captured by the idea that the functors decorating cospans are lax monoidal and not strict. That is, the best you can say often is "the behavior of the composition is bigger than the behavior of the parts"

view this post on Zulip James Fairbanks (Apr 10 2020 at 13:19):

For a lot of things, that will have to be good enough because the behavior of a system is more complex than the behaviors of the parts. FinSet cospans capture a "systems are networks" perspective and networks do exhibit emergent complexity. If everything was describable by strict functors, there would be no emergent complexity and the CT model of networks as decorated FinSet cospans would be a bad abstraction. I think we can do a lot with just having descriptions of complex systems that are compositional. Instead of representing a network by an edge list, we can represent it as a formula in terms of (generators,,,Δ,id,...) (generators, \circ, \otimes, \Delta, id, ...)

view this post on Zulip James Fairbanks (Apr 10 2020 at 13:22):

even if you can't functorially compute the solution from the formula, you can say a lot of the structure of the problem. That is the focus of my upcoming research projects, if anyone wants to collaborate.

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 13:22):

I agree, for a lot of things this perspective is unavoidable. Still, the way I see it is that "when you have a strict functor then you can claim to really have captured what is going on". To give an example, Quantum Mechanics is full of emergent behavior (think about entangled states) but all the monoidal functors in CQM are strict. This means, in my opinion, that we are able to completely classify the emergent behavior in this field. All in all there is a difference between "emergent behavior which is accounted for in your model" and "emergent behavior that we don't know exactly where it comes from".

view this post on Zulip James Fairbanks (Apr 10 2020 at 13:30):

Yeah I think that difference is important. It is almost like "complex behavior" the behavior of a complex (multiple things together) is more complicated than the behavior of the parts, vs "emergent behavior" when you complex things together, it gets complicated in an unexplained way. We can probably think of that as unexplained variance in a statistical model. As you increase the complexity (degrees of freedom) of a statistical model, you explain more of the variance in the data. But there is always some unexplained variability that is the randomness inherent to the underlying phenomena.

view this post on Zulip Blake Pollard (Apr 10 2020 at 17:59):

The freedom the decorated/structured cospan approach gives you in terms of choosing the inputs/outputs is interesting/under appreciated/potentially confusing. When talking to certain audiences, I would pivot and talk about 'boundary states' as the union of the images of input/output cospan legs, e.g. https://www.mdpi.com/1099-4300/18/4/140/htm

Then if you want to glue along part of the boundary instead of the whole thing, you basically have to introduce the subset of the boundary shared with the other system and you more or less get back into this whole input/output or left/right interface setup. One way I thought about this stuff (inspired by the chemistry/markov semantics) is that boundary states don't obey the 'closed' system dynamics, they have some other stuff going on. If your open reaction network or Markov process is in a steady state, there can be some extra stuff flowing in/out beyond the closed system dynamics at the boundary states. In chemistry/physics this extra stuff can come from a 'reservoir,' which basically is a system that can give/take particles/probability as needed to maintain the steady state. Alternatively, you can look at having some other open chemical reaction network/markov process provide/receive the extra stuff, i.e. composing and then looking at steady states.

view this post on Zulip Blake Pollard (Apr 10 2020 at 18:11):

One interesting thing about the structured setups is that if you have some gizmo, i.e. directed graphs, petri nets, maybe with some labels etc, then all the all the left adjoints, say from set into the category of gizmos, give you different possible 'interface' types.

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:01):

This is all very cool! Recently, I've been wondering about systems that both have this asynchronous "gluing along boundary states" of composition and a synchronous input/ouput composition in the style of these open dynamical systems https://youtu.be/8T-Km3taNko. Dynamical systems defined by indexed vector fields have both types of composition and I was wondering about other systems that do. My original questions was how to think about petri nets with this second type of composition!

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:02):

Maybe the "message level" connections @Fabrizio Genovese pointed to will fit the bill

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:03):

Sophie Libkind said:

This is all very cool! Recently, I've been wondering about systems that both have this asynchronous "gluing along boundary states" of composition and a synchronous input/ouput composition in the style of these open dynamical systems https://youtu.be/8T-Km3taNko. Dynamical systems defined by indexed vector fields have both types of composition and I was wondering about other systems that do. My original questions was how to think about petri nets with this second type of composition!

This is one of the main things I've worked on in the last year or so. Precisely how to do both things in the same formalism

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:03):

Both types of composition in the same formalism?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:03):

There are nice formalisms to do these things separately (unfortunately they are bot called "open petri nets" causing some confusion), but doing both at the same time is tricky

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:04):

I've run into the same linguistic problem with dynamical systems

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:04):

Yes. I want one categorical model where I can connect both synchronously and asynchronously

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:04):

So the stage I'm at now is that I disregarded ports altogether and studied the morphisms in the category of nets with a semantics attached to them which give me this kind of gluing

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:04):

what makes doing both at the same time tricky?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:05):

Now I should get back to ports and try to have them back in in the picture

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:06):

So basically gluing along places amounts to compute pushout, while gluing along transitions amounts to do a double pushout

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:06):

And I still don't know precisely how could I have ports that allow me to do both at the same time :slight_smile:

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:06):

a transition here is a transition of the petri net?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:06):

Yup

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:07):

Gluing along transitions = synchronizing

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:07):

Let me see if i understand this...

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:08):

I'm confused!

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:08):

What does it mean to synchronize along transitions

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:08):

?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:08):

It means that you wanna say "when this transition fires, this other transition has to fire as well"

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:09):

So you can immagine that transitions can "exchange messages between each other" that signal when a transition is firing

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:09):

and you want to synchronize the firings of different transitions

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:10):

For instance you could have a petri net with two transitions A -> B and C -> D. If you synchronize them then you obtain a petri net with one transition A,C -> B, D, in which the two "single transitions" are conflated into one

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:10):

So the Petri net you get is the one that models the idea that "every time the first transition fires the second has to fire as well, and vice-versa"

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:11):

Do you want to do this without conflating the places?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:12):

Yes, transitions should be able to sync even without sharing resources

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:12):

This is literally the modelling of something happening at "event level"

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:12):

You are saying "every time this event happens, this other event has to happen as well"

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:13):

I'm pretty new to petri nets and so far I've mostly used them as petri nets with rates to get a differential equation. Do these concepts translate?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:14):

I don't know about PT nets with rates, we always use "discrete nets" with tokens

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:14):

for us firing is a discrete event, so it makes sense to think about them in this way

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:17):

that makes sense

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:17):

When you think about discrete nets with tokens, what category are you using?

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:18):

The category I "really" work in is the category of free symmetric strict monoidal categories

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:18):

since every Petri nets presents a free SMC

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:19):

And gluings amount to quotient object/morphism generators in these categories

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:20):

You can find a reasonably clean explanation of how we use PT nets here: https://arxiv.org/abs/1906.07629

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:20):

The relevant chapters are from chapter 4 I think

view this post on Zulip Sophie Libkind (Apr 10 2020 at 19:22):

Thanks!

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 19:23):

So the most imporant difference with other formalisms is that we don't use these nets for chemistry, but for orchestraring computation. So we need to be able to distinguish single tokens. This is called "single token philosophy". The consequence is that we don't use the net to present free commutative strict monoidal categories like the UCR group does, but we use them to present free symmetric strict monoidal categories

view this post on Zulip John Baez (Apr 10 2020 at 20:33):

Which means, I believe, that you need pre-nets.

view this post on Zulip John Baez (Apr 10 2020 at 20:39):

I should make Jade rewrite our open Petri net paper for pre-nets. She did a bunch of work on those in Generalized Petri nets. She could easily do open generalized Petri nets, which would include open pre-nets. But the fun part would be getting a functorial semantics for them.

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 21:27):

John Baez said:

Which means, I believe, that you need pre-nets.

Those won't cut it. I wrote a paper about why: https://arxiv.org/abs/1904.12974

view this post on Zulip Fabrizio Genovese (Apr 10 2020 at 21:28):

I've read the generalized Petri nets paper by Jade, it's very nice!

view this post on Zulip John Baez (Apr 11 2020 at 01:07):

Sophie Libkind said:

Thinking out loud: Can I turn a petri net into a moore machine by taking states to be markings of the petri net?

There's probably some good ways to do that! Don't forget that thought!

view this post on Zulip sarahzrf (Apr 11 2020 at 19:20):

Fabrizio Genovese said:

Fabrizio Genovese said:

Just a small aside: The notation input/output may be misleading. Gluing along places is an asynchronous operation, meaning that it does not have directionality per se. So suppose you compose nets N and M, where the output of N matches the input of M. You would expect then that tokens in the output of N get consumed by M, but N could as well "take them back" (e.g if the output place of N is also the input of one of its transitions). For this reason it's probably better to say left and right ports

Also, this sort of behavior is what makes difficult to compositionally evaluate the reachability relation starting from the reachability relation of the components. That is, when you compose along places you can, for instance, create new loops in the composed net, which make the reachability relation richer

oh, this is really interesting

view this post on Zulip sarahzrf (Apr 11 2020 at 19:22):

(tangentially: personally i would almost define "compositionality" as the opposite of "emergent-ness" ("emergency"?), so something lax sounds to me like it's non-compositional)

view this post on Zulip sarahzrf (Apr 11 2020 at 19:22):

the thing about creating loops from gluing together reminds me of something, though...

view this post on Zulip sarahzrf (Apr 11 2020 at 19:24):

oh, i think i know what it is—thinking about string diagrams in compact closed categories & how they appear to have "loops" and "backwards arrows" but formally everything can be sliced up just like normal in an ordinary monoidal category string diagram

view this post on Zulip Fabrizio Genovese (Apr 11 2020 at 19:28):

sarahzrf said:

(tangentially: personally i would almost define "compositionality" as the opposite of "emergent-ness" ("emergency"?), so something lax sounds to me like it's non-compositional)

I totally agree with you on this, but this point of view is controversial. I imagine for many people a lax functor is still compositional.

view this post on Zulip Fabrizio Genovese (Apr 11 2020 at 19:29):

In the case of petri net, the drawback is evident in applications: If the functor is not strict, you can't use the component nets to simplify the model-checking of the composite net.

view this post on Zulip Fabrizio Genovese (Apr 11 2020 at 19:29):

BTW, we know reachability is a superexponential problem, so there will always be corner cases. Still, we can develop compositional model checking techniques to reduce the corner cases to a minimum.

view this post on Zulip Fabrizio Genovese (Apr 11 2020 at 19:31):

compact closed categories and Petri nets are related, but in a bit more strange way: https://arxiv.org/abs/1805.05988
The results in this paper were then further generalized by @Jade Master in https://arxiv.org/abs/1904.09091

view this post on Zulip sarahzrf (Apr 11 2020 at 19:42):

oh hey i have that second paper open in a tab right now :)

view this post on Zulip John Baez (Apr 12 2020 at 00:52):

Speaking of laxness and compositionality: Jade and I came up with a reachability semantics for open Petris that's a lax monoidal double functor in our paper Open Petri nets, and the laxness comes from the ability of tokens to make "zigzags" like this:

  \;

But in my talk this week I described a different reachability semantics that's a strong monoidal double functor, not lax.

So, it's a fun and slightly subtle business.

view this post on Zulip Jules Hedges (Apr 12 2020 at 10:32):

You mean it's lax both as a functor and as a monoidal functor, right? A "lax monoidal lax double functor"? Unless I'm confused, this example was one of my motivations for #practice: applied ct > measuring non-compositionality. Missed the seminar, now I have some serious motivation to catch up to find out what the trick is

view this post on Zulip John Baez (Apr 12 2020 at 21:10):

I'm talking about laxness of functoriality, not monoidality.

view this post on Zulip John Baez (Apr 12 2020 at 21:11):

The lax functoriality of Jade's & my original reachability semantics is explained in this blog article starting at "It's easy to see why":

https://johncarlosbaez.wordpress.com/2018/08/18/open-petri-nets-part-2/

view this post on Zulip John Baez (Apr 12 2020 at 21:13):

I didn't discuss this at all in my talk; instead I presented another reachability semantics that's strongly, not laxly functorial. But this other semantics is much more "bulky" - it's not doing any "black-boxing", it's keeping track of reachability relations involving not just input and output places, but all places.

view this post on Zulip Jade Master (Apr 18 2020 at 22:27):

@Fabrizio Genovese Do you know anything about the complexity of the reachability problem for integer nets?

view this post on Zulip Fabrizio Genovese (Apr 18 2020 at 22:28):

Nope, but i'd guess is lower than the one for standard nets

view this post on Zulip Fabrizio Genovese (Apr 18 2020 at 22:28):

Since you can produce/cancel stuff everywhere you have more strategies to travel from a place to another

view this post on Zulip Fabrizio Genovese (Apr 18 2020 at 22:29):

so it's at best as complex as the standard case

view this post on Zulip Joe Moeller (Apr 19 2020 at 04:40):

An idea I had quite a while ago was to take Jade's Lawvere theory setup for generalized nets and bump it up to 2-theories so you can plug in the SMC and cartesian cat pseudomonads. The hope would be to represent individual token philosophy.

view this post on Zulip sarahzrf (Apr 19 2020 at 04:57):

god dammit is there anyone on this server who hasn't apparently had that idea

view this post on Zulip Joe Moeller (Apr 19 2020 at 05:17):

It's the natural next step.

view this post on Zulip sarahzrf (Apr 19 2020 at 05:26):

alright this is true

view this post on Zulip Fabrizio Genovese (Apr 19 2020 at 16:30):

I don't think it would work

view this post on Zulip Fabrizio Genovese (Apr 19 2020 at 16:31):

I already tried to tame the combinatorial nightmare of symmetries not composing as we would like them to using bicategories

view this post on Zulip Fabrizio Genovese (Apr 19 2020 at 16:31):

And well, it doesn't work. It was a more naive setting than the one you are suggesting tho

view this post on Zulip Jade Master (Apr 19 2020 at 21:21):

@Joe Moeller I like that idea.

view this post on Zulip Jade Master (Apr 19 2020 at 21:28):

Also @sarahzrf. Maybe the generating data would be like a graph in the Kleisli category of the 2-monad

view this post on Zulip Jade Master (Apr 19 2020 at 21:29):

In the case of SMC's you would have a category of transitions, a category of places, and two functors from the transitions to the free smc on the places.

view this post on Zulip Jade Master (Apr 19 2020 at 21:30):

Hm. This isn't quite what you said but maybe it's fun to think about too.

view this post on Zulip Jade Master (Apr 19 2020 at 21:48):

Right. The problem is that if you "2" the Lawvere theory you also gotta "2" the category of models that it lands in.

view this post on Zulip Jade Master (Apr 19 2020 at 21:49):

So that requires you to have more sophisticated generating data like what I described.

view this post on Zulip Joe Moeller (Apr 20 2020 at 16:27):

I mean, you can still take models in Set, because it should be generating a smc internal to Set, so just an smc.

view this post on Zulip sarahzrf (Apr 21 2020 at 05:00):

that sounds slightly off to me

view this post on Zulip sarahzrf (Apr 21 2020 at 05:01):

if SMC is the lawvere 2-theory, then we want nice pseudofunctors SMC → Cat to be SMCs, right?

view this post on Zulip sarahzrf (Apr 21 2020 at 05:01):

so a model in Set should be a nice pseudofunctor SMC → Set

view this post on Zulip sarahzrf (Apr 21 2020 at 05:02):

but that's not an internal SMC, i think? it's just a commutative monoid again, because the higher structure necessarily trivializes into equalities

view this post on Zulip Joe Moeller (Apr 21 2020 at 21:33):

Oh duh. Yes, you take models in Cat to get actual general SMCs.

view this post on Zulip David Tanzer (Jul 10 2020 at 18:50):

A note on the application of Petri nets to compartmental models in epidemiology, such as the commonly cited SIR model:

view this post on Zulip David Tanzer (Jul 10 2020 at 18:50):

...these are simplifying models, which are predicated on the assumption that the epidemic process is Markovian. While this is a plausible assumption for the reaction Susceptible+Infected --> Infected+Infected, it is not plausible for the reaction Infected --> Recovered. The distribution of the infection period is hardly exponential. The simplest model for the infection period would be that it is a constant K. That would lead to a rate equation in which the derivative of the Recovered population equals the size of the Infected population from K days back.

view this post on Zulip David Tanzer (Jul 10 2020 at 18:55):

view this post on Zulip David Tanzer (Jul 10 2020 at 18:56):

While network models capture contact more accurately, the assumption that the underlying stochastic transmission and recovery processes are memoryless (Keeling and Eames 2005; Volz 2008; House and Keeling 2011) remains restrictive. Of course, memoryless processes are mathematically more tractable and relatively simple to analyse when compared to models where the inter-event times are chosen from distributions other than the exponential. However, when compared to data, these assumptions are often violated. For example, diseases can exhibit unique and non-Markovian behaviour in terms of the strength and duration of infection. In this respect, the distribution of the infectious period is usually better approximated by some peaked distribution with a well defined mean, see e.g. Bailey (1954), Gough (1977), Wearing et al. (2005) and references therein.

view this post on Zulip David Tanzer (Jul 10 2020 at 19:04):

The Markov assumption involved in SIR could be a workable approximation as the infection period is small in comparison to the duration of the epidemic. But it does suggest that the application SIR etc. deserves to reviewed in each empirical context as there is a built-in error term here.

view this post on Zulip David Tanzer (Jul 10 2020 at 19:09):

Of course there is another simplifying assumption in these models, which is that the population is well-mixed. But that is commonly acknowledged. This one deserves to be included in the footnotes as well. The wikipedia article on compartmental models in epidemiology, for example, makes no mention of it. I will add something there...

view this post on Zulip Jules Hedges (Jul 10 2020 at 20:15):

Interesting..... I've been wondering whether Petri nets are actually used in real life epidemiology, or if that's a just a lie that keeps circulating. (From what little I've seen of epidemiology it seems to be mostly statistics)

view this post on Zulip David Tanzer (Jul 10 2020 at 21:18):

It looks like both compartmental models and agent-based models are being used these days.

view this post on Zulip David Tanzer (Jul 10 2020 at 21:20):

Agent-based models are a stochastic refinement, which in principle will track the stochastic behaviors of each individual. As such, they are data-hungry.

view this post on Zulip James Fairbanks (Jul 10 2020 at 21:22):

Yes compartmental models are the main tool for understanding the dynamics a the macro scale. ABMs are useful for understanding the effects of intervention strategies like modeling the movement of people through a hospital floor and deciding how to place PPE or hand hygiene resources to maximize effectiveness.

view this post on Zulip David Tanzer (Jul 10 2020 at 21:37):

That makes sense.

view this post on Zulip Jules Hedges (Jul 10 2020 at 21:39):

Thanks!

view this post on Zulip David Tanzer (Jul 10 2020 at 21:40):

Abstract. Continuous time deterministic epidemic models are traditionally formulated as systems of ordinary differential equations for the numbers of individuals in various disease states, with the sojourn time in a state being exponentially distributed. Time delays are introduced to model constant sojourn times in a state, for example, the infective or immune state. Models then become delay-differential and/or integral equations. For a review of some epidemic models with delay see van den Driessche [228]. More generally, an arbitrarily distributed sojourn time in a state, for example, the infective or immune state, is used by some authors (see [69] and the references therein).

view this post on Zulip David Tanzer (Jul 10 2020 at 21:48):

I see there's a whole bunch of literature on non-Markovian stochastic Petri nets.

view this post on Zulip James Fairbanks (Jul 10 2020 at 21:48):

Here are a bunch of different implementations of SIR models https://github.com/epirecipes/sir-julia

view this post on Zulip John Baez (Jul 10 2020 at 21:48):

When things get fancy enough it may cease to be useful to call them "Petri nets", but they can still be useful.

view this post on Zulip James Fairbanks (Jul 10 2020 at 21:49):

The maintainer of that repo was at a University in the UK until recently now he works at Microsoft studying infectious disease prediction.

view this post on Zulip James Fairbanks (Jul 10 2020 at 21:52):

One of our goals in using open Petri nets is to expand the complexity of the models while ensuring correctness and the ability to estimate parameters. Because as model complexity increases, the data requirements for calibration also increase and we want to find ways to mitigate that.

view this post on Zulip David Tanzer (Jul 10 2020 at 21:55):

@James Fairbanks Is there a good place to read more about the project(s) you are referring to?

view this post on Zulip John Baez (Jul 10 2020 at 21:56):

I'm glad Petri nets are being useful to you, James!

view this post on Zulip James Fairbanks (Jul 10 2020 at 21:56):

The AlgebraicJulia repo is where we are currently coordinating activity

view this post on Zulip David Tanzer (Jul 10 2020 at 22:36):

Thanks James!

view this post on Zulip David Tanzer (Jul 10 2020 at 23:25):

I'm looking for a solid, modern textbook in mathematical epidemiology. I see that Springer has a bunch of books on the subject. If anyone has a favorite to recommend... Thanks

view this post on Zulip John Baez (Jul 10 2020 at 23:28):

I don't have one. Sounds like a nice question. (You could ask Carl Bergstrom on Twitter.)

view this post on Zulip Paul Pukite (Jul 11 2020 at 01:32):

Regarding delayed differential equations, you may be able to sequence several Markov flows in series to approximate the delay. Each will increase the order of a gamma function, approximating a delayed delta function for N large enough.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:12):

Speaking from 10,000 feet away (having never done such simulations):

view this post on Zulip David Tanzer (Jul 11 2020 at 02:14):

I would think that, given that you are running a simulation, using delayed differential equations wouldn't be worse than using non-delayed equations, given that you have access to the whole history of the simulation.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:17):

There's also the theoretical question of putting a bound on how much error would be caused by simplifying to the Markovian equations.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:40):

Searching around, I'm having trouble finding any clear answers to how long the covid-19 "infectious period" actually is. Ultimately we'd want to know its distribution, and use that as a windowing function when looking back in time during the simulation. Even that would be simplified, as it ignores the fact that infectiousness is a matter of degree.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:42):

One could use simulations to get a handle on the error bound. I.e., just compare the global solutions produced by refined models of the infectious period with the solutions produced by the simple ODEs.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:47):

If there were a sensitivity here then we could regress against empirical data to estimate the infectivity parameters.

view this post on Zulip David Tanzer (Jul 11 2020 at 02:49):

My WAG is that there isn't a significant sensitivity here, that these variations would just fall into the pot of noise that's already there. Partly this is based on the fact that you don't hear a lot of discussion about this aspect of the simulation. But clearly these are not truly satisfying answers.

view this post on Zulip Paul Pukite (Jul 11 2020 at 16:41):

Given the latest information that the virus is airborne, and therefore air circulation and dispersion are important factors, a rethinking in terms of fluid dynamics and filtration may be forthcoming. Clean-room thinking

view this post on Zulip David Tanzer (Jul 11 2020 at 18:00):

Let me know if I'm missing something here, but it sounds like that's still consistent with a compartmental, reaction-network based framework. It would be change to our understanding of the physical mechanisms by which the reactions are "implemented."

view this post on Zulip David Tanzer (Jul 11 2020 at 18:02):

The idea of compartments clearly remains. And the aggregate law which says that the derivative of Infected is proportional to the product of Infected and Susceptible still looks valid, given a set of general conditions for quality of air filtration, etc.

view this post on Zulip David Tanzer (Jul 11 2020 at 18:08):

So you have a "stochastic Petri net," with a coefficient for each process. These coefficients show up in the ODEs for the rate equations. The coefficients themselves are complex functions of natural parameters like virus transmissibility, incubation period, as well as social parameters like the degree of distancing; now we add into that mix parameters like average quality of air filtration.

view this post on Zulip Paul Pukite (Jul 11 2020 at 22:21):

Not sure what the goal is. If it can be shown that by increasing social distance by another meter that viral transmission can be reduced by orders of magnitude via 3D dispersion, that's what will be important to model. I would like to concentrate on the applied aspects and potentially determine which factors make a difference to stopping the spread of the disease.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:31):

That would be a great goal for you to pursue, especially given your expertise in the physical sciences.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:33):

But we’re talking about different branches of epidemiology. One is the investigation of local physical mechanisms of transmission. The other is “macro-epidemiology,” which studies the movement of aggregate quantities, abstracted from physical detail.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:34):

When a baseball player hits a home run, the event can be understood on multiple levels: the sportscaster’s description; the physicist speaking in terms of center of mass of the ball, collisions, parabolic trajectories; the more detailed view of the materials scientist.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:37):

Regarding goals. As science, the first goal is to understand the reality. This includes modeling, and reconciliation with empirical data.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:38):

Compartmental models are integral part of the textbook introductions to mathematical epidemiology, e.g. https://www.springer.com/us/book/9781489976116

view this post on Zulip David Tanzer (Jul 12 2020 at 20:38):

There’s more, though, as there is a clear need for macro-epidemiological models to inform the trade-offs faced by public policy planners. It’s all over the map that SEIR models are a key part of the practitioner’s toolbox for COVID-19 modeling.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:51):

More generally speaking, applied reaction networks are of particular interest to the ACT community, as they give a clear example of a mathematical concept with categorical properties and substantive empirical applications.

view this post on Zulip David Tanzer (Jul 12 2020 at 20:59):

Culturally, the aim here is to create an interdisciplinary community drawing from a diverse range of mathematical fields and application domains, with the hope of promoting new collaborations, connections and discoveries. It’s an exploratory quest.

view this post on Zulip Paul Pukite (Jul 14 2020 at 01:57):

Diffusion is compartmental modeling on an infinitesimal scale, whereby each tiny compartment is connected to an adjacent compartment by a random walk. This is a basic interpretation based on the understanding that an airborne virus will travel by convection and turbulent diffusion. I mention this because it is an application of compartmental models, but extended to a continuum limit.

view this post on Zulip David Tanzer (Jul 15 2020 at 01:55):

Nice observation

view this post on Zulip Paul Pukite (Jul 17 2020 at 06:16):

Notes on aerosol transmission https://twitter.com/Bob_Wachter/status/1283970874631000065 "Aerosol scientists like Milton think about mechanisms/particles differently than MDs."

1/ Covid (@UCSF) Chronicles, Day 121 Grand rounds today, here: https://tinyurl.com/y5ut4435. As I said in my intro (@ 1:00), we covered perhaps the most important topics in the world today: how SARS-Co-V-2 spreads & what can be done to prevent it.

- Bob Wachter (@Bob_Wachter)