// 2.a Create antecedent: max(l1,...,ln) for l in loop
ArrayList<FuzzyExpression> antList = new ArrayList<FuzzyExpression>();
for (GroundLiteral l : loop) {
antList.add(new FuzzyVariableExpression(l.toString()));
}
FuzzyExpression ant = new FuzzyMultiExpression(antList, new SM());
// 2.b Create consequent: max(B1,...,Bn) for l <- Bi in R^{+}(P,L)
ArrayList<FuzzyExpression> consList = new ArrayList<FuzzyExpression>();
// Add a zero for elements that never occur in the head of a rule
consList.add(new FuzzyConstantExpression(0.0));
for (GroundRule r : rMinus) {
consList.add(r.convertBodyExpression());
}
FuzzyExpression cons = new FuzzyMultiExpression(consList, new SM());
return new FuzzyClause(
new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(ant, cons, new IW())));
}