edu.ksu.cis.projects.bogor.module
Class DefaultCounterExampleWriter

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.module.DefaultCounterExampleWriter
All Implemented Interfaces:
ISelfDescribingModule, ICounterExampleWriter, IModule, Disposable

public class DefaultCounterExampleWriter
extends Object
implements ICounterExampleWriter, ISelfDescribingModule

[Document Pending]

Version:
CVS $Revision: 1.44 $ $Date: 2005/06/09 00:22:01 $
Author:
Robby , Matt Hoosier

Nested Class Summary
protected  class DefaultCounterExampleWriter.DummyProgressManager
          [Document Pending]
protected static class DefaultCounterExampleWriter.DummyStateManagerProxy
          [Document Pending]
static class DefaultCounterExampleWriter.GuidedSchedulingStrategistProxy
          [Document Pending]
protected  class DefaultCounterExampleWriter.GuidedSearcherProxy
          [Document Pending]
static class DefaultCounterExampleWriter.GuidedSystemSharedState
          Information that should be kept in sync among components of a guided search system.
static interface DefaultCounterExampleWriter.IGuidedSimulator
           
static interface DefaultCounterExampleWriter.IStateSnapshotSource
           
 
Field Summary
protected  IBogorConfiguration bc
           
static String BUNDLED_SCHEDULE_FILENAME
           
static String CONFIGURATION_CLASSNAME_FILENAME
           
static String CONFIGURATION_FILENAME
           
protected  List<ICounterExampleSchedulingInfo> currErrorSchedules
           
protected  String errorDirName
           
protected  ArrayList<String> errorReasons
           
protected  ArrayList<List<ICounterExampleSchedulingInfo>> errorSchedulesList
           
protected static String EXPAND_TRAILS_ID
           
protected  boolean expandTrails
           
protected static String GENERATE_TRAILS_ID
           
protected  boolean generateTrails
           
protected  Properties overriddenBogorConfiguration
           
protected static String OVERRIDE_ID
           
protected  PrintWriter pw
           
protected  int stateNum
           
protected  String statesDirName
           
protected  SymbolTable symbolTable
           
protected static String TRAILS_EXT
           
protected  String trailsExt
           
protected  String transitionsDirName
           
protected  ZipOutputStream zos
           
protected  PrintWriter zpw
           
 
Constructor Summary
DefaultCounterExampleWriter()
           
 
Method Summary
 IMessageStore connect(IBogorConfiguration bc)
          [Document Pending]
 void dispose()
          [Document Pending]
 String getCopyrightNotice()
          [Document Pending]
protected  Properties getCounterExampleGenerationConfiguration()
           
static IntObjectTable<ErrorType> getErrorTraceDescriptions(File trailsFile)
           
 DefaultCounterExampleWriter.IGuidedSimulator getGuidedSimulator(SymbolTable symtab, Properties config, Class bcClass, List<ICounterExampleSchedulingInfo> scheduleDecisions)
           
 DefaultCounterExampleWriter.IGuidedSimulator getGuidedSimulator(SymbolTable symtab, Properties config, Class bcClass, List<ICounterExampleSchedulingInfo> scheduleDecisions, int numScheduleDecisionsToUse, boolean externalizeAllSteps)
           
 Pair<Domain,Boolean> getOptionDomain(String id)
           
 Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
           
 Properties getOverriddenBogorConfiguration()
          [Document Pending]
static DefaultCounterExampleWriter.IGuidedSimulator getSimulator(File trailsFile, int traceNumber, SymbolTable st, Class bogorConfigurationClass, PrintWriter pw)
           
static DefaultCounterExampleWriter.IGuidedSimulator getSimulator(File trailsFile, int traceNumber, SymbolTable st, PrintWriter pw)
           
 Collection<String> getSuggestedValues(String id, IBogorConfiguration bc, SymbolTable st)
           
static List<ICounterExampleSchedulingInfo> parseCounterExampleErrorSchedule(InputStream is)
           
 IMessageStore setOptions(String key, Properties configuration)
          [Document Pending]
 void storeCounterExample(List<ICounterExampleSchedulingInfo> cesis, 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()
          [Document Pending]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRAILS_EXT

protected static final String TRAILS_EXT
See Also:
Constant Field Values

CONFIGURATION_CLASSNAME_FILENAME

public static final String CONFIGURATION_CLASSNAME_FILENAME
See Also:
Constant Field Values

CONFIGURATION_FILENAME

public static final String CONFIGURATION_FILENAME
See Also:
Constant Field Values

BUNDLED_SCHEDULE_FILENAME

public static final String BUNDLED_SCHEDULE_FILENAME
See Also:
Constant Field Values

GENERATE_TRAILS_ID

protected static final String GENERATE_TRAILS_ID
See Also:
Constant Field Values

EXPAND_TRAILS_ID

protected static final String EXPAND_TRAILS_ID
See Also:
Constant Field Values

OVERRIDE_ID

protected static final String OVERRIDE_ID
See Also:
Constant Field Values

trailsExt

protected String trailsExt

generateTrails

protected boolean generateTrails

expandTrails

protected boolean expandTrails

bc

protected IBogorConfiguration bc

symbolTable

protected SymbolTable symbolTable

pw

protected PrintWriter pw

errorSchedulesList

protected ArrayList<List<ICounterExampleSchedulingInfo>> errorSchedulesList

errorReasons

protected ArrayList<String> errorReasons

zos

protected ZipOutputStream zos

zpw

protected PrintWriter zpw

currErrorSchedules

protected List<ICounterExampleSchedulingInfo> currErrorSchedules

stateNum

protected int stateNum

errorDirName

protected String errorDirName

statesDirName

protected String statesDirName

transitionsDirName

protected String transitionsDirName

overriddenBogorConfiguration

protected Properties overriddenBogorConfiguration
Constructor Detail

DefaultCounterExampleWriter

public DefaultCounterExampleWriter()
Method Detail

getCopyrightNotice

public String getCopyrightNotice()
[Document Pending]

Specified by:
getCopyrightNotice in interface IModule
Returns:
[Document Pending]

getGuidedSimulator

public DefaultCounterExampleWriter.IGuidedSimulator getGuidedSimulator(SymbolTable symtab,
                                                                       Properties config,
                                                                       Class bcClass,
                                                                       List<ICounterExampleSchedulingInfo> scheduleDecisions)

getGuidedSimulator

public DefaultCounterExampleWriter.IGuidedSimulator getGuidedSimulator(SymbolTable symtab,
                                                                       Properties config,
                                                                       Class bcClass,
                                                                       List<ICounterExampleSchedulingInfo> scheduleDecisions,
                                                                       int numScheduleDecisionsToUse,
                                                                       boolean externalizeAllSteps)

setOptions

public IMessageStore setOptions(String key,
                                Properties configuration)
[Document Pending]

Specified by:
setOptions in interface IModule
Parameters:
key - [Document Pending]
configuration - [Document Pending]

getOverriddenBogorConfiguration

public Properties getOverriddenBogorConfiguration()
[Document Pending]

Specified by:
getOverriddenBogorConfiguration in interface ICounterExampleWriter
Returns:
[Document Pending]

connect

public IMessageStore connect(IBogorConfiguration bc)
[Document Pending]

Specified by:
connect in interface IModule
Parameters:
bc - [Document Pending]

dispose

public void dispose()
[Document Pending]

Specified by:
dispose in interface Disposable

storeCounterExample

public void storeCounterExample(List<ICounterExampleSchedulingInfo> cesis,
                                String reason)
Specified by:
storeCounterExample in interface ICounterExampleWriter

writeCounterExamples

public void writeCounterExamples()
[Document Pending]

Specified by:
writeCounterExamples in interface ICounterExampleWriter

getCounterExampleGenerationConfiguration

protected Properties getCounterExampleGenerationConfiguration()

getOptionIds

public Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
Specified by:
getOptionIds in interface ISelfDescribingModule
Returns:
a set of tuples whose first element says the name of the option, and whose second element says whether the option is required, and whose third element says whether the option is private to this module (and thus prefixed by the interface implemented, e.g., edu.ksu.cis.projects.bogor.module.ISearcher) or global in scope (and thus no qualifier is prepended).

getOptionDomain

public Pair<Domain,Boolean> getOptionDomain(String id)
Specified by:
getOptionDomain in interface ISelfDescribingModule
Returns:
a tuple whose first element says the domain of the option values, and whose second element says whether the option is multivalued (that is, a comma-separated list)

getSuggestedValues

public Collection<String> getSuggestedValues(String id,
                                             IBogorConfiguration bc,
                                             SymbolTable st)
Specified by:
getSuggestedValues in interface ISelfDescribingModule

validate

public boolean validate(String id,
                        String value,
                        IBogorConfiguration bc,
                        SymbolTable st,
                        Collection<FileMessage> errors)
Checks whether the value of a configuration option is legal.

Specified by:
validate in interface ISelfDescribingModule
Parameters:
id - 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 unconfigued
st - the symbol table for the BIR model
errors - 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.
Returns:
true iff the option is supported and its value is legal

parseCounterExampleErrorSchedule

public static List<ICounterExampleSchedulingInfo> parseCounterExampleErrorSchedule(InputStream is)
                                                                            throws ClassNotFoundException
Throws:
ClassNotFoundException

getErrorTraceDescriptions

public static IntObjectTable<ErrorType> getErrorTraceDescriptions(File trailsFile)
                                                           throws IOException,
                                                                  JAXBException
Throws:
IOException
JAXBException

getSimulator

public static DefaultCounterExampleWriter.IGuidedSimulator getSimulator(File trailsFile,
                                                                        int traceNumber,
                                                                        SymbolTable st,
                                                                        PrintWriter pw)
                                                                 throws ClassNotFoundException,
                                                                        IOException
Parameters:
st - optional. If given, the symbol table isn't parsed from the trace file
Throws:
ClassNotFoundException
IOException

getSimulator

public static DefaultCounterExampleWriter.IGuidedSimulator getSimulator(File trailsFile,
                                                                        int traceNumber,
                                                                        SymbolTable st,
                                                                        Class bogorConfigurationClass,
                                                                        PrintWriter pw)
                                                                 throws ClassNotFoundException,
                                                                        IOException
Parameters:
st - optional. If given, the symbol table isn't parsed from the trace file
Throws:
ClassNotFoundException
IOException