|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ksu.cis.projects.bogor.module.DefaultSearcher
public class DefaultSearcher
| Nested Class Summary | |
|---|---|
protected class |
DefaultSearcher.FoundValueException
|
protected class |
DefaultSearcher.MaxErrorReachedException
|
| Fields inherited from interface edu.ksu.cis.projects.bogor.module.ISearcher |
|---|
ASSERTION_FAILED_CODE, EXT_FAILED_CODE, ILL_FORMED_MODEL_CODE, INVALID_END_STATE_CODE, INVARIANT_VIOLATED_CODE, RANGE_EXCEPTION_CODE, UNCAUGHT_EXCEPTION_CODE |
| Constructor Summary | |
|---|---|
DefaultSearcher()
|
|
| Method Summary | |
|---|---|
protected void |
addAll(ArrayList<IBacktrackingInfo> result,
IBacktrackingInfo[] bis)
|
boolean |
backtrack()
Backtracks and executes the next unexecuted transformation sibling (if any). |
protected IBacktrackingInfo |
backtrack(IState state,
ArrayList<IBacktrackingInfo> backtrackingInfos)
|
protected IBacktrackingInfo |
backtrackToTransitionBeginning(IState state,
ArrayList<IBacktrackingInfo> backtrackingInfos)
Rolls back the state to the moment just before the most recent transition. |
protected void |
checkExceptions()
|
protected boolean |
checkInvariants()
|
IMessageStore |
connect(IBogorConfiguration bc)
Connects this modules to other modules. |
protected ISchedulingStrategyContext |
createContext(int stateId,
int invisibleMoves,
int threadId,
IState state)
|
protected IEnabledTransformationsContext |
createContext(IState state,
int stateId,
int invisibleMoves,
int[] threadIds)
|
IState |
createInitialState()
Creates the initial state. |
void |
dispose()
Remove references. |
protected void |
doPostTransformationBookkeeping(int lastMovedThreadId,
ISchedulingStrategyInfo ssi)
|
void |
doTransition(int threadId,
Transformation t,
Action a)
Executes a transformation. |
protected void |
doTransition(ISchedulingStrategyContext ssc,
Transformation t,
Action a)
|
protected void |
dumpBacktrackingStack(PrintWriter pw,
ArrayList<IBacktrackingInfo> backtrackingInfos)
|
void |
error(int errCode)
Signal an error has been found. |
protected ArrayList<ICounterExampleSchedulingInfo> |
extractErrorSchedule(ArrayList<IBacktrackingInfo> backtrackingInfos)
|
protected void |
fillInitialVariableValues(IState vanillaState,
IStateFactoryArguments args)
|
protected ITransformationsBacktrackingInfo |
findMostRecentTransformationBacktrackingInfo()
|
ArrayList<IBacktrackingInfo> |
getBacktrackingInfos()
Gets the list of backtacking information from the initial state to the current state (last completed transformation). |
String |
getCopyrightNotice()
Returns the copyright notice for this module. |
int |
getErrorCount()
Gets the number of errors found in the model so far. |
protected FSMSymbolTable |
getFSMSymbolTable(int locDesc)
|
protected FSMSymbolTable |
getFSMSymbolTable(IState state,
int threadId)
|
protected IStateFactoryArguments |
getInitialStateFactoryArguments()
|
protected Location |
getLocation(int locDesc)
|
protected Location |
getLocation(IState state,
int threadId)
|
protected String |
getMemory(long mem)
|
Pair<Domain,Boolean> |
getOptionDomain(String id)
|
Collection<Triple<String,Boolean,OptionScope>> |
getOptionIds()
|
IState |
getState()
Gets the current state. |
Collection<String> |
getSuggestedValues(String id,
IBogorConfiguration bc,
SymbolTable st)
|
protected String |
getTime(long time)
|
void |
initialize()
Perform all work preceding the a call to search(). |
protected void |
makeChoices(IntObjectTable<ArrayList<Transformation>> ets,
int[] threadIds,
Transformation[] transformations)
|
void |
search()
Starts the search. |
IMessageStore |
setOptions(String key,
Properties configuration)
Sets the options for this module. |
protected boolean |
shouldActivateThread(FSM fsm)
|
protected boolean |
shouldBacktrack()
|
boolean |
shouldStore()
Determines whether the current state should be stored in the seen before set. |
boolean |
step()
Executes an enabled transformation (if any). |
boolean |
stepBackward()
Backtracks to just before the beginning of the most recent transition executed. |
boolean |
store()
Stores the current state. |
protected void |
storeCounterExample(ArrayList<IBacktrackingInfo> backtrackingInfos,
int stateId,
int invisibleMoves,
String reason)
|
boolean |
validate(String id,
String value,
IBogorConfiguration bc,
SymbolTable st,
Collection<FileMessage> errors)
Checks whether the value of a configuration option is legal. |
void |
writeCounterExamples()
Externalize all counter-examples found so far. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String PRINT_VERBOSE_TRACE_ID
protected static final String PRINT_STATUS_ID
protected static final String TRAIL_EXT
protected static final String PRINT_COUNTER_EXAMPLES_ID
protected static final String WRITE_TRAIL_FILE_ID
protected static final String ALL_AS_ERRORS_ID
protected static final String MAX_ERRORS_ID
protected static final String MAX_DEPTH_ID
protected static final String MAX_INVISIBLE_MOVES_ID
protected static final String UPDATE_STATE_INCREMENT_ID
protected static final String UPDATE_TRANSITION_INCREMENT_ID
protected static final String INVARIANTS_ID
protected static final String CHECK_BACKTRACK_ID
protected boolean printCounterExamples
protected boolean writeTrailFile
protected boolean allAsErrors
protected boolean printVerboseTrace
protected boolean printStatus
protected int maxErrors
protected int maxDepth
protected int updateStateIncrement
protected int maxInvisibleMoves
protected long updateTransitionIncrement
protected boolean checkBacktrack
protected String[] invariants
protected PrintWriter pw
protected ArrayList<IBacktrackingInfo> backtrackingInfos
protected IBogorConfiguration bc
protected IActionTaker at
protected IBacktrackingInfoFactory bif
protected ICounterExampleWriter cew
protected IExpEvaluator ee
protected ISchedulingStrategist ss
protected IState state
protected IStateFactory sf
protected IStateManager sm
protected ISearcher sr
protected ITransformer tr
protected IValueFactory vf
protected IProgressManager pm
protected SymbolTable symbolTable
protected boolean isInvisible
protected boolean seenState
protected int lastMovedThreadId
protected int stateId
protected int invisibleMoves
protected int currentDepth
protected int currentMaxDepth
protected int errors
protected int seenStates
protected long startTime
protected long transitions
protected long lastUpdatedTransitions
protected int lastUpdatedStates
| Constructor Detail |
|---|
public DefaultSearcher()
| Method Detail |
|---|
public ArrayList<IBacktrackingInfo> getBacktrackingInfos()
ISearcher
getBacktrackingInfos in interface ISearcherpublic String getCopyrightNotice()
IModule
getCopyrightNotice in interface IModulepublic int getErrorCount()
ISearcher
getErrorCount in interface ISearcher
public IMessageStore setOptions(String key,
Properties configuration)
IModule
setOptions in interface IModulekey - The key (prefix) for this module options. Must be non-null.
The key is used for module specific options.configuration - The options for all modules. Must be non-null.public IState getState()
ISearcher
getState in interface ISearcherpublic boolean backtrack()
ISearcher
backtrack in interface ISearcherpublic IMessageStore connect(IBogorConfiguration bc)
IModule
connect in interface IModulebc - The Bogor configuration containing modules to connect to.
Must be non-null.public IState createInitialState()
ISearcher
createInitialState in interface ISearcherpublic void dispose()
Disposable
dispose in interface Disposable
public void doTransition(int threadId,
Transformation t,
Action a)
ISearcher
doTransition in interface ISearcherthreadId - The thread descriptor that executes the transformation. Must
be an active thread descriptor at the current state.t - The transformation to be executed. Non-null.a - The action to start from. Must be null if t is not an instance
of BlockTransformation. If it is non-null, it
indicates the execution starts from the action a.public void error(int errCode)
ISearcher
error in interface ISearchererrCode - The error code.public void initialize()
ISearchersearch().
initialize in interface ISearcherpublic void search()
ISearcher
search in interface ISearcherpublic boolean shouldStore()
ISearcher
shouldStore in interface ISearcherpublic boolean step()
ISearcher
step in interface ISearcherpublic boolean stepBackward()
ISearcherstep() and stepBackward()
successively is not guaranteed to be reflexive.
stepBackward in interface ISearcherpublic boolean store()
ISearcher
store in interface ISearcherpublic void writeCounterExamples()
ISearcher
writeCounterExamples in interface ISearcherprotected FSMSymbolTable getFSMSymbolTable(int locDesc)
protected FSMSymbolTable getFSMSymbolTable(IState state,
int threadId)
protected IStateFactoryArguments getInitialStateFactoryArguments()
protected Location getLocation(IState state,
int threadId)
protected Location getLocation(int locDesc)
protected String getMemory(long mem)
protected String getTime(long time)
protected void addAll(ArrayList<IBacktrackingInfo> result,
IBacktrackingInfo[] bis)
protected IBacktrackingInfo backtrack(IState state,
ArrayList<IBacktrackingInfo> backtrackingInfos)
protected IBacktrackingInfo backtrackToTransitionBeginning(IState state,
ArrayList<IBacktrackingInfo> backtrackingInfos)
state - system state to revertbacktrackingInfos - stack of reverse deltas to roll back state
ITransformationsBacktrackingInfo of the most
recent transition (incomplete)protected void checkExceptions()
protected boolean checkInvariants()
protected ISchedulingStrategyContext createContext(int stateId,
int invisibleMoves,
int threadId,
IState state)
protected IEnabledTransformationsContext createContext(IState state,
int stateId,
int invisibleMoves,
int[] threadIds)
protected void doPostTransformationBookkeeping(int lastMovedThreadId,
ISchedulingStrategyInfo ssi)
protected void doTransition(ISchedulingStrategyContext ssc,
Transformation t,
Action a)
protected void dumpBacktrackingStack(PrintWriter pw,
ArrayList<IBacktrackingInfo> backtrackingInfos)
protected ArrayList<ICounterExampleSchedulingInfo> extractErrorSchedule(ArrayList<IBacktrackingInfo> backtrackingInfos)
protected ITransformationsBacktrackingInfo findMostRecentTransformationBacktrackingInfo()
protected void fillInitialVariableValues(IState vanillaState,
IStateFactoryArguments args)
protected void makeChoices(IntObjectTable<ArrayList<Transformation>> ets,
int[] threadIds,
Transformation[] transformations)
protected boolean shouldActivateThread(FSM fsm)
protected boolean shouldBacktrack()
protected void storeCounterExample(ArrayList<IBacktrackingInfo> backtrackingInfos,
int stateId,
int invisibleMoves,
String reason)
public Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
getOptionIds in interface ISelfDescribingModuleedu.ksu.cis.projects.bogor.module.ISearcher)
or global in scope (and thus no qualifier is prepended).public Pair<Domain,Boolean> getOptionDomain(String id)
getOptionDomain in interface ISelfDescribingModule
public Collection<String> getSuggestedValues(String id,
IBogorConfiguration bc,
SymbolTable st)
getSuggestedValues in interface ISelfDescribingModule
public boolean validate(String id,
String value,
IBogorConfiguration bc,
SymbolTable st,
Collection<FileMessage> errors)
validate in interface ISelfDescribingModuleid - the option's name, as returned by the first tuple element of
an item returned by getOptionIds()value - the value of the option, or null if unconfiguedst - the symbol table for the BIR modelerrors - a container into which errors should be put. Implementors
should not assume that errors is empty upon
entry into this method; it may aggregate the results of
calling validate on many
ISelfDescribingModule instances.
true iff the option is supported and its value is legal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||