//Use basic Assignments class, of course
for(GdlSentence alwaysTrueSentences : model.getSentencesListedAsTrue(curForm))
trueFlowSentences.add(alwaysTrueSentences);
for(GdlRule rule : model.getRules(curForm)) {
GdlSentence head = rule.getHead();
List<GdlVariable> varsInHead = GdlUtils.getVariables(head);
Assignments assignments = AssignmentsFactory.getAssignmentsForRule(rule, model, functionInfoMap, Collections.EMPTY_MAP);
AssignmentIterator asnItr = assignments.getIterator();
while(asnItr.hasNext()) {
Map<GdlVariable, GdlConstant> assignment = asnItr.next();
boolean isGoodAssignment = true;
GdlSentence transformedHead = CommonTransforms.replaceVariables(head, assignment);
if(trueFlowSentences.contains(transformedHead))
asnItr.changeOneInNext(varsInHead, assignment);
//Go through the conjuncts
for(GdlLiteral literal : rule.getBody()) {
if(literal instanceof GdlSentence) {
if(curForm.matches((GdlSentence) literal))
throw new RuntimeException("Haven't implemented recursion in the game flow");
GdlSentence transformed = CommonTransforms.replaceVariables((GdlSentence) literal, assignment);
SentenceForm conjForm = model.getSentenceForm(transformed);
if(constantForms.contains(conjForm)) {
if(!constantChecker.isTrueConstant(transformed)) {
isGoodAssignment = false;
asnItr.changeOneInNext(GdlUtils.getVariables(literal), assignment);
}
} else {
if(!trueFlowSentences.contains(transformed)) {
//False sentence
isGoodAssignment = false;
asnItr.changeOneInNext(GdlUtils.getVariables(literal), assignment);
}
}
} else if(literal instanceof GdlNot) {
GdlSentence internal = (GdlSentence) ((GdlNot) literal).getBody();
GdlSentence transformed = CommonTransforms.replaceVariables(internal, assignment);
SentenceForm conjForm = model.getSentenceForm(transformed);
if(constantForms.contains(conjForm)) {
if(constantChecker.isTrueConstant(transformed)) {
isGoodAssignment = false;