use of at.ac.tuwien.kr.alpha.core.programs.transformation.aggregates.AggregateRewriting in project Alpha by alpha-asp.
the class NormalizeProgramTransformation method apply.
@Override
public NormalProgram apply(ASPCore2Program inputProgram) {
ASPCore2Program tmpPrg;
// Remove variable equalities.
tmpPrg = new VariableEqualityRemoval().apply(inputProgram);
// Transform choice rules.
tmpPrg = new ChoiceHeadToNormal().apply(tmpPrg);
// Transform aggregates.
tmpPrg = new AggregateRewriting(aggregateRewritingCfg.isUseSortingGridEncoding(), aggregateRewritingCfg.isSupportNegativeValuesInSums()).apply(tmpPrg);
// Transform enumeration atoms.
tmpPrg = new EnumerationRewriting().apply(tmpPrg);
EnumerationAtom.resetEnumerations();
// Construct the normal program.
NormalProgram retVal = NormalProgramImpl.fromInputProgram(tmpPrg);
// Transform intervals.
retVal = new IntervalTermToIntervalAtom().apply(retVal);
// Rewrite ArithmeticTerms.
retVal = new ArithmeticTermsRewriting().apply(retVal);
return retVal;
}
Aggregations