Package statechum.analysis.learning.rpnicore.WMethod

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


   */
  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

  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

    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

   
    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

      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

    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

  {
    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

  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B-a->C","testAutomatonConnected4",mainConfiguration, converter);
    Assert.assertFalse(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

  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B-a->C-b->A / D-a->D","testAutomatonConnected5",mainConfiguration, converter);
    Assert.assertFalse(graph.pathroutines.automatonConnected());
    LearnerGraph actual = new LearnerGraph(mainConfiguration);graph.pathroutines.removeReachableStatesFromWhichInitIsNotReachable(actual);
    final LearnerGraph expected = FsmParser.buildLearnerGraph("A-a->B-a->C-b->A","testAutomatonConnected3a",mainConfiguration, converter);
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null) throw ex;
  }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

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.