ides.api.plugin.operation
Class FSAToolbox

java.lang.Object
  extended by ides.api.plugin.operation.FSAToolbox

public class FSAToolbox
extends java.lang.Object

A class of methods useful for checking FSAModels for certain criteria.

Author:
Valerie Sugarman

Field Summary
static java.lang.String ERROR_CONTROL
          A standard error message which can be used by Operations.
static java.lang.String ERROR_OBSERVE
          A standard error message which can be used by Operations.
static java.lang.String ERROR_UNABLE_TO_COMPUTE
          A standard error message which can be used by Operations.
static java.lang.String ILLEGAL_ARGUMENT
          A standard error message which can be used by Operations.
static java.lang.String ILLEGAL_NUMBER_OF_ARGUMENTS
          A standard error message which can be used by Operations.
static java.lang.String NO_MARKED_STATES
          A standard error message which can be used by Operations.
static java.lang.String NON_DETERM
          A standard error message which can be used by Operations.
static java.lang.String NOT_1_INITIAL_STATE
          A standard error message which can be used by Operations.
 
Method Summary
static boolean containsEpsilonTransitions(FSAModel model)
          Determines if there are any epsilon transitions in the model.
static java.util.Set<java.lang.Long> getEpsilonTransitions(FSAModel model)
          Obtains a set of the ids of all epsilon transitions in the model.
static java.util.Set<java.lang.Long> getInitialStates(FSAModel model)
          Obtains a set of the ids of all initial states in the model.
static java.util.Set<java.lang.Long> getMarkedStates(FSAModel model)
          Obtains a set of the ids of all marked states in the model.
static boolean hasControllabilityConflict(FSAModel[] models)
          A check to see whether there is a conflict in the controllability attribute of events contained in the given models.
static boolean hasObservabilityConflict(FSAModel[] models)
          A check to see whether there is a conflict in the observability attribute of events contained in the given models.
static int initialStateCount(FSAModel model)
          Identifies the number of initial states in the model.
static boolean isDeterministic(FSAModel model)
          Determines whether the model is deterministic, i.e.
static boolean isEmptyLanguage(FSAModel model)
          Determines whether the language represented by the automaton is empty.
static boolean isEmptyModel(FSAModel model)
          Determines whether the given model is empty (has no states).
static boolean isEpsilonLanguage(FSAModel model)
          Determines whether the language represented by the automaton is the epsilon language.
static int markedStateCount(FSAModel model)
          Identifies the number of marked states in the model.
static FSAModel modelFromList(java.util.List<DESEvent> list)
          Constructs an FSAModel representing a string from a list of DESEvents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_1_INITIAL_STATE

public static final java.lang.String NOT_1_INITIAL_STATE
A standard error message which can be used by Operations.

None or more than one initial states.


NO_MARKED_STATES

public static final java.lang.String NO_MARKED_STATES
A standard error message which can be used by Operations.

No marked states.


ILLEGAL_ARGUMENT

public static final java.lang.String ILLEGAL_ARGUMENT
A standard error message which can be used by Operations.

Illegal argument.


ILLEGAL_NUMBER_OF_ARGUMENTS

public static final java.lang.String ILLEGAL_NUMBER_OF_ARGUMENTS
A standard error message which can be used by Operations.

Unsupported number of arguments.


NON_DETERM

public static final java.lang.String NON_DETERM
A standard error message which can be used by Operations.

Nondeterministic model.


ERROR_CONTROL

public static final java.lang.String ERROR_CONTROL
A standard error message which can be used by Operations.

Mismatch between the controllability attributes of events.


ERROR_OBSERVE

public static final java.lang.String ERROR_OBSERVE
A standard error message which can be used by Operations.

Mismatch between the observability attributes of events.


ERROR_UNABLE_TO_COMPUTE

public static final java.lang.String ERROR_UNABLE_TO_COMPUTE
A standard error message which can be used by Operations.

Unable to compute the operation.

Method Detail

getInitialStates

public static java.util.Set<java.lang.Long> getInitialStates(FSAModel model)
Obtains a set of the ids of all initial states in the model.

Parameters:
model - the model in which to find the initial states
Returns:
a set of the ids of all initial states in the model

initialStateCount

public static int initialStateCount(FSAModel model)
Identifies the number of initial states in the model.

Parameters:
model - the model in which to find the number of initial states
Returns:
the number of initial states in the model

getMarkedStates

public static java.util.Set<java.lang.Long> getMarkedStates(FSAModel model)
Obtains a set of the ids of all marked states in the model.

Parameters:
model - the model in which to find the marked states
Returns:
a set of the ids of all marked states in the model

markedStateCount

public static int markedStateCount(FSAModel model)
Identifies the number of marked states in the model.

Parameters:
model - the model in which to find the number of marked states
Returns:
the number of marked states in the model

getEpsilonTransitions

public static java.util.Set<java.lang.Long> getEpsilonTransitions(FSAModel model)
Obtains a set of the ids of all epsilon transitions in the model.

Parameters:
model - the model in which to find the epsilon transitions
Returns:
a set of the ids of all epsilon transitions in the model

containsEpsilonTransitions

public static boolean containsEpsilonTransitions(FSAModel model)
Determines if there are any epsilon transitions in the model.

Parameters:
model - the model in which to determine if there are epsilon transitions
Returns:
true if there is at least one epsilon transition in the model, false otherwise.

isEmptyModel

public static boolean isEmptyModel(FSAModel model)
Determines whether the given model is empty (has no states).

Parameters:
model - the model to be checked
Returns:
true if the model contains no states, false otherwise.

isEmptyLanguage

public static boolean isEmptyLanguage(FSAModel model)
Determines whether the language represented by the automaton is empty.

Parameters:
model - the model under consideration
Returns:
true if the language represented by the automaton is empty, false otherwise.

isEpsilonLanguage

public static boolean isEpsilonLanguage(FSAModel model)
Determines whether the language represented by the automaton is the epsilon language.

Parameters:
model - the model under consideration
Returns:
true if the language represented by the automaton is the epsilon language, false otherwise.

isDeterministic

public static boolean isDeterministic(FSAModel model)
Determines whether the model is deterministic, i.e. contains no epsilon transitions, has no more than one initial state (but could have none), and from each state there is not more than one transition with a given event.

Parameters:
model - the model to be checked
Returns:
false if model contains epsilon transitions, has more than one initial state or has a state with more than one transition firing on the same event, true otherwise.

hasControllabilityConflict

public static boolean hasControllabilityConflict(FSAModel[] models)
A check to see whether there is a conflict in the controllability attribute of events contained in the given models.

Parameters:
models - the models containing the events whose controllability attributes have to be checked for conflict
Returns:
true if an event with the same name exists in any pair of models but is controllable in one and uncontrollable in the other, false otherwise.

hasObservabilityConflict

public static boolean hasObservabilityConflict(FSAModel[] models)
A check to see whether there is a conflict in the observability attribute of events contained in the given models.

Parameters:
models - the models containing the events whose observability attributes have to be checked for conflict
Returns:
true if an event with the same name exists in any pair of models but is observable in one and unobservable in the other, false otherwise.

modelFromList

public static FSAModel modelFromList(java.util.List<DESEvent> list)
Constructs an FSAModel representing a string from a list of DESEvents.

Parameters:
list - The list of DESEvents to construct the FSAModel from.
Returns:
FSAModel representing the given string.