Package statechum.analysis.learning.rpnicore.LabelRepresentation

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


   */
  public CompositionOfFunctions interpretPrePostCondition(String data,FunctionArgumentsHandler functionArgumentsHandler)
  {
    if (data == null) return CompositionOfFunctions.createEmptySecondPhase();// returns the second phase CompositionOfFunctions here.
    buildLexer(data);
    CompositionOfFunctions result = functionArgumentsHandler.getComposition(interpretFunctionalExpression(functionArgumentsHandler,true));
    if (lexExpr.getMatch() != null) // if we did not stop parsing the expression due to the end of text
      throw new IllegalArgumentException("extra text at the end of expression "+lexExpr.getText());
    return result;
  }
View Full Code Here


    int currentMatch = lexExpr.getMatchType();
    if (currentMatch < 0)
      throw new IllegalArgumentException("unexpected end of expression");
   
    String lastLabel = null;
    CompositionOfFunctions lastArgs = null;
    boolean argumentsAlreadyParsed = false;
    int position = 0;// position in the trace.
    while(currentMatch >= 0)
    {
      switch(currentMatch)
View Full Code Here

    final String expectedCompDeclarations = LabelRepresentation.encloseInBeginEndIfNotEmpty(
        "(define "+LabelRepresentation.generateFreshVariable("fn", VARIABLEUSE.IO, 0, 0)+"::int)"+LabelRepresentation.ENDL+
        "(define "+LabelRepresentation.generateFreshVariable("fn", VARIABLEUSE.IO, 0, 1)+"::int)"+LabelRepresentation.ENDL+
        "(define "+LabelRepresentation.generateFreshVariable("fn", VARIABLEUSE.IO, 0, 2)+"::int)"+LabelRepresentation.ENDL,LabelRepresentation.blockVARDECLS);

    CompositionOfFunctions comp = compIterator.next();
    Assert.assertEquals("(= 0 "+LabelRepresentation.generateFreshVariable("fn", VARIABLEUSE.IO, 0, 0)+") (< output"+_N+" 8)",comp.text);
    Assert.assertEquals(expectedCompDeclarations,comp.varDeclarations);
    Assert.assertEquals(1,comp.variablesUsedForArgs.size());
    Assert.assertArrayEquals(new String[]{LabelRepresentation.generateFreshVariable("fn", VARIABLEUSE.IO, 0, JUConstants.intUNKNOWN)}, comp.variablesUsedForArgs.get(lbls.functionMap.get("fn")).toArray());
View Full Code Here

        expectedDecls.append("(define "+LabelRepresentation.generateFreshVariable("func", VARIABLEUSE.PRE, fnUse, arg)+"::int)"+LabelRepresentation.ENDL);
       
    final String expectedCompDeclarations = LabelRepresentation.encloseInBeginEndIfNotEmpty(
        expectedDecls.toString(),LabelRepresentation.blockVARDECLS);

    CompositionOfFunctions comp = lbls.labelMapConstructionOfDataTraces.get("func").pre;
    Assert.assertEquals(expectedCompDeclarations,comp.varDeclarations);
   
    String
      FUNC0=LabelRepresentation.generateFreshVariable("func", VARIABLEUSE.PRE, 0, 0),
      FUNC1=LabelRepresentation.generateFreshVariable("func", VARIABLEUSE.PRE, 1, 0),
View Full Code Here

  /** a few operations. */
  @Test
  public final void testTraceParser11()
  {
    checkParsingPre("(and (= (func (+ y (func (+ x 3) (func (+ y 6)) input"+_M+")) 90) 5) (> (func output"+_N+" (func a input"+_M+")) (func b (func (+ x 3)))))",false);
    CompositionOfFunctions comp = lbls.labelMapConstructionOfDataTraces.get("func").pre;
    Assert.assertEquals("",comp.varDeclarations);
    Assert.assertEquals("(and (= (func (+ y (func (+ x 3) (func (+ y 6)) input"+_M+")) 90) 5) (> (func output"+_N+" (func a input"+_M+")) (func b (func (+ x 3)))))",comp.relabelledText);
    Assert.assertEquals(0,comp.variablesUsedForArgs.size());
  }
View Full Code Here

      expectedDecls.append("(define "+LabelRepresentation.generateFreshVariable("func", VARIABLEUSE.PRE, 2, arg)+"::int)"+LabelRepresentation.ENDL);
     
    final String expectedCompDeclarations = LabelRepresentation.encloseInBeginEndIfNotEmpty(
        expectedDecls.toString(),LabelRepresentation.blockVARDECLS);

    CompositionOfFunctions comp = lbls.labelMapConstructionOfDataTraces.get("func").pre;
    Assert.assertEquals(expectedCompDeclarations,comp.varDeclarations);

    // funcT
    // 0,1,2
    // (T_0)
View Full Code Here

TOP

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

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.