- java.lang.Object
-
- org.logicng.solvers.sat.MiniSatConfig.Builder
-
- Enclosing class:
- MiniSatConfig
public static class MiniSatConfig.Builder extends Object
The builder for a MiniSAT configuration.- Since:
- 1.0
- Version:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MiniSatConfig.BuilderauxiliaryVariablesInModels(boolean auxiliaryVariablesInModels)Sets whether auxiliary variables (CNF, cardinality constraints, pseudo-Boolean constraints) should be included in methods likeSATSolver.model()orSATSolver.enumerateAllModels().MiniSatConfig.BuilderbbCheckForComplementModelLiterals(boolean checkForComplementModelLiterals)Sets whether the backbone algorithm should check for complement model literals.MiniSatConfig.BuilderbbCheckForRotatableLiterals(boolean checkForRotatableLiterals)Sets whether the backbone algorithm should check for rotatable literals.MiniSatConfig.BuilderbbInitialUBCheckForRotatableLiterals(boolean initialUBCheckForRotatableLiterals)Sets whether the backbone algorithm should check for rotatable literals during initial unit propagation.MiniSatConfigbuild()Builds the MiniSAT configuration.MiniSatConfig.BuilderclauseDecay(double clauseDecay)Sets the clause activity decay factor to a given value.MiniSatConfig.BuilderclMinimization(MiniSatConfig.ClauseMinimization ccmin)Sets the clause minimization method.MiniSatConfig.BuildercnfMethod(MiniSatConfig.CNFMethod cnfMethod)Sets the CNF method for converting formula which are not in CNF for the solver.MiniSatConfig.Builderincremental(boolean incremental)Turns the incremental mode of the solver off and on.MiniSatConfig.BuilderinitialPhase(boolean initialPhase)Sets the initial phase of the solver.MiniSatConfig.BuilderlsFactor(double learntsizeFactor)Sets the initial limit for learnt clauses as a factor of the original clauses to the given value.MiniSatConfig.BuilderlsInc(double learntsizeInc)Sets the factor by which the limit for learnt clauses is multiplied every restart to a given value.MiniSatConfig.BuilderproofGeneration(boolean proofGeneration)Sets whether the information for generating a proof with DRUP should be recorded or not.MiniSatConfig.BuilderremoveSatisfied(boolean removeSatisfied)If turned on, the satisfied original clauses will be removed when simplifying on level 0, when turned off, only the satisfied learnt clauses will be removed.MiniSatConfig.BuilderrestartFirst(int restartFirst)Sets the base restart interval to the given value.MiniSatConfig.BuilderrestartInc(double restartInc)Sets the restart interval increase factor to the given value.MiniSatConfig.BuildervarDecay(double varDecay)Sets the variable activity decay factor to a given value.MiniSatConfig.BuildervarInc(double varInc)Sets the initial value to bump a variable with each time it is used in conflict resolution to a given value.
-
-
-
Method Detail
-
varDecay
public MiniSatConfig.Builder varDecay(double varDecay)
Sets the variable activity decay factor to a given value. The default value is 0.95.- Parameters:
varDecay- the value (should be in the range 0..1)- Returns:
- the builder
-
varInc
public MiniSatConfig.Builder varInc(double varInc)
Sets the initial value to bump a variable with each time it is used in conflict resolution to a given value. The default value is 1.0.- Parameters:
varInc- the value- Returns:
- the builder
-
clMinimization
public MiniSatConfig.Builder clMinimization(MiniSatConfig.ClauseMinimization ccmin)
Sets the clause minimization method. The default value isDEEP.- Parameters:
ccmin- the value- Returns:
- the builder
-
restartFirst
public MiniSatConfig.Builder restartFirst(int restartFirst)
Sets the base restart interval to the given value. The default value is 100.- Parameters:
restartFirst- the value (should be at least 1)- Returns:
- the builder
-
restartInc
public MiniSatConfig.Builder restartInc(double restartInc)
Sets the restart interval increase factor to the given value. The default value is 2.0.- Parameters:
restartInc- the value (should be at least 1)- Returns:
- the builder
-
clauseDecay
public MiniSatConfig.Builder clauseDecay(double clauseDecay)
Sets the clause activity decay factor to a given value. The default value is 0.999.- Parameters:
clauseDecay- the value (should be in the range 0..1)- Returns:
- the builder
-
removeSatisfied
public MiniSatConfig.Builder removeSatisfied(boolean removeSatisfied)
If turned on, the satisfied original clauses will be removed when simplifying on level 0, when turned off, only the satisfied learnt clauses will be removed. The default value istrue.- Parameters:
removeSatisfied-trueif the original clauses should be simplified,falseotherwise- Returns:
- the builder
-
lsFactor
public MiniSatConfig.Builder lsFactor(double learntsizeFactor)
Sets the initial limit for learnt clauses as a factor of the original clauses to the given value. The default value is 1/3.- Parameters:
learntsizeFactor- the value- Returns:
- the builder
-
lsInc
public MiniSatConfig.Builder lsInc(double learntsizeInc)
Sets the factor by which the limit for learnt clauses is multiplied every restart to a given value. The default value is 1.1.- Parameters:
learntsizeInc- the value- Returns:
- the builder
-
incremental
public MiniSatConfig.Builder incremental(boolean incremental)
Turns the incremental mode of the solver off and on. The default value istrue.- Parameters:
incremental-trueif incremental mode is turned on,falseotherwise- Returns:
- the builder
-
initialPhase
public MiniSatConfig.Builder initialPhase(boolean initialPhase)
Sets the initial phase of the solver. The default value istrue.- Parameters:
initialPhase- the initial phase- Returns:
- the builder
-
proofGeneration
public MiniSatConfig.Builder proofGeneration(boolean proofGeneration)
Sets whether the information for generating a proof with DRUP should be recorded or not. The default value isfalse.- Parameters:
proofGeneration-trueif proof generating information should be recorded,falseotherwise- Returns:
- the builder
-
cnfMethod
public MiniSatConfig.Builder cnfMethod(MiniSatConfig.CNFMethod cnfMethod)
Sets the CNF method for converting formula which are not in CNF for the solver. The default value isFACTORY_CNF.- Parameters:
cnfMethod- the CNF method- Returns:
- the builder
-
auxiliaryVariablesInModels
public MiniSatConfig.Builder auxiliaryVariablesInModels(boolean auxiliaryVariablesInModels)
Sets whether auxiliary variables (CNF, cardinality constraints, pseudo-Boolean constraints) should be included in methods likeSATSolver.model()orSATSolver.enumerateAllModels(). If set totrue, all variables will be included in these methods, if set tofalse, variables starting with "@RESERVED_CC_", "@RESERVED_PB_", and "@RESERVED_CNF_" will be excluded from the models. The default value isfalse.- Parameters:
auxiliaryVariablesInModels-trueif auxiliary variables should be included in the models,falseotherwise- Returns:
- the builder
-
bbCheckForRotatableLiterals
public MiniSatConfig.Builder bbCheckForRotatableLiterals(boolean checkForRotatableLiterals)
Sets whether the backbone algorithm should check for rotatable literals. The default value istrue.- Parameters:
checkForRotatableLiterals- the boolean value that istrueif the algorithm should check for rotatables orfalseotherwise.- Returns:
- the builder
-
bbInitialUBCheckForRotatableLiterals
public MiniSatConfig.Builder bbInitialUBCheckForRotatableLiterals(boolean initialUBCheckForRotatableLiterals)
Sets whether the backbone algorithm should check for rotatable literals during initial unit propagation. The default value istrue.- Parameters:
initialUBCheckForRotatableLiterals- the boolean value that istrueif the algorithm should check for rotatables orfalseotherwise.- Returns:
- the builder
-
bbCheckForComplementModelLiterals
public MiniSatConfig.Builder bbCheckForComplementModelLiterals(boolean checkForComplementModelLiterals)
Sets whether the backbone algorithm should check for complement model literals. The default value istrue.- Parameters:
checkForComplementModelLiterals- the boolean value that istrueif the algorithm should check for complement literals orfalseotherwise.- Returns:
- the builder
-
build
public MiniSatConfig build()
Builds the MiniSAT configuration.- Returns:
- the configuration
-
-