Package statechum.model.testset.PTASequenceEngine

Examples of statechum.model.testset.PTASequenceEngine.SequenceSet


 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality_differentcontainer()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = en.new SequenceSet();
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    PTA_FSMStructure engine2 = new PTA_FSMStructure(fsm,null);   
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,engine2.new SequenceSet(), true);
  }
View Full Code Here


 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0a()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = seqStart1.crossWithSequence(labelList(
        new String[] {"a"}
    ));
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.crossWithSequence(labelList(
        new String[] {"a"}
    ));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2, true);
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0b()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = en.new SequenceSet();
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.crossWithSequence(labelList(
        new String[] {"a"}
    ));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2, true);
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0c()
  {
    SequenceSet seqStart1 = en.new SequenceSet();seqStart1.crossWithSequence(labelList(
        new String[] {"t"}
    ));
    SequenceSet seqStart2 = en.new SequenceSet();seqStart2.crossWithSequence(labelList(
        new String[] {"t"}
    ));
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a"}
       
    },mainConfiguration,converter));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2, true);
  }
View Full Code Here

  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;
        }

      });
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality1()
  {
    SequenceSet seqStart1 = en.new SequenceSet();seqStart1.setIdentity();
    SequenceSet seqStart2 = en.new SequenceSet();seqStart2.setIdentity();
    SequenceSet seqDifferent1 = en.new SequenceSet();
    SequenceSet seqDifferent2 = seqStart1.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a"}
    },mainConfiguration,converter));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2, true);
  }
View Full Code Here

    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())
View Full Code Here

    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())
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality2()
  {
    SequenceSet seqStart = en.new SequenceSet();seqStart.setIdentity();
    SequenceSet seqStartOne = seqStart.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a","a"},
        new String[] {"c"}
    },mainConfiguration,converter));
   
    SequenceSet seqStartTwo = seqStart.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a","a"},
        new String[] {"c","a","a"}
    },mainConfiguration,converter));
   
    SequenceSet seqDifferent1 = en.new SequenceSet();
    SequenceSet seqDifferent2 = seqStart.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a"}
    },mainConfiguration,converter));
    equalityTestingHelper(seqStartOne,seqStartTwo,seqDifferent1,seqDifferent2, true);
  }
View Full Code Here

    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

TOP

Related Classes of statechum.model.testset.PTASequenceEngine.SequenceSet

Copyright © 2018 www.massapicom. 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.