proposed new definition of preemption

There hasn't been much commentary on this subject recently, so I'm sending around my proposed new definition of preemption.  For starters,   I think that we can get rid of the term 'preemption' altogether, and just talk about conflicting transitions.   My questions are:

1.        Is the algorithm below correct?

2.       Is it clear?

3.       Is it a good idea to get rid of the word "preemption"?  (the selectTransitions functions have to be modified to call removeConflictingTransitions instead of filterPreempted, but the argument to the functions and the return values are the same.  hasIntersection() und union() are defined in the list of functions/procedures at the top of the algorithm)

4.       Is there a better way to do this?


-          Jim

function removeConflictingTransitions(enabledTransitions)
enabledTransitions will contain multiple transitions only if a parallel state is active. In that case, we may have one transition selected for each of its children. These transitions may conflict with each other in the sense that they have incompatible target states. Loosely speaking, transitions are compatible when each one is contained within a single <state> child of the <parallel> element. Transitions that aren't contained within a single child force the state machine to leave the <parallel> ancestor (even if they reenter it later). Such transitions conflict with each other, and with transitions that remain within a single <state> child, in that they may have targets that cannot be simultaneously active. The test that transitions have non-intersecting exit sets captures this requirement. (If the intersection is null, the transitions are contained in separate <state> descendents of <parallel>. If intersection is non-null, then at least one of the transitions is exiting the <parallel>). When such a conflict occurs, we select the first transition in document order and discard the other transition. Note that targetless transitions have empty exit sets and thus do not conflict with any other transitions.
function removeConflictingTransitions(enabledTransitions):
    filteredTransitions = new OrderedSet()
    totalExitSet = new OrderedSet()
    for t in enabledTransitions:
        if not totalExitSet.hasIntersection(computeExitSet(t)):
            filteredTransitions.add(t)
            totalExitSet.union(computeExitSet(t))
    return filteredTransitions

Received on Monday, 25 February 2013 15:53:36 UTC