Package statechum.model.testset

Examples of statechum.model.testset.PTASequenceEngine


    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;

    @Override
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here


    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;

    @Override
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here

      case CONVENTIONAL: qConstructor=new QSMQuestionGenerator();break;
      case CONVENTIONAL_IMPROVED:qConstructor=new QSMQuestionGeneratorImproved();break;
      case SYMMETRIC:qConstructor=new SymmetricQuestionGenerator();break;
      case ORIGINAL:assert false;break;// should not be reached because it is handled at the top of this routine.
    }
    PTASequenceEngine engine = original.learnerCache.getQuestionsPTA();
    if (engine == null)
    {
      engine = computeQS_general(pair, original, merged, qConstructor);
      original.learnerCache.questionsPTA = engine;
    }
   
    if (properties != null)
      try {
        // this marks visited questions so that getData() we'll subsequently do will return only those questions which were not answered by property automata
        Transform.augmentFromIfThenAutomaton(original, (NonExistingPaths)engine.getFSM(), properties, -1);
      } catch (IncompatibleStatesException e) {
        Helper.throwUnchecked("failure doing merge on the original graph", e);
        // An exception "cannot merge a tentative state" at this point means that
        // a merged graph had a valid path (absent from the original graph) which
        // contradicts the property automata, hence we should not even have gotten
View Full Code Here

      // proceed to merge them.
  }
 
  public static LearnerGraph constructGraphWithQuestions(final StatePair pair, LearnerGraph original, LearnerGraph merged)
  {
    PTASequenceEngine questionsPTA = getQuestionPta(pair,original,merged,null);
    Configuration config = original.config.copy();config.setLearnerCloneGraph(false);
    LearnerGraph updatedGraph = new LearnerGraph(original,config);
    updatedGraph.setName("graph_with_questions");
    // for the putAll below to work, I have to ensure that if a state of the original graph is cloned
    // in NonExistingPaths and points to some of the existing states, the references added by
    // putAll should refer the vertices from updatedGraphActual rather than those from graph.
    // This is best accomplished by not cloning vertices when making copies of graphs.
    updatedGraph.transitionMatrix.putAll(((NonExistingPaths)questionsPTA.getFSM()).getNonExistingTransitionMatrix());
    updatedGraph.learnerCache.invalidate();return updatedGraph;
  }
View Full Code Here

    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;
   
    @Override
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here

    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;

    @Override
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here

    private Map<CmpVertex,PTASequenceEngine.SequenceSet> fanout = null;

    @Override
    public PTASequenceEngine constructEngine(LearnerGraph original, @SuppressWarnings("unused") LearnerGraph learnt)
    {
      engine = new PTASequenceEngine();
      engine.init(original.new NonExistingPaths());
      return engine;
    }
View Full Code Here

  }
 
  public static PTASequenceEngine 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<CmpVertex,LearnerGraphCachedData> eq:learnt.learnerCache.getMergedStates())
      qConstructor.addQuestionsForState(eq, original, learnt, pairToMerge,
          learnt.learnerCache.stateLearnt,new MergeData(){
View Full Code Here

  {
    CmpVertex mergedRed = merged.findVertex(pair.getR());
    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.pathroutines.computePathsSBetween(merged.getInit(),mergedRed, initp, paths);
   
    Collection<Label> inputsToMultWith = new LinkedList<Label>();
    for(Entry<Label,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

    Set<Label> alphabet =  coregraph.learnerCache.getAlphabet();
    List<List<Label>> stateCover = coregraph.pathroutines.computeStateCover(initialState);
    characterisationSet = computeWSet_reducedmemory(coregraph);if (characterisationSet.isEmpty()) characterisationSet.add(Arrays.asList(new Label[]{}));
    transitionCover = crossWithSet(stateCover,alphabet);transitionCover.addAll(stateCover);

    PTASequenceEngine engine = new PTA_FSMStructure(coregraph,initialState);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(stateCover);
   
    partialPTA.cross(characterisationSet);
    for(int i=0;i<=numberOfExtraStates;i++)
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTASequenceEngine

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.