Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SAT4J
sat4j
Commits
b4fbd7a8
Commit
b4fbd7a8
authored
Jun 06, 2017
by
Lonca Emmanuel
Browse files
Fixed some bugs that made the solver incorrect.
parent
37e71508
Pipeline
#174
failed with stage
in 18 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/CountingCtrBuilder.java
View file @
b4fbd7a8
...
...
@@ -68,7 +68,9 @@ public class CountingCtrBuilder {
exprBuf
.
append
(
','
);
}
varId
=
list
[
list
.
length
-
1
].
id
;
exprBuf
.
append
(
CtrBuilderUtils
.
normalizeCspVarName
(
varId
));
final
int
lastCoeff
=
coeffs
[
list
.
length
-
1
];
final
String
normName
=
CtrBuilderUtils
.
normalizeCspVarName
(
varId
);
exprBuf
.
append
(
lastCoeff
==
1
?
normName
:
"mul("
+
lastCoeff
+
","
+
normName
+
")"
);
for
(
int
i
=
0
;
i
<
list
.
length
-
1
;
++
i
)
{
exprBuf
.
append
(
')'
);
}
...
...
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/TseitinBasedIntensionCtrEncoder.java
View file @
b4fbd7a8
...
...
@@ -387,7 +387,7 @@ public class TseitinBasedIntensionCtrEncoder implements IIntensionCtrEncoder {
Iterator
<
Entry
<
Integer
,
Integer
>>
it2
=
mappings
.
get
(
1
).
entrySet
().
iterator
();
while
(
it2
.
hasNext
())
{
Entry
<
Integer
,
Integer
>
entry2
=
it2
.
next
();
buildImplVar
(
ret
,
entry1
.
getValue
(),
entry2
.
getValue
(),
entry1
.
getKey
()
==
entry2
.
getKey
()?
1
:
0
);
buildImplVar
(
ret
,
entry1
.
getValue
(),
entry2
.
getValue
(),
entry1
.
getKey
()
.
equals
(
entry2
.
getKey
()
)
?
1
:
0
);
}
}
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment