Commit e76ce855 authored by Philipp Meyer's avatar Philipp Meyer
Browse files

Generated smaller cuts by removing outputs of other traps

parent 23c15ac1
......@@ -100,12 +100,11 @@ instance Show PetriNet where
-- TODO: better cuts, scc, min cut?
constructCut:: PetriNet -> FiringVector -> [Trap] -> Cut
constructCut net _ traps =
uniqueCut (map trapComponent traps, concatMap trapOutput traps)
where trapComponent trap =
(trap, mpre net trap)
constructCut net _ traps = (trapComponents, trapOutputs)
where trapComponent trap = (sort trap, sort (mpre net trap) \\ trapOutputs)
trapComponents = listSet $ map trapComponent traps
trapOutput trap = mpost net trap \\ mpre net trap
uniqueCut (ts, u) = (listSet (map (sort *** sort) ts), listSet u)
trapOutputs = listSet $ concatMap trapOutput traps
renamePlace :: (String -> String) -> Place -> Place
renamePlace f (Place p) = Place (f p)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment