Skip to content
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

Algebra Tool Feature Request: Merge tags of merged nodes #24

Closed
Arminius opened this issue Feb 26, 2021 · 9 comments
Closed

Algebra Tool Feature Request: Merge tags of merged nodes #24

Arminius opened this issue Feb 26, 2021 · 9 comments

Comments

@Arminius
Copy link

Hello once again,

let me illustrate the issue with a minimal example:
I have two petri nets, each with only one place.
In the first petri net, the place is tagged a and also has one initial marking:
pic
In the second petri net, the place is tagged a|b and has no initial markings:
pic

I would like to use the algebra tool to merge these two nets into one net whose place with the tags a|b and an initial marking. But using this tool, the result is simply equal to one of my input nets, whichever one was the first operand of the merge. Whichever way I merge, some information is lost, either the b tag or the initial marking.

If you're curious as to why I want this, I actually have three petri nets A, B, and an intermediate petri net M. The end result is a merger of and A and B, but M contains the information of which nodes are to be merged, e.g. if A has a node tagged a and B has a node tagged b which I want to merge, I'll add a node tagged a|b to M. I'm building an automated system where it's not feasible for me to merge A and B directly with each other.
Now M does not know anything specific about the nodes in A or B, such as initial markings or firing rates, so I need to retain the information about the actual nodes from A and B while keeping the tagging information from M. Currently, if I merge A with M, I either forget what the actual nodes are or which nodes from B I need to merge with.

@amparore
Copy link
Collaborator

amparore commented Feb 26, 2021 via email

@Arminius
Copy link
Author

I don't think a cross-product would address my problem. I do only want a basic superposition, but I don't think I can ensure the constraint that each tag appears only once.

I don't fully understand the specification.
Does using M as the first operand resolve the issue? Or do you have some
information from M and some other from A that you want to combine?

I lose important information if I use M as my first operand. I guess I should use another example, less minimal and closer to my actual problem:
Net A has a place going into a timed transition tagged a: pic
Net B has a timed transition tagged b going into a place: pic

Net M consists of a single transition tagged a|b to signify that transition a has to be merged with transition b. M does not know the firing rate of the transition to be merged or even that it is a timed transition, so I represent it as an immediate transition:
pic

If I merge M and A and B, in that order, I get the following:
pic
This is a place going into a transition going into another place, which is roughly want I want, except the timing information on the transition is lost - it has become an immediate transition.

If I merge A and M, I lose the tag b on the transition and I can no longer merge with B.

@Arminius
Copy link
Author

Arminius commented Feb 26, 2021

Another way of stating what I would have expected: If you merge a node with tags a|b with another node with tags a|c over the tag a, the result should have the tags a|b|c. If the actual node itself is a copy of the node from the first operand, that is fine. Is merging the tags like this feasible?

@amparore
Copy link
Collaborator

amparore commented Feb 26, 2021 via email

@Arminius
Copy link
Author

Wow, I did not expect you to start working on this so quickly!

Unfortunately, if I try this switch to merge net A and net M from my previous example, the algebra tool throws a segmentation fault.

It does work wonderfully with the other example where I merge a node a|b with another node a|c, though.

Could I ask you to look into what's happening with my first example? Net M simply looks as follows:
One immediate transition tagged a|b

@amparore
Copy link
Collaborator

amparore commented Feb 27, 2021 via email

@Arminius
Copy link
Author

Arminius commented Mar 3, 2021

Hey, sorry for not responding for a while.
I've gathered the relevant files in a zip archive. The pnpro files were created with the GreatSPN Editor; the other files were generated from those using the tool unfolding2.

@amparore
Copy link
Collaborator

amparore commented Mar 3, 2021 via email

@Arminius
Copy link
Author

Arminius commented Mar 3, 2021

Thanks! Now it works exactly as I imagined it.

Thank you again for making such quick work of this feature request.

@Arminius Arminius closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants