Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
probkodkod
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
probkodkod
Commits
14d32666
Commit
14d32666
authored
8 years ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
add comments
parent
dbccc74f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/stups/probkodkod/KodkodAnalysis.java
+3
-3
3 additions, 3 deletions
src/main/java/de/stups/probkodkod/KodkodAnalysis.java
src/main/java/de/stups/probkodkod/KodkodSession.java
+2
-1
2 additions, 1 deletion
src/main/java/de/stups/probkodkod/KodkodSession.java
with
5 additions
and
4 deletions
src/main/java/de/stups/probkodkod/KodkodAnalysis.java
+
3
−
3
View file @
14d32666
...
...
@@ -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 sen
d
directly.
* and the first solutions will be sen
t
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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/stups/probkodkod/KodkodSession.java
+
2
−
1
View file @
14d32666
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment