• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Search类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gov.nasa.jpf.search.Search的典型用法代码示例。如果您正苦于以下问题:Java Search类的具体用法?Java Search怎么用?Java Search使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Search类属于gov.nasa.jpf.search包,在下文中一共展示了Search类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: check

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
/**
 * return 'false' if property is violated
 */
@Override
public boolean check (Search search, VM vm) {
  if (throwOutOfMemory) {
    // in this case we don't want to stop the program, but see if it
    // behaves gracefully - don't report a property violation
    return true;
  } else {
    if ((maxHeapSizeLimit >= 0) && (stat.heapSize > maxHeapSizeLimit)) {
      return false;
    }
    if ((maxLiveLimit >=0) && ((stat.nNew - stat.nReleased) > maxLiveLimit)) {
      return false;
    }

    return true;
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:21,代码来源:HeapTracker.java


示例2: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  int id = search.getStateId();

  out.print("----------------------------------- [" +
                   search.getDepth() + "] forward: " + id);
  if (search.isNewState()) {
    out.print(" new");
  } else {
    out.print(" visited");
  }

  if (search.isEndState()) {
    out.print(" end");
  }

  out.println();

  lastMi = null;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:21,代码来源:MethodTracker.java


示例3: getPreemptions

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
int getPreemptions (Search search){
  VM vm = search.getVM();
  int n=0;
  ThreadChoiceGenerator cg = vm.getLastChoiceGeneratorOfType(ThreadChoiceGenerator.class);
  
  while (cg != null){
    ThreadChoiceGenerator cgPrev = cg.getPreviousChoiceGeneratorOfType(ThreadChoiceGenerator.class);
    if (cg.isSchedulingPoint()) {
      System.out.println("       " + cg);
      if (cgPrev != null) {
        ThreadInfo ti = cg.getNextChoice();
        ThreadInfo tiPrev = cgPrev.getNextChoice();

        if (tiPrev != ti && cg.contains(tiPrev)) {
          n++;
        }
      }
    }
    
    cg = cgPrev;
  }
  
  return n;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:25,代码来源:MinimizePreemptionTest.java


示例4: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced (Search search){
  long m = Runtime.getRuntime().totalMemory();
  if (m > maxUsed) {
    maxUsed = m;
  }

  if (search.isNewState()){
    newStates++;
    int depth = search.getDepth();
    if (depth > maxDepth){
      maxDepth = depth;
    }
  } else {
    visitedStates++;
  }
  if (search.isEndState()){
    endStates++;
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:21,代码来源:Statistics.java


示例5: searchStarted

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void searchStarted(Search search){
  Pair<Integer, Integer> init = new Pair<Integer, Integer>(-1, 0);

  stack = new Stack<Pair<Integer, Integer>>();
  stack.push(init);

  contours = new ArrayList<Set<Pair<Integer, Integer>>>();
  contours.add(new TreeSet<Pair<Integer,Integer>>());
  contours.get(0).add(init);

  vm = search.getVM();

  initialize(vm);

  printHeader();
  printStartState("S");
}
 
开发者ID:d3sformal,项目名称:panda,代码行数:19,代码来源:SimpleDot.java


示例6: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  steps += search.getTransition().getStepCount();
 
  if (isHeuristic)
  	queueSize = ((HeuristicSearch)(search)).getQueueSize();
  
  if (search.isNewState()) {
    searchLevel = search.getDepth();
    if (searchLevel > maxSearchLevel)
    	maxSearchLevel = searchLevel;
    
    newStates++; 
    
    currentHeapCount = search.getVM().getHeap().size();
    
    if (currentHeapCount > maxHeapCount)
      maxHeapCount = currentHeapCount;
    
    if (search.isEndState()) {
      endStates++;
    }
  } else {
    revisitedStates++;
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:27,代码来源:SearchStats.java


示例7: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced (Search search){
  
  if (search.isNewState() && (lastOp != null)) {
    int stateId = search.getStateId();
    
    for (MethodOp op=lastOp; op != null; op=op.p) {
      op.stateId = stateId;
    }
    
    lastOp.prevTransition = lastTransition;
    lastTransition = lastOp;
  }
  
  lastOp = null;
  isFirstTransition = false;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:18,代码来源:MethodAnalyzer.java


示例8: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced (Search search) {    
  if (timeExceeded() || heapExceeded()) {
    search.notifySearchConstraintHit(message);
    search.terminate();
  }
  
  if (search.isNewState()){
    if (!vm.isTraceReplay()){
      newStates++;
    }
    if (statesExceeded() || depthExceeded() || newStatesExceeded()){
      search.notifySearchConstraintHit(message);
      search.terminate();        
    }
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:18,代码来源:BudgetChecker.java


示例9: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  int id = search.getStateId();
  boolean has_next =search.hasNextState();
  boolean is_new = search.isNewState();
  try {
    if (format==DOT_FORMAT) {
      graph.write("/* searchAdvanced(" + id + ", " + makeDotLabel(search, id) +
                  ", " + has_next + ") */");
      graph.newLine();
    }
    if (prev_state != null) {
      addEdge(prev_state.id, id, search);
    } else {
      prev_state = new StateInformation();
    }
    addNode(prev_state);
    prev_state.reset(id, has_next, is_new);
  } catch (IOException e) {}
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:21,代码来源:StateSpaceDot.java


示例10: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  //TODO: check iserrorstate here as was done originally?
  if(search.isEndState()) {
    checkExecutionPath(search.getVM());
  }
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:8,代码来源:PathListener.java


示例11: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  super.stateAdvanced(search);
  ChoiceGenerator<?> cg = search.getVM().getSystemState().getChoiceGenerator();
  if(cg instanceof PCChoiceGenerator) {
    this.newChoices++;
  }
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:9,代码来源:PolicyGeneratorListener.java


示例12: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
  super.stateAdvanced(search);
  if(search.isEndState()) {
    checkTermination(search);
  }
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:8,代码来源:HeuristicListener.java


示例13: checkTermination

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
private void checkTermination(Search search) {
  if(terminationStrategy.terminateAnalysis(search, this.statistics)) {
    logger.info("Termination strategy [" + terminationStrategy.getClass().getName() + "] " +
        "terminated the heuristic search");
    search.terminate();
  }
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:8,代码来源:HeuristicListener.java


示例14: propertyViolated

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void propertyViolated(Search search) {
  ThreadInfo ti = search.getVM().getCurrentThread();
  ConcolicMethodExplorer ca = ConcolicMethodExplorer.getCurrentAnalysis(ti);
  if(ca == null)
    return;
  ca.completePathError(ti);
  ti.clearPendingException();
}
 
开发者ID:psycopaths,项目名称:jdart,代码行数:10,代码来源:ConcolicListener.java


示例15: stateAdvanced

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateAdvanced(Search search) {
    try {
        unfreeze();

        positions.push(getCurrentPosition());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:d3sformal,项目名称:panda,代码行数:11,代码来源:BacktrackedLogger.java


示例16: stateRestored

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
/******************************************* SearchListener interface *****/

  @Override
  public void stateRestored(Search search) {
    int id = search.getStateId();
    out.println("----------------------------------- [" +
                       search.getDepth() + "] restored: " + id);
  }
 
开发者ID:d3sformal,项目名称:panda,代码行数:9,代码来源:ExecTracker.java


示例17: check

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public boolean check (Search search, VM vm) {
  if (vm.isDeadlocked()){
    ThreadInfo ti = vm.getCurrentThread();
    if (ti.isAtomic()){
      tiAtomic = ti;
    }
    return false;
  } else {
    return true;
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:13,代码来源:NotDeadlockedProperty.java


示例18: stateBacktracked

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void stateBacktracked(Search search) {
  int id = search.getStateId();

  lastMi = null;

  out.println("----------------------------------- [" +
                     search.getDepth() + "] backtrack: " + id);
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:10,代码来源:MethodTracker.java


示例19: stateRestored

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
/******************************************* SearchListener interface *****/

@Override
public void stateRestored(Search search) {
  int id = search.getStateId();
  out.println("----------------------------------- [" +
                     search.getDepth() + "] restored: " + id);
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:9,代码来源:ExecTracker.java


示例20: searchFinished

import gov.nasa.jpf.search.Search; //导入依赖的package包/类
@Override
public void searchFinished (Search search) {
  if (allSpecs != null && !matchesAll(allSpecs, pathOutputs)) {
    log.warning("pom.all violated");
    search.error(this);
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:8,代码来源:PathOutputMonitor.java



注:本文中的gov.nasa.jpf.search.Search类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SyncComplete类代码示例发布时间:2022-05-23
下一篇:
Java Processor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap