boolean accepted = pair.getQ().isAccept();
Pair<Integer,String> answer = null;
if (tentativeAutomaton.config.getUseLTL() && tentativeAutomaton.config.getUseSpin() && !ifthenAutomataAsText.isEmpty())
answer = new Pair<Integer,String>(checkWithSPIN(question),null);
CmpVertex tempVertex = temp.getVertex(question);
boolean answerFromSpin = false;
if(answer != null && answer.firstElem >= 0)
answerFromSpin = true;
else
{
if (Boolean.valueOf(GlobalConfiguration.getConfiguration().getProperty(GlobalConfiguration.G_PROPERTIES.ASSERT)))
if (ptaHardFacts.paths.tracePathPrefixClosed(question) == AbstractOracle.USER_ACCEPTED)
throw new IllegalArgumentException("question "+ question+ " has already been answered");
List<Boolean> acceptedElements = null;
acceptedElements = PathRoutines.mapPathToConfirmedElements(ptaHardFacts,question,ifthenAutomata);
answer = topLevelListener.CheckWithEndUser(tentativeAutomaton, question,
tempVertex.isAccept()?AbstractOracle.USER_ACCEPTED:question.size() - 1,
acceptedElements,
new Object[] { "LTL","IFTHEN","IGNORE QUESTION","MARK AS INCOMPATIBLE"});
}
if (answer.firstElem == AbstractOracle.USER_CANCELLED)
{
System.err.println("CANCELLED");
return null;
}
else
if (answer.firstElem == AbstractOracle.USER_IGNORED)
{// do nothing
restartLearning = RestartLearningEnum.restartNONE;
System.err.println("<ignore> "+question);
}
else
if (answer.firstElem == AbstractOracle.USER_INCOMPATIBLE)
{
tentativeAutomaton.addToCompatibility(pair.firstElem, pair.secondElem, PAIRCOMPATIBILITY.INCOMPATIBLE);
restartLearning = RestartLearningEnum.restartRECOMPUTEPAIRS;
}
else
if (answer.firstElem == AbstractOracle.USER_ACCEPTED)
{
if(!answerFromSpin) // only add to hard facts when obtained directly from a user or from autofile
AugumentPTA_and_QuestionPTA(ptaHardFacts,RestartLearningEnum.restartHARD,question, true,colourToAugmentWith);
if (tentativeAutomaton.config.getUseLTL() && tentativeAutomaton.config.getUseSpin()) topLevelListener.AugmentPTA(ptaSoftFacts,RestartLearningEnum.restartSOFT,question, true,colourToAugmentWith);
if (!tempVertex.isAccept())
{// contradiction with the result of merging
if(!answerFromSpin)
restartLearning = RestartLearningEnum.restartHARD;
else
restartLearning = RestartLearningEnum.restartSOFT;
}
} else
if (answer.firstElem >= 0)
{// The sequence has been rejected by a user
assert answer.firstElem < question.size();
LinkedList<String> subAnswer = new LinkedList<String>();
subAnswer.addAll(question.subList(0, answer.firstElem + 1));
if(!answerFromSpin) // only add to hard facts when obtained directly from a user or from autofile
AugumentPTA_and_QuestionPTA(ptaHardFacts, RestartLearningEnum.restartHARD,subAnswer, false,colourToAugmentWith);
if (tentativeAutomaton.config.getUseLTL() && tentativeAutomaton.config.getUseSpin()) topLevelListener.AugmentPTA(ptaSoftFacts,RestartLearningEnum.restartSOFT,subAnswer, false,colourToAugmentWith);
// important: since vertex IDs is
// only unique for each instance of ComputeStateScores, only
// one instance should ever receive calls to augmentPTA
if ((answer.firstElem < question.size() - 1) || tempVertex.isAccept())
{// contradiction with the result of merging
assert accepted == true;
if(!answerFromSpin)
restartLearning = RestartLearningEnum.restartHARD;
else