Examples of PTASequenceEngine


Examples of statechum.model.testset.PTASequenceEngine

  /** Similar to testNode2 but uses a helper method. */
  @Test
  public final void testNode3()
  {
    PTASequenceEngine engine = new PTASequenceEngine();
    Node a = engine.new Node("A"), c = engine.new Node("B"),d = engine.new Node("C");
    equalityTestingHelper(a,a,c,d, true);
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

 
  /** Similar to testNode2 but uses a helper method. */
  @Test
  public final void testNode_toString()
  {
    PTASequenceEngine engine = new PTASequenceEngine();
    Node a = engine.new Node("A");
    Assert.assertEquals("1(A)", a.toString());
    Assert.assertEquals("REJECT",engine.rejectNode.toString());
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

      }
    };
    SequenceSet seq = en.new SequenceSet();seq.setIdentity();
    SequenceSet nodeD = seq.crossWithSet(labelList(new String[] {"b","a"}))
      .crossWithSet(labelList(new String[] {"b","a"}));
    PTASequenceEngine filtered = en.filter(en.getFSM_filterPredicate());
    vertifyPTA(filtered, 2, new String[][] {
        new String[] {"a","b"},
        new String[] {"b","b"}
    });
    // now modify the original PTA
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine engine = new PTA_FSMStructure(new LearnerGraph(g,mainConfiguration),null);
    engine.containsSequence(new ArrayList<Label>());
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

  }
 
  public static List<List<String>> computeQS_general(final StatePair pairToMerge,
      final LearnerGraph original, final LearnerGraph learnt,final QuestionConstructor qConstructor)
  {
    final PTASequenceEngine engine = qConstructor.constructEngine(original, learnt);
   
    final SequenceSet identity = engine.new SequenceSet();identity.setIdentity();
    for(AMEquivalenceClass eq:learnt.learnerCache.getMergedStates())
      qConstructor.addQuestionsForState(eq, original, learnt, pairToMerge,
          learnt.stateLearnt,new MergeData(){
        public SequenceSet getPathsToBlue()
        {
          SequenceSet toBlue = engine.new SequenceSet();
          original.paths.computePathsSBetween(original.init, pairToMerge.getQ(), identity, toBlue);
          return toBlue;
        }

        public SequenceSet getPathsToRed()
        {
          SequenceSet toRed = engine.new SequenceSet();
          original.paths.computePathsSBetween(original.init, pairToMerge.getR(), identity, toRed);
          return toRed;
        }

        public SequenceSet getPathsToLearnt()
        {
          SequenceSet toLearnt = engine.new SequenceSet();
          learnt.paths.computePathsSBetween(learnt.init, learnt.stateLearnt, identity, toLearnt);
          return toLearnt;
        }

      });
   
    return engine.getData();
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

  {
    CmpVertex mergedRed = merged.findVertex(pair.getR().getID());
    if (mergedRed == null)
      throw new IllegalArgumentException("failed to find the red state in the merge result");
   
    PTASequenceEngine engine = new PTASequenceEngine();
    engine.init(original.new NonExistingPaths());
    PTASequenceEngine.SequenceSet paths = engine.new SequenceSet();
    PTASequenceEngine.SequenceSet initp = engine.new SequenceSet();initp.setIdentity();

    merged.paths.computePathsSBetween(merged.init,mergedRed, initp, paths);
   
    Collection<String> inputsToMultWith = new LinkedList<String>();
    for(Entry<String,CmpVertex> loopEntry:merged.transitionMatrix.get(mergedRed).entrySet())
      if (loopEntry.getValue() == mergedRed)
      {// Note an input corresponding to any loop in temp can be followed in the original machine, since
        // a loop in temp is either due to the merge or because it was there in the first place.
        inputsToMultWith.add(loopEntry.getKey());
      }
    paths.unite(paths.crossWithSet(inputsToMultWith));// the resulting path does a "transition cover" on all transitions leaving the red state.
    merged.questions.buildQuestionsFromPair_Compatible(mergedRed, paths);
    return engine.getData();
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

  {
    CmpVertex mergedRed = merged.findVertex(pair.getR().getID());
    if (mergedRed == null)
      throw new IllegalArgumentException("failed to find the red state in the merge result");
   
    PTASequenceEngine engine = new PTASequenceEngine();
    engine.init(original.new NonExistingPaths());
    PTASequenceEngine.SequenceSet paths = engine.new SequenceSet();
    PTASequenceEngine.SequenceSet initp = engine.new SequenceSet();initp.setIdentity();

    List<Collection<String>> sequenceOfSets = merged.paths.computePathsSBetween(merged.init,mergedRed);
    if (sequenceOfSets == null)
      throw new IllegalArgumentException("failed to find the red state in the merge result");
    for(Collection<String> inputsToMultWith:sequenceOfSets)
      initp = initp.crossWithSet(inputsToMultWith);
    paths.unite(initp);
    //merged.paths.computePathsSBetweenBooleanReduced(merged.init,mergedRed, initp, paths);
   
    Collection<String> inputsToMultWith = new LinkedList<String>();
    for(Entry<String,CmpVertex> loopEntry:merged.transitionMatrix.get(mergedRed).entrySet())
      if (loopEntry.getValue() == mergedRed)
      {// Note an input corresponding to any loop in temp can be followed in the original machine, since
        // a loop in temp is either due to the merge or because it was there in the first place.
        inputsToMultWith.add(loopEntry.getKey());
      }
    paths.unite(paths.crossWithSet(inputsToMultWith));// the resulting path does a "transition cover" on all transitions leaving the red state.
    merged.questions.buildQuestionsFromPair_Compatible(mergedRed, paths);
    return engine.getData();
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

  {
    CmpVertex mergedRed = merged.findVertex(pair.getR().getID());
    if (mergedRed == null)
      throw new IllegalArgumentException("failed to find the red state in the merge result");
   
    PTASequenceEngine engine = new PTASequenceEngine();
    engine.init(original.new NonExistingPaths());
    PTASequenceEngine.SequenceSet initp = engine.new SequenceSet();initp.setIdentity();
    merged.questions.buildQuestionsFromPair_Compatible(mergedRed, initp);
    return engine.getData(PTASequenceEngine.truePred);
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

  public void GenerateInitialTraces() {
    topLevelListener.init(GenerateInitialTraces(5), 0, 0);
  }

  public PTASequenceEngine GenerateInitialTraces(int wavecount) {
    PTASequenceEngine engine = new PTASequenceEngine();
    engine.init(new ErlangMachine());

    PTASequenceEngine.SequenceSet seq = engine.new SequenceSet();
    seq.setIdentity();
    PTASequenceEngine.SequenceSet seqNext = null;
View Full Code Here

Examples of statechum.model.testset.PTASequenceEngine

    private PTASequenceEngine engine = null;
    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;
   
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.