use of at.ac.tuwien.kr.alpha.core.programs.transformation.NormalizeProgramTransformation in project Alpha by alpha-asp.
the class ChoiceManagerTests method setUp.
@BeforeEach
public void setUp() {
String testProgram = "h :- b1, b2, not b3, not b4.";
ASPCore2Program parsedProgram = new ProgramParserImpl().parse(testProgram);
CompiledProgram internalProgram = InternalProgram.fromNormalProgram(new NormalizeProgramTransformation(SystemConfig.DEFAULT_AGGREGATE_REWRITING_CONFIG).apply(parsedProgram));
atomStore = new AtomStoreImpl();
grounder = new NaiveGrounder(internalProgram, atomStore, true);
WritableAssignment assignment = new TrailAssignment(atomStore);
NoGoodStore store = new NoGoodStoreAlphaRoaming(assignment);
choiceManager = new ChoiceManager(assignment, store);
}
use of at.ac.tuwien.kr.alpha.core.programs.transformation.NormalizeProgramTransformation in project Alpha by alpha-asp.
the class TestUtils method buildSolverFromSystemConfig.
private static Solver buildSolverFromSystemConfig(ASPCore2Program prog, SystemConfig cfg) {
AtomStore atomStore = new AtomStoreImpl();
NormalProgram normalProg = new NormalizeProgramTransformation(cfg.getAggregateRewritingConfig()).apply(prog);
InternalProgram preprocessed = cfg.isEvaluateStratifiedPart() ? new StratifiedEvaluation().apply(AnalyzedProgram.analyzeNormalProgram(normalProg)) : InternalProgram.fromNormalProgram(normalProg);
return SolverFactory.getInstance(cfg, atomStore, GrounderFactory.getInstance(cfg.getGrounderName(), preprocessed, atomStore, cfg.isDebugInternalChecks()));
}
Aggregations