Package statechum.analysis.learning.rpnicore.LabelRepresentation

Examples of statechum.analysis.learning.rpnicore.LabelRepresentation.AbstractState


        Iterator<AbstractState>
          stateA_iter = graph.getVertexToAbstractState().get(pair.firstElem).iterator(),
          stateB_iter = graph.getVertexToAbstractState().get(pair.secondElem).iterator();
        while(stateA_iter.hasNext() && !finished)
        {
          AbstractState stateA = stateA_iter.next();
          while(stateB_iter.hasNext() && !finished)
            if (lbl.abstractStatesCompatible(stateA, stateB_iter.next()))
            {
              finished = true;statesIntersect = true;
            }
View Full Code Here


    lbls.parseLabel(INITMEM+" "+LabelRepresentation.XM_DATA.PRE+ " decl_N");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondA");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondA");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondB");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondB");
    AbstractState state = lbls.getConjunctionForPath(Arrays.asList(new String[]{}));
    Assert.assertEquals("varDecl_0"+ENDL+"decl_0"+ENDL,state.variableDeclarations);
    Assert.assertEquals(LabelRepresentation.commentForNewSeq+"[]"+ENDL+"true"+ENDL, state.abstractState);
    Assert.assertEquals(0,state.stateNumber);
    Assert.assertNull(state.lastLabel);
  }
View Full Code Here

    lbls.parseLabel(INITMEM+" "+LabelRepresentation.XM_DATA.POST+ " initCond_N");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondA");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondA");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondB");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondB");
    AbstractState state = lbls.getConjunctionForPath(Arrays.asList(new String[]{}));
    Assert.assertEquals("varDecl_0"+ENDL,state.variableDeclarations);
    Assert.assertEquals(LabelRepresentation.commentForNewSeq+"[]"+ENDL+"(and"+ENDL+"initCond_0"+ENDL+')'+ENDL,state.abstractState);
    Assert.assertEquals(0,state.stateNumber);
    Assert.assertNull(state.lastLabel);
  }
View Full Code Here

    lbls.parseLabel(INITMEM+" "+LabelRepresentation.XM_DATA.POST+ " initCond_N");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondA_N");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondA_N");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondB_N");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondB_N");
    AbstractState state = lbls.getConjunctionForPath(Arrays.asList(new String[]{"A","B"}));
    Assert.assertEquals("varDeclP_0"+ENDL+"varDeclQ_0"+ENDL+
        "varDeclP_1"+ENDL+"varDeclQ_1"+ENDL+
        "varDeclP_2"+ENDL+"varDeclQ_2"+ENDL,state.variableDeclarations);

    Assert.assertEquals(LabelRepresentation.commentForNewSeq+"[A, B]"+ENDL+
View Full Code Here

    lbls.parseLabel(INITMEM+" "+LabelRepresentation.XM_DATA.PRE+ " varDeclP_N");
    lbls.parseLabel(INITMEM+" "+LabelRepresentation.XM_DATA.PRE+ " varDeclQ_N");
    lbls.parseLabel("A"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondA_N");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.PRE+ " somePrecondB_N");
    lbls.parseLabel("B"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondB_N");
    AbstractState state = lbls.getConjunctionForPath(Arrays.asList(new String[]{"A","B"}));
    Assert.assertEquals("varDeclP_0"+ENDL+"varDeclQ_0"+ENDL+
        "varDeclP_1"+ENDL+"varDeclQ_1"+ENDL+
        "varDeclP_2"+ENDL+"varDeclQ_2"+ENDL, state.variableDeclarations);

    Assert.assertEquals(LabelRepresentation.commentForNewSeq+"[A, B]"+ENDL+
View Full Code Here

  /** Tests that creation of successive conjunctions returns the correct numbers for abstract states. */
  @Test
  public void testCreateConjunction3()
  {
    LabelRepresentation lbls = testCreateConjunction2_internal();
    AbstractState state = lbls.getConjunctionForPath(Arrays.asList(new String[]{"A","B"}));
    Assert.assertEquals("varDeclP_3"+ENDL+"varDeclQ_3"+ENDL+
        "varDeclP_4"+ENDL+"varDeclQ_4"+ENDL+
        "varDeclP_5"+ENDL+"varDeclQ_5"+ENDL, state.variableDeclarations);

    Assert.assertEquals(LabelRepresentation.commentForNewSeq+"[A, B]"+ENDL+
View Full Code Here

    lbls.parseLabel("b"+" "+LabelRepresentation.XM_DATA.POST+ " somePostcondB_N");

    lbls.AugmentAbstractStates(null,Arrays.asList(new String[]{}), graph,true);// initial state
    Assert.assertEquals(1,lbls.idToState.size());
    Assert.assertTrue(lbls.idToState.containsKey(VertexID.parseID("A")));
    AbstractState stateInit = lbls.idToState.get(VertexID.parseID("A"));
   
    lbls.AugmentAbstractStates(null,Arrays.asList(new String[]{}), graph,true);// and again
    Assert.assertEquals(1,lbls.idToState.size());
    Assert.assertTrue(lbls.idToState.containsKey(VertexID.parseID("A")));
    Assert.assertSame(stateInit,lbls.idToState.get(VertexID.parseID("A")));
View Full Code Here

    lbls.parseLabel("remove"+" "+LabelRepresentation.XM_DATA.POST+ " (= m_N (- m_M 1))");
    Smt.loadLibrary();
    Smt.closeStdOut();
    Smt smt = new Smt();

    AbstractState state = null;
    smt.pushContext();
    state = lbls.getConjunctionForPath(Arrays.asList(new String[]{"remove"}));
    smt.loadData(LabelRepresentation.getAssertionFromAbstractState(state));
    Assert.assertFalse(smt.check());
    smt.popContext();
View Full Code Here

        Iterator<AbstractState>
          stateA_iter = graph.getVertexToAbstractState().get(pair.firstElem).iterator(),
          stateB_iter = graph.getVertexToAbstractState().get(pair.secondElem).iterator();
        while(stateA_iter.hasNext() && !finished)
        {
          AbstractState stateA = stateA_iter.next();
          while(stateB_iter.hasNext() && !finished)
            if (lbl.abstractStatesCompatible(stateA, stateB_iter.next()))
            {
              finished = true;statesIntersect = true;
            }
View Full Code Here

      QSMTool.cmdOperation+" "+"A"+" "+LabelRepresentation.OP_DATA.PRE+ " somePrecondA",
      QSMTool.cmdOperation+" "+"A"+" "+LabelRepresentation.OP_DATA.POST+ " somePostcondA",
      QSMTool.cmdOperation+" "+"B"+" "+LabelRepresentation.OP_DATA.PRE+ " somePrecondB",
      QSMTool.cmdOperation+" "+"B"+" "+LabelRepresentation.OP_DATA.POST+ " somePostcondB"}));
    lbls.buildVertexToAbstractStateMap(new LearnerGraph(FsmParser.buildGraph("stA-A->stB-B->stC-A->stD", "testCreateConjunction1"), Configuration.getDefaultConfiguration()),null,true);
    AbstractState state = lbls.new AbstractState(AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("P"),config),0);
    Assert.assertEquals("varDecl"+__P+"0",state.variableDeclarations);
    Assert.assertEquals(LabelRepresentation.commentForInit+ENDL+"initCond"+__P+"0",state.abstractState);
    Assert.assertNull(state.lastLabel);
    Assert.assertNull(state.previousState);
    Assert.assertEquals(0,state.stateNumber);
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.LabelRepresentation.AbstractState

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.