Skip to content

Commit 4e43015

Browse files
committed
api: Convert TODOs to issues
See issues #302, #303, #304 on GitHub. Also some code quality improvements.
1 parent 14a7417 commit 4e43015

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

alpha-api/src/main/java/at/ac/tuwien/kr/alpha/api/config/SystemConfig.java

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
import java.util.stream.Collectors;
3434

3535
public class SystemConfig {
36-
37-
// TODO add validation on configs!
38-
// TODO naive solver cannot print stats!
39-
// TODO introduce debug levels (lvl 1 = print graphs and preprocessed, lvl 2 = same with debugInternalChecks)
40-
4136
// Note: Defining constants for default values here rather than just
4237
// initializing from those values in order to have the values accessible in
4338
// contexts where no AlphaConfig instance exists (e.g. argument parsing from

alpha-commons/src/main/java/at/ac/tuwien/kr/alpha/commons/literals/BasicLiteralImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public BasicLiteralImpl negate() {
6868
*/
6969
@Override
7070
public BasicLiteralImpl substitute(Substitution substitution) {
71-
return new BasicLiteralImpl((BasicAtom) getAtom().substitute(substitution), positive);
71+
return new BasicLiteralImpl(getAtom().substitute(substitution), positive);
7272
}
7373

7474
/**

alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/parser/ParseTreeVisitor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public List<ChoiceElement> visitChoice_elements(ASPCore2Parser.Choice_elementsCo
271271
@Override
272272
public ChoiceHead.ChoiceElement visitChoice_element(ASPCore2Parser.Choice_elementContext ctx) {
273273
// choice_element : classical_literal (COLON naf_literals?)?;
274-
BasicAtom atom = (BasicAtom) visitClassical_literal(ctx.classical_literal());
274+
BasicAtom atom = visitClassical_literal(ctx.classical_literal());
275275
if (ctx.naf_literals() != null) {
276276
return Heads.newChoiceElement(atom, visitNaf_literals(ctx.naf_literals()));
277277
} else {

alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/solver/NoGoodStoreAlphaRoaming.java

+3-8
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,10 @@ private void clearAlphaWatchList(int literal) {
820820

821821
@Override
822822
public int estimate(int atom, boolean truth, BinaryNoGoodPropagationEstimationStrategy strategy) {
823-
switch (strategy) {
824-
case BinaryNoGoodPropagation:
825-
if (hasBinaryNoGoods) {
826-
return estimateEffectsOfBinaryNoGoodPropagation(atom, truth) - 1;
827-
}
828-
case CountBinaryWatches:
829-
default:
830-
return getNumberOfBinaryWatches(atom, truth);
823+
if (BinaryNoGoodPropagationEstimationStrategy.BinaryNoGoodPropagation.equals(strategy)) {
824+
return estimateEffectsOfBinaryNoGoodPropagation(atom, truth) - 1;
831825
}
826+
return getNumberOfBinaryWatches(atom, truth);
832827
}
833828

834829
private int getNumberOfBinaryWatches(int atom, boolean truth) {

0 commit comments

Comments
 (0)