forked from SWISDATA/processintel
converters.petri_net: the inductive Petri net models an XOR join as an AND join #4
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: medium (the net is wrong after every XOR, but the Petri net view is opt-in and nothing in the app replays it)
Where
app/converters/petri_net_converter.py:124-141Problem
When a process tree is converted into a Petri net, an
xornode gets one silent join transition, and the exit place of every branch is connected to it:A Petri-net transition only fires when all of its input places hold a token. In an exclusive choice only one branch is executed, so only one
child_exitreceives a token. The join can never fire, and the net deadlocks after every XOR block.In Petri net notation the drawing shows an AND join; only the tooltip of the exit place says "Exclusive". The
"par"case is correct.Steps to reproduce
{a,b,d: 5, a,c,d: 5, a,b,e,d: 1})Or test the converter directly with the tree
('seq','a',('xor','b','c'),'d').Expected behavior
Each XOR branch connects to the shared exit place through its own silent transition, and every trace of the log can reach
p_end.Actual behavior
All branches feed the same silent transition, which can never fire. No trace through an XOR block reaches
p_end; the net is unsound. The DOT/SVG/PNG exports and the pickledpetri_netshow the wrong net.Corrections from the review
a,b,d/a,c,dfrom the first draft does not trigger the bug: the SPM filter removesbandcat every threshold.petri_netdict.('seq',('xor',a,b),('xor',c,d))the middle place is first tagged as an XOR join, then as an XOR split (petri_net_converter.py:130-131). This only affects tooltips.base_mining.py:424,:437-440). This needs its own issue.Fix
In
build_fragment, branchop == "xor"(petri_net_converter.py:124-141):join_id = new_tau("xor_join")and itsregister_transition(:127-128)toolkit.add_arc(child_exit, join_id)(:139) withconnect_places(child_exit, exit_place, "xor_join")toolkit.add_arc(join_id, exit_place)(:140)Building each child with
exit_override=exit_placeis also correct and gives fewer silent transitions.Check
New
tests/converters/petri_net_converter_test.py. Do not usesimulate_traceas the oracle: it fires silent transitions greedily (petri_net.py:150-163,:360-383) and rejects valid traces even on the fixed net. Use a small strict reachability helper. Cover:xorinsideseq('xor','tau',X)(optional activity)xorat the root (exit =p_end)xoras a loop redofrom
issues/BUG-004-inductive-petri-net-xor-join-is-and-join.md(code analysis of commit6bcc646, 2026-10-03), corrected by the review inverdicts-claude/BUG-004-inductive-petri-net-xor-join-is-and-join.md