java.lang.Object
dev.civl.gmc.dpor.DporDfsSearcher<STATE,TRANSITION>
-
Constructor Summary
ConstructorsConstructorDescriptionDporDfsSearcher(DependencyAnalyzer<STATE, TRANSITION> analyzer, StateManager<STATE, TRANSITION> manager, StatePredicateIF<STATE> predicate, GMCConfiguration gmcConfig) DporDfsSearcher(DependencyAnalyzer<STATE, TRANSITION> analyzer, StateManager<STATE, TRANSITION> manager, StatePredicateIF<STATE> predicate, GMCConfiguration gmcConfig, PrintStream debugOut) Constructs a new depth first search searcher. -
Method Summary
Modifier and TypeMethodDescriptionbooleanExplore the state space starting at initialState using DPOR.Returns the stream used to print debugging output when the debugging flag is on.intintThe number of states matched so far.intThe number of states seen in this search.intThe number of transitions executed in the course of this search so far.intvoidprintStack(PrintStream out) Prints the whole stack in a human readable form to the given stream.voidprintStack(PrintStream out, boolean longFormat, boolean summarize) Prints the current stack in a human-readable format.voidprintSummary(PrintStream out) Summarizes the current state of the search in a human-readable form printed to the given stream.voidsetDebugging(boolean value) Set the debugging flag to the given value.voidsetDebugOut(PrintStream out) Sets the debugging output stream to the given stream.stack()Returns the stack used to perform the depth first searchvoidwriteStack(PrintStream stream) Write the state of the current stack in a condensed form that can be used to replay the trace later.
-
Constructor Details
-
DporDfsSearcher
public DporDfsSearcher(DependencyAnalyzer<STATE, TRANSITION> analyzer, StateManager<STATE, TRANSITION> manager, StatePredicateIF<STATE> predicate, GMCConfiguration gmcConfig, PrintStream debugOut) Constructs a new depth first search searcher.- Parameters:
manager- the object used to manage states, compute the next state from a current state and transition, and so, during this searchpredicate- the state predicate -- this will be checked at each state encountered in the search, and if it is found to hold, the search method will return; hence it is usually a predicate about something "bad" happening, like a deadlockgmcConfig- GMC configuration objectdebugOut- if null, debugging output is not printed, otherwise debugging output will be printing to this streamenabler- the enabler used to determine the set of enabled transitions at each state in the course of this search
-
DporDfsSearcher
public DporDfsSearcher(DependencyAnalyzer<STATE, TRANSITION> analyzer, StateManager<STATE, TRANSITION> manager, StatePredicateIF<STATE> predicate, GMCConfiguration gmcConfig)
-
-
Method Details
-
predicate
-
stack
Returns the stack used to perform the depth first search -
explore
Explore the state space starting at initialState using DPOR.- Parameters:
initialState-- Returns:
- Throws:
StateSpaceCycleException
-
setDebugging
public void setDebugging(boolean value) Set the debugging flag to the given value. If true, debugging output will be printed to the debug stream. Otherwise debugging output will not be printed.- Parameters:
value- if true, start showing the debugging output, otherwise don't show it
-
setDebugOut
Sets the debugging output stream to the given stream. This is the stream used to print debugging information if the debugging flag is on.- Parameters:
out- the output stream to which debugging information should be sent
-
getDebugOut
Returns the stream used to print debugging output when the debugging flag is on.- Returns:
- the debugging output stream
-
printStack
Prints the current stack in a human-readable format.- Parameters:
out- the stream to which to print the stacklongFormat- if true, provide detailed information about each statesummarize- if true, don't print out more than some fixed bound number of entries from the top of the stack; otherwise print the whole stack
-
printStack
Prints the whole stack in a human readable form to the given stream. Prints first a summary, then the stack in full detail (with detailed state information).- Parameters:
out- output stream to which this information should be sent
-
numStatesSeen
public int numStatesSeen()The number of states seen in this search.- Returns:
- the number of states seen so far
-
numTraceSteps
public int numTraceSteps()The number of transitions executed in the course of this search so far.- Returns:
- the number of transitions executed.
-
numTraceStepsMatched
public int numTraceStepsMatched() -
numStatesMatched
public int numStatesMatched()The number of states matched so far. A state is "matched" when the search determines the state has been seen before, earlier in the search. If the state has been seen before, it is not explored.- Returns:
- the number of states matched
-
numOfSearchNodeSaved
public int numOfSearchNodeSaved()- Returns:
- the number of search nodes saved which is also the number of non-equal states.
-
printSummary
Summarizes the current state of the search in a human-readable form printed to the given stream.- Parameters:
out- the stream to which to print the information
-
writeStack
Write the state of the current stack in a condensed form that can be used to replay the trace later.- Parameters:
stream- stream to which to write the current state of the DFS stack
-