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
6a063fd3
Commit
6a063fd3
authored
8 years ago
by
Sebastian Krings
Browse files
Options
Downloads
Patches
Plain Diff
change access rights
parent
0be2621a
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/SolverChecker.java
+1
-1
1 addition, 1 deletion
src/main/java/de/stups/probkodkod/SolverChecker.java
src/test/java/de/stups/probkodkod/NegativeIntTest.java
+6
-8
6 additions, 8 deletions
src/test/java/de/stups/probkodkod/NegativeIntTest.java
with
7 additions
and
9 deletions
src/main/java/de/stups/probkodkod/SolverChecker.java
+
1
−
1
View file @
6a063fd3
...
...
@@ -41,7 +41,7 @@ public class SolverChecker {
}
}
p
ublic
static
SATFactory
determineSatFactory
(
SATFactory
...
factories
)
{
p
rivate
static
SATFactory
determineSatFactory
(
SATFactory
...
factories
)
{
Map
<
String
,
Throwable
>
throwables
=
new
HashMap
<
String
,
Throwable
>();
for
(
final
SATFactory
factory
:
factories
)
{
try
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/stups/probkodkod/NegativeIntTest.java
+
6
−
8
View file @
6a063fd3
...
...
@@ -5,6 +5,9 @@ package de.stups.probkodkod;
import
java.util.Iterator
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
kodkod.ast.Formula
;
import
kodkod.ast.IntConstant
;
import
kodkod.ast.Relation
;
...
...
@@ -17,9 +20,6 @@ import kodkod.instance.TupleFactory;
import
kodkod.instance.TupleSet
;
import
kodkod.instance.Universe
;
import
org.junit.Assert
;
import
org.junit.Test
;
/**
* @author plagge
*
...
...
@@ -45,7 +45,7 @@ public class NegativeIntTest {
bounds
.
bound
(
x
,
factory
.
allOf
(
1
));
final
Formula
formula
=
x
.
sum
().
eq
(
IntConstant
.
constant
(
value
));
final
Solver
solver
=
new
Solver
();
solver
.
options
().
setSolver
(
SolverChecker
.
determineSatFactory
());
solver
.
options
().
setSolver
(
SolverChecker
.
determineSatFactory
(
SATSolver
.
sat4j
));
solver
.
options
().
setBitwidth
(
5
);
final
Iterator
<
Solution
>
iterator
=
solver
.
solveAll
(
formula
,
bounds
);
Assert
.
assertTrue
(
"solution expected"
,
iterator
.
hasNext
());
...
...
@@ -58,9 +58,7 @@ public class NegativeIntTest {
final
Object
atom
=
tuple
.
atom
(
0
);
sum
+=
((
Integer
)
atom
).
intValue
();
}
Assert
.
assertEquals
(
"constant in formula and solution should be same"
,
value
,
sum
);
Assert
.
assertTrue
(
"no other solution expected"
,
!
iterator
.
hasNext
()
||
iterator
.
next
().
instance
()
==
null
);
Assert
.
assertEquals
(
"constant in formula and solution should be same"
,
value
,
sum
);
Assert
.
assertTrue
(
"no other solution expected"
,
!
iterator
.
hasNext
()
||
iterator
.
next
().
instance
()
==
null
);
}
}
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