runPN :: (a -> SimFlow ()) -> PN SimFlow SimValue -> Marking SimValue -> [a] -> SimFlow (Marking SimValue)
    runPN setTime pn marking times = run pn marking times
        where
            step pn marking time = do
                setTime time
                -- simFlowSet TimeRef $ TimeState time
                (progress, marking') <- stepPN pn marking
                return (not progress, marking')

            run _ marking [] = return marking
            run pn marking (time:times) = do
                (stop, marking') <- step pn marking time
                if stop
                    then return marking'
                    else run pn marking' times
runPN :: (a -> SimFlow ()) -> PN SimFlow SimValue -> Marking SimValue -> [a] -> SimFlow (Marking SimValue)
runPN setTime pn marking times = run pn marking times
        where
            step pn marking time = do
                setTime time
                -- simFlowSet TimeRef $ TimeState time
                (progress, marking') <- stepPN pn marking
                return (not progress, marking')

            run _ marking [] = return marking
            run pn marking (time:times) = do
                (stop, marking') <- step pn marking time
                if stop
                    then return marking'
                    else run pn marking' times
runPN setTime pn marking times = run pn marking times
        where
            step pn marking time = do
                setTime time
                -- simFlowSet TimeRef $ TimeState time
                (progress, marking') <- stepPN pn marking
                return (not progress, marking')

            run _ marking [] = return marking
            run pn marking (time:times) = do
                (stop, marking') <- step pn marking time
                if stop
                    then return marking'
                    else run pn marking' times