Skip to content

Commit 7a5d83a

Browse files
committed
improve example: make usage of enumeration theory more local to avoid unnecessary errors.
1 parent 41ecfe7 commit 7a5d83a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/org/sosy_lab/java_smt/example/Sudoku.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,11 @@ public abstract static class SudokuSolver<S> {
169169
private final SolverContext context;
170170
final BooleanFormulaManager bmgr;
171171
final IntegerFormulaManager imgr;
172-
final EnumerationFormulaManager emgr;
173172

174173
private SudokuSolver(SolverContext pContext) {
175174
context = pContext;
176175
bmgr = context.getFormulaManager().getBooleanFormulaManager();
177176
imgr = context.getFormulaManager().getIntegerFormulaManager();
178-
emgr = context.getFormulaManager().getEnumerationFormulaManager();
179177
}
180178

181179
abstract S getSymbols();
@@ -426,13 +424,15 @@ Integer getValue(BooleanFormula[][][] symbols, Model model, int row, int col) {
426424

427425
public static class EnumerationBasedSudokuSolver extends SudokuSolver<EnumerationFormula[][]> {
428426

427+
private final EnumerationFormulaManager emgr;
429428
private final EnumerationFormulaType type;
430429
private static final String[] VALUES = {
431430
"ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE",
432431
};
433432

434433
public EnumerationBasedSudokuSolver(SolverContext context) {
435434
super(context);
435+
emgr = context.getFormulaManager().getEnumerationFormulaManager();
436436
type = emgr.declareEnumeration("VALUES", VALUES);
437437
}
438438

0 commit comments

Comments
 (0)