Search in sources :

Example 11 with AlphaConfig

use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.

the class CommandLineParserTest method grounderToleranceConstraints_string.

@Test
public void grounderToleranceConstraints_string() throws ParseException {
    CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
    AlphaConfig alphaConfig = parser.parseCommandLine(new String[] { "-str", "aString.", "-gtc", "strict" });
    assertEquals("strict", alphaConfig.getSystemConfig().getGrounderToleranceConstraints());
}
Also used : AlphaConfig(at.ac.tuwien.kr.alpha.api.config.AlphaConfig) Test(org.junit.jupiter.api.Test)

Example 12 with AlphaConfig

use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.

the class CommandLineParserTest method disableStratifiedEvalLongOpt.

@Test
public void disableStratifiedEvalLongOpt() throws ParseException {
    CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
    AlphaConfig ctx = parser.parseCommandLine(new String[] { "-i", "someFile.asp", "-i", "someOtherFile.asp", "--disableStratifiedEvaluation" });
    assertFalse(ctx.getSystemConfig().isEvaluateStratifiedPart());
}
Also used : AlphaConfig(at.ac.tuwien.kr.alpha.api.config.AlphaConfig) Test(org.junit.jupiter.api.Test)

Example 13 with AlphaConfig

use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.

the class CommandLineParserTest method grounderToleranceRules_string.

@Test
public void grounderToleranceRules_string() throws ParseException {
    CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
    AlphaConfig alphaConfig = parser.parseCommandLine(new String[] { "-str", "aString.", "-gtr", "permissive" });
    assertEquals("permissive", alphaConfig.getSystemConfig().getGrounderToleranceRules());
}
Also used : AlphaConfig(at.ac.tuwien.kr.alpha.api.config.AlphaConfig) Test(org.junit.jupiter.api.Test)

Example 14 with AlphaConfig

use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.

the class CommandLineParserTest method numAnswerSets.

@Test
public void numAnswerSets() throws ParseException {
    CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
    AlphaConfig ctx = parser.parseCommandLine(new String[] { "-str", "aString.", "-n", "00435" });
    assertEquals(435, ctx.getInputConfig().getNumAnswerSets());
}
Also used : AlphaConfig(at.ac.tuwien.kr.alpha.api.config.AlphaConfig) Test(org.junit.jupiter.api.Test)

Example 15 with AlphaConfig

use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.

the class CommandLineParserTest method basicUsageWithString.

@Test
public void basicUsageWithString() throws ParseException {
    CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
    AlphaConfig ctx = parser.parseCommandLine(new String[] { "-str", "b :- a.", "-str", "c :- a, b." });
    assertEquals(Arrays.asList(new String[] { "b :- a.", "c :- a, b." }), ctx.getInputConfig().getAspStrings());
}
Also used : AlphaConfig(at.ac.tuwien.kr.alpha.api.config.AlphaConfig) Test(org.junit.jupiter.api.Test)

Aggregations

AlphaConfig (at.ac.tuwien.kr.alpha.api.config.AlphaConfig)15 Test (org.junit.jupiter.api.Test)12 InputConfig (at.ac.tuwien.kr.alpha.api.config.InputConfig)3 ParseException (org.apache.commons.cli.ParseException)3 Alpha (at.ac.tuwien.kr.alpha.api.Alpha)2 DebugSolvingContext (at.ac.tuwien.kr.alpha.api.DebugSolvingContext)2 Solver (at.ac.tuwien.kr.alpha.api.Solver)2 StatisticsReportingSolver (at.ac.tuwien.kr.alpha.api.StatisticsReportingSolver)2 SystemConfig (at.ac.tuwien.kr.alpha.api.config.SystemConfig)2 AlphaImpl (at.ac.tuwien.kr.alpha.api.impl.AlphaImpl)2 ASPCore2Program (at.ac.tuwien.kr.alpha.api.programs.ASPCore2Program)2 CommandLineParser (at.ac.tuwien.kr.alpha.app.config.CommandLineParser)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 AnswerSet (at.ac.tuwien.kr.alpha.api.AnswerSet)1 NormalProgram (at.ac.tuwien.kr.alpha.api.programs.NormalProgram)1 ComponentGraph (at.ac.tuwien.kr.alpha.api.programs.analysis.ComponentGraph)1 DependencyGraph (at.ac.tuwien.kr.alpha.api.programs.analysis.DependencyGraph)1 AnswerSetFormatter (at.ac.tuwien.kr.alpha.api.util.AnswerSetFormatter)1 ComponentGraphWriter (at.ac.tuwien.kr.alpha.app.ComponentGraphWriter)1