diff --git a/src/main/java/de/stups/probkodkod/KodkodAnalysis.java b/src/main/java/de/stups/probkodkod/KodkodAnalysis.java index 06521422b62e198c7ad2043febf6e3deb2fb0550..454fd7c157f78cb8259ae9f1d38b901dc7799515 100644 --- a/src/main/java/de/stups/probkodkod/KodkodAnalysis.java +++ b/src/main/java/de/stups/probkodkod/KodkodAnalysis.java @@ -275,7 +275,7 @@ public class KodkodAnalysis extends DepthFirstAdapter { /** * A request has been entered. It will be added to the {@link KodkodSession} - * and the first solutions will be send directly. + * and the first solutions will be sent directly. */ @Override public void caseARequest(final ARequest node) { @@ -283,7 +283,7 @@ public class KodkodAnalysis extends DepthFirstAdapter { final ImmutableProblem problem = session.getProblem(problemId); if (problem != null) { final boolean signum = getSignum(node.getReqtype()); - int size = extractInt(node.getSize()); + int size = extractInt(node.getSize()); // the maximum number of solutions to be computed final Map<String, TupleSet> args = extractArguments( node.getArguments(), problem); session.request(problem, signum, args); @@ -301,7 +301,7 @@ public class KodkodAnalysis extends DepthFirstAdapter { final String id = extractIdentifier(node.getProblem()); final ImmutableProblem problem = session.getProblem(id); if (problem != null) { - final int size = extractInt(node.getSize()); + final int size = extractInt(node.getSize()); // the maximum number of solutions to be computed session.writeNextSolutions(problem, size, pto); } } diff --git a/src/main/java/de/stups/probkodkod/KodkodSession.java b/src/main/java/de/stups/probkodkod/KodkodSession.java index 324dc0b4b53bacbbdb58e720fa92f3c879bfdcdd..59d46c7e7c2224c314fe792243e41634d050f037 100644 --- a/src/main/java/de/stups/probkodkod/KodkodSession.java +++ b/src/main/java/de/stups/probkodkod/KodkodSession.java @@ -36,7 +36,7 @@ public class KodkodSession { final Solver solver = new Solver(); solver.options().setSolver(new SAT4JWithTimeoutFactory(timeout)); - solver.options().setSymmetryBreaking(0); + solver.options().setSymmetryBreaking(0); // TO DO: provide preference for this; default int value for Kodkod is 20 final Integer bitwidth = problem.getBitwidth(); if (bitwidth != null) { solver.options().setBitwidth(bitwidth); @@ -65,6 +65,7 @@ public class KodkodSession { return problems.get(problemId); } + // size is the max number of solutions found public boolean writeNextSolutions(final ImmutableProblem problem, final int size, final IPrologTermOutput pto) { Request request = currentRequests.get(problem);