Skip to content

Commit

Permalink
refactoring of AdvancedFactorizationHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
SHildebrandt committed Aug 28, 2024
1 parent 5c71fac commit ba6a45e
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public static Formula encode(final FormulaFactory f, final Formula formula, fina
* @return the CNF encoding of the formula
*/
protected static Formula advancedEncoding(final FormulaFactory f, final Formula formula, final CNFConfig config) {
final var factorizationHandler = new AdvancedFactorizationHandler();
factorizationHandler.setBounds(config.distributionBoundary, config.createdClauseBoundary);
final var factorizationHandler = new AdvancedFactorizationHandler(config.distributionBoundary, config.createdClauseBoundary);
final var advancedFactorization = new CNFFactorization(f);
final FormulaTransformation fallbackTransformation;
switch (config.fallbackAlgorithmForAdvancedEncoding) {
Expand Down Expand Up @@ -133,13 +132,13 @@ private static FormulaTransformation getPgTransformation(final FormulaFactory f,
*/
protected static class AdvancedFactorizationHandler implements ComputationHandler {

protected boolean canceled = false;
protected int distributionBoundary;
protected int createdClauseBoundary;
protected int currentDistributions;
protected int currentClauses;
private final int distributionBoundary;
private final int createdClauseBoundary;
private boolean canceled = false;
private int currentDistributions = 0;
private int currentClauses = 0;

protected void setBounds(final int distributionBoundary, final int createdClauseBoundary) {
protected AdvancedFactorizationHandler(final int distributionBoundary, final int createdClauseBoundary) {
this.distributionBoundary = distributionBoundary;
this.createdClauseBoundary = createdClauseBoundary;
}
Expand Down

0 comments on commit ba6a45e

Please sign in to comment.