当前位置: 首页>>代码示例>>Java>>正文


Java Path类代码示例

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


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

示例1: computeHeuristicValue

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
@Override
protected int computeHeuristicValue () {
  int aliveThreads = vm.getThreadList().getMatchingCount(aliveThread);

  Path path = vm.getPath();
  int  pathSize = path.size();
  
  int tid = vm.getCurrentThread().getId();
  int h_value = 0;

  if (aliveThreads > 1) { // otherwise there's nothing to interleave
    
    for (int i= Math.max(0, pathSize - historyLimit); i<pathSize; i++) {
      if (path.get(i).getThreadIndex() == tid) {
        h_value += (pathSize - i) * aliveThreads;
      }
    }
  }

  return h_value;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:22,代码来源:Interleaving.java

示例2: publishOutput

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
@Override
protected void publishOutput() {
  Path path = reporter.getPath();

  if (path.size() == 0) {
    return; // nothing to publish
  }

  publishTopicStart("output " + reporter.getCurrentErrorId());

  if (path.hasOutput()) {
    for (Transition t : path) {
      String s = t.getOutput();
      if (s != null){
        out.print(s);
      }
    }
  } else {
    out.println("no output");
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:22,代码来源:ConsolePublisher.java

示例3: publishOutput

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
@Override
protected void publishOutput() {
  Path path = reporter.getPath();

  if (path.size() == 0) {
    return; // nothing to publish
  }
      
  if (path.hasOutput()) {
    out.println("  <output>");
    for (Transition t : path) {
      String s = t.getOutput();
      if (s != null){
        out.print(s);
      }
    }
    out.println("  </output>");
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:20,代码来源:XMLPublisher.java

示例4: Error

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
public Error (int id, Property prop, Path p, ThreadList l) {
  this.id = id;
  property = prop;
  errorMessage = prop.getErrorMessage();    
  path = p; // client has to clone in case we go on
  threadList = l;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:8,代码来源:Error.java

示例5: publishTrace

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
@Override
protected void publishTrace() {
  Path path = reporter.getPath();
  int i=0;

  if (path.size() == 0) {
    return; // nothing to publish
  }
  
  out.println("  <trace>");
  for (Transition t : path) {
    ChoiceGenerator<?> cg = t.getChoiceGenerator();
    out.println("    <transition id=\"" + i++ + "\" thread=\"" + t.getThreadIndex() + "\">");
    out.println("      <cg class=\""+cg.getClass().getName() + "\" choice=\"" +
                cg.getProcessedNumberOfChoices() + "\"/>");
    for (Step s : t) {
      out.print("      <insn src=\"" + s.getLocationString() + "\">");
      String insn = s.getInstruction().toString();
      if (insn.indexOf('<') >= 0) { // <init> and <clinit> clash with XML
        insn = insn.replaceAll("<", "&lt;");
        insn = insn.replaceAll(">", "&gt;");
      }
      out.print(insn);
      out.println("</insn>");
    }
    out.println("    </transition>");      
  }
  out.println("  </trace>");
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:30,代码来源:XMLPublisher.java

示例6: error

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
public void error(Property property, Path path, ThreadList threadList, boolean disableRefinement) {
    if (disableRefinement) {
        backtrackLevel = null;
    } else {
        backtrackLevel = PredicateAbstraction.getInstance().error();
    }

    if (backtrackLevel == null) {
        super.error(property, path, threadList);
    } else {
        VM.getVM().getSystemState().setIgnored(true);
    }
}
 
开发者ID:d3sformal,项目名称:panda,代码行数:14,代码来源:PredicateAbstractionRefinementSearch.java

示例7: log

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
private boolean log(Search search)
{
   VM vm;
   Path path;
   Transition trans;
   ChoiceGenerator cg;
   double percent, delta;
   long currentState, expectedState, currentTime, expectedTime;
   int i, size, processed;

   vm       = search.getVM();
   path      = vm.getPath();
   size      = path.size();
   percent   = 0.0;
   delta     = 1.0;
   processed = 0;
   
   for (i = 0; i < size; i++)
   {
      trans      = path.get(i);
      cg         = trans.getChoiceGenerator();
      delta     /= cg.getTotalNumberOfChoices();
      processed  = cg.getProcessedNumberOfChoices() - 1;
      percent   += delta * processed;
   }
   
   if (size == 0)
      percent = 1.0;
   
   if (m_lastPercent > percent)  // Sometimes a state is declared as processed but doesn't show up in the path so the percentage appears to go backwards.
      return(false);
   
   m_lastPercent = percent;
      
   currentState  = vm.getStateCount();
   expectedState = (long) (currentState / percent);
   
   currentTime   = System.currentTimeMillis() - m_startTime;
   expectedTime  = (long) (currentTime / percent);
   
   m_formatter.format("State:  %,d / %,d (%g%%)    Time:  ", currentState, expectedState, 100.0 * percent);
   
   formatTime(expectedTime);
   m_buffer.append(" - ");
   formatTime(currentTime);
   m_buffer.append(" = ");
   formatTime(expectedTime - currentTime);

   m_out.println(m_buffer.toString());
   m_buffer.setLength(0);
   
   return(true);
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:54,代码来源:StateCountEstimator.java

示例8: getPath

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
public Path getPath () {
  return path;
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:4,代码来源:Error.java

示例9: publishTrace

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
/**
 * this is done as part of the property violation reporting, i.e.
 * we have an error
 */
@Override
protected void publishTrace() {
  Path path = reporter.getPath();
  int i=0;

  if (path.size() == 0) {
    return; // nothing to publish
  }

  publishTopicStart("trace " + reporter.getCurrentErrorId());

  for (Transition t : path) {
    out.print("------------------------------------------------------ ");
    out.println("transition #" + i++ + " thread: " + t.getThreadIndex());

    if (showCG){
      out.println(t.getChoiceGenerator());
    }

    if (showSteps) {
      String lastLine = null;
      MethodInfo lastMi = null;
      int nNoSrc=0;

      for (Step s : t) {
        if (showSource) {
          String line = s.getLineString();
          if (line != null) {
            if (!line.equals(lastLine)) {
              if (nNoSrc > 0){
                out.println("      [" + nNoSrc + " insn w/o sources]");
              }

              out.print("  ");
              if (showLocation) {
                out.print(Left.format(s.getLocationString(),30));
                out.print(" : ");
              }
              out.println(line.trim());
              nNoSrc = 0;

            }
          } else { // no source
            nNoSrc++;
          }
          
          lastLine = line;
        }

        if (showCode) {
          Instruction insn = s.getInstruction();
          if (showMethod){
            MethodInfo mi = insn.getMethodInfo();
            if (mi != lastMi) {
              ClassInfo mci = mi.getClassInfo();
              out.print("    ");
              if (mci != null) {
                out.print(mci.getName());
                out.print(".");
              }
              out.println(mi.getUniqueName());
              lastMi = mi;
            }
          }
          out.print("      ");
          out.println(insn);
        }
      }

      if (showSource && !showCode && (nNoSrc > 0)) {
        out.println("      [" + nNoSrc + " insn w/o sources]");
      }
    }
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:80,代码来源:ConsolePublisher.java

示例10: getPath

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
public Path getPath (){
  return vm.getClonedPath();
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:4,代码来源:Reporter.java

示例11: publishTrace

import gov.nasa.jpf.vm.Path; //导入依赖的package包/类
public static void publishTrace(PrintStream out, Path path) {
    publishTrace(new PrintWriter(out, true), path);
}
 
开发者ID:d3sformal,项目名称:panda,代码行数:4,代码来源:PredicateConsolePublisher.java


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