本文整理汇总了Java中gov.nasa.jpf.Config.hasValue方法的典型用法代码示例。如果您正苦于以下问题:Java Config.hasValue方法的具体用法?Java Config.hasValue怎么用?Java Config.hasValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.jpf.Config
的用法示例。
在下文中一共展示了Config.hasValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
/**
* initialize object from config file
*
* @param conf
*/
private void initialize(Config conf) {
// create a constraint solver
ConstraintSolverFactory cFactory = new ConstraintSolverFactory(conf);
this.solver = cFactory.createSolver(conf);
// parse symbolic method info
if(conf.hasValue(CONF_PREFIX + ".method")) {
String id = conf.getString(CONF_PREFIX + ".method");
ConcolicMethodConfig mc = ConcolicMethodConfig.read(id, CONF_PREFIX + ".method." + id, conf);
registerConcolicMethod(mc);
}
// parse termination
this.termination = parseTerminationStrategy(conf);
}
示例2: PathListener
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public PathListener(Config jpfConf, JPF jpf) {
this.jpfConf = jpfConf;
//TODO: we can make this even more precise by also allowing specifying the EXACT
//call (e.g. src line number + class) after which count collection should start
if(!jpfConf.hasValue(MEASURED_METHODS) && !jpfConf.hasValue(SYMBOLIC_METHODS)) {
RuntimeException e = new RuntimeException("Must set either " + MEASURED_METHODS + " or " + SYMBOLIC_METHODS);
logger.severe(e.getMessage());
throw e;
}
this.measuredMethods = getMeasuredMethods(this.jpfConf);
this.symbolicMethods = getSymbolicMethods(this.jpfConf);
logger.info("Measured methods: " + this.measuredMethods.toString());
this.policyManager = new PolicyManager(this.getPolicyBaseDir(jpfConf));
if(this.visualize(this.jpfConf))
this.visDir = this.getVisualizationDir(this.jpfConf);
this.showInstrs = jpfConf.getBoolean(SHOW_INSTRS_CONF, false);
this.ctxManager = new ContextManager();
//Initialize state
if(jpfConf.hasValue(WORST_CASE_STATE_BLDR_CONF)) {
this.stateBuilder = jpfConf.getInstance(WORST_CASE_STATE_BLDR_CONF, StateBuilder.class);
} else
this.stateBuilder = new DepthState.DepthStateBuilder();
if(jpfConf.hasValue(POLICY_GENERATOR_CLS_CONF)) {
this.policyGenerator = jpfConf.getInstance(POLICY_GENERATOR_CLS_CONF, PolicyGenerator.class);
this.worstCasePathBuilder = new WorstCasePath.Builder(ctxManager);
} else {
HistoryBasedPolicy.Builder histGenerator = new HistoryBasedPolicy.Builder();
if(jpfConf.hasValue(HISTORY_SIZE_CONF)) {
this.historySize = jpfConf.getInt(HISTORY_SIZE_CONF);
histGenerator.setMaxHistorySize(historySize);
this.worstCasePathBuilder = new WorstCasePath.Builder(ctxManager, historySize);
} else { // adaptive by default
histGenerator.setAdaptive(true);
this.worstCasePathBuilder = new WorstCasePath.Builder(ctxManager);
}
this.policyGenerator = histGenerator;
}
this.wcPath = null;
}
示例3: visualize
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
@Override
public boolean visualize(Config jpfConf) {
return jpfConf.hasValue(VIS_OUTPUT_PATH_CONF);
}
示例4: serialize
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
@Override
public boolean serialize(Config jpfConf) {
return jpfConf.hasValue(SER_OUTPUT_PATH);
}
示例5: parse
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public void parse(String prefix, Config config) {
String maxDepthKey = prefix + ".max_depth";
if(config.hasValue(maxDepthKey)) {
this.treeMaxDepth = config.getInt(maxDepthKey);
}
String maxAltDepthKey = prefix + ".max_alt_depth";
if(config.hasValue(maxAltDepthKey)) {
this.treeMaxAltDepth = config.getInt(maxAltDepthKey);
}
String maxNestDepthKey = prefix + ".max_nesting_depth";
if(config.hasValue(maxNestDepthKey)) {
this.maxNestingDepth = config.getInt(maxNestDepthKey);
}
String constrKey = prefix + ".constraints";
if(config.hasValue(constrKey)) {
String constraintsStr = config.getString(constrKey);
setConstraints(constraintsStr);
}
String fdefKey = prefix + ".use_func_defs";
if(config.hasValue(fdefKey)) {
this.loadAxioms = config.getBoolean(fdefKey);
}
String explPrefix = prefix + ".exploration.";
String explInitiallyKey = explPrefix + "initial";
if(config.hasValue(explInitiallyKey)) {
this.exploreInitially = config.getBoolean(explInitiallyKey);
}
String suspendKey = explPrefix + "suspend";
if(config.hasValue(suspendKey)) {
setSuspendExploration(config.getString(suspendKey));
}
String resumeKey = explPrefix + "resume";
if(config.hasValue(resumeKey)) {
setResumeExploration(config.getString(resumeKey));
}
String symbPrefix = prefix + ".symbolic.";
String symbStaticKey = symbPrefix + "statics";
if(config.hasValue(symbStaticKey)) {
String symbStaticStr = config.getString(symbStaticKey);
setSymbolicStatics(symbStaticStr);
}
String symbExclKey = symbPrefix + "exclude";
if(config.hasValue(symbExclKey)) {
String symbExclStr = config.getString(symbExclKey);
setSymbolicFieldsExclude(symbExclStr);
}
String symbInclKey = symbPrefix + "include";
if(config.hasValue(symbInclKey)) {
String symbInclStr = config.getString(symbInclKey);
setSymbolicFieldsInclude(symbInclStr);
}
}
示例6: parseTerminationStrategy
import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public static TerminationStrategy parseTerminationStrategy(Config conf) {
if (!conf.hasValue("jdart.termination")) {
return new NeverTerminate();
}
return parseTerminationStrategy(conf.getProperty("jdart.termination"));
}