Package statechum.analysis.Erlang

Examples of statechum.analysis.Erlang.ErlangLabel$ErlangChar


    ErlangModule.setupErlangConfiguration(config,file);config.setErlangCompileIntoBeamDirectory(true);config.setTransitionMatrixImplType(STATETREE.STATETREE_SLOWTREE);
    ErlangModule.loadModule(config);
    final String LBL1 = "{call, read}", LBL2 = "{call, lock}";
    final LearnerGraph gr = buildLearnerGraph("A- "+LBL1+" ->B-"+LBL2+"->B", "testConvertToModuleFailure1", config,null);
    Iterator<Label> lblIter = gr.pathroutines.computeAlphabet().iterator();
    ErlangLabel lbl1 = (ErlangLabel)lblIter.next(),lbl2 = (ErlangLabel)lblIter.next();
    List<Label> trace = Arrays.asList(new Label[]{lbl1,lbl2,lbl2});
    Assert.assertEquals("[{?F(),'call','read'},{?F(),'call','lock'},{?F(),'call','lock'}]",RPNILearner.questionToString(trace));
  }
View Full Code Here


      int prefixLen = outcome.answerDetails.length - 1;
      List<Label> prefix = question.subList(0, prefixLen);
      Label failedLabel = question.get(prefixLen);
      response.append("- [");
      boolean first = true;
      ErlangLabel noop = stripOutput((ErlangLabel) failedLabel);

      //assert noop.function != null : "questions do not contain function details";
      for (Label lbl : inputToPossibleOutputs.get(noop)) {
        if (!first)
          response.append(',');
View Full Code Here

    }

  }

  public static ErlangLabel stripOutput(ErlangLabel label) {
    return new ErlangLabel(label.function, label.callName, label.input,
        null);
  }
View Full Code Here

    for (Label lbl : question) {
      if (!(lbl instanceof ErlangLabel))
        throw new IllegalArgumentException("question element " + lbl
            + " is not of Erlang type");

      ErlangLabel erlLabel = (ErlangLabel)lbl;
     
      if (!module.getName().equals(erlLabel.function.getModuleName()))
        throw new IllegalArgumentException("current module is "+module.getName()+" but attempting to call "+erlLabel.function.getModuleName());

      if (!module.behaviour.getAlphabet().contains(lbl))
View Full Code Here

      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
              questionDetails[i].function,
              questionDetails[i].callName,
              questionDetails[i].input, elemAti.elementAt(2));
        } else {
          answerDetails[i] = new ErlangLabel(
              questionDetails[i].function,
              questionDetails[i].callName,
              questionDetails[i].input);
        }
View Full Code Here

        nextState = ErlangState.newErlangState(state, input, true);
        // System.out.println("OK : "+RPNILearner.questionToString(newTrace));
        break;
      case TRACE_DIFFERENTOUTPUT:
        assert outcome.answerDetails.length == traceLength;
        ErlangLabel nextLabel = outcome.answerDetails[traceLength - 1];
        state.rejects.add(input);// record the reject.
        if (!module.behaviour.getAlphabet().contains(nextLabel)) {
          module.behaviour.getAlphabet().add(nextLabel);
          // extend the alphabet
          // (if the input is already in the alphabet, fine, it would
View Full Code Here

    config = ErlangModule.setupErlangConfiguration(file);config.setTransitionMatrixImplType(STATETREE.STATETREE_SLOWTREE);
    ErlangModule.loadModule(config);
    final String LBL1 = "{call, read}", LBL2 = "{call, lock}";
    final LearnerGraph gr = buildLearnerGraph("A- "+LBL1+" ->B-"+LBL2+"->B", "testConvertToModuleFailure1", config,null);
    Iterator<Label> lblIter = gr.pathroutines.computeAlphabet().iterator();
    ErlangLabel lbl1 = (ErlangLabel)lblIter.next(),lbl2 = (ErlangLabel)lblIter.next();
    List<Label> trace = Arrays.asList(new Label[]{lbl1,lbl2,lbl2});
    Assert.assertEquals("[{?F(),'call','read'},{?F(),'call','lock'},{?F(),'call','lock'}]",RPNILearner.questionToString(trace));
  }
View Full Code Here

                      {
                        text.append("<font color="+color+">");text.append(lbl.toString());
                      }
                      else
                      {
                        ErlangLabel l = (ErlangLabel)lbl;
                        text.append("<font color=blue>");text.append(l.callName);text.append("</font>,&nbsp;");
                        text.append("<font color="+color+">");text.append(l.input);text.append("</font>");
                        if (l.expectedOutput != null)
                        {
                          text.append(",&nbsp;<font color=black>");text.append(l.expectedOutput);text.append("</font>");
View Full Code Here

        if (origLabel instanceof StringLabel)
          result = new StringLabel(prefix+origLabel);
        else
        if (origLabel instanceof ErlangLabel)
        {
          ErlangLabel oErl = (ErlangLabel)origLabel;
          result = new ErlangLabel(oErl.function,prefix+oErl.callName,
              oErl.input, oErl.expectedOutput);
        }
        else
          assert false;
       
View Full Code Here

                final ConvertALabel converter = ErlangModule.loadModule(grOrig.config).behaviour.new ConverterModToErl();
              AbstractLearnerGraph.interpretLabelsOnGraph(grOrig,grNew,new Transform.ConvertLabel(new ConvertALabel() {
           
            @Override
            public Label convertLabelToLabel(Label label) {
              ErlangLabel lbl = (ErlangLabel)converter.convertLabelToLabel(label);
              return new ErlangLabel(null, lbl.callName.replace(moduleName, ""), lbl.input, lbl.expectedOutput);
            }
          }));
              grNew.setName(grOrig.getNameNotNull()+"-nomodule");
              updateFrameWithPos(grNew, strippedFrameNumber++);
             
View Full Code Here

TOP

Related Classes of statechum.analysis.Erlang.ErlangLabel$ErlangChar

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.