Examples of DifferentFSMException


Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

    Assert.assertSame(MarkovOutcome.positive, newTransitions.get(graph.findVertex("B")).get(lblB));
    Assert.assertSame(MarkovOutcome.positive, newTransitions.get(graph.findVertex("Z")).get(lblU));

    final LearnerGraph expected = FsmParser.buildLearnerGraph("A-a->B / A-c->B-c->Z-u->Y / B-b->C / T-b->T-u->T","testConstructExtendedGraph7b",config, converter);
    LearnerGraph actual = cl.constructMarkovTentative();
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null)
      throw ex;
    Assert.assertNotSame(graph, actual);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

    Assert.assertNull(result);
  }
 
  static void compareGraphs(LearnerGraph A, LearnerGraph B)
  {
    DifferentFSMException ex= WMethod.checkM_and_colours(A, B, VERTEX_COMPARISON_KIND.NONE);
    Assert.assertNull(ex==null?"":ex.toString(),ex);
   
    // reachability of all states ensures that transition structures are isomorphic.
    Assert.assertEquals(A.getStateNumber(),A.pathroutines.computeShortPathsToAllStates().size());
    Assert.assertEquals(B.getStateNumber(),B.pathroutines.computeShortPathsToAllStates().size());
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

  /** Verifies the equivalence of a supplied graph to the supplied machine. */
  public static void checkM_ND(String fsm,String g,Configuration conf, ConvertALabel converter)
  {
    final LearnerGraphND graph = buildLearnerGraphND(g,"expected graph",conf,converter);
    final LearnerGraphND expected = buildLearnerGraphND(fsm,"expected graph",conf,converter);
    DifferentFSMException
      ex1 = WMethod.checkM(expected,graph),
      ex2 = WMethod.checkM(graph,expected);
    if (ex1 != null)
      Assert.assertNotNull(ex2);
    else
      Assert.assertNull(ex2);
    Assert.assertNull(ex1==null?"":ex1.toString(),ex1);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

   */
  public static void checkM(String fsm,LearnerGraph graph,Configuration conf, ConvertALabel converter)
  {
    final LearnerGraph expected = buildLearnerGraph(fsm,"expected graph",conf,converter);
   
    DifferentFSMException
      ex1 = WMethod.checkM(expected,graph),
      ex2 = WMethod.checkM(graph,expected);
   
    if (ex1 != null)
      Assert.assertNotNull(ex2);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

  public static void checkReduction(String fsm,String g,Configuration conf, ConvertALabel converter)
  {
    final LearnerGraph graph = buildLearnerGraph(g,"actual graph",conf,converter);
    final LearnerGraph expected = buildLearnerGraph(fsm,"expected graph",conf,converter);
   
    DifferentFSMException
      exReduction = WMethod.checkReduction(expected, expected.init, graph, graph.init);
   
    if (exReduction != null)
    {// if not a reduction, cannot be an equivalence
      DifferentFSMException
        ex1 = WMethod.checkM(expected,graph),
        ex2 = WMethod.checkM(graph,expected);
      Assert.assertNotNull(ex1);
      Assert.assertNotNull(ex2);
    }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

    for(Entry<CmpVertex,LinkedList<String>> entry:A.wmethod.computeShortPathsToAllStates().entrySet())
    {
      CmpVertex Bstate = B.getVertex(entry.getValue());
      CmpVertex Astate = entry.getKey();
      if (Bstate.getColour() != Astate.getColour())
        throw new DifferentFSMException("states "+ Astate + " (" +
            ((Astate.getColour() == null)?"no color":Astate.getColour())+") and "+Bstate+" ("+
            ((Bstate.getColour() == null)?"no color":Bstate.getColour())+") have different colours");
    }  
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

   
    System.out.println("Huge: "+hugeGraph.getStateNumber()+" states, "+(hugeGraph.getStateNumber()-hugeGraph.getAcceptStateNumber())+" reject states");
    System.out.println("Small: "+smallGraph.getStateNumber()+" states, "+(smallGraph.getStateNumber()-smallGraph.getAcceptStateNumber())+" reject states");
    Label labelToMerge = AbstractLearnerGraph.generateNewLabel("Waypoint_Selected",mainConfiguration,converter);
    LearnerGraph mergedHuge = PairQualityLearner.mergeStatesForUnique(hugeGraph, labelToMerge);
    DifferentFSMException diffFSM = WMethod.checkM(smallGraph, mergedHuge);
    if (diffFSM != null)
      throw diffFSM;

    LearnerGraph mergedSmall = PairQualityLearner.mergeStatesForUnique(smallGraph,labelToMerge);
    diffFSM = WMethod.checkM(smallGraph,mergedSmall);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

      gd.computeDifference(patcher);

      ChangesRecorder.applyGD_WithRelabelling(graph, patcher.writeGD(TestGD.createDoc()),outcome);
      Assert.assertNull(testDetails(),WMethod.checkM(grB,graph));
      Assert.assertEquals(testDetails(),grB.getStateNumber(),graph.getStateNumber());
      DifferentFSMException ex= WMethod.checkM_and_colours(grB,outcome,VERTEX_COMPARISON_KIND.DEEP);
      Assert.assertNull(testDetails()+ex,WMethod.checkM_and_colours(grB,outcome,VERTEX_COMPARISON_KIND.DEEP));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
      Assert.assertEquals(grB,outcome);
    }
    catch(IOException ex)
    {
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

    LearnerGraph graph = new LearnerGraph(mainConfiguration);
    Assert.assertNull(PairQualityLearner.uniqueFromInitial(graph));
    Assert.assertTrue(graph.pathroutines.automatonConnected());
    LearnerGraph actual = new LearnerGraph(mainConfiguration);graph.pathroutines.removeReachableStatesFromWhichInitIsNotReachable(actual);
    LearnerGraph expected = new LearnerGraph(mainConfiguration);
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null) throw ex;
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B-a->C-b->A","testAutomatonConnected3",mainConfiguration, converter);
    Assert.assertNull(PairQualityLearner.uniqueFromInitial(graph));
    Assert.assertTrue(graph.pathroutines.automatonConnected());
    LearnerGraph actual = new LearnerGraph(mainConfiguration);graph.pathroutines.removeReachableStatesFromWhichInitIsNotReachable(actual);
    DifferentFSMException ex = WMethod.checkM(graph, actual);
    if (ex != null) throw ex;
  }
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.