-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Represent transition firing as composition. #3
Comments
I may have an alternative idea which could maybe simplify this a bit. Handle with care, this is a bit sketchy Consider the state as a partial function Then, to represent the transition Notice that this representation is possible only if our set/type of indices for the Tokens allows to auto-generate the next index (in our example it would be 6). This property holds even if we would like to use UUIDs as keys to identify the tokens, which would probably be nice from an implementation point of view. If this property does not hold, we should also specify a new key in the second component of the pair which describes the transition. |
This is interesting, but I have a question: In this representation function domain is implicit. This means that if I specify a transition AxB -> C as, say, My suggestion is this: On smproc I have seen that James defines a helper function that turns every function The helper function above is great because I can specify some functions (i.e. populate transitions with semantic meaning in my Petri net) and then generating the corresponding category just by applying that helper function to all transitions. What do you think? |
I will definitely have a look at smproc. Regarding you question, I wouldn't say that we are assuming that |
The firing of a transition in a category
FSMC(o,m,source,target)
(see #2 for details) can be represented as a functionMorally, you give me the current
state
of the net (represented by a string diagram), a transitiont
(which is a generating morphism in the category) and the tokens on which you wanna fire it,tokens
(details missing here!) and I give you the next state by postcomposingt
withstate
as specified bytokens
. Clearly this thing should be defined only for suitablet
,state
,tokens
.There is a slight problem here: Suppose I have state:
A x A x C x B x C x D
and I want to fire a transitiont: A x D -> C
using the secondA
and the onlyD
in the state. To make this work:A
andD
come together and we can applyt
. We want to do this in a "canonical" way (meaning that we want to find a way to do this that works in the same way for any possible enabled transition in the state).A(1) x A(2) x C(1) x B x C(2) x D
toA(2) x D x A(1) x C(1) x B x C(2)
(I am using numbers to distinguish copies of the same generating object). This means that the tokens that have to be used are rearranged to become the first in the product.t : GenMor(FSMC(o,m,source,target)) -> state : Mor(FSMC(o,m,source,target)) -> tokens : Obj(FSMC(o,m,source,target))
and I give you a list of symmetries tensored with identities that can be sequentially composed withstate
to reshuffle the object in its target as we want. In our example this effectively mapsstate
, having codomainA(1) x A(2) x C(1) x B x C(2) x D
, tostate'
having codomainA(2) x D x A(1) x C(1) x B x C(2)
.state'
witht x id_A x id_C x id_B x id_C
and obtain the state representing the firing oft
in statestate
using tokenstokens
.t
tensored with identities as in point ii.Note: If our nets are safe then we don't need to specify
tokens
in our function. This is because in a product all objects will be different: For instance in our exampleA(1) x A(2) x C(1) x B x C(2) x D
represents having 2 tokens inA
and two inC
, which is not possible if the net is safe.You see then that in a safe net a possible state is a product of objects
X_1 x X_2 x ... x X_n
where all theX_i
are generating objects different from each other. In such a situation, if you give me a transitiont
, two things can happen:t
are present in the codomain ofstate
. In this case there is only one possible way to reshuffle the tokens in the codomain of state as specified above to compose witht
.t
are not present in the codomain ofstate
. In this caset
is not enabled instate
and so our stuff shouldn't typecheck.The text was updated successfully, but these errors were encountered: