Skip to content

Commit

Permalink
polishing - debug code fragments removed
Browse files Browse the repository at this point in the history
  • Loading branch information
madmike200590 committed Sep 3, 2020
1 parent 045d5ca commit 81987df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
16 changes: 0 additions & 16 deletions src/main/java/at/ac/tuwien/kr/alpha/grounder/NaiveGrounder.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ public class NaiveGrounder extends BridgedGrounder implements ProgramAnalyzingGr
private final LiteralInstantiator ruleInstantiator;
private final DefaultLazyGroundingInstantiationStrategy instantiationStrategy;

// TODO remove - debugging help only!
// private TreeMap<InternalRule, Integer> ruleEvaluationCounts = new TreeMap<>((r1, r2) -> r1.toString().compareTo(r2.toString()));
// private TreeMap<InternalRule, Integer> ruleSubstitutionCounts = new TreeMap<>((r1, r2) -> r1.toString().compareTo(r2.toString()));

public NaiveGrounder(InternalProgram program, AtomStore atomStore, boolean debugInternalChecks, Bridge... bridges) {
this(program, atomStore, new GrounderHeuristicsConfiguration(), debugInternalChecks, bridges);
}
Expand Down Expand Up @@ -282,20 +278,8 @@ public AnswerSet assignmentToAnswerSet(Iterable<Integer> trueAtoms) {
return BasicAnswerSet.EMPTY;
}

// TODO remove, debugging help
// this.dbgPrintCounts();

return new BasicAnswerSet(knownPredicates, predicateInstances);
}

// TODO remove, debugging help
// private void dbgPrintCounts() {
// System.out.println("********** GROUNDING INFO ***********");
// for (InternalRule rule : this.ruleEvaluationCounts.keySet()) {
// System.out.println("Rule: " + rule + ", evaluations = " + this.ruleEvaluationCounts.get(rule) + ", non-unique-substitutions = " + this.ruleSubstitutionCounts.get(rule));
// }
// System.out.println("******* END OF GROUNDING INFO *******");
// }

/**
* Prepares facts of the input program for joining and derives all NoGoods representing ground rules. May only be called once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ private List<Substitution> calculateSatisfyingSubstitutionsForRule(InternalRule
RuleGroundingOrders groundingOrders = rule.getGroundingOrders();
List<Substitution> groundSubstitutions = new ArrayList<>(); // the actual full ground substitutions for the rule
LOGGER.debug("Is fixed rule? {}", rule.getGroundingOrders().fixedInstantiation());
if (groundingOrders.fixedInstantiation()) { // FIXME fixed instantiation handling is ugly AF
if (groundingOrders.fixedInstantiation()) {
// Note: Representation of fixed grounding orders should be refactored in RuleGroundingOrders.
RuleGroundingOrder fixedGroundingOrder = groundingOrders.getFixedGroundingOrder();
groundSubstitutions.addAll(this.calcSubstitutionsWithGroundingOrder(rule, fixedGroundingOrder, 0,
Collections.singletonList(new Substitution())));
Expand Down

0 comments on commit 81987df

Please sign in to comment.