Skip to content

Commit

Permalink
merged upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
madmike200590 committed Aug 27, 2020
2 parents 66baa80 + f1d1cd9 commit 2fb34af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/at/ac/tuwien/kr/alpha/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import at.ac.tuwien.kr.alpha.api.Alpha;
import at.ac.tuwien.kr.alpha.common.AnswerSet;
import at.ac.tuwien.kr.alpha.common.AnswerSetFormatter;
import at.ac.tuwien.kr.alpha.common.BasicAnswerSetFormatter;
import at.ac.tuwien.kr.alpha.common.SimpleAnswerSetFormatter;
import at.ac.tuwien.kr.alpha.common.depgraph.ComponentGraph;
import at.ac.tuwien.kr.alpha.common.depgraph.DependencyGraph;
import at.ac.tuwien.kr.alpha.common.graphio.ComponentGraphWriter;
Expand Down Expand Up @@ -188,7 +188,7 @@ private static void computeAndConsumeAnswerSets(Alpha alpha, InputConfig inputCf
if (!alpha.getConfig().isQuiet()) {
AtomicInteger counter = new AtomicInteger(0);
final BiConsumer<Integer, AnswerSet> answerSetHandler;
final AnswerSetFormatter<String> fmt = new BasicAnswerSetFormatter(alpha.getConfig().getAtomSeparator());
final AnswerSetFormatter<String> fmt = new SimpleAnswerSetFormatter(alpha.getConfig().getAtomSeparator());
BiConsumer<Integer, AnswerSet> stdoutPrinter = (n, as) -> {
System.out.println("Answer set " + Integer.toString(n) + ":" + System.lineSeparator() + fmt.format(as));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import at.ac.tuwien.kr.alpha.common.atoms.Atom;

public class BasicAnswerSetFormatter implements AnswerSetFormatter<String> {
public class SimpleAnswerSetFormatter implements AnswerSetFormatter<String> {

private final String atomSeparator;

public BasicAnswerSetFormatter(String atomSeparator) {
public SimpleAnswerSetFormatter(String atomSeparator) {
this.atomSeparator = atomSeparator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class CommandLineParser {
+ SystemConfig.DEFAULT_GROUNDER_ACCUMULATOR_ENABLED + ")")
.build();
private static final Option OPT_OUTPUT_ATOM_SEPARATOR = Option.builder("sep").longOpt("atomSeparator").hasArg(true).argName("separator")
.desc("a character (sequence) to use s separator for atoms in printed answer sets. (default: "
.desc("a character (sequence) to use as separator for atoms in printed answer sets (default: "
+ SystemConfig.DEFAULT_ATOM_SEPARATOR + ")")
.build();
//@formatter:on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class AnswerSetFormatterTest {

@Test
public void basicFormatterWithSeparator() {
AnswerSetFormatter<String> fmt = new BasicAnswerSetFormatter(" bla ");
AnswerSetFormatter<String> fmt = new SimpleAnswerSetFormatter(" bla ");
AnswerSet as = new AnswerSetBuilder().predicate("p").instance("a").predicate("q").instance("b").build();
String formatted = fmt.format(as);
Assert.assertEquals("{ p(\"a\") bla q(\"b\") }", formatted);
Expand Down

0 comments on commit 2fb34af

Please sign in to comment.