Package statechum.analysis.learning.spin

Examples of statechum.analysis.learning.spin.SpinUtil.check()


        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, counterExampleHolder.toString()));
      setTentativeAutomaton(updatedTentativeAutomaton);
    }
    if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){
      spin = new SpinUtil(config,getLabelConverter());
      SpinResult sr = spin.check(ptaHardFacts, ifthenAutomataAsText);
      if(!sr.isPass())
        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, sr.getCounters()));
    }

    Stack<PairScore> possibleMerges = topLevelListener.ChooseStatePairs(getTentativeAutomaton());
View Full Code Here


      long score = pair.getScore();
      RestartLearningEnum restartLearning = RestartLearningEnum.restartNONE;// whether we need to rebuild a PTA and restart learning.

      if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){

        Collection<List<Label>> counterExamples = spin.check(temp, getTentativeAutomaton(), ifthenAutomataAsText).getCounters();
        Iterator<List<Label>> counterExampleIt = counterExamples.iterator();
        while(counterExampleIt.hasNext())
        {
          List<Label> counterExample = counterExampleIt.next();
          topLevelListener.AugmentPTA(ptaSoftFacts, RestartLearningEnum.restartSOFT, counterExample, false,colourToAugmentWith);
View Full Code Here

        List<Label> question = questionIt.next();
       
        boolean accepted = pair.getQ().isAccept();
        Pair<Integer,String> answer = null;
        if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty())
          answer = new Pair<Integer,String>(spin.check(question, ifthenAutomataAsText),null);
       
        CmpVertex tempVertex = temp.getVertex(question);
        boolean answerFromSpin = false;
        if(answer != null && answer.firstElem >= 0)
          answerFromSpin = true;
View Full Code Here

            {
              if (!obtainedLTLViaAuto) System.out.println(QUESTION_USER+" "+question.toString()+ " <"+answerType+"> "+addedConstraint);
              Set<String> tmpLtl = new HashSet<String>();tmpLtl.addAll(ifthenAutomataAsText);tmpLtl.add(answerType+" "+addedConstraint);
              if(!config.isUseConstraints())
              {
                Collection<List<Label>> counters = spin.check(ptaHardFacts, tmpLtl).getCounters();
                if (counters.size()>0)
                {
                  String errorMessage = getHardFactsContradictionErrorMessage(tmpLtl, counters);
                  if (obtainedLTLViaAuto) // cannot recover from autosetting, otherwise warn a user
                    throw new IllegalArgumentException(errorMessage);
View Full Code Here

        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, counterExampleHolder.toString()));
      setTentativeAutomaton(updatedTentativeAutomaton);
    }
    if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){
      spin = new SpinUtil(config);
      SpinResult sr = spin.check(ptaHardFacts, ifthenAutomataAsText);
      if(!sr.isPass())
        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, sr.getCounters()));
    }

    Stack<PairScore> possibleMerges = topLevelListener.ChooseStatePairs(getTentativeAutomaton());
View Full Code Here

      long score = pair.getScore();
      RestartLearningEnum restartLearning = RestartLearningEnum.restartNONE;// whether we need to rebuild a PTA and restart learning.

      if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){

        Collection<List<Label>> counterExamples = spin.check(temp, getTentativeAutomaton(), ifthenAutomataAsText).getCounters();
        Iterator<List<Label>> counterExampleIt = counterExamples.iterator();
        while(counterExampleIt.hasNext())
        {
          List<Label> counterExample = counterExampleIt.next();
          topLevelListener.AugmentPTA(ptaSoftFacts, RestartLearningEnum.restartSOFT, counterExample, false,colourToAugmentWith);
View Full Code Here

        List<Label> question = questionIt.next();
       
        boolean accepted = pair.getQ().isAccept();
        Pair<Integer,String> answer = null;
        if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty())
          answer = new Pair<Integer,String>(spin.check(question, ifthenAutomataAsText),null);
       
        CmpVertex tempVertex = temp.getVertex(question);
        boolean answerFromSpin = false;
        if(answer != null && answer.firstElem >= 0)
          answerFromSpin = true;
View Full Code Here

            {
              if (!obtainedLTLViaAuto) System.out.println(QUESTION_USER+" "+question.toString()+ " <"+answerType+"> "+addedConstraint);
              Set<String> tmpLtl = new HashSet<String>();tmpLtl.addAll(ifthenAutomataAsText);tmpLtl.add(answerType+" "+addedConstraint);
              if(!config.isUseConstraints())
              {
                Collection<List<Label>> counters = spin.check(ptaHardFacts, tmpLtl).getCounters();
                if (counters.size()>0)
                {
                  String errorMessage = getHardFactsContradictionErrorMessage(tmpLtl, counters);
                  if (obtainedLTLViaAuto) // cannot recover from autosetting, otherwise warn a user
                    throw new IllegalArgumentException(errorMessage);
View Full Code Here

        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, counterExampleHolder.toString()));
      setTentativeAutomaton(updatedTentativeAutomaton);
    }
    if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){
      spin = new SpinUtil(config);
      SpinResult sr = spin.check(ptaHardFacts, ifthenAutomataAsText);
      if(!sr.isPass())
        throw new IllegalArgumentException(getHardFactsContradictionErrorMessage(ifthenAutomataAsText, sr.getCounters()));
    }

    Stack<PairScore> possibleMerges = topLevelListener.ChooseStatePairs(getTentativeAutomaton());
View Full Code Here

      long score = pair.getScore();
      RestartLearningEnum restartLearning = RestartLearningEnum.restartNONE;// whether we need to rebuild a PTA and restart learning.

      if (getTentativeAutomaton().config.getUseLTL() && getTentativeAutomaton().config.getUseSpin() && !ifthenAutomataAsText.isEmpty()){

        Collection<List<Label>> counterExamples = spin.check(temp, getTentativeAutomaton(), ifthenAutomataAsText).getCounters();
        Iterator<List<Label>> counterExampleIt = counterExamples.iterator();
        while(counterExampleIt.hasNext())
        {
          List<Label> counterExample = counterExampleIt.next();
          topLevelListener.AugmentPTA(ptaSoftFacts, RestartLearningEnum.restartSOFT, counterExample, false,colourToAugmentWith);
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.