diff --git a/core/src/main/java/com/booleworks/logicng/backbones/BackboneGeneration.java b/core/src/main/java/com/booleworks/logicng/backbones/BackboneGeneration.java index a50859cd..96b65260 100644 --- a/core/src/main/java/com/booleworks/logicng/backbones/BackboneGeneration.java +++ b/core/src/main/java/com/booleworks/logicng/backbones/BackboneGeneration.java @@ -8,11 +8,11 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.BackboneFunction; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.util.FormulaHelper; import java.util.Collection; @@ -45,16 +45,16 @@ private BackboneGeneration() { * @param type the type of backbone variables that should be computed * @param handler a handler * @return the backbone or {@code null} if the computation was canceled by - * the handler + * the handler */ - public static LNGResult compute(final FormulaFactory f, final Collection formulas, + public static LngResult compute(final FormulaFactory f, final Collection formulas, final Collection variables, final BackboneType type, final ComputationHandler handler) { if (formulas == null || formulas.isEmpty()) { throw new IllegalArgumentException("Provide at least one formula for backbone computation"); } - final SATSolver solver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); solver.add(formulas); return solver.execute(BackboneFunction.builder().variables(variables).type(type).build(), handler); } diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGBooleanVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngBooleanVector.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/collections/LNGBooleanVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngBooleanVector.java index a62473ce..5a55fee7 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGBooleanVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngBooleanVector.java @@ -10,14 +10,14 @@ * A simple vector for boolean elements implementation (inspired by MiniSat and * CleaneLing). *

- * In theory one could use the {@link LNGVector} also for boolean. But Java's + * In theory one could use the {@link LngVector} also for boolean. But Java's * auto-boxing comes with such a large performance penalty that for the * mission-critical data structures of the SAT solvers we use this specialized * implementation. * @version 3.0.0 * @since 1.0 */ -public final class LNGBooleanVector { +public final class LngBooleanVector { private boolean[] elements; private int size; @@ -25,7 +25,7 @@ public final class LNGBooleanVector { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGBooleanVector() { + public LngBooleanVector() { this(5); } @@ -33,7 +33,7 @@ public LNGBooleanVector() { * Creates a vector with a given capacity. * @param size the capacity of the vector. */ - public LNGBooleanVector(final int size) { + public LngBooleanVector(final int size) { elements = new boolean[size]; } @@ -42,7 +42,7 @@ public LNGBooleanVector(final int size) { * @param size the capacity of the vector * @param pad the initial element */ - public LNGBooleanVector(final int size, final boolean pad) { + public LngBooleanVector(final int size, final boolean pad) { elements = new boolean[size]; Arrays.fill(elements, pad); this.size = size; @@ -52,7 +52,7 @@ public LNGBooleanVector(final int size, final boolean pad) { * Copy constructor. * @param other the other byte vector. */ - public LNGBooleanVector(final LNGBooleanVector other) { + public LngBooleanVector(final LngBooleanVector other) { elements = Arrays.copyOf(other.elements, other.size); size = other.size; } @@ -61,12 +61,12 @@ public LNGBooleanVector(final LNGBooleanVector other) { * Creates a vector with the given elements. * @param elems the elements */ - public LNGBooleanVector(final boolean... elems) { + public LngBooleanVector(final boolean... elems) { elements = Arrays.copyOf(elems, elems.length); size = elems.length; } - public LNGBooleanVector(final boolean[] elements, final int size) { + public LngBooleanVector(final boolean[] elements, final int size) { this.elements = elements; this.size = size; } diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGByteVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngByteVector.java similarity index 94% rename from core/src/main/java/com/booleworks/logicng/collections/LNGByteVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngByteVector.java index 8863abe1..4b9113a5 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGByteVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngByteVector.java @@ -10,14 +10,14 @@ * A simple vector for byte elements implementation (inspired by MiniSat and * CleaneLing). *

- * In theory one could use the {@link LNGVector} also for bytes. But Java's + * In theory one could use the {@link LngVector} also for bytes. But Java's * auto-boxing comes with such a large performance penalty that for the * mission-critical data structures of the SAT solvers we use this specialized * implementation. * @version 3.0.0 * @since 1.0 */ -public final class LNGByteVector { +public final class LngByteVector { private byte[] elements; private int size; @@ -25,7 +25,7 @@ public final class LNGByteVector { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGByteVector() { + public LngByteVector() { this(5); } @@ -33,7 +33,7 @@ public LNGByteVector() { * Creates a vector with a given capacity. * @param size the capacity of the vector. */ - public LNGByteVector(final int size) { + public LngByteVector(final int size) { elements = new byte[size]; } @@ -42,7 +42,7 @@ public LNGByteVector(final int size) { * @param size the capacity of the vector * @param pad the initial element */ - public LNGByteVector(final int size, final byte pad) { + public LngByteVector(final int size, final byte pad) { elements = new byte[size]; Arrays.fill(elements, pad); this.size = size; @@ -52,7 +52,7 @@ public LNGByteVector(final int size, final byte pad) { * Copy constructor. * @param other the other byte vector. */ - public LNGByteVector(final LNGByteVector other) { + public LngByteVector(final LngByteVector other) { elements = Arrays.copyOf(other.elements, other.size); size = other.size; } @@ -61,7 +61,7 @@ public LNGByteVector(final LNGByteVector other) { * Creates a vector with the given elements. * @param elems the elements */ - public LNGByteVector(final byte... elems) { + public LngByteVector(final byte... elems) { elements = Arrays.copyOf(elems, elems.length); size = elems.length; } diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGDoubleVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngDoubleVector.java similarity index 94% rename from core/src/main/java/com/booleworks/logicng/collections/LNGDoubleVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngDoubleVector.java index 90553e31..f1450bd7 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGDoubleVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngDoubleVector.java @@ -10,14 +10,14 @@ * A simple vector for double elements implementation (inspired by MiniSat, * CleaneLing, Sat4J). *

- * In theory one could use the {@link LNGVector} also for doubles. But Java's + * In theory one could use the {@link LngVector} also for doubles. But Java's * auto-boxing comes with such a large performance penalty that for the * mission-critical data structures of the SAT solvers we use this specialized * implementation. * @version 3.0.0 * @since 1.0 */ -public final class LNGDoubleVector { +public final class LngDoubleVector { private double[] elements; private int size; @@ -25,7 +25,7 @@ public final class LNGDoubleVector { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGDoubleVector() { + public LngDoubleVector() { this(5); } @@ -33,7 +33,7 @@ public LNGDoubleVector() { * Creates a vector with a given capacity. * @param size the capacity of the vector. */ - public LNGDoubleVector(final int size) { + public LngDoubleVector(final int size) { elements = new double[size]; } @@ -42,7 +42,7 @@ public LNGDoubleVector(final int size) { * @param size the capacity of the vector * @param pad the initial element */ - public LNGDoubleVector(final int size, final double pad) { + public LngDoubleVector(final int size, final double pad) { elements = new double[size]; Arrays.fill(elements, pad); this.size = size; @@ -52,7 +52,7 @@ public LNGDoubleVector(final int size, final double pad) { * Copy constructor. * @param other the other byte vector. */ - public LNGDoubleVector(final LNGDoubleVector other) { + public LngDoubleVector(final LngDoubleVector other) { elements = Arrays.copyOf(other.elements, other.size); size = other.size; } @@ -61,7 +61,7 @@ public LNGDoubleVector(final LNGDoubleVector other) { * Creates a vector with the given elements. * @param elems the elements */ - public LNGDoubleVector(final double... elems) { + public LngDoubleVector(final double... elems) { elements = Arrays.copyOf(elems, elems.length); size = elems.length; } diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGIntVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngIntVector.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/collections/LNGIntVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngIntVector.java index 386a87f1..a221f60c 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGIntVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngIntVector.java @@ -9,14 +9,14 @@ /** * A simple vector for integer elements implementation (inspired by MiniSat). *

- * In theory one could use the {@link LNGVector} also for integers. But Java's + * In theory one could use the {@link LngVector} also for integers. But Java's * auto-boxing comes with such a large performance penalty that for the * mission-critical data structures of the SAT solvers we use this specialized * implementation. * @version 3.0.0 * @since 1.0 */ -public final class LNGIntVector { +public final class LngIntVector { private int[] elements; private int size; @@ -24,7 +24,7 @@ public final class LNGIntVector { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGIntVector() { + public LngIntVector() { this(5); } @@ -32,7 +32,7 @@ public LNGIntVector() { * Creates a vector with a given capacity. * @param size the capacity of the vector. */ - public LNGIntVector(final int size) { + public LngIntVector(final int size) { elements = new int[size]; } @@ -40,12 +40,12 @@ public LNGIntVector(final int size) { * Copy constructor. * @param other the other byte vector. */ - public LNGIntVector(final LNGIntVector other) { + public LngIntVector(final LngIntVector other) { elements = Arrays.copyOf(other.elements, other.size); size = other.size; } - public LNGIntVector(final int[] elements, final int size) { + public LngIntVector(final int[] elements, final int size) { this.elements = elements; this.size = size; } @@ -55,8 +55,8 @@ public LNGIntVector(final int[] elements, final int size) { * @param elements the elements * @return the new vector */ - public static LNGIntVector of(final int... elements) { - final LNGIntVector result = new LNGIntVector(elements.length); + public static LngIntVector of(final int... elements) { + final LngIntVector result = new LngIntVector(elements.length); result.elements = Arrays.copyOf(elements, elements.length); result.size = elements.length; return result; diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGLongVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngLongVector.java similarity index 94% rename from core/src/main/java/com/booleworks/logicng/collections/LNGLongVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngLongVector.java index c18c0ff7..a4eb83a0 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGLongVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngLongVector.java @@ -10,14 +10,14 @@ * A simple vector for long elements implementation (inspired by MiniSat, * CleaneLing, Sat4J). *

- * In theory one could use the {@link LNGVector} also for longs. But Java's + * In theory one could use the {@link LngVector} also for longs. But Java's * auto-boxing comes with such a large performance penalty that for the * mission-critical data structures of the SAT solvers we use this specialized * implementation. * @version 3.0.0 * @since 1.0 */ -public final class LNGLongVector { +public final class LngLongVector { private long[] elements; private int size; @@ -25,7 +25,7 @@ public final class LNGLongVector { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGLongVector() { + public LngLongVector() { this(5); } @@ -33,7 +33,7 @@ public LNGLongVector() { * Creates a vector with a given capacity. * @param size the capacity of the vector. */ - public LNGLongVector(final int size) { + public LngLongVector(final int size) { elements = new long[size]; } @@ -42,7 +42,7 @@ public LNGLongVector(final int size) { * @param size the capacity of the vector * @param pad the initial element */ - public LNGLongVector(final int size, final long pad) { + public LngLongVector(final int size, final long pad) { elements = new long[size]; Arrays.fill(elements, pad); this.size = size; @@ -52,7 +52,7 @@ public LNGLongVector(final int size, final long pad) { * Copy constructor. * @param other the other byte vector. */ - public LNGLongVector(final LNGLongVector other) { + public LngLongVector(final LngLongVector other) { elements = Arrays.copyOf(other.elements, other.size); size = other.size; } @@ -61,12 +61,12 @@ public LNGLongVector(final LNGLongVector other) { * Creates a vector with the given elements. * @param elems the elements */ - public LNGLongVector(final long... elems) { + public LngLongVector(final long... elems) { elements = Arrays.copyOf(elems, elems.length); size = elems.length; } - public LNGLongVector(final long[] elements, final int size) { + public LngLongVector(final long[] elements, final int size) { this.elements = elements; this.size = size; } diff --git a/core/src/main/java/com/booleworks/logicng/collections/LNGVector.java b/core/src/main/java/com/booleworks/logicng/collections/LngVector.java similarity index 97% rename from core/src/main/java/com/booleworks/logicng/collections/LNGVector.java rename to core/src/main/java/com/booleworks/logicng/collections/LngVector.java index f3482a78..bb20180a 100644 --- a/core/src/main/java/com/booleworks/logicng/collections/LNGVector.java +++ b/core/src/main/java/com/booleworks/logicng/collections/LngVector.java @@ -16,7 +16,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class LNGVector implements Iterable { +public final class LngVector implements Iterable { private T[] elements; private int size; @@ -24,7 +24,7 @@ public final class LNGVector implements Iterable { /** * Creates a vector with an initial capacity of 5 elements. */ - public LNGVector() { + public LngVector() { this(5); } @@ -33,7 +33,7 @@ public LNGVector() { * @param size the capacity of the vector. */ @SuppressWarnings("unchecked") - public LNGVector(final int size) { + public LngVector(final int size) { elements = (T[]) new Object[size]; } @@ -43,7 +43,7 @@ public LNGVector(final int size) { * @param pad the initial element */ @SuppressWarnings("unchecked") - public LNGVector(final int size, final T pad) { + public LngVector(final int size, final T pad) { elements = (T[]) new Object[size]; Arrays.fill(elements, pad); this.size = size; @@ -54,7 +54,7 @@ public LNGVector(final int size, final T pad) { * @param elems the elements */ @SafeVarargs - public LNGVector(final T... elems) { + public LngVector(final T... elems) { elements = Arrays.copyOf(elems, elems.length); size = elems.length; } @@ -64,7 +64,7 @@ public LNGVector(final T... elems) { * @param elems the elements */ @SuppressWarnings("unchecked") - public LNGVector(final Collection elems) { + public LngVector(final Collection elems) { elements = (T[]) new Object[elems.size()]; int count = 0; for (final T e : elems) { @@ -230,7 +230,7 @@ public boolean remove(final T element) { * itself */ @SuppressWarnings("unchecked") - public void replaceInplace(final LNGVector other) { + public void replaceInplace(final LngVector other) { if (this == other) { throw new IllegalArgumentException("cannot replace a vector in-place with itself"); } diff --git a/core/src/main/java/com/booleworks/logicng/datastructures/EncodingResult.java b/core/src/main/java/com/booleworks/logicng/datastructures/EncodingResult.java index a14d8a3b..20c8c667 100644 --- a/core/src/main/java/com/booleworks/logicng/datastructures/EncodingResult.java +++ b/core/src/main/java/com/booleworks/logicng/datastructures/EncodingResult.java @@ -4,15 +4,15 @@ package com.booleworks.logicng.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.InternalAuxVarType; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.ArrayList; import java.util.List; @@ -33,7 +33,7 @@ public final class EncodingResult { private final FormulaFactory f; private final Proposition proposition; - private final LNGCoreSolver solver; + private final LngCoreSolver solver; private final List result; /** @@ -42,7 +42,7 @@ public final class EncodingResult { * @param solver the solver instance * @param proposition the original proposition of the cardinality constraint */ - private EncodingResult(final FormulaFactory f, final LNGCoreSolver solver, final Proposition proposition) { + private EncodingResult(final FormulaFactory f, final LngCoreSolver solver, final Proposition proposition) { this.f = f; this.proposition = proposition; this.solver = solver; @@ -65,7 +65,7 @@ public static EncodingResult resultForFormula(final FormulaFactory f) { * @param proposition the original proposition of the cardinality constraint * @return the result */ - public static EncodingResult resultForSATSolver(final FormulaFactory f, final LNGCoreSolver solver, + public static EncodingResult resultForSatSolver(final FormulaFactory f, final LngCoreSolver solver, final Proposition proposition) { return new EncodingResult(f, solver, proposition); } @@ -78,7 +78,7 @@ public void addClause(final Literal... literals) { if (solver == null) { result.add(f.clause(literals)); } else { - final LNGIntVector clauseVec = new LNGIntVector(literals.length); + final LngIntVector clauseVec = new LngIntVector(literals.length); for (final Literal literal : literals) { addLiteral(clauseVec, literal); } @@ -90,11 +90,11 @@ public void addClause(final Literal... literals) { * Adds a clause to the result * @param literals the literals of the clause */ - public void addClause(final LNGVector literals) { + public void addClause(final LngVector literals) { if (solver == null) { result.add(vec2clause(literals)); } else { - final LNGIntVector clauseVec = new LNGIntVector(literals.size()); + final LngIntVector clauseVec = new LngIntVector(literals.size()); for (final Literal l : literals) { addLiteral(clauseVec, l); } @@ -102,7 +102,7 @@ public void addClause(final LNGVector literals) { } } - private void addLiteral(final LNGIntVector clauseVec, final Literal lit) { + private void addLiteral(final LngIntVector clauseVec, final Literal lit) { int index = solver.idxForName(lit.getName()); if (index == -1) { index = solver.newVar(!solver.getConfig().getInitialPhase(), true); @@ -122,7 +122,7 @@ private void addLiteral(final LNGIntVector clauseVec, final Literal lit) { * @param literals the literals * @return the clause */ - private Formula vec2clause(final LNGVector literals) { + private Formula vec2clause(final LngVector literals) { final List lits = new ArrayList<>(literals.size()); for (final Literal l : literals) { lits.add(l); @@ -153,7 +153,7 @@ public Variable newVariable(final InternalAuxVarType auxType) { * Returns a new auxiliary variable for cardinality constraint encodings. * @return a new auxiliary variable */ - public Variable newCCVariable() { + public Variable newCcVariable() { return newVariable(InternalAuxVarType.CC); } @@ -161,7 +161,7 @@ public Variable newCCVariable() { * Returns a new auxiliary variable for pseudo-boolean constraint encodings. * @return a new auxiliary variable */ - public Variable newPBCVariable() { + public Variable newPbcVariable() { return newVariable(InternalAuxVarType.PBC); } @@ -169,7 +169,7 @@ public Variable newPBCVariable() { * Returns a new auxiliary variable for cnf encodings. * @return a new auxiliary variable */ - public Variable newCNFVariable() { + public Variable newCnfVariable() { return newVariable(InternalAuxVarType.CNF); } diff --git a/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBNode.java b/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbNode.java similarity index 90% rename from core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBNode.java rename to core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbNode.java index b2415411..0e8c9682 100644 --- a/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBNode.java +++ b/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbNode.java @@ -15,17 +15,17 @@ * @version 3.0.0 * @since 1.5.0 */ -public final class UBNode> { +public final class UbNode> { private final T element; - private final SortedMap> children; + private final SortedMap> children; private SortedSet set; /** * Constructs a new UB Tree node with the given element. * @param element the node's element */ - UBNode(final T element) { + UbNode(final T element) { this.element = element; children = new TreeMap<>(); } @@ -54,7 +54,7 @@ SortedSet getSet() { * @return a mapping from element to its node - all of which are children of * the current node */ - SortedMap> getChildren() { + SortedMap> getChildren() { return children; } @@ -82,7 +82,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final UBNode ubNode = (UBNode) o; + final UbNode ubNode = (UbNode) o; return Objects.equals(element, ubNode.element) && Objects.equals(children, ubNode.children) && Objects.equals(set, ubNode.set); @@ -95,7 +95,7 @@ public int hashCode() { @Override public String toString() { - return "UBNode{" + + return "UbNode{" + "element=" + element + ", children=" + children + ", set=" + set + diff --git a/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBTree.java b/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbTree.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBTree.java rename to core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbTree.java index 9b674e83..5bbad5cc 100644 --- a/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UBTree.java +++ b/core/src/main/java/com/booleworks/logicng/datastructures/ubtrees/UbTree.java @@ -20,13 +20,13 @@ * @version 3.0.0 * @since 1.5.0 */ -public final class UBTree> { - private final SortedMap> rootNodes; +public final class UbTree> { + private final SortedMap> rootNodes; /** * Constructs an empty UBTree. */ - public UBTree() { + public UbTree() { rootNodes = new TreeMap<>(); } @@ -35,10 +35,10 @@ public UBTree() { * @param set the set of comparable objects */ public void addSet(final SortedSet set) { - SortedMap> nodes = rootNodes; - UBNode node = null; + SortedMap> nodes = rootNodes; + UbNode node = null; for (final T element : set) { - node = nodes.computeIfAbsent(element, UBNode::new); + node = nodes.computeIfAbsent(element, UbNode::new); nodes = node.getChildren(); } if (node != null) { @@ -86,9 +86,9 @@ public Set> allSupersets(final SortedSet set) { * @return all sets in this UBTree */ public Set> allSets() { - final List> allEndOfPathNodes = getAllEndOfPathNodes(rootNodes); + final List> allEndOfPathNodes = getAllEndOfPathNodes(rootNodes); final Set> allSets = new LinkedHashSet<>(); - for (final UBNode endOfPathNode : allEndOfPathNodes) { + for (final UbNode endOfPathNode : allEndOfPathNodes) { allSets.add(endOfPathNode.getSet()); } return allSets; @@ -98,14 +98,14 @@ public Set> allSets() { * Returns all root nodes of this UBTree. * @return all root nodes of this UBTree */ - SortedMap> getRootNodes() { + SortedMap> getRootNodes() { return rootNodes; } - private SortedSet firstSubset(final SortedSet set, final SortedMap> forest) { - final Set> nodes = getAllNodesContainingElements(set, forest); + private SortedSet firstSubset(final SortedSet set, final SortedMap> forest) { + final Set> nodes = getAllNodesContainingElements(set, forest); SortedSet foundSubset = null; - for (final UBNode node : nodes) { + for (final UbNode node : nodes) { if (foundSubset != null) { return foundSubset; } @@ -119,10 +119,10 @@ private SortedSet firstSubset(final SortedSet set, final SortedMap set, final SortedMap> forest, + private void allSubsets(final SortedSet set, final SortedMap> forest, final Set> subsets) { - final Set> nodes = getAllNodesContainingElements(set, forest); - for (final UBNode node : nodes) { + final Set> nodes = getAllNodesContainingElements(set, forest); + for (final UbNode node : nodes) { if (node.isEndOfPath()) { subsets.add(node.getSet()); } @@ -132,24 +132,24 @@ private void allSubsets(final SortedSet set, final SortedMap> fo } } - private void allSupersets(final SortedSet set, final SortedMap> forest, + private void allSupersets(final SortedSet set, final SortedMap> forest, final Set> supersets) { - final Set> nodes = getAllNodesContainingElementsLessThan(forest, set.first()); - for (final UBNode node : nodes) { + final Set> nodes = getAllNodesContainingElementsLessThan(forest, set.first()); + for (final UbNode node : nodes) { allSupersets(set, node.getChildren(), supersets); } - for (final UBNode node : forest.values()) { + for (final UbNode node : forest.values()) { if (node.getElement().equals(set.first())) { final SortedSet remainingSet = new TreeSet<>(set); remainingSet.remove(set.first()); if (!remainingSet.isEmpty()) { allSupersets(remainingSet, node.getChildren(), supersets); } else { - final List> allEndOfPathNodes = getAllEndOfPathNodes(node.getChildren()); + final List> allEndOfPathNodes = getAllEndOfPathNodes(node.getChildren()); if (node.isEndOfPath()) { allEndOfPathNodes.add(node); } - for (final UBNode endOfPathNode : allEndOfPathNodes) { + for (final UbNode endOfPathNode : allEndOfPathNodes) { supersets.add(endOfPathNode.getSet()); } } @@ -157,10 +157,10 @@ private void allSupersets(final SortedSet set, final SortedMap> } } - private Set> getAllNodesContainingElements(final SortedSet set, final SortedMap> forest) { - final Set> nodes = new LinkedHashSet<>(); + private Set> getAllNodesContainingElements(final SortedSet set, final SortedMap> forest) { + final Set> nodes = new LinkedHashSet<>(); for (final T element : set) { - final UBNode node = forest.get(element); + final UbNode node = forest.get(element); if (node != null) { nodes.add(node); } @@ -168,10 +168,10 @@ private Set> getAllNodesContainingElements(final SortedSet set, fin return nodes; } - private Set> getAllNodesContainingElementsLessThan(final SortedMap> forest, + private Set> getAllNodesContainingElementsLessThan(final SortedMap> forest, final T element) { - final Set> nodes = new LinkedHashSet<>(); - for (final UBNode node : forest.values()) { + final Set> nodes = new LinkedHashSet<>(); + for (final UbNode node : forest.values()) { if (node != null && node.getElement().compareTo(element) < 0) { nodes.add(node); } @@ -179,14 +179,14 @@ private Set> getAllNodesContainingElementsLessThan(final SortedMap> getAllEndOfPathNodes(final SortedMap> forest) { - final List> endOfPathNodes = new ArrayList<>(); + private List> getAllEndOfPathNodes(final SortedMap> forest) { + final List> endOfPathNodes = new ArrayList<>(); getAllEndOfPathNodes(forest, endOfPathNodes); return endOfPathNodes; } - private void getAllEndOfPathNodes(final SortedMap> forest, final List> endOfPathNodes) { - for (final UBNode node : forest.values()) { + private void getAllEndOfPathNodes(final SortedMap> forest, final List> endOfPathNodes) { + for (final UbNode node : forest.values()) { if (node.isEndOfPath()) { endOfPathNodes.add(node); } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/CcEncoder.java b/core/src/main/java/com/booleworks/logicng/encodings/CcEncoder.java index acc576f1..e9e889d6 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/CcEncoder.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/CcEncoder.java @@ -226,7 +226,7 @@ private static void amo(final EncodingResult result, final EncoderConfig config, CcAmo.bimander(result, computeBimanderGroupSize(config, vars.length), vars); break; case BEST: - bestAMO(result, config, vars); + bestAmo(result, config, vars); break; default: throw new IllegalStateException("Unknown at-most-one encoder: " + config.amoEncoder); @@ -416,7 +416,7 @@ protected static void exk(final EncodingResult result, final EncoderConfig confi * <= 10 the pure encoding without introduction of new variables is used, * otherwise the product encoding is chosen. */ - private static void bestAMO(final EncodingResult result, final EncoderConfig config, final Variable... vars) { + private static void bestAmo(final EncodingResult result, final EncoderConfig config, final Variable... vars) { if (vars.length <= 10) { CcAmo.pure(result, vars); } else { diff --git a/core/src/main/java/com/booleworks/logicng/encodings/CcIncrementalData.java b/core/src/main/java/com/booleworks/logicng/encodings/CcIncrementalData.java index c579dcb6..198c6093 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/CcIncrementalData.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/CcIncrementalData.java @@ -26,7 +26,7 @@ package com.booleworks.logicng.encodings; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; @@ -44,13 +44,13 @@ */ public final class CcIncrementalData { private final EncodingResult result; - private final EncoderConfig.AMK_ENCODER amkEncoder; - private final EncoderConfig.ALK_ENCODER alkEncoder; - private final LNGVector vector1; - private final LNGVector vector2; + private final EncoderConfig.AmkEncoder amkEncoder; + private final EncoderConfig.AlkEncoder alkEncoder; + private final LngVector vector1; + private final LngVector vector2; private final int mod; private int nVars; - private int currentRHS; + private int currentRhs; /** * Constructs new incremental data for an at-most-k encoder and the given @@ -62,13 +62,13 @@ public final class CcIncrementalData { * @param vector2 the second internal vector * @param mod the modulo value */ - public CcIncrementalData(final EncodingResult result, final EncoderConfig.AMK_ENCODER amkEncoder, final int rhs, - final LNGVector vector1, final LNGVector vector2, + public CcIncrementalData(final EncodingResult result, final EncoderConfig.AmkEncoder amkEncoder, final int rhs, + final LngVector vector1, final LngVector vector2, final int mod) { this.result = result; this.amkEncoder = amkEncoder; alkEncoder = null; - currentRHS = rhs; + currentRhs = rhs; this.vector1 = vector1; this.vector2 = vector2; this.mod = mod; @@ -82,8 +82,8 @@ public CcIncrementalData(final EncodingResult result, final EncoderConfig.AMK_EN * @param rhs the current right-hand-side * @param vector1 the first internal vector */ - public CcIncrementalData(final EncodingResult result, final EncoderConfig.AMK_ENCODER encoder, final int rhs, - final LNGVector vector1) { + public CcIncrementalData(final EncodingResult result, final EncoderConfig.AmkEncoder encoder, final int rhs, + final LngVector vector1) { this(result, encoder, rhs, vector1, null, -1); } @@ -98,14 +98,14 @@ public CcIncrementalData(final EncodingResult result, final EncoderConfig.AMK_EN * @param vector2 the second internal vector * @param mod the modulo value */ - public CcIncrementalData(final EncodingResult result, final EncoderConfig.ALK_ENCODER alkEncoder, final int rhs, + public CcIncrementalData(final EncodingResult result, final EncoderConfig.AlkEncoder alkEncoder, final int rhs, final int nVars, - final LNGVector vector1, final LNGVector vector2, + final LngVector vector1, final LngVector vector2, final int mod) { this.result = result; this.alkEncoder = alkEncoder; amkEncoder = null; - currentRHS = rhs; + currentRhs = rhs; this.nVars = nVars; this.vector1 = vector1; this.vector2 = vector2; @@ -122,8 +122,8 @@ public CcIncrementalData(final EncodingResult result, final EncoderConfig.ALK_EN * @param nVars the number of variables * @param vector1 the first internal vector */ - public CcIncrementalData(final EncodingResult result, final EncoderConfig.ALK_ENCODER alkEncoder, final int rhs, - final int nVars, final LNGVector vector1) { + public CcIncrementalData(final EncodingResult result, final EncoderConfig.AlkEncoder alkEncoder, final int rhs, + final int nVars, final LngVector vector1) { this(result, alkEncoder, rhs, nVars, vector1, null, -1); } @@ -134,7 +134,7 @@ public CcIncrementalData(final EncodingResult result, final EncoderConfig.ALK_EN * @return the incremental encoding of the new upper bound */ public List newUpperBound(final int rhs) { - computeUBConstraint(result, rhs); + computeUbConstraint(result, rhs); return result.getResult(); } @@ -147,16 +147,16 @@ public List newUpperBound(final int rhs) { * @param rhs the new upperBound */ public void newUpperBoundForSolver(final int rhs) { - computeUBConstraint(result, rhs); + computeUbConstraint(result, rhs); } - private void computeUBConstraint(final EncodingResult result, final int rhs) { + private void computeUbConstraint(final EncodingResult result, final int rhs) { final FormulaFactory f = result.getFactory(); - if (rhs >= currentRHS) { + if (rhs >= currentRhs) { throw new IllegalArgumentException( - "New upper bound " + rhs + " + does not tighten the current bound of " + currentRHS); + "New upper bound " + rhs + " + does not tighten the current bound of " + currentRhs); } - currentRHS = rhs; + currentRhs = rhs; if (amkEncoder == null) { throw new IllegalStateException("Cannot encode a new upper bound for an at-most-k constraint"); } @@ -207,7 +207,7 @@ private void computeUBConstraint(final EncodingResult result, final int rhs) { * @return the incremental encoding of the new lower bound */ public List newLowerBound(final int rhs) { - computeLBConstraint(result, rhs); + computeLbConstraint(result, rhs); return result.getResult(); } @@ -220,16 +220,16 @@ public List newLowerBound(final int rhs) { * @param rhs the new upperBound */ public void newLowerBoundForSolver(final int rhs) { - computeLBConstraint(result, rhs); + computeLbConstraint(result, rhs); } - private void computeLBConstraint(final EncodingResult result, final int rhs) { + private void computeLbConstraint(final EncodingResult result, final int rhs) { final FormulaFactory f = result.getFactory(); - if (rhs <= currentRHS) { + if (rhs <= currentRhs) { throw new IllegalArgumentException( - "New lower bound " + rhs + " + does not tighten the current bound of " + currentRHS); + "New lower bound " + rhs + " + does not tighten the current bound of " + currentRhs); } - currentRHS = rhs; + currentRhs = rhs; if (alkEncoder == null) { throw new IllegalStateException("Cannot encode a new lower bound for an at-least-k constraint"); } @@ -240,10 +240,10 @@ private void computeLBConstraint(final EncodingResult result, final int rhs) { } break; case MODULAR_TOTALIZER: - int newRHS = nVars - rhs; + int newRhs = nVars - rhs; assert vector1.size() != 0 || vector2.size() != 0; - final int ulimit = (newRHS + 1) / mod; - final int llimit = (newRHS + 1) - ulimit * mod; + final int ulimit = (newRhs + 1) / mod; + final int llimit = (newRhs + 1) - ulimit * mod; assert ulimit <= vector1.size(); assert llimit <= vector2.size(); for (int i = ulimit; i < vector1.size(); i++) { @@ -265,9 +265,9 @@ private void computeLBConstraint(final EncodingResult result, final int rhs) { } break; case CARDINALITY_NETWORK: - newRHS = nVars - rhs; - if (vector1.size() > newRHS) { - result.addClause(vector1.get(newRHS).negate(f)); + newRhs = nVars - rhs; + if (vector1.size() > newRhs) { + result.addClause(vector1.get(newRhs).negate(f)); } break; default: @@ -279,19 +279,19 @@ private void computeLBConstraint(final EncodingResult result, final int rhs) { * Returns the current right-hand side of this CCIncrementalData. * @return the current right-hand side of this CCIncrementalData. */ - public int getCurrentRHS() { - return currentRHS; + public int getCurrentRhs() { + return currentRhs; } @Override public String toString() { - return "CCIncrementalData{" + + return "CcIncrementalData{" + ", amkEncoder=" + amkEncoder + ", alkEncoder=" + alkEncoder + ", vector1=" + vector1 + ", vector2=" + vector2 + ", mod=" + mod + - ", currentRHS=" + currentRHS + + ", currentRhs=" + currentRhs + '}'; } } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/EncoderConfig.java b/core/src/main/java/com/booleworks/logicng/encodings/EncoderConfig.java index 25124cc7..9bcb079c 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/EncoderConfig.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/EncoderConfig.java @@ -17,7 +17,7 @@ public final class EncoderConfig extends Configuration { /** * The encoder for at-most-one and exactly-one constraints. */ - public enum AMO_ENCODER { + public enum AmoEncoder { PURE, LADDER, PRODUCT, @@ -31,7 +31,7 @@ public enum AMO_ENCODER { /** * The encoder for at-most-k constraints. */ - public enum AMK_ENCODER { + public enum AmkEncoder { TOTALIZER, MODULAR_TOTALIZER, CARDINALITY_NETWORK, @@ -41,7 +41,7 @@ public enum AMK_ENCODER { /** * The encoder for at-least-k constraints. */ - public enum ALK_ENCODER { + public enum AlkEncoder { TOTALIZER, MODULAR_TOTALIZER, CARDINALITY_NETWORK, @@ -51,7 +51,7 @@ public enum ALK_ENCODER { /** * The encoder for exactly-k constraints. */ - public enum EXK_ENCODER { + public enum ExkEncoder { TOTALIZER, CARDINALITY_NETWORK, BEST @@ -60,7 +60,7 @@ public enum EXK_ENCODER { /** * The pseudo-Boolean encoder. */ - public enum PB_ENCODER { + public enum PbEncoder { SWC, BINARY_MERGE, ADDER_NETWORKS, @@ -70,25 +70,25 @@ public enum PB_ENCODER { /** * The group size for the Bimander encoding. */ - public enum BIMANDER_GROUP_SIZE { + public enum BimanderGroupSize { HALF, SQRT, FIXED } - final AMO_ENCODER amoEncoder; - final AMK_ENCODER amkEncoder; - final ALK_ENCODER alkEncoder; - final EXK_ENCODER exkEncoder; - final PB_ENCODER pbEncoder; + final AmoEncoder amoEncoder; + final AmkEncoder amkEncoder; + final AlkEncoder alkEncoder; + final ExkEncoder exkEncoder; + final PbEncoder pbEncoder; - final BIMANDER_GROUP_SIZE bimanderGroupSize; + final BimanderGroupSize bimanderGroupSize; final int bimanderFixedGroupSize; final int nestingGroupSize; final int productRecursiveBound; final int commanderGroupSize; - final boolean binaryMergeUseGAC; + final boolean binaryMergeUseGac; final boolean binaryMergeNoSupportForSingleBit; final boolean binaryMergeUseWatchDog; @@ -118,7 +118,7 @@ private EncoderConfig(final Builder builder) { productRecursiveBound = builder.productRecursiveBound; commanderGroupSize = builder.commanderGroupSize; - binaryMergeUseGAC = builder.binaryMergeUseGAC; + binaryMergeUseGac = builder.binaryMergeUseGac; binaryMergeNoSupportForSingleBit = builder.binaryMergeNoSupportForSingleBit; binaryMergeUseWatchDog = builder.binaryMergeUseWatchDog; } @@ -136,7 +136,7 @@ public String toString() { sb.append("nestingGroupSize=").append(nestingGroupSize).append(System.lineSeparator()); sb.append("productRecursiveBound=").append(productRecursiveBound).append(System.lineSeparator()); sb.append("commanderGroupSize=").append(commanderGroupSize).append(System.lineSeparator()); - sb.append("binaryMergeUseGAC=").append(binaryMergeUseGAC).append(System.lineSeparator()); + sb.append("binaryMergeUseGac=").append(binaryMergeUseGac).append(System.lineSeparator()); sb.append("binaryMergeNoSupportForSingleBit=").append(binaryMergeNoSupportForSingleBit) .append(System.lineSeparator()); sb.append("binaryMergeUseWatchDog=").append(binaryMergeUseWatchDog).append(System.lineSeparator()); @@ -148,19 +148,19 @@ public String toString() { * The builder for an encoder configuration. */ public static class Builder { - private AMO_ENCODER amoEncoder = AMO_ENCODER.BEST; - private AMK_ENCODER amkEncoder = AMK_ENCODER.BEST; - private ALK_ENCODER alkEncoder = ALK_ENCODER.BEST; - private EXK_ENCODER exkEncoder = EXK_ENCODER.BEST; - private PB_ENCODER pbEncoder = PB_ENCODER.BEST; + private AmoEncoder amoEncoder = AmoEncoder.BEST; + private AmkEncoder amkEncoder = AmkEncoder.BEST; + private AlkEncoder alkEncoder = AlkEncoder.BEST; + private ExkEncoder exkEncoder = ExkEncoder.BEST; + private PbEncoder pbEncoder = PbEncoder.BEST; - private BIMANDER_GROUP_SIZE bimanderGroupSize = BIMANDER_GROUP_SIZE.SQRT; + private BimanderGroupSize bimanderGroupSize = BimanderGroupSize.SQRT; private int bimanderFixedGroupSize = 3; private int nestingGroupSize = 4; private int productRecursiveBound = 20; private int commanderGroupSize = 3; - private boolean binaryMergeUseGAC = true; + private boolean binaryMergeUseGac = true; private boolean binaryMergeNoSupportForSingleBit = false; private boolean binaryMergeUseWatchDog = true; @@ -174,7 +174,7 @@ private Builder() { * @param amoEncoder the at-most-one encoder * @return the builder */ - public Builder amoEncoding(final AMO_ENCODER amoEncoder) { + public Builder amoEncoding(final AmoEncoder amoEncoder) { this.amoEncoder = amoEncoder; return this; } @@ -185,7 +185,7 @@ public Builder amoEncoding(final AMO_ENCODER amoEncoder) { * @param amkEncoder the at-most-k encoder * @return the builder */ - public Builder amkEncoding(final AMK_ENCODER amkEncoder) { + public Builder amkEncoding(final AmkEncoder amkEncoder) { this.amkEncoder = amkEncoder; return this; } @@ -196,7 +196,7 @@ public Builder amkEncoding(final AMK_ENCODER amkEncoder) { * @param alkEncoder the at-least-k encoder * @return the builder */ - public Builder alkEncoding(final ALK_ENCODER alkEncoder) { + public Builder alkEncoding(final AlkEncoder alkEncoder) { this.alkEncoder = alkEncoder; return this; } @@ -207,7 +207,7 @@ public Builder alkEncoding(final ALK_ENCODER alkEncoder) { * @param exkEncoder the exactly-k encoder * @return the builder */ - public Builder exkEncoding(final EXK_ENCODER exkEncoder) { + public Builder exkEncoding(final ExkEncoder exkEncoder) { this.exkEncoder = exkEncoder; return this; } @@ -218,7 +218,7 @@ public Builder exkEncoding(final EXK_ENCODER exkEncoder) { * @param pbEncoder the pseudo-Boolean encoder * @return the builder */ - public Builder pbEncoding(final PB_ENCODER pbEncoder) { + public Builder pbEncoding(final PbEncoder pbEncoder) { this.pbEncoder = pbEncoder; return this; } @@ -229,7 +229,7 @@ public Builder pbEncoding(final PB_ENCODER pbEncoder) { * @param bimanderGroupSize the bimander encoding group size * @return the builder */ - public Builder bimanderGroupSize(final BIMANDER_GROUP_SIZE bimanderGroupSize) { + public Builder bimanderGroupSize(final BimanderGroupSize bimanderGroupSize) { this.bimanderGroupSize = bimanderGroupSize; return this; } @@ -282,12 +282,12 @@ public Builder commanderGroupSize(final int commanderGroupSize) { * Sets whether general arc consistency should be used in the binary * merge encoding. The default value is {@code * true}. - * @param binaryMergeUseGAC {@code true} if general arc consistency + * @param binaryMergeUseGac {@code true} if general arc consistency * should be used, {@code false} otherwise * @return the builder */ - public Builder binaryMergeUseGAC(final boolean binaryMergeUseGAC) { - this.binaryMergeUseGAC = binaryMergeUseGAC; + public Builder binaryMergeUseGac(final boolean binaryMergeUseGac) { + this.binaryMergeUseGac = binaryMergeUseGac; return this; } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/PbEncoder.java b/core/src/main/java/com/booleworks/logicng/encodings/PbEncoder.java index 1b7593b0..a2d198e2 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/PbEncoder.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/PbEncoder.java @@ -4,8 +4,8 @@ package com.booleworks.logicng.encodings; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.encodings.pbc.PbAdderNetwork; @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import java.util.Collections; import java.util.List; @@ -37,7 +37,7 @@ private PbEncoder() { * @param constraint the pseudo-Boolean constraint * @return the CNF encoding of the pseudo-Boolean constraint */ - public static List encode(final FormulaFactory f, final PBConstraint constraint) { + public static List encode(final FormulaFactory f, final PbConstraint constraint) { final EncodingResult result = EncodingResult.resultForFormula(f); encode(constraint, result, null); return Collections.unmodifiableList(result.getResult()); @@ -48,7 +48,7 @@ public static List encode(final FormulaFactory f, final PBConstraint co * @param constraint the pseudo-Boolean constraint * @param result the result of the encoding */ - public static void encode(final PBConstraint constraint, final EncodingResult result) { + public static void encode(final PbConstraint constraint, final EncodingResult result) { encode(constraint, result, null); } @@ -59,7 +59,7 @@ public static void encode(final PBConstraint constraint, final EncodingResult re * @param config the encoder configuration * @return the CNF encoding of the pseudo-Boolean constraint */ - public static List encode(final FormulaFactory f, final PBConstraint constraint, + public static List encode(final FormulaFactory f, final PbConstraint constraint, final EncoderConfig config) { final EncodingResult result = EncodingResult.resultForFormula(f); encode(constraint, result, config); @@ -72,12 +72,12 @@ public static List encode(final FormulaFactory f, final PBConstraint co * @param result the result of the encoding * @param initConfig the encoder configuration */ - public static void encode(final PBConstraint constraint, final EncodingResult result, + public static void encode(final PbConstraint constraint, final EncodingResult result, final EncoderConfig initConfig) { final FormulaFactory f = result.getFactory(); final EncoderConfig config = initConfig != null ? initConfig : (EncoderConfig) f.configurationFor(ConfigurationType.ENCODER); - if (constraint.isCC()) { + if (constraint.isCc()) { CcEncoder.encode((CardinalityConstraint) constraint, result, config); return; } @@ -90,8 +90,8 @@ public static void encode(final PBConstraint constraint, final EncodingResult re result.addClause(); return; case PBC: - final PBConstraint pbc = (PBConstraint) normalized; - if (pbc.isCC()) { + final PbConstraint pbc = (PbConstraint) normalized; + if (pbc.isCc()) { CcEncoder.encode((CardinalityConstraint) pbc, result, config); return; } @@ -104,15 +104,15 @@ public static void encode(final PBConstraint constraint, final EncodingResult re result.addClause(); continue; case PBC: - encode((PBConstraint) op, result, config); + encode((PbConstraint) op, result, config); continue; default: - throw new IllegalArgumentException("Illegal return value of PBConstraint.normalize"); + throw new IllegalArgumentException("Illegal return value of PbConstraint.normalize"); } } return; default: - throw new IllegalArgumentException("Illegal return value of PBConstraint.normalize"); + throw new IllegalArgumentException("Illegal return value of PbConstraint.normalize"); } } @@ -138,8 +138,8 @@ protected static void encode(final EncodingResult result, final List li result.addClause(); return; } - final LNGVector simplifiedLits = new LNGVector<>(); - final LNGIntVector simplifiedCoeffs = new LNGIntVector(); + final LngVector simplifiedLits = new LngVector<>(); + final LngIntVector simplifiedCoeffs = new LngIntVector(); if (rhs == 0) { for (final Literal lit : lits) { result.addClause(lit.negate(f)); @@ -164,7 +164,7 @@ protected static void encode(final EncodingResult result, final List li break; case BINARY_MERGE: PbBinaryMerge.encode(result, simplifiedLits, simplifiedCoeffs, rhs, - config.binaryMergeUseGAC, config.binaryMergeNoSupportForSingleBit, + config.binaryMergeUseGac, config.binaryMergeNoSupportForSingleBit, config.binaryMergeUseWatchDog); break; case ADDER_NETWORKS: diff --git a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcAmo.java b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcAmo.java index 6541e82d..ec2f4650 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcAmo.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcAmo.java @@ -22,7 +22,7 @@ package com.booleworks.logicng.encodings.cc; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; @@ -62,7 +62,7 @@ public static void ladder(final EncodingResult result, final Variable... vars) { final FormulaFactory f = result.getFactory(); final Variable[] seqAuxiliary = new Variable[vars.length - 1]; for (int i = 0; i < vars.length - 1; i++) { - seqAuxiliary[i] = result.newCCVariable(); + seqAuxiliary[i] = result.newCcVariable(); } for (int i = 0; i < vars.length; i++) { if (i == 0) { @@ -90,11 +90,11 @@ public static void product(final EncodingResult result, final int recursiveBound final int q = (int) Math.ceil((double) n / (double) p); final Variable[] us = new Variable[p]; for (int i = 0; i < us.length; i++) { - us[i] = result.newCCVariable(); + us[i] = result.newCcVariable(); } final Variable[] vs = new Variable[q]; for (int i = 0; i < vs.length; i++) { - vs[i] = result.newCCVariable(); + vs[i] = result.newCcVariable(); } if (us.length <= recursiveBound) { pure(result, us); @@ -129,7 +129,7 @@ public static void binary(final EncodingResult result, final Variable... vars) { final int k = (twoPowNBits - vars.length) * 2; final Variable[] bits = new Variable[numberOfBits]; for (int i = 0; i < numberOfBits; i++) { - bits[i] = result.newCCVariable(); + bits[i] = result.newCcVariable(); } int grayCode; int nextGray; @@ -172,21 +172,21 @@ public static void binary(final EncodingResult result, final Variable... vars) { * @param vars the variables for the at-most-one constraint */ public static void commander(final EncodingResult result, final int groupSize, final Variable... vars) { - commanderRec(result, groupSize, new LNGVector<>(vars)); + commanderRec(result, groupSize, new LngVector<>(vars)); } private static void commanderRec(final EncodingResult result, final int groupSize, - final LNGVector currentLiterals) { + final LngVector currentLiterals) { final FormulaFactory f = result.getFactory(); boolean isExactlyOne = false; while (currentLiterals.size() > groupSize) { - final LNGVector literals = new LNGVector<>(); - final LNGVector nextLiterals = new LNGVector<>(); + final LngVector literals = new LngVector<>(); + final LngVector nextLiterals = new LngVector<>(); for (int i = 0; i < currentLiterals.size(); i++) { literals.push(currentLiterals.get(i)); if (i % groupSize == groupSize - 1 || i == currentLiterals.size() - 1) { pure(result, literals); - literals.push(result.newCCVariable()); + literals.push(result.newCcVariable()); nextLiterals.push(literals.back().negate(f)); if (isExactlyOne && literals.size() > 0) { result.addClause(literals); @@ -213,10 +213,10 @@ private static void commanderRec(final EncodingResult result, final int groupSiz * @param vars the variables for the at-most-one constraint */ public static void nested(final EncodingResult result, final int groupSize, final Variable... vars) { - nestedRec(result, groupSize, new LNGVector<>(vars)); + nestedRec(result, groupSize, new LngVector<>(vars)); } - private static void nestedRec(final EncodingResult result, final int groupSize, final LNGVector vars) { + private static void nestedRec(final EncodingResult result, final int groupSize, final LngVector vars) { final FormulaFactory f = result.getFactory(); if (vars.size() <= groupSize) { for (int i = 0; i + 1 < vars.size(); i++) { @@ -225,8 +225,8 @@ private static void nestedRec(final EncodingResult result, final int groupSize, } } } else { - final LNGVector l1 = new LNGVector<>(vars.size() / 2); - final LNGVector l2 = new LNGVector<>(vars.size() / 2); + final LngVector l1 = new LngVector<>(vars.size() / 2); + final LngVector l2 = new LngVector<>(vars.size() / 2); int i = 0; for (; i < vars.size() / 2; i++) { l1.push(vars.get(i)); @@ -234,7 +234,7 @@ private static void nestedRec(final EncodingResult result, final int groupSize, for (; i < vars.size(); i++) { l2.push(vars.get(i)); } - final Variable newVariable = result.newCCVariable(); + final Variable newVariable = result.newCcVariable(); l1.push(newVariable); l2.push(newVariable.negate(f)); nestedRec(result, groupSize, l1); @@ -249,12 +249,12 @@ private static void nestedRec(final EncodingResult result, final int groupSize, * @param vars the variables for the at-most-one constraint */ public static void bimander(final EncodingResult result, final int groupSize, final Variable... vars) { - bimanderIntern(result, groupSize, new LNGVector<>(vars)); + bimanderIntern(result, groupSize, new LngVector<>(vars)); } private static void bimanderIntern(final EncodingResult result, final int groupSize, - final LNGVector vars) { - final LNGVector> groups = initializeGroups(result, groupSize, vars); + final LngVector vars) { + final LngVector> groups = initializeGroups(result, groupSize, vars); final BimanderBits bits = initializeBits(result, groupSize); int grayCode; int nextGray; @@ -280,7 +280,7 @@ private static void bimanderIntern(final EncodingResult result, final int groupS } } - private static void handleGrayCode(final EncodingResult result, final LNGVector> groups, + private static void handleGrayCode(final EncodingResult result, final LngVector> groups, final BimanderBits bits, final int grayCode, final int index, final int j) { if ((grayCode & (1 << j)) != 0) { @@ -295,12 +295,12 @@ private static void handleGrayCode(final EncodingResult result, final LNGVector< } } - private static LNGVector> initializeGroups(final EncodingResult result, final int groupSize, - final LNGVector vars) { - final LNGVector> groups = new LNGVector<>(); + private static LngVector> initializeGroups(final EncodingResult result, final int groupSize, + final LngVector vars) { + final LngVector> groups = new LngVector<>(); final int n = vars.size(); for (int i = 0; i < groupSize; i++) { - groups.push(new LNGVector<>()); + groups.push(new LngVector<>()); } int g = (int) Math.ceil((double) n / groupSize); @@ -327,12 +327,12 @@ private static BimanderBits initializeBits(final EncodingResult result, final in bits.twoPowNBits = (int) Math.pow(2, bits.numberOfBits); bits.k = (bits.twoPowNBits - groupSize) * 2; for (int i = 0; i < bits.numberOfBits; ++i) { - bits.bits.push(result.newCCVariable()); + bits.bits.push(result.newCcVariable()); } return bits; } - private static void pure(final EncodingResult result, final LNGVector vars) { + private static void pure(final EncodingResult result, final LngVector vars) { final FormulaFactory f = result.getFactory(); for (int i = 0; i < vars.size(); i++) { for (int j = i + 1; j < vars.size(); j++) { @@ -342,7 +342,7 @@ private static void pure(final EncodingResult result, final LNGVector v } private static final class BimanderBits { - private final LNGVector bits = new LNGVector<>(); + private final LngVector bits = new LngVector<>(); private int numberOfBits; private int twoPowNBits; private int k; diff --git a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcCardinalityNetwork.java b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcCardinalityNetwork.java index cfea632e..a8c532a4 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcCardinalityNetwork.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcCardinalityNetwork.java @@ -22,7 +22,7 @@ package com.booleworks.logicng.encodings.cc; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.encodings.CcIncrementalData; import com.booleworks.logicng.encodings.EncoderConfig; @@ -44,8 +44,8 @@ private CcCardinalityNetwork() { public static void amk(final EncodingResult result, final Variable[] vars, final int rhs) { final FormulaFactory f = result.getFactory(); - final LNGVector input = new LNGVector<>(); - final LNGVector output = new LNGVector<>(); + final LngVector input = new LngVector<>(); + final LngVector output = new LngVector<>(); if (rhs > vars.length / 2) { final int geq = vars.length - rhs; for (final Variable v : vars) { @@ -68,24 +68,24 @@ public static void amk(final EncodingResult result, final Variable[] vars, final public static CcIncrementalData amkForIncremental(final EncodingResult result, final Variable[] vars, final int rhs) { final FormulaFactory f = result.getFactory(); - final LNGVector input = new LNGVector<>(); - final LNGVector output = new LNGVector<>(); + final LngVector input = new LngVector<>(); + final LngVector output = new LngVector<>(); for (final Variable var : vars) { input.push(var); } CcSorting.sort(f, rhs + 1, input, result, output, CcSorting.ImplicationDirection.INPUT_TO_OUTPUT); assert output.size() > rhs; result.addClause(output.get(rhs).negate(f)); - return new CcIncrementalData(result, EncoderConfig.AMK_ENCODER.CARDINALITY_NETWORK, rhs, output); + return new CcIncrementalData(result, EncoderConfig.AmkEncoder.CARDINALITY_NETWORK, rhs, output); } public static void alk(final EncodingResult result, final Variable[] vars, final int rhs) { final FormulaFactory f = result.getFactory(); - final LNGVector input = new LNGVector<>(); - final LNGVector output = new LNGVector<>(); - final int newRHS = vars.length - rhs; - if (newRHS > vars.length / 2) { - final int geq = vars.length - newRHS; + final LngVector input = new LngVector<>(); + final LngVector output = new LngVector<>(); + final int newRhs = vars.length - rhs; + if (newRhs > vars.length / 2) { + final int geq = vars.length - newRhs; for (final Variable v : vars) { input.push(v); } @@ -97,31 +97,31 @@ public static void alk(final EncodingResult result, final Variable[] vars, final for (final Variable v : vars) { input.push(v.negate(f)); } - CcSorting.sort(f, newRHS + 1, input, result, output, CcSorting.ImplicationDirection.INPUT_TO_OUTPUT); - assert output.size() > newRHS; - result.addClause(output.get(newRHS).negate(f)); + CcSorting.sort(f, newRhs + 1, input, result, output, CcSorting.ImplicationDirection.INPUT_TO_OUTPUT); + assert output.size() > newRhs; + result.addClause(output.get(newRhs).negate(f)); } } public static CcIncrementalData alkForIncremental(final EncodingResult result, final Variable[] vars, final int rhs) { final FormulaFactory f = result.getFactory(); - final LNGVector input = new LNGVector<>(); - final LNGVector output = new LNGVector<>(); + final LngVector input = new LngVector<>(); + final LngVector output = new LngVector<>(); for (final Variable var : vars) { input.push(var.negate(f)); } - final int newRHS = vars.length - rhs; - CcSorting.sort(f, newRHS + 1, input, result, output, CcSorting.ImplicationDirection.INPUT_TO_OUTPUT); - assert output.size() > newRHS; - result.addClause(output.get(newRHS).negate(f)); - return new CcIncrementalData(result, EncoderConfig.ALK_ENCODER.CARDINALITY_NETWORK, rhs, vars.length, output); + final int newRhs = vars.length - rhs; + CcSorting.sort(f, newRhs + 1, input, result, output, CcSorting.ImplicationDirection.INPUT_TO_OUTPUT); + assert output.size() > newRhs; + result.addClause(output.get(newRhs).negate(f)); + return new CcIncrementalData(result, EncoderConfig.AlkEncoder.CARDINALITY_NETWORK, rhs, vars.length, output); } public static void exk(final EncodingResult result, final Variable[] vars, final int rhs) { final FormulaFactory f = result.getFactory(); - final LNGVector input = new LNGVector<>(); - final LNGVector output = new LNGVector<>(); + final LngVector input = new LngVector<>(); + final LngVector output = new LngVector<>(); for (final Variable var : vars) { input.push(var); } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcModularTotalizer.java b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcModularTotalizer.java index 1c654654..f1b5fa58 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcModularTotalizer.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcModularTotalizer.java @@ -22,7 +22,7 @@ package com.booleworks.logicng.encodings.cc; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.encodings.CcIncrementalData; import com.booleworks.logicng.encodings.EncoderConfig; @@ -54,11 +54,11 @@ public static CcIncrementalData amk(final EncodingResult result, final Variable[ for (final Variable var : vars) { state.inlits.push(var); } - toCNF(result, mod, state.cardinalityUpOutvars, state.cardinalityLwOutvars, vars.length, state); + toCnf(result, mod, state.cardinalityUpOutvars, state.cardinalityLwOutvars, vars.length, state); assert state.inlits.size() == 0; encodeOutput(result, rhs, mod, state); state.currentCardinalityRhs = rhs + 1; - return new CcIncrementalData(result, EncoderConfig.AMK_ENCODER.MODULAR_TOTALIZER, rhs, + return new CcIncrementalData(result, EncoderConfig.AmkEncoder.MODULAR_TOTALIZER, rhs, state.cardinalityUpOutvars, state.cardinalityLwOutvars, mod); } @@ -72,31 +72,31 @@ public static CcIncrementalData amk(final EncodingResult result, final Variable[ */ public static CcIncrementalData alk(final EncodingResult result, final Variable[] vars, final int rhs) { final var state = new State(result.getFactory()); - final int newRHS = vars.length - rhs; - final int mod = initialize(result, newRHS, vars.length, state); + final int newRhs = vars.length - rhs; + final int mod = initialize(result, newRhs, vars.length, state); for (final Variable var : vars) { state.inlits.push(var.negate(result.getFactory())); } - toCNF(result, mod, state.cardinalityUpOutvars, state.cardinalityLwOutvars, vars.length, state); - assert state.inlits.size() == 0; - encodeOutput(result, newRHS, mod, state); - state.currentCardinalityRhs = newRHS + 1; - return new CcIncrementalData(result, EncoderConfig.ALK_ENCODER.MODULAR_TOTALIZER, rhs, vars.length, + toCnf(result, mod, state.cardinalityUpOutvars, state.cardinalityLwOutvars, vars.length, state); + assert state.inlits.isEmpty(); + encodeOutput(result, newRhs, mod, state); + state.currentCardinalityRhs = newRhs + 1; + return new CcIncrementalData(result, EncoderConfig.AlkEncoder.MODULAR_TOTALIZER, rhs, vars.length, state.cardinalityUpOutvars, state.cardinalityLwOutvars, mod); } private static int initialize(final EncodingResult result, final int rhs, final int n, final State state) { - state.cardinalityLwOutvars = new LNGVector<>(); + state.cardinalityLwOutvars = new LngVector<>(); final int mod = (int) Math.ceil(Math.sqrt(rhs + 1.0)); - state.cardinalityUpOutvars = new LNGVector<>(n / mod); + state.cardinalityUpOutvars = new LngVector<>(n / mod); for (int i = 0; i < n / mod; i++) { - state.cardinalityUpOutvars.push(result.newCCVariable()); + state.cardinalityUpOutvars.push(result.newCcVariable()); } - state.cardinalityLwOutvars = new LNGVector<>(mod - 1); + state.cardinalityLwOutvars = new LngVector<>(mod - 1); for (int i = 0; i < mod - 1; i++) { - state.cardinalityLwOutvars.push(result.newCCVariable()); + state.cardinalityLwOutvars.push(result.newCcVariable()); } - state.inlits = new LNGVector<>(n); + state.inlits = new LngVector<>(n); state.currentCardinalityRhs = rhs + 1; if (state.cardinalityUpOutvars.size() == 0) { state.cardinalityUpOutvars.push(state.h0); @@ -131,13 +131,13 @@ private static void encodeOutput(final EncodingResult result, final int rhs, fin } } - private static void toCNF(final EncodingResult result, final int mod, final LNGVector ubvars, - final LNGVector lwvars, final int rhs, + private static void toCnf(final EncodingResult result, final int mod, final LngVector ubvars, + final LngVector lwvars, final int rhs, final State state) { - final LNGVector lupper = new LNGVector<>(); - final LNGVector llower = new LNGVector<>(); - final LNGVector rupper = new LNGVector<>(); - final LNGVector rlower = new LNGVector<>(); + final LngVector lupper = new LngVector<>(); + final LngVector llower = new LngVector<>(); + final LngVector rupper = new LngVector<>(); + final LngVector rlower = new LngVector<>(); assert rhs > 1; final int split = rhs / 2; int left = 1; @@ -150,14 +150,14 @@ private static void toCNF(final EncodingResult result, final int mod, final LNGV } else { left = split / mod; for (int i = 0; i < left; i++) { - lupper.push(result.newCCVariable()); + lupper.push(result.newCcVariable()); } int limit = mod - 1; if (left % mod == 0 && split < mod - 1) { limit = split; } for (int i = 0; i < limit; i++) { - llower.push(result.newCCVariable()); + llower.push(result.newCcVariable()); } } if (rhs - split == 1) { @@ -168,14 +168,14 @@ private static void toCNF(final EncodingResult result, final int mod, final LNGV } else { right = (rhs - split) / mod; for (int i = 0; i < right; i++) { - rupper.push(result.newCCVariable()); + rupper.push(result.newCcVariable()); } int limit = mod - 1; if (right % mod == 0 && rhs - split < mod - 1) { limit = rhs - split; } for (int i = 0; i < limit; i++) { - rlower.push(result.newCCVariable()); + rlower.push(result.newCcVariable()); } } if (lupper.size() == 0) { @@ -187,26 +187,26 @@ private static void toCNF(final EncodingResult result, final int mod, final LNGV adder(result, mod, ubvars, lwvars, rupper, rlower, lupper, llower, state); int val = left * mod + split - left * mod; if (val > 1) { - toCNF(result, mod, lupper, llower, val, state); + toCnf(result, mod, lupper, llower, val, state); } val = right * mod + (rhs - split) - right * mod; if (val > 1) { - toCNF(result, mod, rupper, rlower, val, state); + toCnf(result, mod, rupper, rlower, val, state); } } - private static void adder(final EncodingResult result, final int mod, final LNGVector upper, - final LNGVector lower, - final LNGVector lupper, final LNGVector llower, - final LNGVector rupper, - final LNGVector rlower, final State state) { + private static void adder(final EncodingResult result, final int mod, final LngVector upper, + final LngVector lower, + final LngVector lupper, final LngVector llower, + final LngVector rupper, + final LngVector rlower, final State state) { assert upper.size() != 0; assert lower.size() >= llower.size() && lower.size() >= rlower.size(); final FormulaFactory f = result.getFactory(); Variable carry = state.varUndef; // != is ok here - we are within the same formula factory if (upper.get(0) != state.h0) { - carry = result.newCCVariable(); + carry = result.newCcVariable(); } for (int i = 0; i <= llower.size(); i++) { for (int j = 0; j <= rlower.size(); j++) { @@ -252,9 +252,9 @@ private static void adder(final EncodingResult result, final int mod, final LNGV } } - private static void finalAdder(final EncodingResult result, final int mod, final LNGVector upper, - final LNGVector lupper, - final LNGVector rupper, final Variable carry, final State state) { + private static void finalAdder(final EncodingResult result, final int mod, final LngVector upper, + final LngVector lupper, + final LngVector rupper, final Variable carry, final State state) { final FormulaFactory f = result.getFactory(); for (int i = 0; i <= lupper.size(); i++) { for (int j = 0; j <= rupper.size(); j++) { @@ -282,7 +282,7 @@ private static void finalAdder(final EncodingResult result, final int mod, final d = upper.get(i + j); } if (c != state.varUndef && c != state.varError) { - final LNGVector clause = new LNGVector<>(); + final LngVector clause = new LngVector<>(); if (a != state.varUndef && a != state.varError) { clause.push(a.negate(f)); } @@ -294,7 +294,7 @@ private static void finalAdder(final EncodingResult result, final int mod, final result.addClause(clause); } } - final LNGVector clause = new LNGVector<>(); + final LngVector clause = new LngVector<>(); clause.push(carry.negate(f)); if (a != state.varUndef && a != state.varError) { clause.push(a.negate(f)); @@ -316,9 +316,9 @@ private static final class State { private final Variable varUndef; private final Variable varError; private final Variable h0; - private LNGVector inlits; - private LNGVector cardinalityUpOutvars; - private LNGVector cardinalityLwOutvars; + private LngVector inlits; + private LngVector cardinalityUpOutvars; + private LngVector cardinalityLwOutvars; private int currentCardinalityRhs; private State(final FormulaFactory f) { @@ -326,7 +326,7 @@ private State(final FormulaFactory f) { varError = f.variable("RESERVED@VAR_ERROR"); h0 = varUndef; currentCardinalityRhs = -1; - inlits = new LNGVector<>(); + inlits = new LngVector<>(); } } } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcSorting.java b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcSorting.java index 4e23f9d4..dc173e19 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcSorting.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcSorting.java @@ -26,7 +26,7 @@ import static com.booleworks.logicng.encodings.cc.CcSorting.ImplicationDirection.INPUT_TO_OUTPUT; import static com.booleworks.logicng.encodings.cc.CcSorting.ImplicationDirection.OUTPUT_TO_INPUT; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; @@ -72,8 +72,8 @@ private static int directSorterValue(final int n) { * @param output the output literals * @param direction the sorting direction */ - public static void sort(final FormulaFactory f, final int m, final LNGVector input, - final EncodingResult result, final LNGVector output, + public static void sort(final FormulaFactory f, final int m, final LngVector input, + final EncodingResult result, final LngVector output, final ImplicationDirection direction) { assert m >= 0; if (m == 0) { @@ -96,9 +96,9 @@ public static void sort(final FormulaFactory f, final int m, final LNGVector input, final EncodingResult result, - final LNGVector output, final ImplicationDirection direction) { + final LngVector input, final EncodingResult result, + final LngVector output, final ImplicationDirection direction) { final int n = input.size(); assert output.size() == 0; assert n > 1; assert m <= n; - final LNGVector tmpLitsA = new LNGVector<>(); - final LNGVector tmpLitsB = new LNGVector<>(); - final LNGVector tmpLitsO1 = new LNGVector<>(); - final LNGVector tmpLitsO2 = new LNGVector<>(); + final LngVector tmpLitsA = new LngVector<>(); + final LngVector tmpLitsB = new LngVector<>(); + final LngVector tmpLitsO1 = new LngVector<>(); + final LngVector tmpLitsO2 = new LngVector<>(); for (int i = 0; i < l; i++) { tmpLitsA.push(input.get(i)); @@ -182,9 +182,9 @@ private static void recursiveSorter(final FormulaFactory f, final int m, final i assert output.size() == m; } - private static void recursiveSorter(final FormulaFactory f, final int m, final LNGVector input, + private static void recursiveSorter(final FormulaFactory f, final int m, final LngVector input, final EncodingResult result, - final LNGVector output, final ImplicationDirection direction) { + final LngVector output, final ImplicationDirection direction) { assert m > 0; assert input.size() > 0; output.clear(); @@ -194,18 +194,18 @@ private static void recursiveSorter(final FormulaFactory f, final int m, final L recursiveSorter(f, m, l, input, result, output, direction); } - private static void counterSorter(final int k, final LNGVector x, final EncodingResult result, - final LNGVector output, final ImplicationDirection direction) { + private static void counterSorter(final int k, final LngVector x, final EncodingResult result, + final LngVector output, final ImplicationDirection direction) { final FormulaFactory f = result.getFactory(); - final LNGVector> auxVars = new LNGVector<>(); + final LngVector> auxVars = new LngVector<>(); final int n = x.size(); for (int i = 0; i < n; i++) { - auxVars.push(new LNGVector<>(k)); + auxVars.push(new LngVector<>(k)); } for (int j = 0; j < k; j++) { for (int i = j; i < n; i++) { - auxVars.get(i).set(j, result.newCCVariable()); + auxVars.get(i).set(j, result.newCcVariable()); } } if (direction == INPUT_TO_OUTPUT || direction == BOTH) { @@ -232,16 +232,16 @@ private static void counterSorter(final int k, final LNGVector x, final } } - private static void directSorter(final int m, final LNGVector input, final EncodingResult result, - final LNGVector output, final ImplicationDirection direction) { + private static void directSorter(final int m, final LngVector input, final EncodingResult result, + final LngVector output, final ImplicationDirection direction) { assert direction == INPUT_TO_OUTPUT; final int n = input.size(); assert n < 20; int bitmask = 1; - final LNGVector clause = new LNGVector<>(); + final LngVector clause = new LngVector<>(); output.clear(); for (int i = 0; i < m; i++) { - output.push(result.newCCVariable()); + output.push(result.newCcVariable()); } while (bitmask < Math.pow(2, n)) { int count = 0; @@ -274,9 +274,9 @@ private static void directSorter(final int m, final LNGVector input, fi * @param output the output vector * @param direction the sorting direction */ - public static void merge(final FormulaFactory f, final int m, final LNGVector inputA, - final LNGVector inputB, final EncodingResult formula, - final LNGVector output, final ImplicationDirection direction) { + public static void merge(final FormulaFactory f, final int m, final LngVector inputA, + final LngVector inputB, final EncodingResult formula, + final LngVector output, final ImplicationDirection direction) { assert m >= 0; if (m == 0) { output.clear(); @@ -304,9 +304,9 @@ public static void merge(final FormulaFactory f, final int m, final LNGVector

  • inputA, - final int a, final LNGVector inputB, final int b, - final EncodingResult formula, final LNGVector output, + private static void recursiveMerger(final FormulaFactory f, final int c, final LngVector inputA, + final int a, final LngVector inputB, final int b, + final EncodingResult formula, final LngVector output, final ImplicationDirection direction) { assert inputA.size() > 0; assert inputB.size() > 0; @@ -321,26 +321,26 @@ private static void recursiveMerger(final FormulaFactory f, final int c, final L b2 = c; } if (c == 1) { - final Variable y = formula.newCCVariable(); + final Variable y = formula.newCcVariable(); comparator(f, inputA.get(0), inputB.get(0), y, formula, direction); output.push(y); return; } if (a2 == 1 && b2 == 1) { assert c == 2; - final Variable y1 = formula.newCCVariable(); - final Variable y2 = formula.newCCVariable(); + final Variable y1 = formula.newCcVariable(); + final Variable y2 = formula.newCcVariable(); comparator(f, inputA.get(0), inputB.get(0), y1, y2, formula, direction); output.push(y1); output.push(y2); return; } - final LNGVector oddMerge = new LNGVector<>(); - final LNGVector evenMerge = new LNGVector<>(); - final LNGVector tmpLitsOddA = new LNGVector<>(); - final LNGVector tmpLitsOddB = new LNGVector<>(); - final LNGVector tmpLitsEvenA = new LNGVector<>(); - final LNGVector tmpLitsEvenB = new LNGVector<>(); + final LngVector oddMerge = new LngVector<>(); + final LngVector evenMerge = new LngVector<>(); + final LngVector tmpLitsOddA = new LngVector<>(); + final LngVector tmpLitsOddB = new LngVector<>(); + final LngVector tmpLitsEvenA = new LngVector<>(); + final LngVector tmpLitsEvenB = new LngVector<>(); for (int i = 0; i < a2; i = i + 2) { tmpLitsOddA.push(inputA.get(i)); @@ -367,8 +367,8 @@ private static void recursiveMerger(final FormulaFactory f, final int c, final L while (true) { if (i < oddMerge.size() && j < evenMerge.size()) { if (output.size() + 2 <= c) { - final Variable z0 = formula.newCCVariable(); - final Variable z1 = formula.newCCVariable(); + final Variable z0 = formula.newCcVariable(); + final Variable z1 = formula.newCcVariable(); comparator(f, oddMerge.get(i), evenMerge.get(j), z0, z1, formula, direction); output.push(z0); output.push(z1); @@ -376,7 +376,7 @@ private static void recursiveMerger(final FormulaFactory f, final int c, final L break; } } else if (output.size() + 1 == c) { - final Variable z0 = formula.newCCVariable(); + final Variable z0 = formula.newCcVariable(); comparator(f, oddMerge.get(i), evenMerge.get(j), z0, formula, direction); output.push(z0); break; @@ -398,14 +398,14 @@ private static void recursiveMerger(final FormulaFactory f, final int c, final L assert output.size() == a2 + b2 || output.size() == c; } - private static void directMerger(final FormulaFactory f, final int m, final LNGVector inputA, - final LNGVector inputB, final EncodingResult formula, - final LNGVector output, final ImplicationDirection direction) { + private static void directMerger(final FormulaFactory f, final int m, final LngVector inputA, + final LngVector inputB, final EncodingResult formula, + final LngVector output, final ImplicationDirection direction) { assert direction == INPUT_TO_OUTPUT; final int a = inputA.size(); final int b = inputB.size(); for (int i = 0; i < m; i++) { - output.push(formula.newCCVariable()); + output.push(formula.newCcVariable()); } int j = Math.min(m, a); for (int i = 0; i < j; i++) { diff --git a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcTotalizer.java b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcTotalizer.java index b2a18cdd..95293022 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/cc/CcTotalizer.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/cc/CcTotalizer.java @@ -22,7 +22,7 @@ package com.booleworks.logicng.encodings.cc; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.encodings.CcIncrementalData; import com.booleworks.logicng.encodings.EncoderConfig; @@ -57,12 +57,12 @@ private CcTotalizer() { */ public static CcIncrementalData amk(final EncodingResult result, final Variable[] vars, final int rhs) { final TotalizerVars tv = initializeConstraint(result, vars); - toCNF(result, tv, rhs, Bound.UPPER); + toCnf(result, tv, rhs, Bound.UPPER); assert tv.invars.size() == 0; for (int i = rhs; i < tv.outvars.size(); i++) { result.addClause(tv.outvars.get(i).negate(result.getFactory())); } - return new CcIncrementalData(result, EncoderConfig.AMK_ENCODER.TOTALIZER, rhs, tv.outvars); + return new CcIncrementalData(result, EncoderConfig.AmkEncoder.TOTALIZER, rhs, tv.outvars); } /** @@ -76,12 +76,12 @@ public static CcIncrementalData amk(final EncodingResult result, final Variable[ */ public static CcIncrementalData alk(final EncodingResult result, final Variable[] vars, final int rhs) { final TotalizerVars tv = initializeConstraint(result, vars); - toCNF(result, tv, rhs, Bound.LOWER); + toCnf(result, tv, rhs, Bound.LOWER); assert tv.invars.size() == 0; for (int i = 0; i < rhs; i++) { result.addClause(tv.outvars.get(i)); } - return new CcIncrementalData(result, EncoderConfig.ALK_ENCODER.TOTALIZER, rhs, vars.length, tv.outvars); + return new CcIncrementalData(result, EncoderConfig.AlkEncoder.TOTALIZER, rhs, vars.length, tv.outvars); } /** @@ -94,7 +94,7 @@ public static CcIncrementalData alk(final EncodingResult result, final Variable[ */ public static void exk(final EncodingResult result, final Variable[] vars, final int rhs) { final TotalizerVars tv = initializeConstraint(result, vars); - toCNF(result, tv, rhs, Bound.BOTH); + toCnf(result, tv, rhs, Bound.BOTH); assert tv.invars.size() == 0; for (int i = 0; i < rhs; i++) { result.addClause(tv.outvars.get(i)); @@ -108,14 +108,14 @@ private static TotalizerVars initializeConstraint(final EncodingResult result, f final var tv = new TotalizerVars(vars.length); for (final Variable var : vars) { tv.invars.push(var); - tv.outvars.push(result.newCCVariable()); + tv.outvars.push(result.newCcVariable()); } return tv; } - private static void toCNF(final EncodingResult result, final TotalizerVars tv, final int rhs, final Bound bound) { - final LNGVector left = new LNGVector<>(); - final LNGVector right = new LNGVector<>(); + private static void toCnf(final EncodingResult result, final TotalizerVars tv, final int rhs, final Bound bound) { + final LngVector left = new LngVector<>(); + final LngVector right = new LngVector<>(); assert tv.outvars.size() > 1; final int split = tv.outvars.size() / 2; for (int i = 0; i < tv.outvars.size(); i++) { @@ -125,7 +125,7 @@ private static void toCNF(final EncodingResult result, final TotalizerVars tv, f left.push(tv.invars.back()); tv.invars.pop(); } else { - left.push(result.newCCVariable()); + left.push(result.newCcVariable()); } } else { if (tv.outvars.size() - split == 1) { @@ -133,27 +133,27 @@ private static void toCNF(final EncodingResult result, final TotalizerVars tv, f right.push(tv.invars.back()); tv.invars.pop(); } else { - right.push(result.newCCVariable()); + right.push(result.newCcVariable()); } } } if (bound == Bound.UPPER || bound == Bound.BOTH) { - adderAMK(result, left, right, tv.outvars, rhs); + adderAmk(result, left, right, tv.outvars, rhs); } if (bound == Bound.LOWER || bound == Bound.BOTH) { - adderALK(result, left, right, tv.outvars); + adderAlk(result, left, right, tv.outvars); } if (left.size() > 1) { - toCNF(result, tv.withNewOutvars(left), rhs, bound); + toCnf(result, tv.withNewOutvars(left), rhs, bound); } if (right.size() > 1) { - toCNF(result, tv.withNewOutvars(right), rhs, bound); + toCnf(result, tv.withNewOutvars(right), rhs, bound); } } - private static void adderAMK(final EncodingResult result, final LNGVector left, - final LNGVector right, - final LNGVector output, final int rhs) { + private static void adderAmk(final EncodingResult result, final LngVector left, + final LngVector right, + final LngVector output, final int rhs) { assert output.size() == left.size() + right.size(); final FormulaFactory f = result.getFactory(); for (int i = 0; i <= left.size(); i++) { @@ -175,9 +175,9 @@ private static void adderAMK(final EncodingResult result, final LNGVector left, - final LNGVector right, - final LNGVector output) { + private static void adderAlk(final EncodingResult result, final LngVector left, + final LngVector right, + final LngVector output) { assert output.size() == left.size() + right.size(); final FormulaFactory f = result.getFactory(); for (int i = 0; i <= left.size(); i++) { @@ -197,20 +197,20 @@ private static void adderALK(final EncodingResult result, final LNGVector invars; - private final LNGVector outvars; + private final LngVector invars; + private final LngVector outvars; - private TotalizerVars(final LNGVector invars, final LNGVector outvars) { + private TotalizerVars(final LngVector invars, final LngVector outvars) { this.invars = invars; this.outvars = outvars; } private TotalizerVars(final int length) { - invars = new LNGVector<>(length); - outvars = new LNGVector<>(length); + invars = new LngVector<>(length); + outvars = new LngVector<>(length); } - private TotalizerVars withNewOutvars(final LNGVector newOutvars) { + private TotalizerVars withNewOutvars(final LngVector newOutvars) { return new TotalizerVars(invars, newOutvars); } } diff --git a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbAdderNetwork.java b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbAdderNetwork.java index 1d56566b..14a1bd45 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbAdderNetwork.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbAdderNetwork.java @@ -22,9 +22,9 @@ package com.booleworks.logicng.encodings.pbc; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; @@ -40,10 +40,10 @@ */ public final class PbAdderNetwork { - public static void encode(final EncodingResult result, final LNGVector lits, final LNGIntVector coeffs, + public static void encode(final EncodingResult result, final LngVector lits, final LngIntVector coeffs, final int rhs) { - final LNGVector literals = new LNGVector<>(); - final LNGVector> buckets = new LNGVector<>(); + final LngVector literals = new LngVector<>(); + final LngVector> buckets = new LngVector<>(); final int nb = ldInt(rhs); for (int iBit = 0; iBit < nb; ++iBit) { buckets.push(new LinkedList<>()); @@ -55,12 +55,12 @@ public static void encode(final EncodingResult result, final LNGVector } } adderTree(result, buckets, literals); - final LNGBooleanVector kBits = numToBits(buckets.size(), rhs); + final LngBooleanVector kBits = numToBits(buckets.size(), rhs); lessThanOrEqual(result, literals, kBits); } - private static void adderTree(final EncodingResult result, final LNGVector> buckets, - final LNGVector literals) { + private static void adderTree(final EncodingResult result, final LngVector> buckets, + final LngVector literals) { Literal x; Literal y; Literal z; @@ -93,9 +93,9 @@ private static void adderTree(final EncodingResult result, final LNGVector= 0; i--) { final int tmp = 1 << i; if (number < tmp) { @@ -109,8 +109,8 @@ private static LNGBooleanVector numToBits(final int n, final int num) { return bits; } - private static void lessThanOrEqual(final EncodingResult result, final LNGVector xs, - final LNGBooleanVector ys) { + private static void lessThanOrEqual(final EncodingResult result, final LngVector xs, + final LngBooleanVector ys) { assert xs.size() == ys.size(); final FormulaFactory f = result.getFactory(); final List clause = new ArrayList<>(); @@ -156,7 +156,7 @@ private static void faExtra(final EncodingResult result, final Literal xc, final private static Literal faCarry(final EncodingResult result, final Literal a, final Literal b, final Literal c) { final FormulaFactory f = result.getFactory(); - final Literal x = f.newPBVariable(); + final Literal x = f.newPbVariable(); result.addClause(b, c, x.negate(f)); result.addClause(a, c, x.negate(f)); result.addClause(a, b, x.negate(f)); @@ -168,7 +168,7 @@ private static Literal faCarry(final EncodingResult result, final Literal a, fin private static Literal faSum(final EncodingResult result, final Literal a, final Literal b, final Literal c) { final FormulaFactory f = result.getFactory(); - final Literal x = f.newPBVariable(); + final Literal x = f.newPbVariable(); result.addClause(a, b, c, x.negate(f)); result.addClause(a, b.negate(f), c.negate(f), x.negate(f)); result.addClause(a.negate(f), b, c.negate(f), x.negate(f)); @@ -182,7 +182,7 @@ private static Literal faSum(final EncodingResult result, final Literal a, final private static Literal haCarry(final EncodingResult result, final Literal a, final Literal b) { final FormulaFactory f = result.getFactory(); - final Literal x = f.newPBVariable(); + final Literal x = f.newPbVariable(); result.addClause(a, x.negate(f)); result.addClause(b, x.negate(f)); result.addClause(a.negate(f), b.negate(f), x); @@ -191,7 +191,7 @@ private static Literal haCarry(final EncodingResult result, final Literal a, fin private static Literal haSum(final EncodingResult result, final Literal a, final Literal b) { final FormulaFactory f = result.getFactory(); - final Literal x = f.newPBVariable(); + final Literal x = f.newPbVariable(); result.addClause(a.negate(f), b.negate(f), x.negate(f)); result.addClause(a, b, x.negate(f)); result.addClause(a.negate(f), b, x); diff --git a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbBinaryMerge.java b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbBinaryMerge.java index 3a5920fc..e7aee247 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbBinaryMerge.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbBinaryMerge.java @@ -24,8 +24,8 @@ import static com.booleworks.logicng.encodings.cc.CcSorting.ImplicationDirection.INPUT_TO_OUTPUT; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.encodings.cc.CcSorting; import com.booleworks.logicng.formulas.FormulaFactory; @@ -39,18 +39,18 @@ */ public final class PbBinaryMerge { - public static void encode(final EncodingResult result, final LNGVector lts, final LNGIntVector cffs, + public static void encode(final EncodingResult result, final LngVector lts, final LngIntVector cffs, final int rhs, final boolean useGac, final boolean noSuppoertSingleBit, final boolean useWatchDog) { final FormulaFactory f = result.getFactory(); - final LNGVector lits = new LNGVector<>(lts.size()); + final LngVector lits = new LngVector<>(lts.size()); for (final Literal lit : lts) { lits.push(lit); } - final LNGIntVector coeffs = new LNGIntVector(cffs); + final LngIntVector coeffs = new LngIntVector(cffs); final int maxWeight = maxWeight(coeffs); if (!useGac) { - binaryMerge(result, lts, new LNGIntVector(cffs), rhs, maxWeight, lits.size(), null, useWatchDog); + binaryMerge(result, lts, new LngIntVector(cffs), rhs, maxWeight, lits.size(), null, useWatchDog); } else { Literal x; boolean encode_complete_constraint = false; @@ -97,12 +97,12 @@ public static void encode(final EncodingResult result, final LNGVector } } if (noSuppoertSingleBit && encode_complete_constraint) { - binaryMerge(result, lts, new LNGIntVector(cffs), rhs, maxWeight, lits.size(), null, useWatchDog); + binaryMerge(result, lts, new LngIntVector(cffs), rhs, maxWeight, lits.size(), null, useWatchDog); } } } - private static int maxWeight(final LNGIntVector weights) { + private static int maxWeight(final LngIntVector weights) { int maxweight = Integer.MIN_VALUE; for (int i = 0; i < weights.size(); i++) { if (weights.get(i) > maxweight) { @@ -112,8 +112,8 @@ private static int maxWeight(final LNGIntVector weights) { return maxweight; } - private static void binaryMerge(final EncodingResult result, final LNGVector literals, - final LNGIntVector coefficients, final int leq, + private static void binaryMerge(final EncodingResult result, final LngVector literals, + final LngIntVector coefficients, final int leq, final int maxWeight, final int n, final Literal gac_lit, final boolean useWatchDog) { final FormulaFactory f = result.getFactory(); @@ -123,12 +123,12 @@ private static void binaryMerge(final EncodingResult result, final LNGVector> buckets = new LNGVector<>(); + final LngVector> buckets = new LngVector<>(); int bit = 1; for (int i = 0; i <= p; i++) { - buckets.push(new LNGVector<>()); + buckets.push(new LngVector<>()); if ((t & bit) != 0) { buckets.get(i).push(true_lit); } @@ -143,14 +143,14 @@ private static void binaryMerge(final EncodingResult result, final LNGVector> bucket_card = new LNGVector<>(p + 1); - final LNGVector> bucket_merge = new LNGVector<>(p + 1); + final LngVector> bucket_card = new LngVector<>(p + 1); + final LngVector> bucket_merge = new LngVector<>(p + 1); for (int i = 0; i < p + 1; i++) { - bucket_card.push(new LNGVector<>()); - bucket_merge.push(new LNGVector<>()); + bucket_card.push(new LngVector<>()); + bucket_merge.push(new LngVector<>()); } assert bucket_card.size() == buckets.size(); - final LNGVector carries = new LNGVector<>(); + final LngVector carries = new LngVector<>(); for (int i = 0; i < buckets.size(); i++) { final int k = (int) Math.ceil(newLessThen / Math.pow(2, i)); if (useWatchDog) { @@ -167,8 +167,8 @@ private static void binaryMerge(final EncodingResult result, final LNGVector 0) { - if (carries.size() > 0) { - if (bucket_card.get(i).size() == 0) { + if (!carries.isEmpty()) { + if (bucket_card.get(i).isEmpty()) { bucket_merge.set(i, carries); } else { if (useWatchDog) { @@ -202,20 +202,20 @@ private static void binaryMerge(final EncodingResult result, final LNGVector x, - final LNGVector u_x) { + private static void totalizer(final EncodingResult result, final LngVector x, + final LngVector u_x) { u_x.clear(); - if (x.size() == 0) { + if (x.isEmpty()) { return; } if (x.size() == 1) { u_x.push(x.get(0)); } else { for (int i = 0; i < x.size(); i++) { - u_x.push(result.getFactory().newPBVariable()); + u_x.push(result.getFactory().newPbVariable()); } - final LNGVector x_1 = new LNGVector<>(); - final LNGVector x_2 = new LNGVector<>(); + final LngVector x_1 = new LngVector<>(); + final LngVector x_2 = new LngVector<>(); int i = 0; for (; i < x.size() / 2; i++) { x_1.push(x.get(i)); @@ -223,29 +223,29 @@ private static void totalizer(final EncodingResult result, final LNGVector u_x_1 = new LNGVector<>(); - final LNGVector u_x_2 = new LNGVector<>(); + final LngVector u_x_1 = new LngVector<>(); + final LngVector u_x_2 = new LngVector<>(); totalizer(result, x_1, u_x_1); totalizer(result, x_2, u_x_2); unary_adder(result, u_x_1, u_x_2, u_x); } } - private static void unary_adder(final EncodingResult result, final LNGVector u, final LNGVector v, - final LNGVector w) { + private static void unary_adder(final EncodingResult result, final LngVector u, final LngVector v, + final LngVector w) { final FormulaFactory f = result.getFactory(); w.clear(); - if (u.size() == 0) { + if (u.isEmpty()) { for (int i = 0; i < v.size(); i++) { w.push(v.get(i)); } - } else if (v.size() == 0) { + } else if (v.isEmpty()) { for (int i = 0; i < u.size(); i++) { w.push(u.get(i)); } } else { for (int i = 0; i < u.size() + v.size(); i++) { - w.push(f.newPBVariable()); + w.push(f.newPbVariable()); } for (int a = 0; a < u.size(); a++) { for (int b = 0; b < v.size(); b++) { diff --git a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbSwc.java b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbSwc.java index 46fe6b24..6a3fd48d 100644 --- a/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbSwc.java +++ b/core/src/main/java/com/booleworks/logicng/encodings/pbc/PbSwc.java @@ -22,8 +22,8 @@ package com.booleworks.logicng.encodings.pbc; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; @@ -36,24 +36,24 @@ */ public final class PbSwc { - public static void encode(final EncodingResult result, final LNGVector lits, final LNGIntVector coeffs, + public static void encode(final EncodingResult result, final LngVector lits, final LngIntVector coeffs, final int rhs) { generateConstraint(result, rhs, lits, coeffs); } - private static void generateConstraint(final EncodingResult result, final int rhs, final LNGVector lits, - final LNGIntVector coeffs) { + private static void generateConstraint(final EncodingResult result, final int rhs, final LngVector lits, + final LngIntVector coeffs) { final FormulaFactory f = result.getFactory(); final int n = lits.size(); - final LNGVector> seqAuxiliary = new LNGVector<>(n + 1); + final LngVector> seqAuxiliary = new LngVector<>(n + 1); for (int i = 0; i < n + 1; i++) { - final LNGVector temp = new LNGVector<>(); + final LngVector temp = new LngVector<>(); temp.growTo(rhs + 1); seqAuxiliary.push(temp); } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= rhs; ++j) { - seqAuxiliary.get(i).set(j, f.newPBVariable()); + seqAuxiliary.get(i).set(j, f.newPbVariable()); } } for (int i = 1; i <= n; i++) { diff --git a/core/src/main/java/com/booleworks/logicng/explanations/UNSATCore.java b/core/src/main/java/com/booleworks/logicng/explanations/UnsatCore.java similarity index 71% rename from core/src/main/java/com/booleworks/logicng/explanations/UNSATCore.java rename to core/src/main/java/com/booleworks/logicng/explanations/UnsatCore.java index 5ec3fd4d..5fc9ed7b 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/UNSATCore.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/UnsatCore.java @@ -15,20 +15,20 @@ * @version 3.0.0 * @since 1.1 */ -public final class UNSATCore { +public final class UnsatCore { private final List propositions; - private final boolean isMUS; + private final boolean isMus; /** * Constructs a new unsatisfiable core. * @param propositions the propositions of the core - * @param isMUS {@code true} if it is a MUS and {@code false} if it + * @param isMus {@code true} if it is a MUS and {@code false} if it * is unknown whether it is a MUS. */ - public UNSATCore(final List propositions, final boolean isMUS) { + public UnsatCore(final List propositions, final boolean isMus) { this.propositions = propositions; - this.isMUS = isMUS; + this.isMus = isMus; } /** @@ -46,13 +46,13 @@ public List getPropositions() { * @return {@code true} if this core is a MUS and {@code false} if it is * unknown whether it is a MUS. */ - public boolean isMUS() { - return isMUS; + public boolean isMus() { + return isMus; } @Override public int hashCode() { - return Objects.hash(propositions, isMUS); + return Objects.hash(propositions, isMus); } @Override @@ -60,15 +60,15 @@ public boolean equals(final Object o) { if (this == o) { return true; } - if (!(o instanceof UNSATCore)) { + if (!(o instanceof UnsatCore)) { return false; } - final UNSATCore unsatCore = (UNSATCore) o; - return isMUS == unsatCore.isMUS && Objects.equals(propositions, unsatCore.propositions); + final UnsatCore unsatCore = (UnsatCore) o; + return isMus == unsatCore.isMus && Objects.equals(propositions, unsatCore.propositions); } @Override public String toString() { - return String.format("UNSATCore{isMUS=%s, propositions=%s}", isMUS, propositions); + return String.format("UnsatCore{isMus=%s, propositions=%s}", isMus, propositions); } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/drup/DRUPTrim.java b/core/src/main/java/com/booleworks/logicng/explanations/drup/DrupTrim.java similarity index 78% rename from core/src/main/java/com/booleworks/logicng/explanations/drup/DRUPTrim.java rename to core/src/main/java/com/booleworks/logicng/explanations/drup/DrupTrim.java index 25b5d38b..bc58b08f 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/drup/DRUPTrim.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/drup/DrupTrim.java @@ -27,8 +27,8 @@ package com.booleworks.logicng.explanations.drup; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import java.util.ArrayList; import java.util.HashMap; @@ -41,7 +41,7 @@ * @version 3.0.0 * @since 1.3 */ -public final class DRUPTrim { +public final class DrupTrim { private static final int BIGINIT = 1000000; private static final int UNSAT = 0; @@ -49,7 +49,7 @@ public final class DRUPTrim { private static final int EXTRA = 2; private static final int MARK = 3; - private static int getHash(final int[] _marks, final int mark, final LNGIntVector input) { + private static int getHash(final int[] _marks, final int mark, final LngIntVector input) { int sum = 0; int xor = 0; int prod = 1; @@ -74,37 +74,37 @@ private static int index(final int lit) { * @return the result of the DRUP execution from which the unsatisfiable * core can be generated */ - public DRUPResult compute(final LNGVector originalProblem, final LNGVector proof) { + public DrupResult compute(final LngVector originalProblem, final LngVector proof) { final Solver s = new Solver(originalProblem, proof); final boolean parseReturnValue = s.parse(); return parseReturnValue - ? new DRUPResult(false, s.verify()) - : new DRUPResult(true, new LNGVector<>()); + ? new DrupResult(false, s.verify()) + : new DrupResult(true, new LngVector<>()); } private static class Solver { - private final LNGVector originalProblem; - private final LNGVector proof; - private final LNGVector core; + private final LngVector originalProblem; + private final LngVector proof; + private final LngVector core; private final boolean delete; - private LNGIntVector DB; + private LngIntVector db; private int[] falseStack; private int[] reason; private int[] internalFalse; private int forcedPtr; private int processedPtr; private int assignedPtr; - private LNGIntVector adlist; - private LNGIntVector[] wlist; + private LngIntVector adlist; + private LngIntVector[] wlist; private int count; private int adlemmas; private int lemmas; - private Solver(final LNGVector originalProblem, final LNGVector proof) { + private Solver(final LngVector originalProblem, final LngVector proof) { this.originalProblem = originalProblem; this.proof = proof; - core = new LNGVector<>(); + core = new LngVector<>(); delete = true; } @@ -114,7 +114,7 @@ private void assign(final int a) { } private void addWatch(final int cPtr, final int index) { - final int lit = DB.get(cPtr + index); + final int lit = db.get(cPtr + index); wlist[index(lit)].push((cPtr << 1)); } @@ -123,8 +123,8 @@ private void addWatchLit(final int l, final int m) { } private void removeWatch(final int cPtr, final int index) { - final int lit = DB.get(cPtr + index); - final LNGIntVector watch = wlist[index(lit)]; + final int lit = db.get(cPtr + index); + final LngIntVector watch = wlist[index(lit)]; int watchPtr = 0; while (true) { final int _cPtr = watch.get(watchPtr++) >> 1; @@ -137,11 +137,11 @@ private void removeWatch(final int cPtr, final int index) { } private void markWatch(final int clausePtr, final int index, final int offset) { - final LNGIntVector watch = wlist[index(DB.get(clausePtr + index))]; - final int clause = DB.get(clausePtr - offset - 1); + final LngIntVector watch = wlist[index(db.get(clausePtr + index))]; + final int clause = db.get(clausePtr - offset - 1); int watchPtr = 0; while (true) { - final int _clause = (DB.get((watch.get(watchPtr++) >> 1) - 1)); + final int _clause = (db.get((watch.get(watchPtr++) >> 1) - 1)); if (_clause == clause) { watch.set(watchPtr - 1, watch.get(watchPtr - 1) | 1); return; @@ -150,16 +150,16 @@ private void markWatch(final int clausePtr, final int index, final int offset) { } private void markClause(int clausePtr, final int index) { - if ((DB.get(clausePtr + index - 1) & 1) == 0) { - DB.set(clausePtr + index - 1, DB.get(clausePtr + index - 1) | 1); - if (DB.get(clausePtr + 1 + index) == 0) { + if ((db.get(clausePtr + index - 1) & 1) == 0) { + db.set(clausePtr + index - 1, db.get(clausePtr + index - 1) | 1); + if (db.get(clausePtr + 1 + index) == 0) { return; } markWatch(clausePtr, index, -index); markWatch(clausePtr, 1 + index, -index); } - while (DB.get(clausePtr) != 0) { - internalFalse[index(DB.get(clausePtr++))] = MARK; + while (db.get(clausePtr) != 0) { + internalFalse[index(db.get(clausePtr++))] = MARK; } } @@ -182,7 +182,7 @@ private int propagate() { int i; int lit; int _lit = 0; - LNGIntVector watch; + LngIntVector watch; int _watchPtr = 0; start[0] = processedPtr; start[1] = processedPtr; @@ -206,26 +206,26 @@ private int propagate() { } // Get the clause from DB final int clausePtr = watch.get(watchPtr) / 2; - if (internalFalse[index(-DB.get(clausePtr))] != 0 || - internalFalse[index(-DB.get(clausePtr + 1))] != 0) { + if (internalFalse[index(-db.get(clausePtr))] != 0 || + internalFalse[index(-db.get(clausePtr + 1))] != 0) { watchPtr++; continue; } - if (DB.get(clausePtr) == lit) { + if (db.get(clausePtr) == lit) { // Ensure that the other watched literal is in front - DB.set(clausePtr, DB.get(clausePtr + 1)); + db.set(clausePtr, db.get(clausePtr + 1)); } boolean gotoNextClause = false; // Scan the non-watched literals - for (i = 2; DB.get(clausePtr + i) != 0; i++) { + for (i = 2; db.get(clausePtr + i) != 0; i++) { // When clause[j] is not false, it is either true // or unset - if (internalFalse[index(DB.get(clausePtr + i))] == 0) { - DB.set(clausePtr + 1, DB.get(clausePtr + i)); + if (internalFalse[index(db.get(clausePtr + i))] == 0) { + db.set(clausePtr + 1, db.get(clausePtr + i)); // Swap literals - DB.set(clausePtr + i, lit); + db.set(clausePtr + i, lit); // Add the watch to the list of clause[1] - addWatchLit(DB.get(clausePtr + 1), watch.get(watchPtr)); + addWatchLit(db.get(clausePtr + 1), watch.get(watchPtr)); // Remove pointer watch.set(watchPtr, wlist[index(lit)].back()); wlist[index(lit)].pop(); @@ -234,15 +234,15 @@ private int propagate() { } // go to the next watched clause } if (!gotoNextClause) { - DB.set(clausePtr + 1, lit); + db.set(clausePtr + 1, lit); // Set lit at clause[1] and set next watch watchPtr++; // If the other watched literal is falsified, - if (internalFalse[index(DB.get(clausePtr))] == 0) { + if (internalFalse[index(db.get(clausePtr))] == 0) { // A unit clause is found, and the reason is set - assign(DB.get(clausePtr)); - reason[Math.abs(DB.get(clausePtr))] = clausePtr + 1; + assign(db.get(clausePtr)); + reason[Math.abs(db.get(clausePtr))] = clausePtr + 1; if (check == 0) { start[0]--; _lit = lit; @@ -265,14 +265,14 @@ private int propagate() { return SAT; } - int matchClause(final LNGIntVector clauselist, final int[] _marks, final int mark, final LNGIntVector input) { + int matchClause(final LngIntVector clauselist, final int[] _marks, final int mark, final LngIntVector input) { int i; int matchsize; for (i = 0; i < clauselist.size(); i++) { matchsize = 0; boolean aborted = false; - for (int l = clauselist.get(i); DB.get(l) != 0; l++) { - if (_marks[index(DB.get(l))] != mark) { + for (int l = clauselist.get(i); db.get(l) != 0; l++) { + if (_marks[index(db.get(l))] != mark) { aborted = true; break; } @@ -295,7 +295,7 @@ int matchClause(final LNGIntVector clauselist, final int[] _marks, final int mar */ private boolean parse() { int nVars = 0; - for (final LNGIntVector vector : originalProblem) { + for (final LngIntVector vector : originalProblem) { for (int i = 0; i < vector.size(); i++) { if (Math.abs(vector.get(i)) > nVars) { nVars = Math.abs(vector.get(i)); @@ -306,37 +306,37 @@ private boolean parse() { boolean del = false; int nZeros = nClauses; - final LNGIntVector buffer = new LNGIntVector(); + final LngIntVector buffer = new LngIntVector(); - DB = new LNGIntVector(); + db = new LngIntVector(); count = 1; falseStack = new int[nVars + 1]; reason = new int[nVars + 1]; internalFalse = new int[2 * nVars + 3]; - wlist = new LNGIntVector[2 * nVars + 3]; + wlist = new LngIntVector[2 * nVars + 3]; for (int i = 1; i <= nVars; ++i) { - wlist[index(i)] = new LNGIntVector(); - wlist[index(-i)] = new LNGIntVector(); + wlist[index(i)] = new LngIntVector(); + wlist[index(-i)] = new LngIntVector(); } - adlist = new LNGIntVector(); + adlist = new LngIntVector(); final int[] marks = new int[2 * nVars + 3]; int mark = 0; - final Map hashTable = new HashMap<>(); - LNGVector currentFile = originalProblem; + final Map hashTable = new HashMap<>(); + LngVector currentFile = originalProblem; boolean fileSwitchFlag; int clauseNr = 0; while (true) { fileSwitchFlag = nZeros <= 0; if (clauseNr >= currentFile.size()) { - lemmas = DB.size() + 1; + lemmas = db.size() + 1; break; } - final LNGIntVector clause = currentFile.get(clauseNr++); + final LngIntVector clause = currentFile.get(clauseNr++); final List toks = new ArrayList<>(clause.size() - 1); if (fileSwitchFlag && clause.get(0) == -1) { del = true; @@ -366,16 +366,16 @@ private boolean parse() { buffer.clear(); continue; } - final int clausePtr = DB.size() + 1; - DB.push(2 * count++); + final int clausePtr = db.size() + 1; + db.push(2 * count++); for (int i = 0; i < buffer.size(); i++) { - DB.push(buffer.get(i)); + db.push(buffer.get(i)); } - DB.push(0); + db.push(0); - LNGIntVector vec = hashTable.get(hash); + LngIntVector vec = hashTable.get(hash); if (vec == null) { - vec = new LNGIntVector(); + vec = new LngIntVector(); hashTable.put(hash, vec); } vec.push(clausePtr); @@ -387,12 +387,12 @@ private boolean parse() { adlemmas = adlist.size() - 1; } if (nZeros > 0) { - if (buffer.isEmpty() || ((buffer.size() == 1) && internalFalse[index(DB.get(clausePtr))] != 0)) { + if (buffer.isEmpty() || ((buffer.size() == 1) && internalFalse[index(db.get(clausePtr))] != 0)) { return false; } else if (buffer.size() == 1) { - if (internalFalse[index(-DB.get(clausePtr))] == 0) { - reason[Math.abs(DB.get(clausePtr))] = clausePtr + 1; - assign(DB.get(clausePtr)); + if (internalFalse[index(-db.get(clausePtr))] == 0) { + reason[Math.abs(db.get(clausePtr))] = clausePtr + 1; + assign(db.get(clausePtr)); } } else { addWatch(clausePtr, 0); @@ -407,7 +407,7 @@ private boolean parse() { return true; } - private LNGVector verify() { + private LngVector verify() { int ad; long d; boolean flag = false; @@ -416,7 +416,7 @@ private LNGVector verify() { final int lastPtr = lemmas; final int endPtr = lemmas; int checked = adlemmas; - final LNGIntVector buffer = new LNGIntVector(); + final LngIntVector buffer = new LngIntVector(); int time; boolean gotoPostProcess = false; @@ -432,14 +432,14 @@ private LNGVector verify() { while (!gotoVerification) { flag = false; buffer.clear(); - time = DB.get(lemmasPtr - 1); + time = db.get(lemmasPtr - 1); clausePtr = lemmasPtr; do { ad = adlist.get(checked++); d = ad & 1; final int cPtr = ad >> 1; - if (d != 0 && DB.get(cPtr + 1) != 0) { - if (reason[Math.abs(DB.get(cPtr))] - 1 == ad >> 1) { + if (d != 0 && db.get(cPtr + 1) != 0) { + if (reason[Math.abs(db.get(cPtr))] - 1 == ad >> 1) { continue; } removeWatch(cPtr, 0); @@ -447,21 +447,21 @@ private LNGVector verify() { } } while (d != 0); - while (DB.get(lemmasPtr) != 0) { - final int lit = DB.get(lemmasPtr++); + while (db.get(lemmasPtr) != 0) { + final int lit = db.get(lemmasPtr++); if (internalFalse[index(-lit)] != 0) { flag = true; } if (internalFalse[index(lit)] == 0) { if (buffer.size() <= 1) { - DB.set(lemmasPtr - 1, DB.get(clausePtr + buffer.size())); - DB.set(clausePtr + buffer.size(), lit); + db.set(lemmasPtr - 1, db.get(clausePtr + buffer.size())); + db.set(clausePtr + buffer.size(), lit); } buffer.push(lit); } } - if (DB.get(clausePtr + 1) != 0) { + if (db.get(clausePtr + 1) != 0) { addWatch(clausePtr, 0); addWatch(clausePtr, 1); } @@ -487,7 +487,7 @@ private LNGVector verify() { } } - if (lemmasPtr >= DB.size()) { + if (lemmasPtr >= db.size()) { break; } } @@ -505,8 +505,8 @@ private LNGVector verify() { ad = adlist.get(--checked); d = ad & 1; final int cPtr = ad >> 1; - if (d != 0 && DB.get(cPtr + 1) != 0) { - if (reason[Math.abs(DB.get(cPtr))] - 1 == ad >> 1) { + if (d != 0 && db.get(cPtr + 1) != 0) { + if (reason[Math.abs(db.get(cPtr))] - 1 == ad >> 1) { continue; } addWatch(cPtr, 0); @@ -514,9 +514,9 @@ private LNGVector verify() { } } while (d != 0); - time = DB.get(clausePtr - 1); + time = db.get(clausePtr - 1); - if (DB.get(clausePtr + 1) != 0) { + if (db.get(clausePtr + 1) != 0) { removeWatch(clausePtr, 0); removeWatch(clausePtr, 1); } @@ -524,8 +524,8 @@ private LNGVector verify() { final boolean gotoNextLemma = ad == 0; if (!gotoNextLemma) { - while (DB.get(clausePtr) != 0) { - final int lit = DB.get(clausePtr++); + while (db.get(clausePtr) != 0) { + final int lit = db.get(clausePtr++); if (internalFalse[index(-lit)] != 0) { flag = true; } @@ -557,7 +557,7 @@ private LNGVector verify() { if (lemmasPtr + EXTRA == lastPtr) { break; } - while (DB.get(--lemmasPtr) != 0) { + while (db.get(--lemmasPtr) != 0) { // empty on purpose } } @@ -566,21 +566,21 @@ private LNGVector verify() { int marked; lemmasPtr = 0; while (lemmasPtr + EXTRA <= lastPtr) { - if ((DB.get(lemmasPtr++) & 1) != 0) { + if ((db.get(lemmasPtr++) & 1) != 0) { count++; } - while (DB.get(lemmasPtr++) != 0) { + while (db.get(lemmasPtr++) != 0) { // empty on purpose } } lemmasPtr = 0; while (lemmasPtr + EXTRA <= lastPtr) { - final LNGIntVector coreVec = new LNGIntVector(); - marked = DB.get(lemmasPtr++) & 1; - while (DB.get(lemmasPtr) != 0) { + final LngIntVector coreVec = new LngIntVector(); + marked = db.get(lemmasPtr++) & 1; + while (db.get(lemmasPtr) != 0) { if (marked != 0) { - coreVec.push(DB.get(lemmasPtr)); + coreVec.push(db.get(lemmasPtr)); } lemmasPtr++; } @@ -592,12 +592,12 @@ private LNGVector verify() { count = 0; while (lemmasPtr + EXTRA <= endPtr) { - time = DB.get(lemmasPtr); - marked = DB.get(lemmasPtr++) & 1; + time = db.get(lemmasPtr); + marked = db.get(lemmasPtr++) & 1; if (marked != 0) { count++; } - while (DB.get(lemmasPtr) != 0) { + while (db.get(lemmasPtr) != 0) { lemmasPtr++; } lemmasPtr++; @@ -609,16 +609,16 @@ private LNGVector verify() { /** * The result of an DRUP execution. */ - public static class DRUPResult { + public static class DrupResult { private final boolean trivialUnsat; - private final LNGVector unsatCore; + private final LngVector unsatCore; /** * Constructs a new DRUP result * @param trivialUnsat a flag whether the formula is trivially unsatisfiable * @param unsatCore the unsatisfiable core */ - public DRUPResult(final boolean trivialUnsat, final LNGVector unsatCore) { + public DrupResult(final boolean trivialUnsat, final LngVector unsatCore) { this.trivialUnsat = trivialUnsat; this.unsatCore = unsatCore; } @@ -635,7 +635,7 @@ public boolean isTrivialUnsat() { * Returns the unsatisfiable core of the formula. * @return the unsatisfiable core of the formula */ - public LNGVector getUnsatCore() { + public LngVector getUnsatCore() { return unsatCore; } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMUS.java b/core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMus.java similarity index 70% rename from core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMUS.java rename to core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMus.java index 8c080ba9..7bd43a2c 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMUS.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/mus/DeletionBasedMus.java @@ -6,12 +6,12 @@ import static com.booleworks.logicng.handlers.events.ComputationStartedEvent.MUS_COMPUTATION_STARTED; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import java.util.ArrayList; @@ -19,28 +19,28 @@ /** * A naive deletion-based MUS algorithm. - * @version 2.1.0 + * @version 3.0.0 * @since 1.1 */ -public final class DeletionBasedMUS extends MUSAlgorithm { +public final class DeletionBasedMus extends MusAlgorithm { @Override - public LNGResult> computeMUS( + public LngResult> computeMus( final FormulaFactory f, final List propositions, - final MUSConfig config, final ComputationHandler handler) { + final MusConfig config, final ComputationHandler handler) { if (!handler.shouldResume(MUS_COMPUTATION_STARTED)) { - return LNGResult.canceled(MUS_COMPUTATION_STARTED); + return LngResult.canceled(MUS_COMPUTATION_STARTED); } final List mus = new ArrayList<>(propositions.size()); final List solverStates = new ArrayList<>(propositions.size()); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); for (final Proposition proposition : propositions) { solverStates.add(solver.saveState()); solver.add(proposition); } - LNGResult sat = solver.satCall().handler(handler).sat(); + LngResult sat = solver.satCall().handler(handler).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } if (sat.getResult()) { throw new IllegalArgumentException("Cannot compute a MUS for a satisfiable formula set."); @@ -52,12 +52,12 @@ public LNGResult> computeMUS( } sat = solver.satCall().handler(handler).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } if (sat.getResult()) { mus.add(propositions.get(i)); } } - return LNGResult.of(new UNSATCore<>(mus, true)); + return LngResult.of(new UnsatCore<>(mus, true)); } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSAlgorithm.java b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusAlgorithm.java similarity index 77% rename from core/src/main/java/com/booleworks/logicng/explanations/mus/MUSAlgorithm.java rename to core/src/main/java/com/booleworks/logicng/explanations/mus/MusAlgorithm.java index ee4b96b7..9ee0aeee 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSAlgorithm.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusAlgorithm.java @@ -4,10 +4,10 @@ package com.booleworks.logicng.explanations.mus; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.propositions.Proposition; @@ -18,7 +18,7 @@ * @version 3.0.0 * @since 1.1 */ -abstract class MUSAlgorithm { +abstract class MusAlgorithm { /** * Computes a MUS for the given propositions. @@ -28,13 +28,13 @@ abstract class MUSAlgorithm { * @param config the MUS configuration * @param handler the computation handler * @return an LNG result containing the MUS (unless the handler canceled - * the computation) + * the computation) * @throws IllegalArgumentException if the set of propositions is * satisfiable */ - public abstract LNGResult> computeMUS( + public abstract LngResult> computeMus( final FormulaFactory f, final List propositions, - final MUSConfig config, final ComputationHandler handler); + final MusConfig config, final ComputationHandler handler); /** * Computes a MUS for the given propositions. @@ -46,8 +46,8 @@ public abstract LNGResult> computeMUS( * @throws IllegalArgumentException if the set of propositions is * satisfiable */ - public UNSATCore computeMUS( - final FormulaFactory f, final List propositions, final MUSConfig config) { - return computeMUS(f, propositions, config, NopHandler.get()).getResult(); + public UnsatCore computeMus( + final FormulaFactory f, final List propositions, final MusConfig config) { + return computeMus(f, propositions, config, NopHandler.get()).getResult(); } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSConfig.java b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusConfig.java similarity index 88% rename from core/src/main/java/com/booleworks/logicng/explanations/mus/MUSConfig.java rename to core/src/main/java/com/booleworks/logicng/explanations/mus/MusConfig.java index e5816ee6..be9bc1fd 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSConfig.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusConfig.java @@ -12,7 +12,7 @@ * @version 2.1.0 * @since 1.1 */ -public final class MUSConfig extends Configuration { +public final class MusConfig extends Configuration { /** * The algorithm for the MUS generation. @@ -28,7 +28,7 @@ public enum Algorithm { * Constructs a new configuration with a given type. * @param builder the builder */ - private MUSConfig(final Builder builder) { + private MusConfig(final Builder builder) { super(ConfigurationType.MUS); algorithm = builder.algorithm; } @@ -43,7 +43,7 @@ public static Builder builder() { @Override public String toString() { - final StringBuilder sb = new StringBuilder("MUSConfig{").append(System.lineSeparator()); + final StringBuilder sb = new StringBuilder("MusConfig{").append(System.lineSeparator()); sb.append("algorithm=").append(algorithm).append(System.lineSeparator()); sb.append("}").append(System.lineSeparator()); return sb.toString(); @@ -75,8 +75,8 @@ public Builder algorithm(final Algorithm algorithm) { * Builds the configuration. * @return the configuration. */ - public MUSConfig build() { - return new MUSConfig(this); + public MusConfig build() { + return new MusConfig(this); } } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSGeneration.java b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusGeneration.java similarity index 73% rename from core/src/main/java/com/booleworks/logicng/explanations/mus/MUSGeneration.java rename to core/src/main/java/com/booleworks/logicng/explanations/mus/MusGeneration.java index 9b0db50b..3a9a310a 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/mus/MUSGeneration.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/mus/MusGeneration.java @@ -5,10 +5,10 @@ package com.booleworks.logicng.explanations.mus; import com.booleworks.logicng.configurations.ConfigurationType; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.propositions.Proposition; @@ -20,17 +20,17 @@ * @version 2.0.0 * @since 1.1 */ -public final class MUSGeneration { +public final class MusGeneration { - private final DeletionBasedMUS deletion; - private final PlainInsertionBasedMUS insertion; + private final DeletionBasedMus deletion; + private final PlainInsertionBasedMus insertion; /** * Constructs a new MUS generator. */ - public MUSGeneration() { - deletion = new DeletionBasedMUS(); - insertion = new PlainInsertionBasedMUS(); + public MusGeneration() { + deletion = new DeletionBasedMus(); + insertion = new PlainInsertionBasedMus(); } /** @@ -41,8 +41,8 @@ public MUSGeneration() { * @param propositions the propositions * @return the MUS */ - public UNSATCore computeMUS(final FormulaFactory f, final List propositions) { - return computeMUS(f, propositions, (MUSConfig) f.configurationFor(ConfigurationType.MUS)); + public UnsatCore computeMus(final FormulaFactory f, final List propositions) { + return computeMus(f, propositions, (MusConfig) f.configurationFor(ConfigurationType.MUS)); } /** @@ -54,9 +54,9 @@ public UNSATCore computeMUS(final FormulaFactory f, f * @param config the MUS configuration * @return the MUS */ - public UNSATCore computeMUS(final FormulaFactory f, final List propositions, - final MUSConfig config) { - return computeMUS(f, propositions, config, NopHandler.get()).getResult(); + public UnsatCore computeMus(final FormulaFactory f, final List propositions, + final MusConfig config) { + return computeMus(f, propositions, config, NopHandler.get()).getResult(); } /** @@ -69,17 +69,17 @@ public UNSATCore computeMUS(final FormulaFactory f, f * @param handler the computation handler * @return the MUS */ - public LNGResult> computeMUS( + public LngResult> computeMus( final FormulaFactory f, final List propositions, - final MUSConfig config, final ComputationHandler handler) { + final MusConfig config, final ComputationHandler handler) { if (propositions.isEmpty()) { throw new IllegalArgumentException("Cannot generate a MUS for an empty list of propositions"); } switch (config.algorithm) { case PLAIN_INSERTION: - return insertion.computeMUS(f, propositions, config, handler); + return insertion.computeMus(f, propositions, config, handler); case DELETION: - return deletion.computeMUS(f, propositions, config, handler); + return deletion.computeMus(f, propositions, config, handler); default: throw new IllegalStateException("Unknown MUS algorithm: " + config.algorithm); } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMUS.java b/core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMus.java similarity index 76% rename from core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMUS.java rename to core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMus.java index 4ceae24f..c5ceac2a 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMUS.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/mus/PlainInsertionBasedMus.java @@ -6,12 +6,12 @@ import static com.booleworks.logicng.handlers.events.ComputationStartedEvent.MUS_COMPUTATION_STARTED; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.ArrayList; import java.util.List; @@ -21,14 +21,14 @@ * @version 2.1.0 * @since 1.1 */ -public class PlainInsertionBasedMUS extends MUSAlgorithm { +public class PlainInsertionBasedMus extends MusAlgorithm { @Override - public LNGResult> computeMUS( + public LngResult> computeMus( final FormulaFactory f, final List propositions, - final MUSConfig config, final ComputationHandler handler) { + final MusConfig config, final ComputationHandler handler) { if (!handler.shouldResume(MUS_COMPUTATION_STARTED)) { - return LNGResult.canceled(MUS_COMPUTATION_STARTED); + return LngResult.canceled(MUS_COMPUTATION_STARTED); } final List currentFormula = new ArrayList<>(propositions.size()); currentFormula.addAll(propositions); @@ -36,15 +36,15 @@ public LNGResult> computeMUS( while (!currentFormula.isEmpty()) { final List currentSubset = new ArrayList<>(propositions.size()); T transitionProposition = null; - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); for (final Proposition p : mus) { solver.add(p); } int count = currentFormula.size(); while (true) { - final LNGResult sat = solver.satCall().handler(handler).sat(); + final LngResult sat = solver.satCall().handler(handler).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } if (!sat.getResult()) { break; @@ -64,7 +64,7 @@ public LNGResult> computeMUS( mus.add(transitionProposition); } } - return LNGResult.of(new UNSATCore<>(mus, true)); + return LngResult.of(new UnsatCore<>(mus, true)); } } diff --git a/core/src/main/java/com/booleworks/logicng/explanations/smus/SmusComputation.java b/core/src/main/java/com/booleworks/logicng/explanations/smus/SmusComputation.java index bdfeb436..e90b7a5c 100644 --- a/core/src/main/java/com/booleworks/logicng/explanations/smus/SmusComputation.java +++ b/core/src/main/java/com/booleworks/logicng/explanations/smus/SmusComputation.java @@ -11,11 +11,11 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.OptimizationFunction; @@ -80,13 +80,13 @@ public static

    List

    computeSmus( * @return the SMUS or {@code null} if the given propositions are * satisfiable or the handler canceled the computation */ - public static

    LNGResult> computeSmus( + public static

    LngResult> computeSmus( final FormulaFactory f, final List

    propositions, final List additionalConstraints, final ComputationHandler handler) { if (!handler.shouldResume(SMUS_COMPUTATION_STARTED)) { - return LNGResult.canceled(SMUS_COMPUTATION_STARTED); + return LngResult.canceled(SMUS_COMPUTATION_STARTED); } - final SATSolver growSolver = SATSolver.newSolver(f); + final SatSolver growSolver = SatSolver.newSolver(f); growSolver.add(additionalConstraints == null ? Collections.singletonList(f.verum()) : additionalConstraints); final Map propositionMapping = new TreeMap<>(); for (final P proposition : propositions) { @@ -94,24 +94,24 @@ public static

    LNGResult> computeSmus( propositionMapping.put(selector, proposition); growSolver.add(f.equivalence(selector, proposition.getFormula())); } - final LNGResult sat = + final LngResult sat = growSolver.satCall().handler(handler).addFormulas(propositionMapping.keySet()).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } - final SATSolver hSolver = SATSolver.newSolver(f); + final SatSolver hSolver = SatSolver.newSolver(f); while (true) { - final LNGResult> h = minimumHs(hSolver, propositionMapping.keySet(), handler); + final LngResult> h = minimumHs(hSolver, propositionMapping.keySet(), handler); if (!h.isSuccess()) { - return LNGResult.canceled(h.getCancelCause()); + return LngResult.canceled(h.getCancelCause()); } else { final SortedSet hResult = h.getResult(); - final LNGResult> c = + final LngResult> c = grow(growSolver, hResult, propositionMapping.keySet(), handler); if (c == null) { - return LNGResult.of(hResult.stream().map(propositionMapping::get).collect(Collectors.toList())); + return LngResult.of(hResult.stream().map(propositionMapping::get).collect(Collectors.toList())); } else if (!c.isSuccess()) { - return LNGResult.canceled(c.getCancelCause()); + return LngResult.canceled(c.getCancelCause()); } else { hSolver.add(f.or(c.getResult())); } @@ -143,32 +143,32 @@ public static List computeSmusForFormulas(final FormulaFactory f, final * @return the SMUS or {@code null} if the given propositions are * satisfiable or the handler canceled the computation */ - public static LNGResult> computeSmusForFormulas( + public static LngResult> computeSmusForFormulas( final FormulaFactory f, final List formulas, final List additionalConstraints, final ComputationHandler handler) { final List props = formulas.stream().map(StandardProposition::new).collect(Collectors.toList()); - final LNGResult> smus = computeSmus(f, props, additionalConstraints, handler); + final LngResult> smus = computeSmus(f, props, additionalConstraints, handler); if (!smus.isSuccess()) { - return LNGResult.canceled(smus.getCancelCause()); + return LngResult.canceled(smus.getCancelCause()); } else { - return LNGResult.of(smus.getResult().stream().map(Proposition::getFormula).collect(Collectors.toList())); + return LngResult.of(smus.getResult().stream().map(Proposition::getFormula).collect(Collectors.toList())); } } - private static LNGResult> minimumHs(final SATSolver hSolver, + private static LngResult> minimumHs(final SatSolver hSolver, final Set variables, final ComputationHandler handler) { - final LNGResult minimumHsModel = hSolver.execute(OptimizationFunction.builder() + final LngResult minimumHsModel = hSolver.execute(OptimizationFunction.builder() .literals(variables) .minimize().build(), handler); if (!minimumHsModel.isSuccess()) { - return LNGResult.canceled(minimumHsModel.getCancelCause()); + return LngResult.canceled(minimumHsModel.getCancelCause()); } else { - return LNGResult.of(minimumHsModel.getResult().positiveVariables()); + return LngResult.of(minimumHsModel.getResult().positiveVariables()); } } - private static LNGResult> grow(final SATSolver growSolver, final SortedSet h, + private static LngResult> grow(final SatSolver growSolver, final SortedSet h, final Set variables, final ComputationHandler handler) { final SolverState solverState = growSolver.saveState(); @@ -176,17 +176,17 @@ private static LNGResult> grow(final SATSolver growSolver, f if (!growSolver.sat()) { return null; } - final LNGResult maxModel = growSolver.execute(OptimizationFunction.builder() + final LngResult maxModel = growSolver.execute(OptimizationFunction.builder() .literals(variables) .maximize().build(), handler); if (!maxModel.isSuccess()) { - return LNGResult.canceled(maxModel.getCancelCause()); + return LngResult.canceled(maxModel.getCancelCause()); } else { final SortedSet maximumSatisfiableSet = maxModel.getResult().positiveVariables(); growSolver.loadState(solverState); final SortedSet minimumCorrectionSet = new TreeSet<>(variables); maximumSatisfiableSet.forEach(minimumCorrectionSet::remove); - return LNGResult.of(minimumCorrectionSet); + return LngResult.of(minimumCorrectionSet); } } } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/CardinalityConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/CardinalityConstraint.java index 7a40e993..126a3655 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/CardinalityConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/CardinalityConstraint.java @@ -17,10 +17,10 @@ * @version 3.0.0 * @since 2.0.0 */ -public interface CardinalityConstraint extends PBConstraint { +public interface CardinalityConstraint extends PbConstraint { @Override - default boolean isCC() { + default boolean isCc() { return true; } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/Formula.java b/core/src/main/java/com/booleworks/logicng/formulas/Formula.java index 6c07ea00..81fcd370 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/Formula.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/Formula.java @@ -11,21 +11,21 @@ import com.booleworks.logicng.functions.NumberOfNodesFunction; import com.booleworks.logicng.functions.VariablesFunction; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.VariableOrderingProvider; -import com.booleworks.logicng.predicates.CNFPredicate; -import com.booleworks.logicng.predicates.DNFPredicate; -import com.booleworks.logicng.predicates.NNFPredicate; +import com.booleworks.logicng.predicates.CnfPredicate; +import com.booleworks.logicng.predicates.DnfPredicate; +import com.booleworks.logicng.predicates.NnfPredicate; import com.booleworks.logicng.predicates.satisfiability.ContradictionPredicate; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.transformations.NNFTransformation; -import com.booleworks.logicng.transformations.cnf.CNFConfig; -import com.booleworks.logicng.transformations.cnf.CNFEncoder; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.transformations.NnfTransformation; +import com.booleworks.logicng.transformations.cnf.CnfConfig; +import com.booleworks.logicng.transformations.cnf.CnfEncoder; import java.util.SortedSet; import java.util.stream.Stream; @@ -158,30 +158,30 @@ default SortedSet literals(final FormulaFactory f) { * Returns {@code true} if this formula is in NNF, otherwise {@code false} * @param f the formula factory to use for caching * @return {@code true} if this formula is in NNF, otherwise {@code false} - * @see NNFPredicate the NNF predicate + * @see NnfPredicate the NNF predicate */ - default boolean isNNF(final FormulaFactory f) { - return holds(new NNFPredicate(f)); + default boolean isNnf(final FormulaFactory f) { + return holds(new NnfPredicate(f)); } /** * Returns {@code true} if this formula is in DNF, otherwise {@code false} * @param f the formula factory to use for caching * @return {@code true} if this formula is in DNF, otherwise {@code false} - * @see DNFPredicate the DNF predicate + * @see DnfPredicate the DNF predicate */ - default boolean isDNF(final FormulaFactory f) { - return holds(new DNFPredicate(f)); + default boolean isDnf(final FormulaFactory f) { + return holds(new DnfPredicate(f)); } /** * Returns {@code true} if this formula is in CNF, otherwise {@code false} * @param f the formula factory to use for caching * @return {@code true} if this formula is in CNF, otherwise {@code false} - * @see CNFPredicate the CNF predicate + * @see CnfPredicate the CNF predicate */ - default boolean isCNF(final FormulaFactory f) { - return holds(new CNFPredicate(f)); + default boolean isCnf(final FormulaFactory f) { + return holds(new CnfPredicate(f)); } /** @@ -219,7 +219,7 @@ default Formula substitute(final FormulaFactory f, final Variable variable, fina * @return a copy of this formula which is in NNF */ default Formula nnf(final FormulaFactory f) { - return transform(new NNFTransformation(f)); + return transform(new NnfTransformation(f)); } /** @@ -233,8 +233,8 @@ default Formula nnf(final FormulaFactory f) { * semantically equivalent CNF but an equisatisfiable CNF. *

    * If the introduction of auxiliary variables is unwanted, you can choose - * one of the algorithms {@link CNFConfig.Algorithm#FACTORIZATION} and - * {@link CNFConfig.Algorithm#BDD}. Both algorithms provide CNF conversions + * one of the algorithms {@link CnfConfig.Algorithm#FACTORIZATION} and + * {@link CnfConfig.Algorithm#BDD}. Both algorithms provide CNF conversions * without the introduction of auxiliary variables and the result is a * semantically equivalent CNF. *

    @@ -245,21 +245,21 @@ default Formula nnf(final FormulaFactory f) { * @return a copy of this formula which is in CNF */ default Formula cnf(final FormulaFactory f) { - return CNFEncoder.encode(f, this, null); + return CnfEncoder.encode(f, this, null); } /** * Returns whether this formula is satisfiable. A new SAT solver is used to * check the satisfiability. This is a convenience method for the predicate - * {@link SATPredicate}. If you want to have more influence on the solver + * {@link SatPredicate}. If you want to have more influence on the solver * (e.g. which solver type or configuration) you must create and use a - * {@link SATSolver} on your own. + * {@link SatSolver} on your own. * @param f the formula factory to use for caching * @return {@code true} when this formula is satisfiable, {@code false} * otherwise */ default boolean isSatisfiable(final FormulaFactory f) { - return holds(new SATPredicate(f)); + return holds(new SatPredicate(f)); } /** @@ -267,7 +267,7 @@ default boolean isSatisfiable(final FormulaFactory f) { * solver is used to check the tautology. This is a convenience method for * the predicate {@link TautologyPredicate}. If you want to have more * influence on the solver (e.g. which solver type or configuration) you - * must create and use a {@link SATSolver} on your own. + * must create and use a {@link SatSolver} on your own. * @param f the formula factory to use for caching * @return {@code true} when this formula is a tautology, {@code false} * otherwise @@ -281,7 +281,7 @@ default boolean isTautology(final FormulaFactory f) { * new SAT solver is used to check the contradiction. This is a convenience * method for the predicate {@link ContradictionPredicate}. If you want to * have more influence on the solver (e.g. which solver type or - * configuration) you must create and use a {@link SATSolver} on your own. + * configuration) you must create and use a {@link SatSolver} on your own. * @param f the formula factory to use for caching * @return {@code true} when this formula is a contradiction, {@code false} * otherwise @@ -295,7 +295,7 @@ default boolean isContradiction(final FormulaFactory f) { * => other` is a tautology. A new SAT solver is used to check this * tautology. This is a convenience method. If you want to have more * influence on the solver (e.g. which solver type or configuration) you - * must create and use a {@link SATSolver} on your own. + * must create and use a {@link SatSolver} on your own. * @param f the formula factory to use for caching * @param other the formula which should be checked if it is implied by this * formula @@ -311,7 +311,7 @@ default boolean implies(final FormulaFactory f, final Formula other) { * `other => this` is a tautology. A new SAT solver is used to check this * tautology. This is a convenience method. If you want to have more * influence on the solver (e.g. which solver type or configuration) you - * must create and use a {@link SATSolver} on your own. + * must create and use a {@link SatSolver} on your own. * @param f the formula factory to use for caching * @param other the formula which should be checked if it implies this * formula @@ -327,7 +327,7 @@ default boolean isImpliedBy(final FormulaFactory f, final Formula other) { * i.e. `other <=> this` is a tautology. A new SAT solver is used to * check this tautology. This is a convenience method. If you want to have * more influence on the solver (e.g. which solver type or configuration) - * you must create and use a {@link SATSolver} on your own. + * you must create and use a {@link SatSolver} on your own. * @param f the formula factory to use for caching * @param other the formula which should be checked if it is equivalent with * this formula @@ -343,22 +343,22 @@ default boolean isEquivalentTo(final FormulaFactory f, final Formula other) { * done by generating a new BDD factory, generating the variable order for * this formula, and building a new BDD. If more sophisticated operations * should be performed on the BDD or more than one formula should be - * constructed on the BDD, an own instance of {@link BDDFactory} should be + * constructed on the BDD, an own instance of {@link BddFactory} should be * created and used. * @param f the formula factory to generate new formulas * @param provider the variable ordering provider * @return the BDD for this formula with the given ordering */ - default BDD bdd(final FormulaFactory f, final VariableOrderingProvider provider) { + default Bdd bdd(final FormulaFactory f, final VariableOrderingProvider provider) { final Formula formula = nnf(f); final int varNum = formula.variables(f).size(); - final BDDKernel kernel; + final BddKernel kernel; if (provider == null) { - kernel = new BDDKernel(f, varNum, varNum * 30, varNum * 20); + kernel = new BddKernel(f, varNum, varNum * 30, varNum * 20); } else { - kernel = new BDDKernel(f, provider.getOrder(f, formula), varNum * 30, varNum * 20); + kernel = new BddKernel(f, provider.getOrder(f, formula), varNum * 30, varNum * 20); } - return BDDFactory.build(f, formula, kernel); + return BddFactory.build(f, formula, kernel); } /** @@ -366,11 +366,11 @@ default BDD bdd(final FormulaFactory f, final VariableOrderingProvider provider) * is done by generating a new BDD factory and building a new BDD. If more * sophisticated operations should be performed on the BDD or more than one * formula should be constructed on the BDD, an own instance of * - * {@link BDDFactory} should be created and used. + * {@link BddFactory} should be created and used. * @param f the formula factory to generate new formulas * @return the BDD for this formula */ - default BDD bdd(final FormulaFactory f) { + default Bdd bdd(final FormulaFactory f) { return bdd(f, null); } @@ -390,7 +390,7 @@ default Formula transform(final FormulaTransformation transformation) { * @return the result of the transformation which may have been canceled by * the computation handler */ - default LNGResult transform(final FormulaTransformation transformation, final ComputationHandler handler) { + default LngResult transform(final FormulaTransformation transformation, final ComputationHandler handler) { return transformation.apply(this, handler); } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/FormulaFactory.java b/core/src/main/java/com/booleworks/logicng/formulas/FormulaFactory.java index 3859c832..9d895366 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/FormulaFactory.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/FormulaFactory.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.configurations.Configuration; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.encodings.EncoderConfig; -import com.booleworks.logicng.explanations.mus.MUSConfig; +import com.booleworks.logicng.explanations.mus.MusConfig; import com.booleworks.logicng.formulas.implementation.cached.CachingFormulaFactory; import com.booleworks.logicng.formulas.implementation.noncaching.NonCachingFormulaFactory; import com.booleworks.logicng.formulas.printer.FormulaStringRepresentation; @@ -16,10 +16,10 @@ import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.transformations.FormulaFactoryImporter; -import com.booleworks.logicng.transformations.cnf.CNFConfig; +import com.booleworks.logicng.transformations.cnf.CnfConfig; import com.booleworks.logicng.transformations.simplification.AdvancedSimplifierConfig; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -106,11 +106,11 @@ protected FormulaFactory(final FormulaFactoryConfig config) { */ private static Map initDefaultConfigs() { final Map configMap = new ConcurrentHashMap<>(); - configMap.put(ConfigurationType.CNF, CNFConfig.builder().build()); + configMap.put(ConfigurationType.CNF, CnfConfig.builder().build()); configMap.put(ConfigurationType.ENCODER, EncoderConfig.builder().build()); - configMap.put(ConfigurationType.SAT, SATSolverConfig.builder().build()); - configMap.put(ConfigurationType.MAXSAT, MaxSATConfig.builder().build()); - configMap.put(ConfigurationType.MUS, MUSConfig.builder().build()); + configMap.put(ConfigurationType.SAT, SatSolverConfig.builder().build()); + configMap.put(ConfigurationType.MAXSAT, MaxSatConfig.builder().build()); + configMap.put(ConfigurationType.MUS, MusConfig.builder().build()); configMap.put(ConfigurationType.ADVANCED_SIMPLIFIER, AdvancedSimplifierConfig.builder().build()); configMap.put(ConfigurationType.MODEL_ENUMERATION, ModelEnumerationConfig.builder().build()); configMap.put(ConfigurationType.FORMULA_RANDOMIZER, FormulaRandomizerConfig.builder().build()); @@ -592,7 +592,7 @@ public Formula pbc(final CType comparator, final int rhs, final List literalsIn, + private Formula constructPbc(final CType comparator, final int rhs, final List literalsIn, final List coefficients) { final List literals = importOrPanic(literalsIn); if (literals.isEmpty()) { return constant(evaluateTrivialPBConstraint(comparator, rhs)); } - if (isCC(comparator, rhs, literals, coefficients)) { - return constructCCUnsafe(comparator, rhs, literals); + if (isCc(comparator, rhs, literals, coefficients)) { + return constructCcUnsafe(comparator, rhs, literals); } return internalPbc(literals, coefficients, comparator, rhs); } @@ -637,7 +637,7 @@ protected abstract Formula internalPbc(final List literals, f * @throws IllegalArgumentException if there are negative variables */ public Formula cc(final CType comparator, final int rhs, final Collection variables) { - return constructCC(comparator, rhs, variables); + return constructCc(comparator, rhs, variables); } /** @@ -649,7 +649,7 @@ public Formula cc(final CType comparator, final int rhs, final Collection variables) { - return constructCCUnsafe(CType.LE, 1, variables); + return constructCcUnsafe(CType.LE, 1, variables); } /** @@ -669,7 +669,7 @@ public Formula amo(final Collection variables) { * @throws IllegalArgumentException if there are negative variables */ public Formula amo(final Variable... variables) { - return constructCCUnsafe(CType.LE, 1, Arrays.asList(variables)); + return constructCcUnsafe(CType.LE, 1, Arrays.asList(variables)); } /** @@ -679,7 +679,7 @@ public Formula amo(final Variable... variables) { * @throws IllegalArgumentException if there are negative variables */ public Formula exo(final Collection variables) { - return constructCCUnsafe(CType.EQ, 1, variables); + return constructCcUnsafe(CType.EQ, 1, variables); } /** @@ -689,20 +689,20 @@ public Formula exo(final Collection variables) { * @throws IllegalArgumentException if there are negative variables */ public Formula exo(final Variable... variables) { - return constructCCUnsafe(CType.EQ, 1, Arrays.asList(variables)); + return constructCcUnsafe(CType.EQ, 1, Arrays.asList(variables)); } - private Formula constructCC(final CType comparator, final int rhs, final Collection literals) { + private Formula constructCc(final CType comparator, final int rhs, final Collection literals) { if (readOnly) { throwReadOnlyException(); } - if (!isCC(comparator, rhs, literals, null)) { + if (!isCc(comparator, rhs, literals, null)) { throw new IllegalArgumentException("Given values do not represent a cardinality constraint."); } - return constructCCUnsafe(comparator, rhs, literals); + return constructCcUnsafe(comparator, rhs, literals); } - private Formula constructCCUnsafe(final CType comparator, final int rhs, + private Formula constructCcUnsafe(final CType comparator, final int rhs, final Collection literalsIn) { if (readOnly) { throwReadOnlyException(); @@ -729,7 +729,7 @@ private Formula constructCCUnsafe(final CType comparator, final int rhs, * @return {@code true} if the given pseudo-Boolean constraint is a * cardinality constraint, otherwise {@code false} */ - private static boolean isCC(final CType comparator, final int rhs, final Collection literals, + private static boolean isCc(final CType comparator, final int rhs, final Collection literals, final List coefficients) { for (final Literal lit : literals) { if (!lit.getPhase()) { @@ -815,7 +815,7 @@ public Variable newAuxVariable(final InternalAuxVarType type) { * the literal is already present. * @return the new cardinality constraint auxiliary literal */ - public Variable newCCVariable() { + public Variable newCcVariable() { return newAuxVariable(InternalAuxVarType.CC); } @@ -826,7 +826,7 @@ public Variable newCCVariable() { * the literal is already present. * @return the new pseudo Boolean auxiliary literal */ - public Variable newPBVariable() { + public Variable newPbVariable() { return newAuxVariable(InternalAuxVarType.PBC); } @@ -837,7 +837,7 @@ public Variable newPBVariable() { * the literal is already present. * @return the new CNF auxiliary literal */ - public Variable newCNFVariable() { + public Variable newCnfVariable() { return newAuxVariable(InternalAuxVarType.CNF); } @@ -974,7 +974,7 @@ private byte addFormulaAnd(final LinkedHashSet ops, final Formula formu } else { ops.add(formula); return (byte) (formula.getType() == FType.LITERAL || - formula.getType() == FType.OR && ((Or) formula).isCNFClause() ? 0x01 : 0x02); + formula.getType() == FType.OR && ((Or) formula).isCnfClause() ? 0x01 : 0x02); } } @@ -1062,7 +1062,7 @@ private Formula importOrPanic(final Formula formula) { * merge strategy is * {@link FormulaFactoryConfig.FormulaMergeStrategy#PANIC}. */ - protected LinkedHashSet importOrPanicLHS(final LinkedHashSet formulas) { + protected LinkedHashSet importOrPanicLhs(final LinkedHashSet formulas) { if (formulaMergeStrategy == FormulaFactoryConfig.FormulaMergeStrategy.USE_BUT_NO_IMPORT) { return formulas; } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/FormulaFunction.java b/core/src/main/java/com/booleworks/logicng/formulas/FormulaFunction.java index 2965c409..985a2c52 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/FormulaFunction.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/FormulaFunction.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.formulas; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; /** @@ -22,7 +22,7 @@ public interface FormulaFunction { * @param formula the input formula * @return the result of the application */ - LNGResult apply(Formula formula, ComputationHandler handler); + LngResult apply(Formula formula, ComputationHandler handler); /** * Applies this function to a given formula. diff --git a/core/src/main/java/com/booleworks/logicng/formulas/FormulaTransformation.java b/core/src/main/java/com/booleworks/logicng/formulas/FormulaTransformation.java index 93805bc7..9b17319d 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/FormulaTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/FormulaTransformation.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.formulas; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; /** @@ -22,7 +22,7 @@ public interface FormulaTransformation { * @param handler the computation handler * @return the LNGResult with the transformed formula */ - LNGResult apply(Formula formula, ComputationHandler handler); + LngResult apply(Formula formula, ComputationHandler handler); /** * Performs the transformation. diff --git a/core/src/main/java/com/booleworks/logicng/formulas/Or.java b/core/src/main/java/com/booleworks/logicng/formulas/Or.java index 9157d06c..e1df3e00 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/Or.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/Or.java @@ -31,5 +31,5 @@ default boolean evaluate(final Assignment assignment) { return false; } - boolean isCNFClause(); + boolean isCnfClause(); } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/PBConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/PbConstraint.java similarity index 95% rename from core/src/main/java/com/booleworks/logicng/formulas/PBConstraint.java rename to core/src/main/java/com/booleworks/logicng/formulas/PbConstraint.java index e9bfa193..49cb7f32 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/PBConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/PbConstraint.java @@ -4,8 +4,8 @@ package com.booleworks.logicng.formulas; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.Assignment; import com.booleworks.logicng.datastructures.Substitution; import com.booleworks.logicng.datastructures.Tristate; @@ -27,7 +27,7 @@ * @version 3.0.0 * @since 1.0 */ -public interface PBConstraint extends Formula { +public interface PbConstraint extends Formula { Iterator ITERATOR = new Iterator<>() { @Override public boolean hasNext() { @@ -127,7 +127,7 @@ static Tristate evaluateCoeffs(final int minValue, final int maxValue, final int * {@code false} otherwise. * @return {@code true} if this constraint is a cardinality constraint */ - default boolean isCC() { + default boolean isCc() { return false; } @@ -163,8 +163,8 @@ default boolean isExo() { * @return the normalized constraint */ default Formula normalize(final FormulaFactory f) { - final LNGVector normPs = new LNGVector<>(getOperands().size()); - final LNGIntVector normCs = new LNGIntVector(getOperands().size()); + final LngVector normPs = new LngVector<>(getOperands().size()); + final LngIntVector normCs = new LngIntVector(getOperands().size()); int normRhs; switch (comparator()) { case EQ: @@ -214,7 +214,7 @@ default Formula normalize(final FormulaFactory f) { * @param rhs the right-hand side * @return the normalized constraint */ - private Formula normalize(final FormulaFactory f, final LNGVector ps, final LNGIntVector cs, + private Formula normalize(final FormulaFactory f, final LngVector ps, final LngIntVector cs, final int rhs) { int c = rhs; int newSize = 0; @@ -240,7 +240,7 @@ private Formula normalize(final FormulaFactory f, final LNGVector ps, f var2consts.put(x, new Pair<>(consts.getFirst(), consts.getSecond() + cs.get(i))); } } - final LNGVector> csps = new LNGVector<>(var2consts.size()); + final LngVector> csps = new LngVector<>(var2consts.size()); for (final Map.Entry> all : var2consts.entrySet()) { if (all.getValue().getFirst() < all.getValue().getSecond()) { c -= all.getValue().getFirst(); @@ -327,7 +327,7 @@ default boolean containsVariable(final Variable variable) { @Override default boolean evaluate(final Assignment assignment) { - final int lhs = evaluateLHS(assignment); + final int lhs = evaluateLhs(assignment); return evaluateComparator(lhs); } @@ -358,16 +358,16 @@ default Formula restrict(final FormulaFactory f, final Assignment assignment) { return f.constant(evaluateComparator(lhsFixed)); } - final int newRHS = getRhs() - lhsFixed; + final int newRhs = getRhs() - lhsFixed; if (comparator() != CType.EQ) { - final Tristate fixed = evaluateCoeffs(minValue, maxValue, newRHS, comparator()); + final Tristate fixed = evaluateCoeffs(minValue, maxValue, newRhs, comparator()); if (fixed == Tristate.TRUE) { return f.verum(); } else if (fixed == Tristate.FALSE) { return f.falsum(); } } - return f.pbc(comparator(), newRHS, newLits, newCoeffs); + return f.pbc(comparator(), newRhs, newLits, newCoeffs); } @Override @@ -446,7 +446,7 @@ default Formula negate(final FormulaFactory f) { * @param assignment the assignment * @return the evaluation of the left-hand side of this constraint */ - private int evaluateLHS(final Assignment assignment) { + private int evaluateLhs(final Assignment assignment) { int lhs = 0; for (int i = 0; i < getOperands().size(); i++) { if (getOperands().get(i).evaluate(assignment)) { diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactory.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactory.java index 12c02725..a963c5f7 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactory.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactory.java @@ -20,7 +20,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.Or; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.formulas.cache.CacheEntry; import com.booleworks.logicng.util.Pair; @@ -46,12 +46,12 @@ public class CachingFormulaFactory extends FormulaFactory { Map, Or> ors3; Map, Or> ors4; Map, Or> orsN; - Map pbConstraints; - Map cardinalityConstraints; + Map pbConstraints; + Map cardinalityConstraints; Map> transformationCache; Map> predicateCache; Map> functionCache; - Map> pbEncodingCache; + Map> pbEncodingCache; /** * Constructor for a new formula factory with the default configuration. @@ -110,7 +110,7 @@ protected Formula internalNot(final Formula operand) { */ @Override protected Formula internalAnd(final LinkedHashSet operandsIn) { - final LinkedHashSet operands = importOrPanicLHS(operandsIn); + final LinkedHashSet operands = importOrPanicLhs(operandsIn); And tempAnd = null; Map, And> opAndMap = andsN; if (operands.size() > 1) { @@ -172,7 +172,7 @@ protected Formula internalAnd(final LinkedHashSet operandsIn) @Override protected Formula internalCnf(final LinkedHashSet clausesIn) { - final LinkedHashSet clauses = importOrPanicLHS(clausesIn); + final LinkedHashSet clauses = importOrPanicLhs(clausesIn); if (clauses.isEmpty()) { return verum(); } @@ -205,7 +205,7 @@ protected Formula internalCnf(final LinkedHashSet clausesIn) @Override protected Formula internalOr(final LinkedHashSet operandsIn) { - final LinkedHashSet operands = importOrPanicLHS(operandsIn); + final LinkedHashSet operands = importOrPanicLhs(operandsIn); Or tempOr = null; Map, Or> opOrMap = orsN; if (operands.size() > 1) { @@ -267,7 +267,7 @@ protected Formula internalOr(final LinkedHashSet operandsIn) @Override protected Formula internalClause(final LinkedHashSet literalsIn) { - final LinkedHashSet literals = importOrPanicLHS(literalsIn); + final LinkedHashSet literals = importOrPanicLhs(literalsIn); if (literals.isEmpty()) { return falsum(); } @@ -324,10 +324,10 @@ protected Literal internalNegativeLiteral(final String name) { @Override protected Formula internalPbc(final List literals, final List coefficients, final CType comparator, final int rhs) { - final PBOperands operands = new PBOperands(literals, coefficients, comparator, rhs); - PBConstraint constraint = pbConstraints.get(operands); + final PbOperands operands = new PbOperands(literals, coefficients, comparator, rhs); + PbConstraint constraint = pbConstraints.get(operands); if (constraint == null) { - constraint = new LngCachedPBConstraint(literals, coefficients, comparator, rhs, this); + constraint = new LngCachedPbConstraint(literals, coefficients, comparator, rhs, this); pbConstraints.put(operands, constraint); } return constraint; @@ -335,7 +335,7 @@ protected Formula internalPbc(final List literals, final List @Override protected Formula internalCc(final List literals, final CType comparator, final int rhs) { - final CCOperands operands = new CCOperands(literals, comparator, rhs); + final CcOperands operands = new CcOperands(literals, comparator, rhs); CardinalityConstraint constraint = cardinalityConstraints.get(operands); if (constraint == null) { constraint = new LngCachedCardinalityConstraint(importOrPanic(literals), comparator, rhs, this); @@ -344,8 +344,8 @@ protected Formula internalCc(final List literals, final CType return constraint; } - private void setCnfCaches(final Formula formula, final boolean isCNF) { - if (isCNF) { + private void setCnfCaches(final Formula formula, final boolean isCnf) { + if (isCnf) { predicateCache.computeIfAbsent(IS_CNF, k -> new HashMap<>()).put(formula, true); transformationCache.computeIfAbsent(FACTORIZED_CNF, k -> new HashMap<>()).put(formula, formula); } else { @@ -485,7 +485,7 @@ public String toString() { /** * Helper class for the operands of a pseudo-Boolean constraint. */ - private final static class PBOperands { + private final static class PbOperands { private final List literals; private final List coefficients; private final CType comparator; @@ -498,7 +498,7 @@ private final static class PBOperands { * @param comparator the comparator of the constraint * @param rhs the right-hand side of the constraint */ - public PBOperands(final List literals, final List coefficients, + public PbOperands(final List literals, final List coefficients, final CType comparator, final int rhs) { this.literals = literals; this.coefficients = coefficients; @@ -516,8 +516,8 @@ public boolean equals(final Object other) { if (this == other) { return true; } - if (other instanceof PBOperands) { - final PBOperands o = (PBOperands) other; + if (other instanceof PbOperands) { + final PbOperands o = (PbOperands) other; return rhs == o.rhs && comparator == o.comparator && coefficients.equals(o.coefficients) && literals.equals(o.literals); } @@ -528,7 +528,7 @@ public boolean equals(final Object other) { /** * Helper class for the operands of a cardinality constraint. */ - private final static class CCOperands { + private final static class CcOperands { private final List literals; private final CType comparator; private final int rhs; @@ -539,7 +539,7 @@ private final static class CCOperands { * @param comparator the comparator of the constraint * @param rhs the right-hand side of the constraint */ - public CCOperands(final List literals, final CType comparator, final int rhs) { + public CcOperands(final List literals, final CType comparator, final int rhs) { this.literals = literals; this.comparator = comparator; this.rhs = rhs; @@ -555,8 +555,8 @@ public boolean equals(final Object other) { if (this == other) { return true; } - if (other instanceof CCOperands) { - final CCOperands o = (CCOperands) other; + if (other instanceof CcOperands) { + final CcOperands o = (CcOperands) other; return rhs == o.rhs && comparator == o.comparator && literals.equals(o.literals); } return false; diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedCardinalityConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedCardinalityConstraint.java index c3692125..60ddd9bf 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedCardinalityConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedCardinalityConstraint.java @@ -11,7 +11,7 @@ import java.util.Collections; import java.util.List; -public class LngCachedCardinalityConstraint extends LngCachedPBConstraint implements CardinalityConstraint { +public class LngCachedCardinalityConstraint extends LngCachedPbConstraint implements CardinalityConstraint { /** * Constructs a new cardinality constraint. diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedOr.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedOr.java index 7555c3fe..f6f02d4f 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedOr.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedOr.java @@ -28,7 +28,7 @@ public class LngCachedOr extends LngCachedNAryOperator implements Or { * @return {@code true} if this formula is a CNF clause */ @Override - public boolean isCNFClause() { + public boolean isCnfClause() { return f.getPredicateCacheForType(PredicateCacheEntry.IS_CNF).get(this) == Boolean.TRUE; } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPBConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPbConstraint.java similarity index 91% rename from core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPBConstraint.java rename to core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPbConstraint.java index 85c789ff..6b4df38c 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPBConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/cached/LngCachedPbConstraint.java @@ -10,13 +10,13 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import java.util.Collection; import java.util.Collections; import java.util.List; -public class LngCachedPBConstraint extends LngCachedFormula implements PBConstraint { +public class LngCachedPbConstraint extends LngCachedFormula implements PbConstraint { protected final List literals; protected final List coefficients; @@ -35,7 +35,7 @@ public class LngCachedPBConstraint extends LngCachedFormula implements PBConstra * @throws IllegalArgumentException if the number of literals and * coefficients do not correspond */ - LngCachedPBConstraint(final Collection literals, final Collection coefficients, + LngCachedPbConstraint(final Collection literals, final Collection coefficients, final CType comparator, final int rhs, final CachingFormulaFactory f) { super(FType.PBC, f); @@ -111,8 +111,8 @@ public boolean equals(final Object other) { // the caching formula factory would have produced the same object return false; } - if (other instanceof PBConstraint && hashCode() == other.hashCode()) { - final PBConstraint o = (PBConstraint) other; + if (other instanceof PbConstraint && hashCode() == other.hashCode()) { + final PbConstraint o = (PbConstraint) other; return rhs == o.getRhs() && comparator == o.comparator() && coefficients.equals(o.getCoefficients()) && literals.equals(o.getOperands()); } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeCardinalityConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeCardinalityConstraint.java index a4359764..6a2a284b 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeCardinalityConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeCardinalityConstraint.java @@ -11,7 +11,7 @@ import java.util.Collections; import java.util.List; -public class LngNativeCardinalityConstraint extends LngNativePBConstraint implements CardinalityConstraint { +public class LngNativeCardinalityConstraint extends LngNativePbConstraint implements CardinalityConstraint { /** * Constructs a new cardinality constraint. diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeOr.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeOr.java index eef94efa..9b296415 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeOr.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativeOr.java @@ -27,7 +27,7 @@ public class LngNativeOr extends LngNativeNAryOperator implements Or { * @return {@code true} if this formula is a CNF clause */ @Override - public boolean isCNFClause() { + public boolean isCnfClause() { return operands.stream().allMatch(op -> op.getType() == FType.LITERAL); } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePBConstraint.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePbConstraint.java similarity index 90% rename from core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePBConstraint.java rename to core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePbConstraint.java index b7bdb386..74896bbd 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePBConstraint.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/LngNativePbConstraint.java @@ -10,12 +10,12 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import java.util.Collection; import java.util.List; -public class LngNativePBConstraint extends LngNativeFormula implements PBConstraint { +public class LngNativePbConstraint extends LngNativeFormula implements PbConstraint { protected final List literals; protected final List coefficients; @@ -34,7 +34,7 @@ public class LngNativePBConstraint extends LngNativeFormula implements PBConstra * @throws IllegalArgumentException if the number of literals and * coefficients do not correspond */ - LngNativePBConstraint(final Collection literals, final Collection coefficients, + LngNativePbConstraint(final Collection literals, final Collection coefficients, final CType comparator, final int rhs, final NonCachingFormulaFactory f) { super(FType.PBC, f); @@ -98,8 +98,8 @@ public boolean equals(final Object other) { if (this == other) { return true; } - if (other instanceof PBConstraint && hashCode() == other.hashCode()) { - final PBConstraint o = (PBConstraint) other; + if (other instanceof PbConstraint && hashCode() == other.hashCode()) { + final PbConstraint o = (PbConstraint) other; return rhs == o.getRhs() && comparator == o.comparator() && coefficients.equals(o.getCoefficients()) && literals.equals(o.getOperands()); } diff --git a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/NonCachingFormulaFactory.java b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/NonCachingFormulaFactory.java index 4d28fb74..12ee1486 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/NonCachingFormulaFactory.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/implementation/noncaching/NonCachingFormulaFactory.java @@ -64,7 +64,7 @@ protected Formula internalNot(final Formula operand) { */ @Override protected Formula internalAnd(final LinkedHashSet operandsIn) { - final LinkedHashSet operands = importOrPanicLHS(operandsIn); + final LinkedHashSet operands = importOrPanicLhs(operandsIn); final LinkedHashSet condensedOperands = operands.size() < 2 ? operands : condenseOperandsAnd(operands); if (condensedOperands == null) { @@ -81,7 +81,7 @@ protected Formula internalAnd(final LinkedHashSet operandsIn) @Override protected Formula internalCnf(final LinkedHashSet clausesIn) { - final LinkedHashSet clauses = importOrPanicLHS(clausesIn); + final LinkedHashSet clauses = importOrPanicLhs(clausesIn); if (clauses.isEmpty()) { return verum(); } @@ -93,7 +93,7 @@ protected Formula internalCnf(final LinkedHashSet clausesIn) @Override protected Formula internalOr(final LinkedHashSet operandsIn) { - final LinkedHashSet operands = importOrPanicLHS(operandsIn); + final LinkedHashSet operands = importOrPanicLhs(operandsIn); final LinkedHashSet condensedOperands = operands.size() < 2 ? operands : condenseOperandsOr(operands); if (condensedOperands == null) { @@ -110,7 +110,7 @@ protected Formula internalOr(final LinkedHashSet operandsIn) @Override protected Formula internalClause(final LinkedHashSet literalsIn) { - final LinkedHashSet literals = importOrPanicLHS(literalsIn); + final LinkedHashSet literals = importOrPanicLhs(literalsIn); if (literals.isEmpty()) { return falsum(); } @@ -146,7 +146,7 @@ protected Literal internalNegativeLiteral(final String name) { @Override protected Formula internalPbc(final List literals, final List coefficients, final CType comparator, final int rhs) { - return new LngNativePBConstraint(literals, coefficients, comparator, rhs, this); + return new LngNativePbConstraint(literals, coefficients, comparator, rhs, this); } @Override diff --git a/core/src/main/java/com/booleworks/logicng/formulas/printer/FormulaStringRepresentation.java b/core/src/main/java/com/booleworks/logicng/formulas/printer/FormulaStringRepresentation.java index 1ec50701..1f9eb9e6 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/printer/FormulaStringRepresentation.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/printer/FormulaStringRepresentation.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import java.util.List; @@ -67,7 +67,7 @@ protected String toInnerString(final Formula formula) { final String naryOp = formula.getType() == FType.AND ? and() : or(); return naryOperator(nary, naryOp); case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; return pbLhs(pbc.getOperands(), pbc.getCoefficients()) + pbComparator(pbc.comparator()) + pbc.getRhs(); default: throw new IllegalArgumentException("Cannot print the unknown formula type " + formula.getType()); diff --git a/core/src/main/java/com/booleworks/logicng/formulas/printer/SortedStringRepresentation.java b/core/src/main/java/com/booleworks/logicng/formulas/printer/SortedStringRepresentation.java index 2f395964..61fa9851 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/printer/SortedStringRepresentation.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/printer/SortedStringRepresentation.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import java.util.ArrayList; @@ -120,7 +120,7 @@ public String toInnerString(final Formula formula) { final String op = formula.getType() == FType.AND ? and() : or(); return naryOperator(nary, String.format("%s", op)); case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; return String.format("%s%s%d", pbLhs(pbc.getOperands(), pbc.getCoefficients()), pbComparator(pbc.comparator()), pbc.getRhs()); default: diff --git a/core/src/main/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentation.java b/core/src/main/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentation.java similarity index 98% rename from core/src/main/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentation.java rename to core/src/main/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentation.java index 3559e012..c422f2e5 100644 --- a/core/src/main/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentation.java +++ b/core/src/main/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentation.java @@ -17,7 +17,7 @@ * @version 1.1 * @since 1.0 */ -public final class UTF8StringRepresentation extends FormulaStringRepresentation { +public final class Utf8StringRepresentation extends FormulaStringRepresentation { private static final Pattern pattern = Pattern.compile("(.*?)(\\d*)"); diff --git a/core/src/main/java/com/booleworks/logicng/functions/FormulaDepthFunction.java b/core/src/main/java/com/booleworks/logicng/functions/FormulaDepthFunction.java index 78a4c949..a451e1c4 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/FormulaDepthFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/FormulaDepthFunction.java @@ -8,7 +8,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.Map; @@ -41,10 +41,10 @@ public FormulaDepthFunction(final FormulaFactory f, final Map } @Override - public LNGResult apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, ComputationHandler handler) { final Integer cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } final int result; if (formula.isAtomicFormula()) { @@ -57,6 +57,6 @@ public LNGResult apply(final Formula formula, ComputationHandler handle result = maxDepth + 1; } setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/LiteralProfileFunction.java b/core/src/main/java/com/booleworks/logicng/functions/LiteralProfileFunction.java index 62441594..1f3fb224 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/LiteralProfileFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/LiteralProfileFunction.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.HashMap; import java.util.Map; @@ -51,8 +51,8 @@ public LiteralProfileFunction(final FormulaFactory f, final Map> apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(hasCache() ? cachingLiteralProfile(formula) : nonCachingLiteralProfile(formula)); + public LngResult> apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(hasCache() ? cachingLiteralProfile(formula) : nonCachingLiteralProfile(formula)); } /** diff --git a/core/src/main/java/com/booleworks/logicng/functions/LiteralsFunction.java b/core/src/main/java/com/booleworks/logicng/functions/LiteralsFunction.java index dd1dfed4..ae5cb864 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/LiteralsFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/LiteralsFunction.java @@ -10,10 +10,10 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.util.FormulaHelper; import java.util.Collections; @@ -49,10 +49,10 @@ public LiteralsFunction(final FormulaFactory f, final Map> apply(final Formula formula, final ComputationHandler handler) { + public LngResult> apply(final Formula formula, final ComputationHandler handler) { final SortedSet cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } SortedSet result = new TreeSet<>(); switch (formula.getType()) { @@ -83,7 +83,7 @@ public LNGResult> apply(final Formula formula, final Computat } break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; result = FormulaHelper.literals(f, pbc.getOperands()); break; default: @@ -91,6 +91,6 @@ public LNGResult> apply(final Formula formula, final Computat } result = Collections.unmodifiableSortedSet(result); setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/MinimumPrimeImplicantFunction.java b/core/src/main/java/com/booleworks/logicng/functions/MinimumPrimeImplicantFunction.java index 1491be65..18195f2d 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/MinimumPrimeImplicantFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/MinimumPrimeImplicantFunction.java @@ -11,10 +11,10 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.OptimizationFunction; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.transformations.LiteralSubstitution; import java.util.HashMap; @@ -39,7 +39,7 @@ public MinimumPrimeImplicantFunction(final FormulaFactory f) { } @Override - public LNGResult> apply(final Formula formula, final ComputationHandler handler) { + public LngResult> apply(final Formula formula, final ComputationHandler handler) { final Formula nnf = formula.nnf(f); final Map newVar2oldLit = new HashMap<>(); final Map substitution = new HashMap<>(); @@ -50,8 +50,8 @@ public LNGResult> apply(final Formula formula, final Computat } final LiteralSubstitution substTransformation = new LiteralSubstitution(f, substitution); final Formula substituted = nnf.transform(substTransformation); - final SATSolver solver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); solver.add(substituted); for (final Literal literal : newVar2oldLit.values()) { if (literal.getPhase() && newVar2oldLit.containsValue(literal.negate(f))) { @@ -62,10 +62,10 @@ public LNGResult> apply(final Formula formula, final Computat throw new IllegalArgumentException("The given formula must be satisfiable"); } - final LNGResult minimumModel = + final LngResult minimumModel = solver.execute(OptimizationFunction.minimize(newVar2oldLit.keySet()), handler); if (!minimumModel.isSuccess()) { - return LNGResult.canceled(minimumModel.getCancelCause()); + return LngResult.canceled(minimumModel.getCancelCause()); } final SortedSet primeImplicant = new TreeSet<>(); for (final Variable variable : minimumModel.getResult().positiveVariables()) { @@ -74,6 +74,6 @@ public LNGResult> apply(final Formula formula, final Computat primeImplicant.add(literal); } } - return LNGResult.of(primeImplicant); + return LngResult.of(primeImplicant); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/NumberOfAtomsFunction.java b/core/src/main/java/com/booleworks/logicng/functions/NumberOfAtomsFunction.java index d753865a..bb149fad 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/NumberOfAtomsFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/NumberOfAtomsFunction.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.Map; @@ -43,10 +43,10 @@ public NumberOfAtomsFunction(final FormulaFactory f, final Map ca } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Long cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } long result = 0L; switch (formula.getType()) { @@ -76,6 +76,6 @@ public LNGResult apply(final Formula formula, final ComputationHandler han throw new IllegalStateException("Unknown formula type " + formula.getType()); } setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/NumberOfNodesFunction.java b/core/src/main/java/com/booleworks/logicng/functions/NumberOfNodesFunction.java index 8567aabb..539e60bd 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/NumberOfNodesFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/NumberOfNodesFunction.java @@ -9,10 +9,10 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.Map; @@ -44,10 +44,10 @@ public NumberOfNodesFunction(final FormulaFactory f, final Map ca } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Long cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } long result; switch (formula.getType()) { @@ -73,7 +73,7 @@ public LNGResult apply(final Formula formula, final ComputationHandler han } break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; result = 1L + pbc.getOperands().size(); break; case PREDICATE: @@ -83,6 +83,6 @@ public LNGResult apply(final Formula formula, final ComputationHandler han throw new IllegalStateException("Unknown formula type " + formula.getType()); } setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/SubNodeFunction.java b/core/src/main/java/com/booleworks/logicng/functions/SubNodeFunction.java index 50c709ae..87c26580 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/SubNodeFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/SubNodeFunction.java @@ -8,7 +8,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.LinkedHashSet; import java.util.Map; @@ -43,10 +43,10 @@ public SubNodeFunction(final FormulaFactory f, final Map> apply(final Formula formula, final ComputationHandler handler) { + public LngResult> apply(final Formula formula, final ComputationHandler handler) { final LinkedHashSet cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } final LinkedHashSet result = new LinkedHashSet<>(); for (final Formula op : formula) { @@ -56,6 +56,6 @@ public LNGResult> apply(final Formula formula, final Comp } result.add(formula); setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/functions/VariableProfileFunction.java b/core/src/main/java/com/booleworks/logicng/functions/VariableProfileFunction.java index 24712619..be6f5ee7 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/VariableProfileFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/VariableProfileFunction.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.HashMap; import java.util.Map; @@ -52,8 +52,8 @@ public VariableProfileFunction(final FormulaFactory f, final Map> apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(hasCache() ? cachingVariableProfile(formula) : nonCachingVariableProfile(formula)); + public LngResult> apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(hasCache() ? cachingVariableProfile(formula) : nonCachingVariableProfile(formula)); } /** diff --git a/core/src/main/java/com/booleworks/logicng/functions/VariablesFunction.java b/core/src/main/java/com/booleworks/logicng/functions/VariablesFunction.java index 0fd71e7f..087ff5fa 100644 --- a/core/src/main/java/com/booleworks/logicng/functions/VariablesFunction.java +++ b/core/src/main/java/com/booleworks/logicng/functions/VariablesFunction.java @@ -10,11 +10,11 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.formulas.cache.FunctionCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.util.FormulaHelper; import java.util.Collections; @@ -50,10 +50,10 @@ public VariablesFunction(final FormulaFactory f, final Map> apply(final Formula formula, final ComputationHandler handler) { + public LngResult> apply(final Formula formula, final ComputationHandler handler) { final SortedSet cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } SortedSet result = new TreeSet<>(); switch (formula.getType()) { @@ -84,7 +84,7 @@ public LNGResult> apply(final Formula formula, final Computa } break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; result = FormulaHelper.variables(f, pbc.literals(f)); break; default: @@ -92,6 +92,6 @@ public LNGResult> apply(final Formula formula, final Computa } result = Collections.unmodifiableSortedSet(result); setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/graphs/generators/HypergraphGenerator.java b/core/src/main/java/com/booleworks/logicng/graphs/generators/HypergraphGenerator.java index 6aa6aa4a..73be94d1 100644 --- a/core/src/main/java/com/booleworks/logicng/graphs/generators/HypergraphGenerator.java +++ b/core/src/main/java/com/booleworks/logicng/graphs/generators/HypergraphGenerator.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.graphs.datastructures.Hypergraph; import com.booleworks.logicng.graphs.datastructures.HypergraphNode; -import com.booleworks.logicng.predicates.CNFPredicate; +import com.booleworks.logicng.predicates.CnfPredicate; import java.util.Arrays; import java.util.HashMap; @@ -35,8 +35,8 @@ public final class HypergraphGenerator { * @param cnf the list of clauses of the CNF for the hyper-graph * @return the hyper-graph for the CNF formula */ - public static Hypergraph fromCNF(final FormulaFactory f, final Formula... cnf) { - return fromCNF(f, Arrays.asList(cnf)); + public static Hypergraph fromCnf(final FormulaFactory f, final Formula... cnf) { + return fromCnf(f, Arrays.asList(cnf)); } /** @@ -47,7 +47,7 @@ public static Hypergraph fromCNF(final FormulaFactory f, final Formula * @param cnf the list of clauses of the CNF for the hyper-graph * @return the hyper-graph for the CNF formula */ - public static Hypergraph fromCNF(final FormulaFactory f, final List cnf) { + public static Hypergraph fromCnf(final FormulaFactory f, final List cnf) { final Hypergraph hypergraph = new Hypergraph<>(); final Map> nodes = new HashMap<>(); for (final Formula clause : cnf) { @@ -76,8 +76,8 @@ public static Hypergraph fromCNF(final FormulaFactory f, final List fromCNF(final FormulaFactory f, final Formula cnf) { - if (!cnf.holds(new CNFPredicate(cnf.getFactory(), null))) { + public static Hypergraph fromCnf(final FormulaFactory f, final Formula cnf) { + if (!cnf.holds(new CnfPredicate(cnf.getFactory(), null))) { throw new IllegalArgumentException("Cannot generate a hypergraph from a non-cnf formula"); } final Hypergraph hypergraph = new Hypergraph<>(); diff --git a/core/src/main/java/com/booleworks/logicng/handlers/ComputationHandler.java b/core/src/main/java/com/booleworks/logicng/handlers/ComputationHandler.java index a16d140b..6d545851 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/ComputationHandler.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/ComputationHandler.java @@ -1,6 +1,6 @@ package com.booleworks.logicng.handlers; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * Interface for a computation handler. @@ -14,5 +14,5 @@ public interface ComputationHandler { * @param event the event to handle, must not be {@code null} * @return whether the computation should be resumed or not */ - boolean shouldResume(LNGEvent event); + boolean shouldResume(LngEvent event); } diff --git a/core/src/main/java/com/booleworks/logicng/handlers/LNGResult.java b/core/src/main/java/com/booleworks/logicng/handlers/LngResult.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/handlers/LNGResult.java rename to core/src/main/java/com/booleworks/logicng/handlers/LngResult.java index 0a4697de..df3901cf 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/LNGResult.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/LngResult.java @@ -1,6 +1,6 @@ package com.booleworks.logicng.handlers; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import java.util.Objects; import java.util.function.Function; @@ -17,12 +17,12 @@ * @version 3.0.0 * @since 3.0.0 */ -public class LNGResult { +public class LngResult { protected final RESULT result; - protected final LNGEvent cancelCause; + protected final LngEvent cancelCause; - protected LNGResult(final RESULT result, final LNGEvent cancelCause) { + protected LngResult(final RESULT result, final LngEvent cancelCause) { this.result = result; this.cancelCause = cancelCause; } @@ -35,11 +35,11 @@ protected LNGResult(final RESULT result, final LNGEvent cancelCause) { * @param the type of the result * @return the LNG result */ - public static LNGResult of(final RESULT result) { + public static LngResult of(final RESULT result) { if (result == null) { throw new IllegalArgumentException("result cannot be null"); } - return new LNGResult<>(result, null); + return new LngResult<>(result, null); } /** @@ -50,11 +50,11 @@ public static LNGResult of(final RESULT result) { * @param the type of the result * @return the LNG result */ - public static LNGResult canceled(final LNGEvent cancelCause) { + public static LngResult canceled(final LngEvent cancelCause) { if (cancelCause == null) { throw new IllegalArgumentException("event cannot be null"); } - return new LNGResult<>(null, cancelCause); + return new LngResult<>(null, cancelCause); } /** @@ -66,8 +66,8 @@ public static LNGResult canceled(final LNGEvent cancelCause) { * @param the type of the result * @return the LNG result */ - public static LNGResult partial(final RESULT partialResult, final LNGEvent cancelCause) { - return new LNGResult<>(partialResult, cancelCause); + public static LngResult partial(final RESULT partialResult, final LngEvent cancelCause) { + return new LngResult<>(partialResult, cancelCause); } /** @@ -98,7 +98,7 @@ public RESULT getPartialResult() { * computation finished successfully. * @return the event which canceled the computation */ - public LNGEvent getCancelCause() { + public LngEvent getCancelCause() { return cancelCause; } @@ -117,7 +117,7 @@ public boolean isSuccess() { * has a partial result. Returns {@code false} if the computation of this * result was canceled without partial result or successful. * @return {@code true} if the computation of this result was canceled and - * has a partial result + * has a partial result */ public boolean isPartial() { return result != null && cancelCause != null; @@ -132,8 +132,8 @@ public boolean isPartial() { * @param the type of the new result * @return the transformed LNG result */ - public LNGResult map(final Function transformation) { - return new LNGResult<>(result != null ? transformation.apply(result) : null, cancelCause); + public LngResult map(final Function transformation) { + return new LngResult<>(result != null ? transformation.apply(result) : null, cancelCause); } @Override @@ -144,7 +144,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final LNGResult that = (LNGResult) o; + final LngResult that = (LngResult) o; return Objects.equals(result, that.result) && Objects.equals(cancelCause, that.cancelCause); } diff --git a/core/src/main/java/com/booleworks/logicng/handlers/NopHandler.java b/core/src/main/java/com/booleworks/logicng/handlers/NopHandler.java index 453f1274..f63dbc79 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/NopHandler.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/NopHandler.java @@ -1,6 +1,6 @@ package com.booleworks.logicng.handlers; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * A computation handler which never cancels the computation. @@ -25,7 +25,7 @@ public static NopHandler get() { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { return true; } } diff --git a/core/src/main/java/com/booleworks/logicng/handlers/NumberOfModelsHandler.java b/core/src/main/java/com/booleworks/logicng/handlers/NumberOfModelsHandler.java index a9f18d34..4f9f3b5e 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/NumberOfModelsHandler.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/NumberOfModelsHandler.java @@ -6,7 +6,7 @@ import com.booleworks.logicng.handlers.events.ComputationStartedEvent; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.SimpleEvent; /** @@ -44,7 +44,7 @@ public NumberOfModelsHandler(final int bound) { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == ComputationStartedEvent.MODEL_ENUMERATION_STARTED) { countCommitted = 0; countUncommitted = 0; diff --git a/core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandler.java b/core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandler.java similarity index 83% rename from core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandler.java rename to core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandler.java index b8ab6cab..2ce3efee 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandler.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandler.java @@ -7,7 +7,7 @@ import static com.booleworks.logicng.handlers.events.ComputationStartedEvent.BDD_COMPUTATION_STARTED; import static com.booleworks.logicng.handlers.events.SimpleEvent.BDD_NEW_REF_ADDED; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * A BDD handler which cancels the build process after a given number of added @@ -15,7 +15,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class NumberOfNodesBDDHandler implements ComputationHandler { +public class NumberOfNodesBddHandler implements ComputationHandler { private boolean canceled = false; private final int bound; @@ -26,7 +26,7 @@ public class NumberOfNodesBDDHandler implements ComputationHandler { * nodes (inclusive). * @param bound the upper bound */ - public NumberOfNodesBDDHandler(final int bound) { + public NumberOfNodesBddHandler(final int bound) { if (bound < 0) { throw new IllegalArgumentException("The bound for added nodes must be equal or greater than 0."); } @@ -34,7 +34,7 @@ public NumberOfNodesBDDHandler(final int bound) { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == BDD_COMPUTATION_STARTED) { count = 0; } else if (event == BDD_NEW_REF_ADDED) { diff --git a/core/src/main/java/com/booleworks/logicng/handlers/TimeoutHandler.java b/core/src/main/java/com/booleworks/logicng/handlers/TimeoutHandler.java index 242592c8..5eab025c 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/TimeoutHandler.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/TimeoutHandler.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.handlers; import com.booleworks.logicng.handlers.events.ComputationStartedEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * A generic timeout handler. @@ -57,7 +57,7 @@ public TimeoutHandler(final long timeout) { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event instanceof ComputationStartedEvent) { if (type == TimerType.RESTARTING_TIMEOUT || designatedEnd == 0) { designatedEnd = System.currentTimeMillis() + timeout; diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationFinishedEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationFinishedEvent.java index 4ef78fe8..59592bb1 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationFinishedEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationFinishedEvent.java @@ -3,7 +3,7 @@ import com.booleworks.logicng.handlers.ComputationHandler; /** - * A class for {@link LNGEvent}s which indicate the end of a computation. + * A class for {@link LngEvent}s which indicate the end of a computation. * By convention, these events are instantiated as {@code static final} fields * s.t. they can be checked in {@link ComputationHandler handlers} by using * referential equality. @@ -12,7 +12,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class ComputationFinishedEvent implements LNGEvent { +public class ComputationFinishedEvent implements LngEvent { public static final ComputationFinishedEvent SAT_CALL_FINISHED = new ComputationFinishedEvent("SAT Call"); public static final ComputationFinishedEvent MAX_SAT_CALL_FINISHED = new ComputationFinishedEvent("MaxSAT Call"); diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationStartedEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationStartedEvent.java index 54577a1c..a0bb60db 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationStartedEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/ComputationStartedEvent.java @@ -4,7 +4,7 @@ import com.booleworks.logicng.handlers.TimeoutHandler; /** - * A class for {@link LNGEvent}s which indicate the start of a computation. + * A class for {@link LngEvent}s which indicate the start of a computation. * By convention, these events are instantiated as {@code static final} fields * s.t. they can be checked in {@link ComputationHandler handlers} by using * referential equality. On the other hand, some handlers (like the @@ -15,7 +15,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class ComputationStartedEvent implements LNGEvent { +public class ComputationStartedEvent implements LngEvent { public static final ComputationStartedEvent FACTORIZATION_STARTED = new ComputationStartedEvent("Factorization"); public static final ComputationStartedEvent BDD_COMPUTATION_STARTED = new ComputationStartedEvent("BDD Computation"); diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/EnumerationFoundModelsEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/EnumerationFoundModelsEvent.java index a973e5e4..1d0caa46 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/EnumerationFoundModelsEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/EnumerationFoundModelsEvent.java @@ -11,7 +11,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class EnumerationFoundModelsEvent implements LNGEvent { +public class EnumerationFoundModelsEvent implements LngEvent { private final int numberOfModels; diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/FactorizationCreatedClauseEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/FactorizationCreatedClauseEvent.java index 0dce7957..d5942d4e 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/FactorizationCreatedClauseEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/FactorizationCreatedClauseEvent.java @@ -1,17 +1,17 @@ package com.booleworks.logicng.handlers.events; import com.booleworks.logicng.formulas.Formula; -import com.booleworks.logicng.transformations.cnf.CNFFactorization; -import com.booleworks.logicng.transformations.dnf.DNFFactorization; +import com.booleworks.logicng.transformations.cnf.CnfFactorization; +import com.booleworks.logicng.transformations.dnf.DnfFactorization; /** * An event created when a factorization algorithm (e.g. - * {@link DNFFactorization} or {@link CNFFactorization}) + * {@link DnfFactorization} or {@link CnfFactorization}) * creates a new clause. * @version 3.0.0 * @since 3.0.0 */ -public class FactorizationCreatedClauseEvent implements LNGEvent { +public class FactorizationCreatedClauseEvent implements LngEvent { private final Formula clause; diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/LNGEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/LngEvent.java similarity index 88% rename from core/src/main/java/com/booleworks/logicng/handlers/events/LNGEvent.java rename to core/src/main/java/com/booleworks/logicng/handlers/events/LngEvent.java index ce8de523..6ee690bb 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/LNGEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/LngEvent.java @@ -7,5 +7,5 @@ * @version 3.0.0 * @since 3.0.0 */ -public interface LNGEvent { +public interface LngEvent { } diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewLowerBoundEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewLowerBoundEvent.java index 249a8ffa..17c1bd12 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewLowerBoundEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewLowerBoundEvent.java @@ -1,13 +1,13 @@ package com.booleworks.logicng.handlers.events; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatSolver; /** - * An event created when a {@link MaxSATSolver} found a new lower bound. + * An event created when a {@link MaxSatSolver} found a new lower bound. * @version 3.0.0 * @since 3.0.0 */ -public class MaxSatNewLowerBoundEvent implements LNGEvent { +public class MaxSatNewLowerBoundEvent implements LngEvent { private final int bound; /** diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewUpperBoundEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewUpperBoundEvent.java index 3fd62b02..bc6bc016 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewUpperBoundEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/MaxSatNewUpperBoundEvent.java @@ -1,13 +1,13 @@ package com.booleworks.logicng.handlers.events; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatSolver; /** - * An event created when a {@link MaxSATSolver} found a new upper bound. + * An event created when a {@link MaxSatSolver} found a new upper bound. * @version 3.0.0 * @since 3.0.0 */ -public class MaxSatNewUpperBoundEvent implements LNGEvent { +public class MaxSatNewUpperBoundEvent implements LngEvent { private final int bound; /** diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/OptimizationFoundBetterBoundEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/OptimizationFoundBetterBoundEvent.java index 153da898..ea5d66bb 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/OptimizationFoundBetterBoundEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/OptimizationFoundBetterBoundEvent.java @@ -11,7 +11,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class OptimizationFoundBetterBoundEvent implements LNGEvent { +public class OptimizationFoundBetterBoundEvent implements LngEvent { private final Supplier model; diff --git a/core/src/main/java/com/booleworks/logicng/handlers/events/SimpleEvent.java b/core/src/main/java/com/booleworks/logicng/handlers/events/SimpleEvent.java index 1dada637..ba49cf92 100644 --- a/core/src/main/java/com/booleworks/logicng/handlers/events/SimpleEvent.java +++ b/core/src/main/java/com/booleworks/logicng/handlers/events/SimpleEvent.java @@ -3,7 +3,7 @@ import com.booleworks.logicng.handlers.ComputationHandler; /** - * A class for simple {@link LNGEvent} types which can basically be used + * A class for simple {@link LngEvent} types which can basically be used * as singletons. By convention, simple events are instantiated as * {@code static final} fields s.t. they can be checked in * {@link ComputationHandler handlers} by using referential equality. @@ -12,7 +12,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class SimpleEvent implements LNGEvent { +public class SimpleEvent implements LngEvent { public static final SimpleEvent NO_EVENT = new SimpleEvent("No event"); public static final SimpleEvent DISTRIBUTION_PERFORMED = new SimpleEvent("Distribution performed"); diff --git a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddEdgeStyleMapper.java b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddEdgeStyleMapper.java index 45d8c467..aaa13f9b 100644 --- a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddEdgeStyleMapper.java +++ b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddEdgeStyleMapper.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.io.graphical.generators; import com.booleworks.logicng.io.graphical.GraphicalEdgeStyle; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; /** * An abstract super class for an edge mapper for a graphical representation of @@ -20,7 +20,7 @@ public abstract class BddEdgeStyleMapper extends BddMapper implements EdgeStyleM * constructed with this kernel. * @param kernel a BDD kernel */ - public BddEdgeStyleMapper(final BDDKernel kernel) { + public BddEdgeStyleMapper(final BddKernel kernel) { super(kernel); } diff --git a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGenerator.java b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGenerator.java index 8b5fc255..1b148d15 100644 --- a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGenerator.java +++ b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGenerator.java @@ -4,8 +4,8 @@ package com.booleworks.logicng.io.graphical.generators; -import static com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel.BDD_FALSE; -import static com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel.BDD_TRUE; +import static com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel.BDD_FALSE; +import static com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel.BDD_TRUE; import com.booleworks.logicng.io.graphical.GraphicalColor; import com.booleworks.logicng.io.graphical.GraphicalEdge; @@ -13,15 +13,15 @@ import com.booleworks.logicng.io.graphical.GraphicalNode; import com.booleworks.logicng.io.graphical.GraphicalNodeStyle; import com.booleworks.logicng.io.graphical.GraphicalRepresentation; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; import java.util.Map; import java.util.TreeMap; import java.util.function.Function; /** - * The graphical generator for representations of BDDs {@link BDD}. + * The graphical generator for representations of BDDs {@link Bdd}. * @version 2.4.0 * @since 2.4.0 */ @@ -63,7 +63,7 @@ public static BddGraphicalGeneratorBuilder builder() { * @param bdd the BDD * @return the graphical representation */ - public GraphicalRepresentation translate(final BDD bdd) { + public GraphicalRepresentation translate(final Bdd bdd) { final Map index2Node = new TreeMap<>(); final GraphicalRepresentation graphicalRepresentation = new GraphicalRepresentation(alignTerminals, true, backgroundColor); @@ -79,12 +79,12 @@ public GraphicalRepresentation translate(final BDD bdd) { graphicalRepresentation.addNode(trueNode); index2Node.put(BDD_TRUE, trueNode); } - for (final int[] internalNode : new BDDOperations(bdd.getUnderlyingKernel()).allNodes(bdd.getIndex())) { + for (final int[] internalNode : new BddOperations(bdd.getUnderlyingKernel()).allNodes(bdd.getIndex())) { final int index = internalNode[0]; final String defaultLabel = bdd.getUnderlyingKernel().getVariableForIndex(internalNode[1]).getName(); addNode(index, labelOrDefault(index, defaultLabel), graphicalRepresentation, index2Node); } - for (final int[] internalNode : new BDDOperations(bdd.getUnderlyingKernel()).allNodes(bdd.getIndex())) { + for (final int[] internalNode : new BddOperations(bdd.getUnderlyingKernel()).allNodes(bdd.getIndex())) { final int index = internalNode[0]; final int lowIndex = internalNode[2]; final int highIndex = internalNode[3]; diff --git a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddLabelMapper.java b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddLabelMapper.java index ae7d9154..866b1407 100644 --- a/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddLabelMapper.java +++ b/core/src/main/java/com/booleworks/logicng/io/graphical/generators/BddLabelMapper.java @@ -4,7 +4,7 @@ package com.booleworks.logicng.io.graphical.generators; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; /** * An abstract super class for a label mapper for a graphical representation of @@ -19,7 +19,7 @@ public abstract class BddLabelMapper extends BddMapper implements LabelMapper nodes) { final Pair pbPair = addNode(pbc, pbc.toString(), false, graphicalRepresentation, nodes); diff --git a/core/src/main/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriter.java b/core/src/main/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriter.java index 5b01276e..c4042985 100644 --- a/core/src/main/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriter.java +++ b/core/src/main/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriter.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.functions.LiteralsFunction; import com.booleworks.logicng.functions.VariablesFunction; -import com.booleworks.logicng.predicates.CNFPredicate; +import com.booleworks.logicng.predicates.CnfPredicate; import java.io.BufferedWriter; import java.io.File; @@ -65,7 +65,7 @@ public static void write(final String fileName, final Formula formula, final boo for (final Variable var : new TreeSet<>(formula.apply(vf))) { var2id.put(var, i++); } - if (!formula.holds(new CNFPredicate(formula.getFactory(), null))) { + if (!formula.holds(new CnfPredicate(formula.getFactory(), null))) { throw new IllegalArgumentException("Cannot write a non-CNF formula to dimacs. Convert to CNF first."); } final List parts = new ArrayList<>(); diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDD.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/Bdd.java similarity index 86% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDD.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/Bdd.java index 10895c9f..c990a875 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDD.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/Bdd.java @@ -10,16 +10,16 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDNode; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.BDDCNFFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.BDDDNFFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.BDDFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.BDDModelEnumerationFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.LngBDDFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDConstruction; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDReordering; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddNode; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.BddCnfFunction; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.BddDnfFunction; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.BddFunction; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.BddModelEnumerationFunction; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.LngBddFunction; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddConstruction; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddReordering; import java.math.BigInteger; import java.util.ArrayList; @@ -38,23 +38,23 @@ * @version 3.0.0 * @since 1.4.0 */ -public class BDD { +public class Bdd { private final int index; - protected final BDDKernel kernel; - protected final BDDConstruction construction; - protected final BDDOperations operations; + protected final BddKernel kernel; + protected final BddConstruction construction; + protected final BddOperations operations; /** * Constructs a new BDD with a given index. * @param index the index * @param kernel the kernel of this BDD */ - public BDD(final int index, final BDDKernel kernel) { + public Bdd(final int index, final BddKernel kernel) { this.index = index; this.kernel = kernel; - construction = new BDDConstruction(kernel); - operations = new BDDOperations(kernel); + construction = new BddConstruction(kernel); + operations = new BddOperations(kernel); } /** @@ -73,7 +73,7 @@ public int getIndex() { * accessed when you know, what you are doing. * @return the BDD Kernel */ - public BDDKernel getUnderlyingKernel() { + public BddKernel getUnderlyingKernel() { return kernel; } @@ -83,7 +83,7 @@ public BDDKernel getUnderlyingKernel() { * @param the result type of the function * @return the result of the function application */ - public T apply(final BDDFunction function) { + public T apply(final BddFunction function) { return function.apply(this); } @@ -143,8 +143,8 @@ public Formula toFormula(final FormulaFactory f, final boolean followPathsToTrue * Returns a new BDD which is the negation of this BDD. * @return the negation of this BDD */ - public BDD negate() { - return new BDD(kernel.addRef(construction.not(index), NopHandler.get()), kernel); + public Bdd negate() { + return new Bdd(kernel.addRef(construction.not(index), NopHandler.get()), kernel); } /** @@ -155,11 +155,11 @@ public BDD negate() { * @throws IllegalArgumentException if the two BDDs don't have the same * kernel */ - public BDD implies(final BDD other) { + public Bdd implies(final Bdd other) { if (other.kernel != kernel) { throw new IllegalArgumentException("Only BDDs with the same kernel can be processed"); } - return new BDD(kernel.addRef(construction.implication(index, other.index), NopHandler.get()), kernel); + return new Bdd(kernel.addRef(construction.implication(index, other.index), NopHandler.get()), kernel); } /** @@ -170,11 +170,11 @@ public BDD implies(final BDD other) { * @throws IllegalArgumentException if the two BDDs don't have the same * kernel */ - public BDD impliedBy(final BDD other) { + public Bdd impliedBy(final Bdd other) { if (other.kernel != kernel) { throw new IllegalArgumentException("Only BDDs with the same kernel can be processed"); } - return new BDD(kernel.addRef(construction.implication(other.index, index), NopHandler.get()), kernel); + return new Bdd(kernel.addRef(construction.implication(other.index, index), NopHandler.get()), kernel); } /** @@ -185,11 +185,11 @@ public BDD impliedBy(final BDD other) { * @throws IllegalArgumentException if the two BDDs don't have the same * kernel */ - public BDD equivalence(final BDD other) { + public Bdd equivalence(final Bdd other) { if (other.kernel != kernel) { throw new IllegalArgumentException("Only BDDs with the same kernel can be processed"); } - return new BDD(kernel.addRef(construction.equivalence(index, other.index), NopHandler.get()), kernel); + return new Bdd(kernel.addRef(construction.equivalence(index, other.index), NopHandler.get()), kernel); } /** @@ -200,11 +200,11 @@ public BDD equivalence(final BDD other) { * @throws IllegalArgumentException if the two BDDs don't have the same * kernel */ - public BDD and(final BDD other) { + public Bdd and(final Bdd other) { if (other.kernel != kernel) { throw new IllegalArgumentException("Only BDDs with the same kernel can be processed"); } - return new BDD(kernel.addRef(construction.and(index, other.index), NopHandler.get()), kernel); + return new Bdd(kernel.addRef(construction.and(index, other.index), NopHandler.get()), kernel); } /** @@ -215,11 +215,11 @@ public BDD and(final BDD other) { * @throws IllegalArgumentException if the two BDDs don't have the same * kernel */ - public BDD or(final BDD other) { + public Bdd or(final Bdd other) { if (other.kernel != kernel) { throw new IllegalArgumentException("Only BDDs with the same kernel can be processed"); } - return new BDD(kernel.addRef(construction.or(index, other.index), NopHandler.get()), kernel); + return new Bdd(kernel.addRef(construction.or(index, other.index), NopHandler.get()), kernel); } /** @@ -227,7 +227,7 @@ public BDD or(final BDD other) { * @return {@code true} if this BDD is a tautology, {@code false} otherwise */ public boolean isTautology() { - return index == BDDKernel.BDD_TRUE; + return index == BddKernel.BDD_TRUE; } /** @@ -237,7 +237,7 @@ public boolean isTautology() { * otherwise */ public boolean isContradiction() { - return index == BDDKernel.BDD_FALSE; + return index == BddKernel.BDD_FALSE; } /** @@ -290,7 +290,7 @@ public List enumerateAllModels(final FormulaFactory f, final Variable... * @return the list of all models */ public List enumerateAllModels(final Collection variables) { - return apply(new BDDModelEnumerationFunction(kernel.factory(), variables)); + return apply(new BddModelEnumerationFunction(kernel.factory(), variables)); } /** @@ -300,7 +300,7 @@ public List enumerateAllModels(final Collection variables) { * @return the list of all models */ public List enumerateAllModels(final FormulaFactory f, final Collection variables) { - return apply(new BDDModelEnumerationFunction(f, variables)); + return apply(new BddModelEnumerationFunction(f, variables)); } /** @@ -317,14 +317,14 @@ public Formula cnf() { * @return the CNF for the formula represented by this BDD */ public Formula cnf(final FormulaFactory f) { - return apply(new BDDCNFFunction(f)); + return apply(new BddCnfFunction(f)); } /** * Returns the number of clauses for the CNF formula of the BDD. * @return the number of clauses for the CNF formula of the BDD */ - public BigInteger numberOfClausesCNF() { + public BigInteger numberOfClausesCnf() { return operations.pathCountZero(index); } @@ -342,7 +342,7 @@ public Formula dnf() { * @return the DNF for the formula represented by this BDD */ public Formula dnf(final FormulaFactory f) { - return apply(new BDDDNFFunction(f)); + return apply(new BddDnfFunction(f)); } /** @@ -350,9 +350,9 @@ public Formula dnf(final FormulaFactory f) { * @param restriction the restriction * @return the restricted BDD */ - public BDD restrict(final Collection restriction) { - final BDD resBDD = BDDFactory.build(restriction, kernel); - return new BDD(construction.restrict(index, resBDD.index), kernel); + public Bdd restrict(final Collection restriction) { + final Bdd resBdd = BddFactory.build(restriction, kernel); + return new Bdd(construction.restrict(index, resBdd.index), kernel); } /** @@ -360,7 +360,7 @@ public BDD restrict(final Collection restriction) { * @param restriction the restriction * @return the restricted BDD */ - public BDD restrict(final Literal... restriction) { + public Bdd restrict(final Literal... restriction) { return restrict(Arrays.asList(restriction)); } @@ -369,9 +369,9 @@ public BDD restrict(final Literal... restriction) { * @param variables the variables to eliminate * @return the BDD with the eliminated variables */ - public BDD exists(final Collection variables) { - final BDD resBDD = BDDFactory.build(variables, kernel); - return new BDD(construction.exists(index, resBDD.index), kernel); + public Bdd exists(final Collection variables) { + final Bdd resBdd = BddFactory.build(variables, kernel); + return new Bdd(construction.exists(index, resBdd.index), kernel); } /** @@ -379,7 +379,7 @@ public BDD exists(final Collection variables) { * @param variables the variables to eliminate * @return the BDD with the eliminated variables */ - public BDD exists(final Variable... variables) { + public Bdd exists(final Variable... variables) { return exists(Arrays.asList(variables)); } @@ -388,9 +388,9 @@ public BDD exists(final Variable... variables) { * @param variables the variables to eliminate * @return the BDD with the eliminated variables */ - public BDD forall(final Collection variables) { - final BDD resBDD = BDDFactory.build(variables, kernel); - return new BDD(construction.forAll(index, resBDD.index), kernel); + public Bdd forall(final Collection variables) { + final Bdd resBdd = BddFactory.build(variables, kernel); + return new Bdd(construction.forAll(index, resBdd.index), kernel); } /** @@ -398,7 +398,7 @@ public BDD forall(final Collection variables) { * @param variables the variables to eliminate * @return the BDD with the eliminated variables */ - public BDD forall(final Variable... variables) { + public Bdd forall(final Variable... variables) { return forall(Arrays.asList(variables)); } @@ -443,10 +443,10 @@ public Model model(final boolean defaultValue, final Collection variab * @return an arbitrary model of this BDD */ public Model model(final FormulaFactory f, final boolean defaultValue, final Collection variables) { - final int varBDD = BDDFactory.build(variables, kernel).index; - final int pol = defaultValue ? BDDKernel.BDD_TRUE : BDDKernel.BDD_FALSE; - final int modelBDD = operations.satOneSet(index, varBDD, pol); - return createModel(f, modelBDD); + final int varBdd = BddFactory.build(variables, kernel).index; + final int pol = defaultValue ? BddKernel.BDD_TRUE : BddKernel.BDD_FALSE; + final int modelBdd = operations.satOneSet(index, varBdd, pol); + return createModel(f, modelBdd); } /** @@ -514,9 +514,9 @@ public BigInteger pathCountZero() { * @return all the variables that this BDD depends on */ public SortedSet support() { - final int supportBDD = operations.support(index); + final int supportBdd = operations.support(index); // only variables, cannot create new literals - final Model model = createModel(kernel.factory(), supportBDD); + final Model model = createModel(kernel.factory(), supportBdd); assert model == null || model.negativeLiterals().isEmpty(); return model == null ? Collections.emptySortedSet() : new TreeSet<>(model.positiveVariables()); } @@ -576,7 +576,7 @@ public void swapVariables(final Variable first, final Variable second) { * Returns the reordering object for the BDD kernel. * @return the reordering object */ - public BDDReordering getReordering() { + public BddReordering getReordering() { return kernel.getReordering(); } @@ -584,32 +584,32 @@ public BDDReordering getReordering() { * Returns a LogicNG internal BDD data structure of this BDD. * @return the BDD as LogicNG data structure */ - public BDDNode toLngBdd() { - return apply(new LngBDDFunction(kernel.factory())); + public BddNode toLngBdd() { + return apply(new LngBddFunction(kernel.factory())); } /** * Creates a model from a BDD. * @param f the formula factory to generate new formulas - * @param modelBDD the BDD + * @param modelBdd the BDD * @return the model * @throws IllegalStateException if the BDD does not represent a unique * model */ - private Model createModel(final FormulaFactory f, final int modelBDD) { - if (modelBDD == BDDKernel.BDD_FALSE) { + private Model createModel(final FormulaFactory f, final int modelBdd) { + if (modelBdd == BddKernel.BDD_FALSE) { return null; } - if (modelBDD == BDDKernel.BDD_TRUE) { + if (modelBdd == BddKernel.BDD_TRUE) { return new Model(); } - final List nodes = operations.allNodes(modelBDD); + final List nodes = operations.allNodes(modelBdd); final List model = new ArrayList<>(); for (final int[] node : nodes) { final Variable variable = kernel.getVariableForIndex(node[1]); - if (node[2] == BDDKernel.BDD_FALSE) { + if (node[2] == BddKernel.BDD_FALSE) { model.add(variable); - } else if (node[3] == BDDKernel.BDD_FALSE) { + } else if (node[3] == BddKernel.BDD_FALSE) { model.add(variable.negate(f)); } else { throw new IllegalStateException("Expected that the model BDD has one unique path through the BDD."); @@ -626,7 +626,7 @@ public int hashCode() { @Override public boolean equals(final Object other) { return this == other || - other instanceof BDD && index == ((BDD) other).index && Objects.equals(kernel, ((BDD) other).kernel); + other instanceof Bdd && index == ((Bdd) other).index && Objects.equals(kernel, ((Bdd) other).kernel); } @Override diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDFactory.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BddFactory.java similarity index 82% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDFactory.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BddFactory.java index e7405974..6586b57d 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDFactory.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/BddFactory.java @@ -43,10 +43,10 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDConstruction; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddConstruction; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import java.util.Collection; import java.util.Iterator; @@ -56,9 +56,9 @@ * @version 3.0.0 * @since 1.4.0 */ -public final class BDDFactory { +public final class BddFactory { - private BDDFactory() { + private BddFactory() { // not to be instantiated } @@ -74,7 +74,7 @@ private BDDFactory() { * @param formula the formula * @return the top node of the BDD */ - public static BDD build(final FormulaFactory f, final Formula formula) { + public static Bdd build(final FormulaFactory f, final Formula formula) { return build(f, formula, null, NopHandler.get()).getResult(); } @@ -89,10 +89,10 @@ public static BDD build(final FormulaFactory f, final Formula formula) { * @param f the formula factory to generate new formulas * @param formula the formula * @param kernel the BBD kernel to use - * @return the top node of the BDD or {@link BDDKernel#BDD_ABORT} if the + * @return the top node of the BDD or {@link BddKernel#BDD_ABORT} if the * computation was canceled */ - public static BDD build(final FormulaFactory f, final Formula formula, final BDDKernel kernel) { + public static Bdd build(final FormulaFactory f, final Formula formula, final BddKernel kernel) { return build(f, formula, kernel, NopHandler.get()).getResult(); } @@ -106,34 +106,34 @@ public static BDD build(final FormulaFactory f, final Formula formula, final BDD * converting them to a BDD. *

    * If a BDD handler is given and the BDD generation is canceled due to the - * handler, the method will return {@link BDDKernel#BDD_ABORT} as result. If + * handler, the method will return {@link BddKernel#BDD_ABORT} as result. If * {@code null} is passed as handler, the generation will continue without * interruption. * @param f the formula factory to generate new formulas * @param formula the formula * @param kernel the BBD kernel to use * @param handler the handler - * @return the top node of the BDD or {@link BDDKernel#BDD_ABORT} if the + * @return the top node of the BDD or {@link BddKernel#BDD_ABORT} if the * computation was canceled */ - public static LNGResult build(final FormulaFactory f, final Formula formula, final BDDKernel kernel, + public static LngResult build(final FormulaFactory f, final Formula formula, final BddKernel kernel, final ComputationHandler handler) { if (!handler.shouldResume(BDD_COMPUTATION_STARTED)) { - return LNGResult.canceled(BDD_COMPUTATION_STARTED); + return LngResult.canceled(BDD_COMPUTATION_STARTED); } final int varNum = formula.variables(f).size(); - final BDDKernel bddKernel = kernel == null ? new BDDKernel(f, varNum, varNum * 30, varNum * 20) : kernel; - final int bddIndex = buildRec(f, formula, bddKernel, new BDDConstruction(bddKernel), handler); - return bddIndex == BDDKernel.BDD_ABORT - ? LNGResult.canceled(BDD_NEW_REF_ADDED) - : LNGResult.of(new BDD(bddIndex, bddKernel)); + final BddKernel bddKernel = kernel == null ? new BddKernel(f, varNum, varNum * 30, varNum * 20) : kernel; + final int bddIndex = buildRec(f, formula, bddKernel, new BddConstruction(bddKernel), handler); + return bddIndex == BddKernel.BDD_ABORT + ? LngResult.canceled(BDD_NEW_REF_ADDED) + : LngResult.of(new Bdd(bddIndex, bddKernel)); } - public static BDD build(final Collection literals, final BDDKernel kernel) { - final var construction = new BDDConstruction(kernel); + public static Bdd build(final Collection literals, final BddKernel kernel) { + final var construction = new BddConstruction(kernel); int bdd; if (literals.isEmpty()) { - bdd = BDDKernel.BDD_FALSE; + bdd = BddKernel.BDD_FALSE; } else if (literals.size() == 1) { final Literal lit = literals.iterator().next(); final int idx = kernel.getOrAddVarIndex(lit.variable()); @@ -153,30 +153,30 @@ public static BDD build(final Collection literals, final BDDK kernel.delRef(operand); } } - return new BDD(bdd, kernel); + return new Bdd(bdd, kernel); } /** * Recursive build procedure for the BDD. *

    * If a BDD handler is given and the BDD generation is canceled due to the - * handler, the method will return {@link BDDKernel#BDD_ABORT} as result. If + * handler, the method will return {@link BddKernel#BDD_ABORT} as result. If * {@code null} is passed as handler, the generation will continue without * interruption. * @param formula the formula * @param kernel the BDD kernel * @param construction the BDD construction instance * @param handler the handler - * @return the BDD index or {@link BDDKernel#BDD_ABORT} if the computation + * @return the BDD index or {@link BddKernel#BDD_ABORT} if the computation * was canceled */ - private static int buildRec(final FormulaFactory f, final Formula formula, final BDDKernel kernel, - final BDDConstruction construction, final ComputationHandler handler) { + private static int buildRec(final FormulaFactory f, final Formula formula, final BddKernel kernel, + final BddConstruction construction, final ComputationHandler handler) { switch (formula.getType()) { case FALSE: - return BDDKernel.BDD_FALSE; + return BddKernel.BDD_FALSE; case TRUE: - return BDDKernel.BDD_TRUE; + return BddKernel.BDD_TRUE; case LITERAL: final Literal lit = (Literal) formula; final int idx = kernel.getOrAddVarIndex(lit.variable()); @@ -184,8 +184,8 @@ private static int buildRec(final FormulaFactory f, final Formula formula, final case NOT: { final Not not = (Not) formula; final int operand = buildRec(f, not.getOperand(), kernel, construction, handler); - if (operand == BDDKernel.BDD_ABORT) { - return BDDKernel.BDD_ABORT; + if (operand == BddKernel.BDD_ABORT) { + return BddKernel.BDD_ABORT; } final int res = kernel.addRef(construction.not(operand), handler); kernel.delRef(operand); @@ -195,12 +195,12 @@ private static int buildRec(final FormulaFactory f, final Formula formula, final case EQUIV: final BinaryOperator binary = (BinaryOperator) formula; final int left = buildRec(f, binary.getLeft(), kernel, construction, handler); - if (left == BDDKernel.BDD_ABORT) { - return BDDKernel.BDD_ABORT; + if (left == BddKernel.BDD_ABORT) { + return BddKernel.BDD_ABORT; } final int right = buildRec(f, binary.getRight(), kernel, construction, handler); - if (right == BDDKernel.BDD_ABORT) { - return BDDKernel.BDD_ABORT; + if (right == BddKernel.BDD_ABORT) { + return BddKernel.BDD_ABORT; } int res = kernel.addRef(binary instanceof Implication ? construction.implication(left, right) : construction.equivalence(left, right), handler); @@ -211,13 +211,13 @@ private static int buildRec(final FormulaFactory f, final Formula formula, final case OR: { final Iterator it = formula.iterator(); res = buildRec(f, it.next(), kernel, construction, handler); - if (res == BDDKernel.BDD_ABORT) { - return BDDKernel.BDD_ABORT; + if (res == BddKernel.BDD_ABORT) { + return BddKernel.BDD_ABORT; } while (it.hasNext()) { final int operand = buildRec(f, it.next(), kernel, construction, handler); - if (operand == BDDKernel.BDD_ABORT) { - return BDDKernel.BDD_ABORT; + if (operand == BddKernel.BDD_ABORT) { + return BddKernel.BDD_ABORT; } final int previous = res; res = formula instanceof And ? kernel.addRef(construction.and(res, operand), handler) diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDConstant.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddConstant.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDConstant.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddConstant.java index 319a8cc7..d56b96e7 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDConstant.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddConstant.java @@ -18,7 +18,7 @@ * @version 3.0.0 * @since 1.4.0 */ -public final class BDDConstant implements BDDNode { +public final class BddConstant implements BddNode { private final Constant value; @@ -26,7 +26,7 @@ public final class BDDConstant implements BDDNode { * Private constructor. * @param value the constant value */ - private BDDConstant(final Constant value) { + private BddConstant(final Constant value) { this.value = value; } @@ -35,8 +35,8 @@ private BDDConstant(final Constant value) { * @param f the formula factory * @return the terminal 0 node */ - public static BDDConstant getFalsumNode(final FormulaFactory f) { - return new BDDConstant(f.falsum()); + public static BddConstant getFalsumNode(final FormulaFactory f) { + return new BddConstant(f.falsum()); } /** @@ -44,8 +44,8 @@ public static BDDConstant getFalsumNode(final FormulaFactory f) { * @param f the formula factory * @return the terminal 1 node */ - public static BDDConstant getVerumNode(final FormulaFactory f) { - return new BDDConstant(f.verum()); + public static BddConstant getVerumNode(final FormulaFactory f) { + return new BddConstant(f.verum()); } @Override @@ -59,17 +59,17 @@ public boolean isInnerNode() { } @Override - public BDDNode getLow() { + public BddNode getLow() { return null; } @Override - public BDDNode getHigh() { + public BddNode getHigh() { return null; } @Override - public Set nodes() { + public Set nodes() { return new HashSet<>(Collections.singletonList(this)); } @@ -80,7 +80,7 @@ public int hashCode() { @Override public boolean equals(final Object other) { - return this == other || other instanceof BDDConstant && Objects.equals(value, ((BDDConstant) other).value); + return this == other || other instanceof BddConstant && Objects.equals(value, ((BddConstant) other).value); } @Override diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDInnerNode.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddInnerNode.java similarity index 77% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDInnerNode.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddInnerNode.java index ccadbc57..e45d6ba9 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDInnerNode.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddInnerNode.java @@ -16,11 +16,11 @@ * @version 3.0.0 * @since 1.4.0 */ -public final class BDDInnerNode implements BDDNode { +public final class BddInnerNode implements BddNode { private final Variable var; - private final BDDNode low; - private final BDDNode high; + private final BddNode low; + private final BddNode high; /** * Constructor for a new inner BDD node holding a variable. @@ -28,7 +28,7 @@ public final class BDDInnerNode implements BDDNode { * @param low the low child node * @param high the high child node */ - public BDDInnerNode(final Variable var, final BDDNode low, final BDDNode high) { + public BddInnerNode(final Variable var, final BddNode low, final BddNode high) { this.var = var; this.low = low; this.high = high; @@ -45,18 +45,18 @@ public boolean isInnerNode() { } @Override - public BDDNode getLow() { + public BddNode getLow() { return low; } @Override - public BDDNode getHigh() { + public BddNode getHigh() { return high; } @Override - public Set nodes() { - final Set res = new HashSet<>(Collections.singleton(this)); + public Set nodes() { + final Set res = new HashSet<>(Collections.singleton(this)); res.addAll(low.nodes()); res.addAll(high.nodes()); return res; @@ -72,8 +72,8 @@ public boolean equals(final Object other) { if (this == other) { return true; } - if (other instanceof BDDInnerNode) { - final BDDInnerNode o = (BDDInnerNode) other; + if (other instanceof BddInnerNode) { + final BddInnerNode o = (BddInnerNode) other; return Objects.equals(var, o.var) && Objects.equals(low, o.low) && Objects.equals(high, o.high); } return false; diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNode.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNode.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNode.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNode.java index 6789538e..77991ece 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNode.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNode.java @@ -13,7 +13,7 @@ * @version 3.0.0 * @since 1.4.0 */ -public interface BDDNode { +public interface BddNode { /** * Returns the label of the node. This can either be a variable or a @@ -34,17 +34,17 @@ public interface BDDNode { * Returns the node of the low edge or {@code null} for a terminal node. * @return the node of the low edge */ - BDDNode getLow(); + BddNode getLow(); /** * Returns the node of the high edge or {@code null} for a terminal node. * @return the node of the high edge */ - BDDNode getHigh(); + BddNode getHigh(); /** * Returns all nodes of the sub-BDD starting at this node. * @return all nodes of the sub-BDD starting at this node */ - Set nodes(); + Set nodes(); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDCNFFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddCnfFunction.java similarity index 67% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDCNFFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddCnfFunction.java index 788139a2..48822802 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDCNFFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddCnfFunction.java @@ -6,21 +6,21 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; /** * Creates a CNF from a BDD. * @version 3.0.0 * @since 2.0.0 */ -public final class BDDCNFFunction extends BDDNormalFormFunction { +public final class BddCnfFunction extends BddNormalFormFunction { - public BDDCNFFunction(final FormulaFactory f) { + public BddCnfFunction(final FormulaFactory f) { super(f); } @Override - public Formula apply(final BDD bdd) { + public Formula apply(final Bdd bdd) { return compute(bdd, true); } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDDNFFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddDnfFunction.java similarity index 67% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDDNFFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddDnfFunction.java index 81c12312..2459b86c 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDDNFFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddDnfFunction.java @@ -6,21 +6,21 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; /** * Creates a DNF from a BDD. * @version 3.0.0 * @since 2.0.0 */ -public final class BDDDNFFunction extends BDDNormalFormFunction { +public final class BddDnfFunction extends BddNormalFormFunction { - public BDDDNFFunction(final FormulaFactory f) { + public BddDnfFunction(final FormulaFactory f) { super(f); } @Override - public Formula apply(final BDD bdd) { + public Formula apply(final Bdd bdd) { return compute(bdd, false); } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddFunction.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddFunction.java index 76a26fc4..cc4abef2 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddFunction.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.knowledgecompilation.bdds.functions; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; /** * A function on a BDD. @@ -13,11 +13,11 @@ * @version 3.0.0 * @since 2.0.0 */ -public abstract class BDDFunction { +public abstract class BddFunction { protected final FormulaFactory f; - protected BDDFunction(final FormulaFactory f) { + protected BddFunction(final FormulaFactory f) { this.f = f; } @@ -26,5 +26,5 @@ protected BDDFunction(final FormulaFactory f) { * @param bdd the BDD * @return the result of the application */ - public abstract T apply(BDD bdd); + public abstract T apply(Bdd bdd); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDModelEnumerationFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddModelEnumerationFunction.java similarity index 87% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDModelEnumerationFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddModelEnumerationFunction.java index 5f9751ac..7096d234 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDModelEnumerationFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddModelEnumerationFunction.java @@ -8,9 +8,9 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; import java.util.ArrayList; import java.util.Collection; @@ -27,7 +27,7 @@ * @version 3.0.0 * @since 2.0.0 */ -public final class BDDModelEnumerationFunction extends BDDFunction> { +public final class BddModelEnumerationFunction extends BddFunction> { private final Collection variables; @@ -37,16 +37,16 @@ public final class BDDModelEnumerationFunction extends BDDFunction> * @param f the formula factory to generate new formulas * @param variables the variables to which models are projected */ - public BDDModelEnumerationFunction(final FormulaFactory f, final Collection variables) { + public BddModelEnumerationFunction(final FormulaFactory f, final Collection variables) { super(f); this.variables = variables; } @Override - public List apply(final BDD bdd) { + public List apply(final Bdd bdd) { final Set res = new HashSet<>(); - final BDDKernel kernel = bdd.getUnderlyingKernel(); - final List models = new BDDOperations(kernel).allSat(bdd.getIndex()); + final BddKernel kernel = bdd.getUnderlyingKernel(); + final List models = new BddOperations(kernel).allSat(bdd.getIndex()); final SortedSet temp; if (variables == null) { temp = new TreeSet<>(kernel.var2idx().values()); @@ -71,7 +71,7 @@ public List apply(final BDD bdd) { return new ArrayList<>(res); } - private void generateAllModels(final BDDKernel kernel, final List assignments, final byte[] model, + private void generateAllModels(final BddKernel kernel, final List assignments, final byte[] model, final int[] relevantIndices, final int position) { if (position == relevantIndices.length) { final List lits = new ArrayList<>(); diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDNormalFormFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddNormalFormFunction.java similarity index 78% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDNormalFormFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddNormalFormFunction.java index d62970ac..1a4cddc2 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BDDNormalFormFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/BddNormalFormFunction.java @@ -7,9 +7,9 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; import java.util.ArrayList; import java.util.List; @@ -19,9 +19,9 @@ * @version 3.0.0 * @since 2.3.0 */ -public abstract class BDDNormalFormFunction extends BDDFunction { +public abstract class BddNormalFormFunction extends BddFunction { - protected BDDNormalFormFunction(final FormulaFactory f) { + protected BddNormalFormFunction(final FormulaFactory f) { super(f); } @@ -32,10 +32,10 @@ protected BDDNormalFormFunction(final FormulaFactory f) { * DNF should be computed * @return the normal form (CNF or DNF) computed from the BDD */ - protected Formula compute(final BDD bdd, final boolean cnf) { - final BDDKernel kernel = bdd.getUnderlyingKernel(); + protected Formula compute(final Bdd bdd, final boolean cnf) { + final BddKernel kernel = bdd.getUnderlyingKernel(); final List pathsToConstant = - cnf ? new BDDOperations(kernel).allUnsat(bdd.getIndex()) : new BDDOperations(kernel).allSat(bdd.getIndex()); + cnf ? new BddOperations(kernel).allUnsat(bdd.getIndex()) : new BddOperations(kernel).allSat(bdd.getIndex()); final List terms = new ArrayList<>(); for (final byte[] path : pathsToConstant) { final List literals = new ArrayList<>(); diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBDDFunction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBddFunction.java similarity index 57% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBDDFunction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBddFunction.java index 57904be4..ed20004d 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBDDFunction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/functions/LngBddFunction.java @@ -6,12 +6,12 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDConstant; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDInnerNode; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDNode; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddConstant; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddInnerNode; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddNode; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; import java.util.HashMap; import java.util.Map; @@ -22,37 +22,37 @@ * @version 3.0.0 * @since 2.0.0 */ -public final class LngBDDFunction extends BDDFunction { +public final class LngBddFunction extends BddFunction { - public LngBDDFunction(final FormulaFactory f) { + public LngBddFunction(final FormulaFactory f) { super(f); } @Override - public BDDNode apply(final BDD bdd) { - final BDDKernel kernel = bdd.getUnderlyingKernel(); + public BddNode apply(final Bdd bdd) { + final BddKernel kernel = bdd.getUnderlyingKernel(); final int index = bdd.getIndex(); - final Map kernelNodeMap = new BDDOperations(kernel).allNodes(index).stream() + final Map kernelNodeMap = new BddOperations(kernel).allNodes(index).stream() .collect(Collectors.toMap(node -> node[0], node -> node)); - return buildBDDNode(index, kernel, kernelNodeMap, new HashMap<>()); + return buildBddNode(index, kernel, kernelNodeMap, new HashMap<>()); } - private BDDNode buildBDDNode(final int index, final BDDKernel kernel, final Map kernelNodeMap, - final Map nodeMap) { - BDDNode node = nodeMap.get(index); + private BddNode buildBddNode(final int index, final BddKernel kernel, final Map kernelNodeMap, + final Map nodeMap) { + BddNode node = nodeMap.get(index); if (node != null) { return node; } - if (index == BDDKernel.BDD_FALSE) { - node = BDDConstant.getFalsumNode(kernel.factory()); - } else if (index == BDDKernel.BDD_TRUE) { - node = BDDConstant.getVerumNode(kernel.factory()); + if (index == BddKernel.BDD_FALSE) { + node = BddConstant.getFalsumNode(kernel.factory()); + } else if (index == BddKernel.BDD_TRUE) { + node = BddConstant.getVerumNode(kernel.factory()); } else { final int[] kernelNode = kernelNodeMap.get(index); final Variable variable = kernel.getVariableForIndex(kernelNode[1]); - final BDDNode lowNode = buildBDDNode(kernelNode[2], kernel, kernelNodeMap, nodeMap); - final BDDNode highNode = buildBDDNode(kernelNode[3], kernel, kernelNodeMap, nodeMap); - node = new BDDInnerNode(variable, lowNode, highNode); + final BddNode lowNode = buildBddNode(kernelNode[2], kernel, kernelNodeMap, nodeMap); + final BddNode highNode = buildBddNode(kernelNode[3], kernel, kernelNodeMap, nodeMap); + node = new BddInnerNode(variable, lowNode, highNode); } nodeMap.put(index, node); return node; diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCache.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCache.java similarity index 86% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCache.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCache.java index b51e5182..ada28e57 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCache.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCache.java @@ -37,17 +37,17 @@ * @version 3.0.0 * @since 1.4.0 */ -public class BDDCache { - private final BDDPrime prime; - private BDDCacheEntry[] table; +public class BddCache { + private final BddPrime prime; + private BddCacheEntry[] table; /** * Constructs a new BDD cache of a given size (number of entries in the * cache). * @param cs the cache size */ - protected BDDCache(final int cs) { - prime = new BDDPrime(); + protected BddCache(final int cs) { + prime = new BddPrime(); resize(cs); } @@ -57,10 +57,10 @@ protected BDDCache(final int cs) { * @param ns the new number of entries */ protected void resize(final int ns) { - final int size = prime.primeGTE(ns); - table = new BDDCacheEntry[size]; + final int size = prime.primeGte(ns); + table = new BddCacheEntry[size]; for (int n = 0; n < size; n++) { - table[n] = new BDDCacheEntry(); + table[n] = new BddCacheEntry(); } } @@ -68,7 +68,7 @@ protected void resize(final int ns) { * Resets (clears) the cache. */ protected void reset() { - for (final BDDCacheEntry ce : table) { + for (final BddCacheEntry ce : table) { ce.reset(); } } @@ -78,11 +78,11 @@ protected void reset() { * entry. *

    * The return value is guaranteed to be non-null since every entry in the - * cache is always a {@link BDDCacheEntry} object. + * cache is always a {@link BddCacheEntry} object. * @param hash the hash value. * @return the respective entry in the cache */ - BDDCacheEntry lookup(final int hash) { + BddCacheEntry lookup(final int hash) { return table[Math.abs(hash % table.length)]; } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCacheEntry.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCacheEntry.java similarity index 97% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCacheEntry.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCacheEntry.java index d6e0c4c6..6eb93844 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDCacheEntry.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddCacheEntry.java @@ -39,7 +39,7 @@ * @version 1.4.0 * @since 1.4.0 */ -final class BDDCacheEntry { +final class BddCacheEntry { int a; int b; int c; @@ -49,7 +49,7 @@ final class BDDCacheEntry { /** * Constructs a new BDD cache entry. */ - BDDCacheEntry() { + BddCacheEntry() { reset(); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDConstruction.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddConstruction.java similarity index 82% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDConstruction.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddConstruction.java index d746ef7f..6f96581f 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDConstruction.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddConstruction.java @@ -9,15 +9,15 @@ * @version 2.0.0 * @since 2.0.0 */ -public class BDDConstruction { +public class BddConstruction { - private final BDDKernel k; + private final BddKernel k; /** * Constructs a new object with the given kernel. * @param k the kernel */ - public BDDConstruction(final BDDKernel k) { + public BddConstruction(final BddKernel k) { this.k = k; } @@ -94,7 +94,7 @@ public int bddHigh(final int root) { * @return the conjunction of the two BDDs */ public int and(final int l, final int r) { - return k.apply(l, r, BDDKernel.Operand.AND); + return k.apply(l, r, BddKernel.Operand.AND); } /** @@ -104,7 +104,7 @@ public int and(final int l, final int r) { * @return the disjunction of the two BDDs */ public int or(final int l, final int r) { - return k.apply(l, r, BDDKernel.Operand.OR); + return k.apply(l, r, BddKernel.Operand.OR); } /** @@ -114,7 +114,7 @@ public int or(final int l, final int r) { * @return the implication of the two BDDs */ public int implication(final int l, final int r) { - return k.apply(l, r, BDDKernel.Operand.IMP); + return k.apply(l, r, BddKernel.Operand.IMP); } /** @@ -124,7 +124,7 @@ public int implication(final int l, final int r) { * @return the equivalence of the two BDDs */ public int equivalence(final int l, final int r) { - return k.apply(l, r, BDDKernel.Operand.EQUIV); + return k.apply(l, r, BddKernel.Operand.EQUIV); } /** @@ -136,15 +136,15 @@ public int not(final int r) { return k.doWithPotentialReordering(() -> notRec(r)); } - protected int notRec(final int r) throws BDDKernel.BddReorderRequest { + protected int notRec(final int r) throws BddKernel.BddReorderRequest { if (k.isZero(r)) { - return BDDKernel.BDD_TRUE; + return BddKernel.BDD_TRUE; } if (k.isOne(r)) { - return BDDKernel.BDD_FALSE; + return BddKernel.BDD_FALSE; } - final BDDCacheEntry entry = k.applycache.lookup(r); - if (entry.a == r && entry.c == BDDKernel.Operand.NOT.v) { + final BddCacheEntry entry = k.applycache.lookup(r); + if (entry.a == r && entry.c == BddKernel.Operand.NOT.v) { return entry.res; } k.pushRef(notRec(k.low(r))); @@ -152,7 +152,7 @@ protected int notRec(final int r) throws BDDKernel.BddReorderRequest { final int res = k.makeNode(k.level(r), k.readRef(2), k.readRef(1)); k.popref(2); entry.a = r; - entry.c = BDDKernel.Operand.NOT.v; + entry.c = BddKernel.Operand.NOT.v; entry.res = res; return res; } @@ -169,15 +169,15 @@ public int restrict(final int r, final int var) { return r; } varset2svartable(var); - return k.doWithPotentialReordering(() -> restrictRec(r, (var << 3) | BDDKernel.CACHEID_RESTRICT)); + return k.doWithPotentialReordering(() -> restrictRec(r, (var << 3) | BddKernel.CACHEID_RESTRICT)); } - protected int restrictRec(final int r, final int miscid) throws BDDKernel.BddReorderRequest { + protected int restrictRec(final int r, final int miscid) throws BddKernel.BddReorderRequest { final int res; if (k.isConst(r) || k.level(r) > k.quantlast) { return r; } - final BDDCacheEntry entry = k.misccache.lookup(k.pair(r, miscid)); + final BddCacheEntry entry = k.misccache.lookup(k.pair(r, miscid)); if (entry.a == r && entry.c == miscid) { return entry.res; } @@ -210,7 +210,7 @@ public int exists(final int r, final int var) { return r; } varset2vartable(var); - return k.doWithPotentialReordering(() -> quantRec(r, BDDKernel.Operand.OR, var << 3)); + return k.doWithPotentialReordering(() -> quantRec(r, BddKernel.Operand.OR, var << 3)); } /** @@ -225,16 +225,16 @@ public int forAll(final int r, final int var) { } varset2vartable(var); return k.doWithPotentialReordering( - () -> quantRec(r, BDDKernel.Operand.AND, (var << 3) | BDDKernel.CACHEID_FORALL)); + () -> quantRec(r, BddKernel.Operand.AND, (var << 3) | BddKernel.CACHEID_FORALL)); } - protected int quantRec(final int r, final BDDKernel.Operand op, final int quantid) - throws BDDKernel.BddReorderRequest { + protected int quantRec(final int r, final BddKernel.Operand op, final int quantid) + throws BddKernel.BddReorderRequest { final int res; if (r < 2 || k.level(r) > k.quantlast) { return r; } - final BDDCacheEntry entry = k.quantcache.lookup(r); + final BddCacheEntry entry = k.quantcache.lookup(r); if (entry.a == r && entry.c == quantid) { return entry.res; } @@ -256,17 +256,17 @@ protected void varset2svartable(final int r) { if (r < 2) { throw new IllegalArgumentException("Illegal variable: " + r); } - k.quantvarsetID++; - if (k.quantvarsetID == Integer.MAX_VALUE / 2) { + k.quantvarsetId++; + if (k.quantvarsetId == Integer.MAX_VALUE / 2) { k.quantvarset = new int[k.varnum]; - k.quantvarsetID = 1; + k.quantvarsetId = 1; } - for (int n = r; !k.isConst(n);) { + for (int n = r; !k.isConst(n); ) { if (k.isZero(k.low(n))) { - k.quantvarset[k.level(n)] = k.quantvarsetID; + k.quantvarset[k.level(n)] = k.quantvarsetId; n = k.high(n); } else { - k.quantvarset[k.level(n)] = -k.quantvarsetID; + k.quantvarset[k.level(n)] = -k.quantvarsetId; n = k.low(n); } k.quantlast = k.level(n); @@ -277,22 +277,22 @@ protected void varset2vartable(final int r) { if (r < 2) { throw new IllegalArgumentException("Illegal variable: " + r); } - k.quantvarsetID++; - if (k.quantvarsetID == Integer.MAX_VALUE) { + k.quantvarsetId++; + if (k.quantvarsetId == Integer.MAX_VALUE) { k.quantvarset = new int[k.varnum]; - k.quantvarsetID = 1; + k.quantvarsetId = 1; } for (int n = r; n > 1; n = k.high(n)) { - k.quantvarset[k.level(n)] = k.quantvarsetID; + k.quantvarset[k.level(n)] = k.quantvarsetId; k.quantlast = k.level(n); } } protected boolean insvarset(final int a) { - return Math.abs(k.quantvarset[a]) == k.quantvarsetID; + return Math.abs(k.quantvarset[a]) == k.quantvarsetId; } protected boolean invarset(final int a) { - return k.quantvarset[a] == k.quantvarsetID; + return k.quantvarset[a] == k.quantvarsetId; } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDKernel.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddKernel.java similarity index 94% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDKernel.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddKernel.java index e957376e..27ed6b6d 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDKernel.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddKernel.java @@ -49,7 +49,7 @@ * @version 2.0.0 * @since 1.4.0 */ -public class BDDKernel { +public class BddKernel { public static final int BDD_ABORT = -1; public static final int BDD_TRUE = 1; @@ -83,12 +83,12 @@ protected enum Operand { public static final int CACHEID_PATHCOU_ZERO = 0x8; public static final int CACHEID_FORALL = 0x1; - protected final BDDPrime prime; + protected final BddPrime prime; protected final FormulaFactory f; protected final SortedMap var2idx; protected final SortedMap idx2var; - protected final BDDReordering reordering; + protected final BddReordering reordering; protected int[] nodes; // All the bdd nodes protected int[] vars; // Set of defined BDD variables @@ -108,15 +108,15 @@ protected enum Operand { protected int[] var2level; // Variable -> level table protected int[] quantvarset; // Current variable set for quant. - protected int quantvarsetID; // Current id used in quantvarset + protected int quantvarsetId; // Current id used in quantvarset protected int quantlast; // Current last variable to be quant. - protected BDDCache applycache; // Cache for apply results - protected BDDCache itecache; // Cache for ITE results - protected BDDCache quantcache; // Cache for exist/forall results - protected BDDCache appexcache; // Cache for appex/appall results - protected BDDCache replacecache; // Cache for replace results - protected BDDCache misccache; // Cache for other results + protected BddCache applycache; // Cache for apply results + protected BddCache itecache; // Cache for ITE results + protected BddCache quantcache; // Cache for exist/forall results + protected BddCache appexcache; // Cache for appex/appall results + protected BddCache replacecache; // Cache for replace results + protected BddCache misccache; // Cache for other results /** * Constructor for the BDD kernel. @@ -125,13 +125,13 @@ protected enum Operand { * @param nodeSize the initial number of nodes in the nodetable * @param cacheSize the fixed size of the internal caches */ - public BDDKernel(final FormulaFactory f, final int numVars, final int nodeSize, final int cacheSize) { + public BddKernel(final FormulaFactory f, final int numVars, final int nodeSize, final int cacheSize) { this.f = f; - prime = new BDDPrime(); + prime = new BddPrime(); var2idx = new TreeMap<>(); idx2var = new TreeMap<>(); - reordering = new BDDReordering(this); - nodesize = prime.primeGTE(Math.max(nodeSize, 3)); + reordering = new BddReordering(this); + nodesize = prime.primeGte(Math.max(nodeSize, 3)); nodes = new int[nodesize * 6]; minfreenodes = 20; for (int n = 0; n < nodesize; n++) { @@ -166,7 +166,7 @@ public BDDKernel(final FormulaFactory f, final int numVars, final int nodeSize, * @param nodeSize the initial number of nodes in the nodetable * @param cacheSize the fixed size of the internal caches */ - public BDDKernel(final FormulaFactory f, final List ordering, final int nodeSize, final int cacheSize) { + public BddKernel(final FormulaFactory f, final List ordering, final int nodeSize, final int cacheSize) { this(f, ordering.size(), nodeSize, cacheSize); for (final Variable var : ordering) { getOrAddVarIndex(var); @@ -245,7 +245,7 @@ public FormulaFactory factory() { * Returns the reordering object for this kernel. * @return the reordering object */ - public BDDReordering getReordering() { + public BddReordering getReordering() { return reordering; } @@ -373,7 +373,7 @@ protected int applyRec(final int l, final int r, final Operand op) throws BddReo if (isConst(l) && isConst(r)) { res = op.tt[l << 1 | r]; } else { - final BDDCacheEntry entry = applycache.lookup(triple(l, r, op.v)); + final BddCacheEntry entry = applycache.lookup(triple(l, r, op.v)); if (entry.a == l && entry.b == r && entry.c == op.v) { return entry.res; } @@ -406,7 +406,7 @@ protected int applyRec(final int l, final int r, final Operand op) throws BddReo * the node in the next garbage collection. If a BDD handler is given, * {@link ComputationHandler#shouldResume} is called with the event * {@link SimpleEvent#BDD_NEW_REF_ADDED}. If the generation gets canceled - * due to the handler, the method will return {@link BDDKernel#BDD_ABORT} + * due to the handler, the method will return {@link BddKernel#BDD_ABORT} * as result. If {@code null} is passed as handler, the generation will * continue without interruption. * @param root the node @@ -591,7 +591,7 @@ protected void nodeResize(final boolean doRehash) { if (nodesize > oldsize + maxnodeincrease) { nodesize = oldsize + maxnodeincrease; } - nodesize = prime.primeLTE(nodesize); + nodesize = prime.primeLte(nodesize); final int[] newnodes = new int[nodesize * 6]; System.arraycopy(nodes, 0, newnodes, 0, nodes.length); nodes = newnodes; @@ -721,13 +721,13 @@ protected int triple(final int a, final int b, final int c) { } protected void initOperators(final int cachesize) { - applycache = new BDDCache(cachesize); - itecache = new BDDCache(cachesize); - quantcache = new BDDCache(cachesize); - appexcache = new BDDCache(cachesize); - replacecache = new BDDCache(cachesize); - misccache = new BDDCache(cachesize); - quantvarsetID = 0; + applycache = new BddCache(cachesize); + itecache = new BddCache(cachesize); + quantcache = new BddCache(cachesize); + appexcache = new BddCache(cachesize); + replacecache = new BddCache(cachesize); + misccache = new BddCache(cachesize); + quantvarsetId = 0; quantvarset = null; } @@ -742,15 +742,15 @@ protected void resetCaches() { protected void varResize() { quantvarset = new int[varnum]; - quantvarsetID = 0; + quantvarsetId = 0; } /** * Returns the statistics for this BDD Kernel. * @return the statistics */ - public BDDStatistics statistics() { - final BDDStatistics statistics = new BDDStatistics(); + public BddStatistics statistics() { + final BddStatistics statistics = new BddStatistics(); statistics.produced = produced; statistics.nodesize = nodesize; statistics.freenum = freenum; @@ -763,7 +763,7 @@ public BDDStatistics statistics() { /** * A class for BDD statistics. */ - public static class BDDStatistics { + public static class BddStatistics { protected long produced; protected int nodesize; protected int freenum; @@ -851,7 +851,7 @@ protected interface BddOperation { int perform() throws BddReorderRequest; } - public BDDPrime getPrime() { + public BddPrime getPrime() { return prime; } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDOperations.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddOperations.java similarity index 89% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDOperations.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddOperations.java index 127a5ad1..5d1d28d4 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDOperations.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddOperations.java @@ -19,11 +19,11 @@ * @version 2.4.0 * @since 2.0.0 */ -public class BDDOperations { - protected final BDDKernel k; +public class BddOperations { + protected final BddKernel k; protected byte[] allunsatProfile; - protected int supportID; // Current ID (true value) for support + protected int supportId; // Current ID (true value) for support protected int supportMax; // Max. used level in support calc. protected int[] supportSet; // The found support set @@ -32,7 +32,7 @@ public class BDDOperations { * kernel. * @param k the kernel */ - public BDDOperations(final BDDKernel k) { + public BddOperations(final BddKernel k) { this.k = k; } @@ -52,16 +52,16 @@ public int satOne(final int r) { return res; } - protected int satOneRec(final int r) throws BDDKernel.BddReorderRequest { + protected int satOneRec(final int r) throws BddKernel.BddReorderRequest { if (k.isConst(r)) { return r; } if (k.isZero(k.low(r))) { final int res = satOneRec(k.high(r)); - return k.pushRef(k.makeNode(k.level(r), BDDKernel.BDD_FALSE, res)); + return k.pushRef(k.makeNode(k.level(r), BddKernel.BDD_FALSE, res)); } else { final int res = satOneRec(k.low(r)); - return k.pushRef(k.makeNode(k.level(r), res, BDDKernel.BDD_FALSE)); + return k.pushRef(k.makeNode(k.level(r), res, BddKernel.BDD_FALSE)); } } @@ -89,32 +89,32 @@ public int satOneSet(final int r, final int var, final int pol) { return res; } - protected int satOneSetRec(final int r, final int var, final int satPolarity) throws BDDKernel.BddReorderRequest { + protected int satOneSetRec(final int r, final int var, final int satPolarity) throws BddKernel.BddReorderRequest { if (k.isConst(r) && k.isConst(var)) { return r; } if (k.level(r) < k.level(var)) { if (k.isZero(k.low(r))) { final int res = satOneSetRec(k.high(r), var, satPolarity); - return k.pushRef(k.makeNode(k.level(r), BDDKernel.BDD_FALSE, res)); + return k.pushRef(k.makeNode(k.level(r), BddKernel.BDD_FALSE, res)); } else { final int res = satOneSetRec(k.low(r), var, satPolarity); - return k.pushRef(k.makeNode(k.level(r), res, BDDKernel.BDD_FALSE)); + return k.pushRef(k.makeNode(k.level(r), res, BddKernel.BDD_FALSE)); } } else if (k.level(var) < k.level(r)) { final int res = satOneSetRec(r, k.high(var), satPolarity); - if (satPolarity == BDDKernel.BDD_TRUE) { - return k.pushRef(k.makeNode(k.level(var), BDDKernel.BDD_FALSE, res)); + if (satPolarity == BddKernel.BDD_TRUE) { + return k.pushRef(k.makeNode(k.level(var), BddKernel.BDD_FALSE, res)); } else { - return k.pushRef(k.makeNode(k.level(var), res, BDDKernel.BDD_FALSE)); + return k.pushRef(k.makeNode(k.level(var), res, BddKernel.BDD_FALSE)); } } else { if (k.isZero(k.low(r))) { final int res = satOneSetRec(k.high(r), k.high(var), satPolarity); - return k.pushRef(k.makeNode(k.level(r), BDDKernel.BDD_FALSE, res)); + return k.pushRef(k.makeNode(k.level(r), BddKernel.BDD_FALSE, res)); } else { final int res = satOneSetRec(k.low(r), k.high(var), satPolarity); - return k.pushRef(k.makeNode(k.level(r), res, BDDKernel.BDD_FALSE)); + return k.pushRef(k.makeNode(k.level(r), res, BddKernel.BDD_FALSE)); } } } @@ -138,7 +138,7 @@ public int fullSatOne(final int r) { return res; } - protected int fullSatOneRec(final int r) throws BDDKernel.BddReorderRequest { + protected int fullSatOneRec(final int r) throws BddKernel.BddReorderRequest { if (r < 2) { return r; } @@ -204,14 +204,14 @@ protected void allSatRec(final int r, final List models, final byte[] al */ public BigInteger satCount(final int r) { final BigInteger size = BigInteger.valueOf(2).pow(k.level(r)); - return satCountRec(r, BDDKernel.CACHEID_SATCOU).multiply(size); + return satCountRec(r, BddKernel.CACHEID_SATCOU).multiply(size); } protected BigInteger satCountRec(final int root, final int miscid) { if (root < 2) { return BigInteger.valueOf(root); } - final BDDCacheEntry entry = k.misccache.lookup(root); + final BddCacheEntry entry = k.misccache.lookup(root); if (entry.a == root && entry.c == miscid) { return entry.bdres; } @@ -234,7 +234,7 @@ protected BigInteger satCountRec(final int root, final int miscid) { * @return the number of paths to the terminal node 'one' */ public BigInteger pathCountOne(final int r) { - return pathCountRecOne(r, BDDKernel.CACHEID_PATHCOU_ONE); + return pathCountRecOne(r, BddKernel.CACHEID_PATHCOU_ONE); } protected BigInteger pathCountRecOne(final int r, final int miscid) { @@ -245,7 +245,7 @@ protected BigInteger pathCountRecOne(final int r, final int miscid) { if (k.isOne(r)) { return BigInteger.ONE; } - final BDDCacheEntry entry = k.misccache.lookup(r); + final BddCacheEntry entry = k.misccache.lookup(r); if (entry.a == r && entry.c == miscid) { return entry.bdres; } @@ -262,7 +262,7 @@ protected BigInteger pathCountRecOne(final int r, final int miscid) { * @return the number of paths to the terminal node 'zero' */ public BigInteger pathCountZero(final int r) { - return pathCountRecZero(r, BDDKernel.CACHEID_PATHCOU_ZERO); + return pathCountRecZero(r, BddKernel.CACHEID_PATHCOU_ZERO); } protected BigInteger pathCountRecZero(final int r, final int miscid) { @@ -273,7 +273,7 @@ protected BigInteger pathCountRecZero(final int r, final int miscid) { if (k.isOne(r)) { return BigInteger.ZERO; } - final BDDCacheEntry entry = k.misccache.lookup(r); + final BddCacheEntry entry = k.misccache.lookup(r); if (entry.a == r && entry.c == miscid) { return entry.bdres; } @@ -333,16 +333,16 @@ public int support(final int r) { final int supportSize = 0; int res = 1; if (r < 2) { - return BDDKernel.BDD_FALSE; + return BddKernel.BDD_FALSE; } if (supportSize < k.varnum) { supportSet = new int[k.varnum]; - supportID = 0; + supportId = 0; } - if (supportID == 0x0FFFFFFF) { - supportID = 0; + if (supportId == 0x0FFFFFFF) { + supportId = 0; } - ++supportID; + ++supportId; final int supportMin = k.level(r); supportMax = supportMin; supportRec(r, supportSet); @@ -350,7 +350,7 @@ public int support(final int r) { k.reordering.disableReorder(); for (int n = supportMax; n >= supportMin; --n) { - if (supportSet[n] == supportID) { + if (supportSet[n] == supportId) { k.addRef(res, NopHandler.get()); final int tmp = k.makeNode(n, 0, res); k.delRef(res); @@ -365,14 +365,14 @@ protected void supportRec(final int r, final int[] support) { if (r < 2) { return; } - if ((k.level(r) & BDDKernel.MARKON) != 0 || k.low(r) == -1) { + if ((k.level(r) & BddKernel.MARKON) != 0 || k.low(r) == -1) { return; } - support[k.level(r)] = supportID; + support[k.level(r)] = supportId; if (k.level(r) > supportMax) { supportMax = k.level(r); } - k.setLevel(r, k.level(r) | BDDKernel.MARKON); + k.setLevel(r, k.level(r) | BddKernel.MARKON); supportRec(k.low(r), support); supportRec(k.high(r), support); } @@ -404,11 +404,11 @@ protected void varProfileRec(final int r, final int[] varprofile) { if (r < 2) { return; } - if ((k.level(r) & BDDKernel.MARKON) != 0) { + if ((k.level(r) & BddKernel.MARKON) != 0) { return; } varprofile[k.level2var[k.level(r)]]++; - k.setLevel(r, k.level(r) | BDDKernel.MARKON); + k.setLevel(r, k.level(r) | BddKernel.MARKON); varProfileRec(k.low(r), varprofile); varProfileRec(k.high(r), varprofile); } @@ -427,8 +427,8 @@ public List allNodes(final int r) { } k.mark(r); for (int n = 0; n < k.nodesize; n++) { - if ((k.level(n) & BDDKernel.MARKON) != 0) { - k.setLevel(n, k.level(n) & BDDKernel.MARKOFF); + if ((k.level(n) & BddKernel.MARKON) != 0) { + k.setLevel(n, k.level(n) & BddKernel.MARKOFF); result.add(new int[]{n, k.level2var[k.level(n)], k.low(n), k.high(n)}); } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrime.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrime.java similarity index 97% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrime.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrime.java index d9b6a483..10fc4b94 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrime.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrime.java @@ -39,7 +39,7 @@ * @version 2.0.0 * @since 1.4.0 */ -public final class BDDPrime { +public final class BddPrime { static final int CHECKTIMES = 20; private final Random rng; @@ -47,7 +47,7 @@ public final class BDDPrime { /** * Private constructor. */ - public BDDPrime() { + public BddPrime() { rng = new Random(); } @@ -56,7 +56,7 @@ public BDDPrime() { * @param num the number * @return the next prime greater than the given number */ - public int primeGTE(int num) { + public int primeGte(int num) { if (isEven(num)) { ++num; } @@ -71,7 +71,7 @@ public int primeGTE(int num) { * @param num the number * @return the next prime less than the given number */ - public int primeLTE(int num) { + public int primeLte(int num) { if (isEven(num)) { --num; } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReordering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReordering.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReordering.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReordering.java index 9218eead..a0bccccd 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReordering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReordering.java @@ -31,19 +31,19 @@ * @version 2.0.0 * @since 2.0.0 */ -public class BDDReordering { +public class BddReordering { - protected final BDDKernel k; + protected final BddKernel k; // Current auto reord. method and number of automatic reorderings left - protected BDDReorderingMethod reorderMethod; + protected BddReorderingMethod reorderMethod; protected int bddreorderTimes; // Flag for disabling reordering temporarily protected boolean reorderDisabled; // Store for the variable relationships - protected BDDTree varTree; + protected BddTree varTree; protected int blockId; // Store for the ref.cou. of the external roots @@ -69,7 +69,7 @@ public class BDDReordering { * Creates a new reordering object for the given kernel. * @param k the kernel */ - public BDDReordering(final BDDKernel k) { + public BddReordering(final BddKernel k) { this.k = k; init(); } @@ -78,7 +78,7 @@ protected void init() { reorderDisabled = false; varTree = null; clrVarBlocks(); - setReorderDuringConstruction(BDDReorderingMethod.BDD_REORDER_NONE, 0); + setReorderDuringConstruction(BddReorderingMethod.BDD_REORDER_NONE, 0); usednumBefore = 0; usednumAfter = 0; blockId = 0; @@ -146,13 +146,13 @@ public void swapVariables(int v1, int v2) { * {@link #addVariableBlockAll()} can be called before this method. * @param method the method to be used for the reordering */ - public void reorder(final BDDReorderingMethod method) { - final BDDTree top; - final BDDReorderingMethod savemethod = reorderMethod; + public void reorder(final BddReorderingMethod method) { + final BddTree top; + final BddReorderingMethod savemethod = reorderMethod; final int savetimes = bddreorderTimes; reorderMethod = method; bddreorderTimes = 1; - top = new BDDTree(-1); + top = new BddTree(-1); reorderInit(); usednumBefore = k.nodesize - k.freenum; top.setFirst(0); @@ -174,13 +174,13 @@ public void reorder(final BDDReorderingMethod method) { * of a BDD. *

    * Automatic reordering can be deactivated by passing - * {@link BDDReorderingMethod#BDD_REORDER_NONE} for the {@code method} + * {@link BddReorderingMethod#BDD_REORDER_NONE} for the {@code method} * parameter, otherwise the reordering is activated with the given method. * The reordering is executed at most {@code num} times. * @param method the method to be used for reordering * @param num the maximum number of reorders to be performed */ - public void setReorderDuringConstruction(final BDDReorderingMethod method, final int num) { + public void setReorderDuringConstruction(final BddReorderingMethod method, final int num) { reorderMethod = method; bddreorderTimes = num; } @@ -269,7 +269,7 @@ public void addVariableBlock(final int first, final int last, final boolean fixe if (first < 0 || first >= k.varnum || last < 0 || last >= k.varnum) { throw new IllegalArgumentException("invalid var range from " + first + " to " + last); } - final BDDTree t = BDDTree.addRange(varTree, first, last, fixed, blockId, k.level2var); + final BddTree t = BddTree.addRange(varTree, first, last, fixed, blockId, k.level2var); if (t == null) { throw new IllegalStateException("Could not add range to tree"); } @@ -306,8 +306,8 @@ protected int nodehashReorder(final int var, final int l, final int h) { return Math.abs(k.pair(l, h) % levels[var].size) + levels[var].start; } - protected void reorderBlock(final BDDTree t, final BDDReorderingMethod method) { - BDDTree thisTree; + protected void reorderBlock(final BddTree t, final BddReorderingMethod method) { + BddTree thisTree; if (t == null) { return; } @@ -371,9 +371,9 @@ protected void reorderDone() { k.gbc(); } - protected BDDTree reorderWin2(final BDDTree t) { - BDDTree thisTree = t; - BDDTree first = t; + protected BddTree reorderWin2(final BddTree t) { + BddTree thisTree = t; + BddTree first = t; if (t == null) { return null; } @@ -390,9 +390,9 @@ protected BDDTree reorderWin2(final BDDTree t) { return first; } - protected BDDTree reorderWin2ite(final BDDTree t) { - BDDTree thisTree; - BDDTree first = t; + protected BddTree reorderWin2ite(final BddTree t) { + BddTree thisTree; + BddTree first = t; if (t == null) { return null; } @@ -418,16 +418,16 @@ protected BDDTree reorderWin2ite(final BDDTree t) { return first; } - protected BDDTree reorderWin3(final BDDTree t) { - BDDTree thisTree = t; - BDDTree first = t; + protected BddTree reorderWin3(final BddTree t) { + BddTree thisTree = t; + BddTree first = t; if (t == null) { return null; } while (thisTree.getNext() != null) { - final Pair swapResult = reorderSwapwin3(thisTree); + final Pair swapResult = reorderSwapwin3(thisTree); thisTree = swapResult.getFirst(); first = swapResult.getSecond() != null ? swapResult.getSecond() : first; } @@ -435,9 +435,9 @@ protected BDDTree reorderWin3(final BDDTree t) { return first; } - protected BDDTree reorderWin3ite(final BDDTree t) { - BDDTree thisTree; - BDDTree first = t; + protected BddTree reorderWin3ite(final BddTree t) { + BddTree thisTree; + BddTree first = t; int lastsize; if (t == null) { @@ -449,7 +449,7 @@ protected BDDTree reorderWin3ite(final BDDTree t) { thisTree = first; while (thisTree.getNext() != null && thisTree.getNext().getNext() != null) { - final Pair swapResult = reorderSwapwin3(thisTree); + final Pair swapResult = reorderSwapwin3(thisTree); thisTree = swapResult.getFirst(); first = swapResult.getSecond() != null ? swapResult.getSecond() : first; } @@ -457,10 +457,10 @@ protected BDDTree reorderWin3ite(final BDDTree t) { return first; } - protected Pair reorderSwapwin3(BDDTree thisTree) { - BDDTree first = null; + protected Pair reorderSwapwin3(BddTree thisTree) { + BddTree first = null; final boolean setfirst = thisTree.getPrev() == null; - BDDTree next = thisTree; + BddTree next = thisTree; int best = reorderNodenum(); if (thisTree.getNext().getNext() == null) { @@ -570,8 +570,8 @@ protected Pair reorderSwapwin3(BDDTree thisTree) { * @param t the input BDD tree * @return the sifted BDD tree */ - protected BDDTree reorderSiftite(final BDDTree t) { - BDDTree first = t; + protected BddTree reorderSiftite(final BddTree t) { + BddTree first = t; int lastsize; if (t == null) { @@ -591,21 +591,21 @@ protected BDDTree reorderSiftite(final BDDTree t) { * @param t the input BDD tree * @return the sifted BDD tree */ - protected BDDTree reorderSift(BDDTree t) { - BDDTree thisTree; - final BDDTree[] seq; - final BDDSizePair[] p; + protected BddTree reorderSift(BddTree t) { + BddTree thisTree; + final BddTree[] seq; + final BddSizePair[] p; int n, num; for (thisTree = t, num = 0; thisTree != null; thisTree = thisTree.getNext()) { thisTree.setPos(num++); } - p = new BDDSizePair[num]; + p = new BddSizePair[num]; for (int i = 0; i < p.length; i++) { - p[i] = new BDDSizePair(); + p[i] = new BddSizePair(); } - seq = new BDDTree[num]; + seq = new BddTree[num]; for (thisTree = t, n = 0; thisTree != null; thisTree = thisTree.getNext(), n++) { int v; @@ -641,8 +641,8 @@ protected BDDTree reorderSift(BDDTree t) { * @param num the current position in the sequence * @return the sifted BDD tree */ - protected BDDTree reorderSiftSeq(final BDDTree t, final BDDTree[] seq, final int num) { - BDDTree thisTree; + protected BddTree reorderSiftSeq(final BddTree t, final BddTree[] seq, final int num) { + BddTree thisTree; int n; if (t == null) { @@ -666,7 +666,7 @@ protected BDDTree reorderSiftSeq(final BDDTree t, final BDDTree[] seq, final int * @param blk the block * @param middlePos the middle position in the block */ - protected void reorderSiftBestpos(final BDDTree blk, final int middlePos) { + protected void reorderSiftBestpos(final BddTree blk, final int middlePos) { int best = reorderNodenum(); int maxAllowed = best / 5 + best; int bestpos = 0; @@ -723,14 +723,14 @@ protected void reorderSiftBestpos(final BDDTree blk, final int middlePos) { } } - protected int siftTestCmp(final BDDSizePair a, final BDDSizePair b) { + protected int siftTestCmp(final BddSizePair a, final BddSizePair b) { return Integer.compare(a.val, b.val); } // === Random reordering (mostly for debugging and test ) ============= - protected BDDTree reorderRandom(final BDDTree t) { - BDDTree thisTree; - final BDDTree[] seq; + protected BddTree reorderRandom(final BddTree t) { + BddTree thisTree; + final BddTree[] seq; int n, num = 0; if (t == null) { @@ -740,7 +740,7 @@ protected BDDTree reorderRandom(final BDDTree t) { for (thisTree = t; thisTree != null; thisTree = thisTree.getNext()) { num++; } - seq = new BDDTree[num]; + seq = new BddTree[num]; for (thisTree = t, num = 0; thisTree != null; thisTree = thisTree.getNext()) { seq[num++] = thisTree; } @@ -764,8 +764,8 @@ protected BDDTree reorderRandom(final BDDTree t) { * Swaps adjacent blocks * @param left the left BDD tree */ - protected void blockdown(final BDDTree left) { - final BDDTree right = left.getNext(); + protected void blockdown(final BddTree left) { + final BddTree right = left.getNext(); int n; final int leftsize = left.getLast() - left.getFirst(); final int rightsize = right.getLast() - right.getFirst(); @@ -1055,7 +1055,7 @@ protected void reorderSetLevellookup() { levels[n].start = n * levels[n].maxsize; levels[n].size = levels[n].maxsize; if (levels[n].size >= 4) { - levels[n].size = k.getPrime().primeLTE(levels[n].size); + levels[n].size = k.getPrime().primeLte(levels[n].size); } } } @@ -1074,7 +1074,7 @@ protected void enableReorder() { } protected boolean reorderReady() { - return reorderMethod != BDDReorderingMethod.BDD_REORDER_NONE && varTree != null && bddreorderTimes != 0 && + return reorderMethod != BddReorderingMethod.BDD_REORDER_NONE && varTree != null && bddreorderTimes != 0 && !reorderDisabled; } @@ -1174,10 +1174,10 @@ protected void addrefRec(final int r, final int[] dep) { k.freenum--; // Detect variable dependencies for the interaction matrix - dep[var(r) & BDDKernel.MARKHIDE] = 1; + dep[var(r) & BddKernel.MARKHIDE] = 1; // Make sure the nodenum field is updated. Used in the initial GBC - levels[var(r) & BDDKernel.MARKHIDE].nodenum++; + levels[var(r) & BddKernel.MARKHIDE].nodenum++; addrefRec(k.low(r), dep); addrefRec(k.high(r), dep); @@ -1187,7 +1187,7 @@ protected void addrefRec(final int r, final int[] dep) { // Update (from previously found) variable dependencies for the // interaction matrix for (n = 0; n < k.varnum; n++) { - dep[n] |= interactionMatrix.depends(var(r) & BDDKernel.MARKHIDE, n); + dep[n] |= interactionMatrix.depends(var(r) & BddKernel.MARKHIDE, n); } } k.incRef(r); @@ -1221,9 +1221,9 @@ protected static class LevelData { protected int nodenum; // Number of nodes in this level } - protected static class BDDSizePair { + protected static class BddSizePair { protected int val; - protected BDDTree block; + protected BddTree block; } protected static class InteractionMatrix { diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReorderingMethod.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReorderingMethod.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReorderingMethod.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReorderingMethod.java index ab527394..c9be2828 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDReorderingMethod.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddReorderingMethod.java @@ -9,7 +9,7 @@ * @version 2.0.0 * @since 2.0.0 */ -public enum BDDReorderingMethod { +public enum BddReorderingMethod { BDD_REORDER_NONE, BDD_REORDER_WIN2, BDD_REORDER_WIN2ITE, diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDTree.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddTree.java similarity index 90% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDTree.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddTree.java index cef541a8..068e2de8 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDTree.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddTree.java @@ -9,7 +9,7 @@ * @version 2.0.0 * @since 2.0.0 */ -public class BDDTree { +public class BddTree { protected int first; protected int last; // First and last variable in this block protected int pos; // Sifting position @@ -17,15 +17,15 @@ public class BDDTree { // Are the sub-blocks fixed or may they be reordered protected boolean fixed; protected final int id; // A sequential id number given by addblock - protected BDDTree next; - protected BDDTree prev; - protected BDDTree nextlevel; + protected BddTree next; + protected BddTree prev; + protected BddTree nextlevel; /** * Constructs a new BDD tree with the given id. * @param id the id */ - public BDDTree(final int id) { + public BddTree(final int id) { this.id = id; first = -1; last = -1; @@ -46,7 +46,7 @@ public BDDTree(final int id) { * @param level2var the level to variable mapping * @return the (possibly changed) BDD tree */ - public static BDDTree addRange(final BDDTree tree, final int first, final int last, final boolean fixed, + public static BddTree addRange(final BddTree tree, final int first, final int last, final boolean fixed, final int id, final int[] level2var) { return addRangeRec(tree, null, first, last, fixed, id, level2var); } @@ -145,7 +145,7 @@ public int getId() { * Returns the next tree or {@code null} if no such tree exists. * @return the next tree */ - public BDDTree getNext() { + public BddTree getNext() { return next; } @@ -153,7 +153,7 @@ public BDDTree getNext() { * Sets the next tree. * @param next the next tree */ - public void setNext(final BDDTree next) { + public void setNext(final BddTree next) { this.next = next; } @@ -161,7 +161,7 @@ public void setNext(final BDDTree next) { * Returns the previous tree or {@code null} if no such tree exists. * @return the previous tree */ - public BDDTree getPrev() { + public BddTree getPrev() { return prev; } @@ -169,7 +169,7 @@ public BDDTree getPrev() { * Sets the previous tree. * @param prev the previous tree */ - public void setPrev(final BDDTree prev) { + public void setPrev(final BddTree prev) { this.prev = prev; } @@ -178,7 +178,7 @@ public void setPrev(final BDDTree prev) { * exists. * @return the tree of the next level */ - public BDDTree getNextlevel() { + public BddTree getNextlevel() { return nextlevel; } @@ -186,7 +186,7 @@ public BDDTree getNextlevel() { * Sets the tree of the next level. * @param nextlevel the tree of the next level */ - public void setNextlevel(final BDDTree nextlevel) { + public void setNextlevel(final BddTree nextlevel) { this.nextlevel = nextlevel; } @@ -201,7 +201,7 @@ public void setNextlevel(final BDDTree nextlevel) { * @param level2var the level to variable mapping * @return the (possibly changed) BDD tree */ - public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first, final int last, + public static BddTree addRangeRec(BddTree t, final BddTree prev, final int first, final int last, final boolean fixed, final int id, final int[] level2var) { if (first < 0 || last < 0 || last < first) { return null; @@ -209,7 +209,7 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first // Empty tree -> build one if (t == null) { - t = new BDDTree(id); + t = new BddTree(id); t.first = first; t.fixed = fixed; t.seq = new int[last - first + 1]; @@ -226,7 +226,7 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first // Before this section -> insert if (last < t.first) { - final BDDTree tnew = new BDDTree(id); + final BddTree tnew = new BddTree(id); tnew.first = first; tnew.last = last; tnew.fixed = fixed; @@ -240,7 +240,7 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first // After this section -> go to next if (first > t.last) { - final BDDTree next = addRangeRec(t.next, t, first, last, fixed, id, level2var); + final BddTree next = addRangeRec(t.next, t, first, last, fixed, id, level2var); if (next != null) { t.next = next; } @@ -249,7 +249,7 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first // Inside this section -> insert in next level if (first >= t.first && last <= t.last) { - final BDDTree nextlevel = addRangeRec(t.nextlevel, null, first, last, fixed, id, level2var); + final BddTree nextlevel = addRangeRec(t.nextlevel, null, first, last, fixed, id, level2var); if (nextlevel != null) { t.nextlevel = nextlevel; } @@ -258,8 +258,8 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first // Covering this section -> insert above this level if (first <= t.first) { - final BDDTree tnew; - BDDTree thisTree = t; + final BddTree tnew; + BddTree thisTree = t; while (true) { // Partial cover ->error @@ -267,7 +267,7 @@ public static BDDTree addRangeRec(BDDTree t, final BDDTree prev, final int first return null; } if (thisTree.next == null || last < thisTree.next.first) { - tnew = new BDDTree(id); + tnew = new BddTree(id); tnew.first = first; tnew.last = last; tnew.fixed = fixed; diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrdering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrdering.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrdering.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrdering.java index a6b415f4..366bdf6a 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrdering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrdering.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import java.util.ArrayList; @@ -24,7 +24,7 @@ * @version 2.0.0 * @since 1.4.0 */ -public final class BFSOrdering implements VariableOrderingProvider { +public final class BfsOrdering implements VariableOrderingProvider { @Override public List getOrder(final FormulaFactory f, final Formula formula) { @@ -62,7 +62,7 @@ private LinkedHashSet bfs(final Formula formula) { } break; case PBC: - final PBConstraint pbc = (PBConstraint) current; + final PbConstraint pbc = (PbConstraint) current; for (final Literal literal : pbc.getOperands()) { variables.add(literal.variable()); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrdering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrdering.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrdering.java rename to core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrdering.java index 0c06bbac..4f7c1fcd 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrdering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrdering.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import java.util.ArrayList; @@ -22,7 +22,7 @@ * @version 2.0.0 * @since 1.4.0 */ -public final class DFSOrdering implements VariableOrderingProvider { +public final class DfsOrdering implements VariableOrderingProvider { @Override public List getOrder(final FormulaFactory f, final Formula formula) { @@ -52,7 +52,7 @@ private void dfs(final Formula formula, final LinkedHashSet variables) } break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; for (final Literal lit : pbc.getOperands()) { variables.add(lit.variable()); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/ForceOrdering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/ForceOrdering.java index c6e7e5c2..3bcb0744 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/ForceOrdering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/ForceOrdering.java @@ -34,7 +34,7 @@ public final class ForceOrdering implements VariableOrderingProvider { private static final Comparator, Double>> COMPARATOR = Map.Entry.comparingByValue(); - private final DFSOrdering dfsOrdering = new DFSOrdering(); + private final DfsOrdering dfsOrdering = new DfsOrdering(); @Override public List getOrder(final FormulaFactory f, final Formula formula) { @@ -42,7 +42,7 @@ public List getOrder(final FormulaFactory f, final Formula formula) { final Formula nnf = formula.nnf(f); originalVariables.addAll(nnf.variables(f)); final Formula cnf = nnf.cnf(f); - final Hypergraph hypergraph = HypergraphGenerator.fromCNF(f, cnf); + final Hypergraph hypergraph = HypergraphGenerator.fromCnf(f, cnf); final Map> nodes = new HashMap<>(); for (final HypergraphNode node : hypergraph.getNodes()) { nodes.put(node.getContent(), node); diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MaxToMinOrdering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MaxToMinOrdering.java index 863b3aa5..4e0c0681 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MaxToMinOrdering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MaxToMinOrdering.java @@ -23,7 +23,7 @@ */ public final class MaxToMinOrdering implements VariableOrderingProvider { - private final DFSOrdering dfsOrdering = new DFSOrdering(); + private final DfsOrdering dfsOrdering = new DfsOrdering(); @Override public List getOrder(final FormulaFactory f, final Formula formula) { diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MinToMaxOrdering.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MinToMaxOrdering.java index feb2b044..da8696f9 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MinToMaxOrdering.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/MinToMaxOrdering.java @@ -25,7 +25,7 @@ */ public final class MinToMaxOrdering implements VariableOrderingProvider { - private final DFSOrdering dfsOrdering = new DFSOrdering(); + private final DfsOrdering dfsOrdering = new DfsOrdering(); @Override public List getOrder(final FormulaFactory f, final Formula formula) { diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/VariableOrderingProvider.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/VariableOrderingProvider.java index 137efee5..52360992 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/VariableOrderingProvider.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/VariableOrderingProvider.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import java.util.ArrayList; import java.util.Comparator; @@ -26,7 +26,7 @@ public interface VariableOrderingProvider { /** * Generates a variable ordering for a given formula. Such a variable * ordering can then be used for the initialization of the BDD Kernel in - * {@link BDDKernel#BDDKernel(FormulaFactory, List, int, int)}. + * {@link BddKernel#BddKernel(FormulaFactory, List, int, int)}. * @param f the factory for caching and generating new formulas * @param formula the formula * @return the variable ordering diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompiler.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompiler.java index 150bc387..63c917c8 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompiler.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompiler.java @@ -12,16 +12,16 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.Dnnf; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTree; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTreeLeaf; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.dtree.DTreeNode; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.dtree.MinFillDTreeGenerator; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.transformations.cnf.CNFSubsumption; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.transformations.cnf.CnfSubsumption; import com.booleworks.logicng.transformations.simplification.BackboneSimplifier; import com.booleworks.logicng.util.Pair; @@ -97,17 +97,17 @@ public static Dnnf compile(final FormulaFactory f, final Formula formula) { * @param handler the computation handler * @return the compiled DNNF */ - public static LNGResult compile(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { + public static LngResult compile(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { return prepareAndStartComputation(f, formula, handler); } - private static LNGResult prepareAndStartComputation(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { + private static LngResult prepareAndStartComputation(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { final SortedSet originalVariables = new TreeSet<>(formula.variables(f)); final Formula cnf = formula.cnf(f); originalVariables.addAll(cnf.variables(f)); - final LNGResult simplified = simplifyFormula(f, cnf, handler); + final LngResult simplified = simplifyFormula(f, cnf, handler); if (!simplified.isSuccess()) { - return LNGResult.canceled(simplified.getCancelCause()); + return LngResult.canceled(simplified.getCancelCause()); } final Formula simplifiedFormula = simplified.getResult(); @@ -115,29 +115,29 @@ private static LNGResult prepareAndStartComputation(final FormulaFactory f final Formula unitClauses = unitAndNonUnitClauses.getFirst(); final Formula nonUnitClauses = unitAndNonUnitClauses.getSecond(); if (nonUnitClauses.isAtomicFormula()) { - return LNGResult.of(new Dnnf(originalVariables, simplifiedFormula)); + return LngResult.of(new Dnnf(originalVariables, simplifiedFormula)); } - if (!simplifiedFormula.holds(new SATPredicate(f))) { - return LNGResult.of(new Dnnf(originalVariables, f.falsum())); + if (!simplifiedFormula.holds(new SatPredicate(f))) { + return LngResult.of(new Dnnf(originalVariables, f.falsum())); } - final LNGResult dTreeResult = generateDTree(nonUnitClauses, f, handler); + final LngResult dTreeResult = generateDTree(nonUnitClauses, f, handler); if (!dTreeResult.isSuccess()) { - return LNGResult.canceled(dTreeResult.getCancelCause()); + return LngResult.canceled(dTreeResult.getCancelCause()); } return new DnnfCompiler(f, simplifiedFormula, unitClauses, nonUnitClauses, computeMaxClauseSize(nonUnitClauses)) .start(dTreeResult.getResult(), originalVariables, handler); } - protected static LNGResult generateDTree(final Formula nonUnitClauses, final FormulaFactory f, final ComputationHandler handler) { + protected static LngResult generateDTree(final Formula nonUnitClauses, final FormulaFactory f, final ComputationHandler handler) { return new MinFillDTreeGenerator().generate(f, nonUnitClauses, handler); } - protected static LNGResult simplifyFormula(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { - final LNGResult backboneSimplified = formula.transform(new BackboneSimplifier(f), handler); + protected static LngResult simplifyFormula(final FormulaFactory f, final Formula formula, final ComputationHandler handler) { + final LngResult backboneSimplified = formula.transform(new BackboneSimplifier(f), handler); if (!backboneSimplified.isSuccess()) { - return LNGResult.canceled(backboneSimplified.getCancelCause()); + return LngResult.canceled(backboneSimplified.getCancelCause()); } - return backboneSimplified.getResult().transform(new CNFSubsumption(f), handler); + return backboneSimplified.getResult().transform(new CnfSubsumption(f), handler); } protected static Pair splitCnfClauses(final Formula originalCnf, final FormulaFactory f) { @@ -179,16 +179,16 @@ protected static int computeMaxClauseSize(final Formula cnf) { } } - protected LNGResult start(final DTree tree, + protected LngResult start(final DTree tree, final SortedSet originalVariables, final ComputationHandler handler) { if (!solver.start()) { - return LNGResult.of(new Dnnf(originalVariables, f.falsum())); + return LngResult.of(new Dnnf(originalVariables, f.falsum())); } tree.initialize(solver); initializeCaches(tree); if (!handler.shouldResume(DNNF_COMPUTATION_STARTED)) { - return LNGResult.canceled(DNNF_COMPUTATION_STARTED); + return LngResult.canceled(DNNF_COMPUTATION_STARTED); } return cnf2Ddnnf(tree, handler).map(result -> new Dnnf(originalVariables, f.and(unitClauses, result))); } @@ -208,23 +208,23 @@ protected void initializeCaches(final DTree dTree) { } } - protected LNGResult cnf2Ddnnf(final DTree tree, final ComputationHandler handler) { + protected LngResult cnf2Ddnnf(final DTree tree, final ComputationHandler handler) { return cnf2Ddnnf(tree, 0, handler); } - protected LNGResult cnf2Ddnnf(final DTree tree, final int currentShannons, final ComputationHandler handler) { + protected LngResult cnf2Ddnnf(final DTree tree, final int currentShannons, final ComputationHandler handler) { final BitSet separator = tree.dynamicSeparator(); final Formula implied = newlyImpliedLiterals(tree.getStaticVarSet()); if (separator.isEmpty()) { if (tree instanceof DTreeLeaf) { - return LNGResult.of(f.and(implied, leaf2Ddnnf((DTreeLeaf) tree))); + return LngResult.of(f.and(implied, leaf2Ddnnf((DTreeLeaf) tree))); } else { return conjoin(implied, (DTreeNode) tree, currentShannons, handler); } } else { if (!handler.shouldResume(DNNF_SHANNON_EXPANSION)) { - return LNGResult.canceled(DNNF_SHANNON_EXPANSION); + return LngResult.canceled(DNNF_SHANNON_EXPANSION); } final int var = chooseShannonVariable(tree, separator, currentShannons); @@ -232,7 +232,7 @@ protected LNGResult cnf2Ddnnf(final DTree tree, final int currentShanno /* Positive branch */ final Formula positiveDnnf; if (solver.decide(var, true)) { - final LNGResult recursivePositive = cnf2Ddnnf(tree, currentShannons + 1, handler); + final LngResult recursivePositive = cnf2Ddnnf(tree, currentShannons + 1, handler); if (!recursivePositive.isSuccess()) { solver.undoDecide(var); return recursivePositive; @@ -246,14 +246,14 @@ protected LNGResult cnf2Ddnnf(final DTree tree, final int currentShanno if (solver.atAssertionLevel() && solver.assertCdLiteral()) { return cnf2Ddnnf(tree, handler); } else { - return LNGResult.of(f.falsum()); + return LngResult.of(f.falsum()); } } /* Negative branch */ Formula negativeDnnf = f.falsum(); if (solver.decide(var, false)) { - final LNGResult recursiveNegative = cnf2Ddnnf(tree, currentShannons + 1, handler); + final LngResult recursiveNegative = cnf2Ddnnf(tree, currentShannons + 1, handler); if (!recursiveNegative.isSuccess()) { solver.undoDecide(var); return recursiveNegative; @@ -265,14 +265,14 @@ protected LNGResult cnf2Ddnnf(final DTree tree, final int currentShanno if (solver.atAssertionLevel() && solver.assertCdLiteral()) { return cnf2Ddnnf(tree, handler); } else { - return LNGResult.of(f.falsum()); + return LngResult.of(f.falsum()); } } final Literal lit = solver.litForIdx(var); final Formula positiveBranch = f.and(lit, positiveDnnf); final Formula negativeBranch = f.and(lit.negate(f), negativeDnnf); - return LNGResult.of(f.and(implied, f.or(positiveBranch, negativeBranch))); + return LngResult.of(f.and(implied, f.or(positiveBranch, negativeBranch))); } } @@ -295,30 +295,30 @@ protected int chooseShannonVariable(final DTree tree, final BitSet separator, fi return max; } - protected LNGResult conjoin(final Formula implied, final DTreeNode tree, final int currentShannons, final ComputationHandler handler) { + protected LngResult conjoin(final Formula implied, final DTreeNode tree, final int currentShannons, final ComputationHandler handler) { if (implied == f.falsum()) { - return LNGResult.of(f.falsum()); + return LngResult.of(f.falsum()); } - final LNGResult left = cnfAux(tree.left(), currentShannons, handler); + final LngResult left = cnfAux(tree.left(), currentShannons, handler); if (left.getResult() == null || left.getResult() == f.falsum()) { return left; } - final LNGResult right = cnfAux(tree.right(), currentShannons, handler); + final LngResult right = cnfAux(tree.right(), currentShannons, handler); if (right.getResult() == null || right.getResult() == f.falsum()) { return right; } - return LNGResult.of(f.and(implied, left.getResult(), right.getResult())); + return LngResult.of(f.and(implied, left.getResult(), right.getResult())); } - protected LNGResult cnfAux(final DTree tree, final int currentShannons, final ComputationHandler handler) { + protected LngResult cnfAux(final DTree tree, final int currentShannons, final ComputationHandler handler) { if (tree instanceof DTreeLeaf) { - return LNGResult.of(leaf2Ddnnf((DTreeLeaf) tree)); + return LngResult.of(leaf2Ddnnf((DTreeLeaf) tree)); } else { final BitSet key = computeCacheKey((DTreeNode) tree, currentShannons); if (cache.containsKey(key)) { - return LNGResult.of(cache.get(key)); + return LngResult.of(cache.get(key)); } else { - final LNGResult dnnf = cnf2Ddnnf(tree, handler); + final LngResult dnnf = cnf2Ddnnf(tree, handler); if (dnnf.getResult() != null && dnnf.getResult() != f.falsum()) { cache.put((BitSet) key.clone(), dnnf.getResult()); } @@ -342,7 +342,7 @@ protected Formula leaf2Ddnnf(final DTreeLeaf leaf) { int index = 0; while (literals.hasNext()) { lit = literals.next(); - switch (solver.valueOf(LNGCoreSolver.mkLit(solver.variableIndex(lit), !lit.getPhase()))) { + switch (solver.valueOf(LngCoreSolver.mkLit(solver.variableIndex(lit), !lit.getPhase()))) { case TRUE: return f.verum(); case UNDEF: diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCoreSolver.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCoreSolver.java index d7b8ec3f..b1c45675 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCoreSolver.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCoreSolver.java @@ -4,14 +4,14 @@ package com.booleworks.logicng.knowledgecompilation.dnnf; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Tristate; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import java.util.ArrayList; import java.util.Arrays; @@ -23,11 +23,11 @@ * @version 2.0.0 * @since 2.0.0 */ -public class DnnfCoreSolver extends LNGCoreSolver implements DnnfSatSolver { +public class DnnfCoreSolver extends LngCoreSolver implements DnnfSatSolver { protected boolean newlyImpliedDirty = false; protected int assertionLevel = -1; - protected LNGIntVector lastLearnt = null; + protected LngIntVector lastLearnt = null; protected final FormulaFactory f; protected final Tristate[] assignment; protected final List impliedOperands; @@ -38,7 +38,7 @@ public class DnnfCoreSolver extends LNGCoreSolver implements DnnfSatSolver { * @param numberOfVariables the number of variables */ public DnnfCoreSolver(final FormulaFactory f, final int numberOfVariables) { - super(f, SATSolverConfig.builder().build()); + super(f, SatSolverConfig.builder().build()); this.f = f; assignment = new Tristate[2 * numberOfVariables]; Arrays.fill(assignment, Tristate.UNDEF); @@ -72,7 +72,7 @@ public Literal litForIdx(final int var) { * @return the variable index of the literal */ public static int var(final int lit) { - return LNGCoreSolver.var(lit); + return LngCoreSolver.var(lit); } /** @@ -142,8 +142,8 @@ public boolean assertCdLiteral() { uncheckedEnqueue(lastLearnt.get(0), null); unitClauses.push(lastLearnt.get(0)); } else { - final LNGClause cr = new LNGClause(lastLearnt, nextStateId); - cr.setLBD(analyzeLBD); + final LngClause cr = new LngClause(lastLearnt, nextStateId); + cr.setLbd(analyzeLbd); cr.setOneWatched(false); learnts.push(cr); attachClause(cr); @@ -177,7 +177,7 @@ protected Literal intToLiteral(final int lit) { } protected boolean propagateAfterDecide() { - final LNGClause conflict = propagate(); + final LngClause conflict = propagate(); if (conflict != null) { handleConflict(conflict); return false; @@ -186,7 +186,7 @@ protected boolean propagateAfterDecide() { } @Override - protected void uncheckedEnqueue(final int lit, final LNGClause reason) { + protected void uncheckedEnqueue(final int lit, final LngClause reason) { assignment[lit] = Tristate.TRUE; assignment[lit ^ 1] = Tristate.FALSE; super.uncheckedEnqueue(lit, reason); @@ -204,9 +204,9 @@ protected void cancelUntil(final int level) { } } - protected void handleConflict(final LNGClause conflict) { + protected void handleConflict(final LngClause conflict) { if (decisionLevel() > 0) { - lastLearnt = new LNGIntVector(); + lastLearnt = new LngIntVector(); analyze(conflict, lastLearnt); assertionLevel = analyzeBtLevel; } else { diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeGenerator.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeGenerator.java index 5a03d2c8..82d83df4 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeGenerator.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeGenerator.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; /** @@ -34,5 +34,5 @@ default DTree generate(final FormulaFactory f, final Formula cnf) { * @param handler the computation handler * @return the DTree */ - LNGResult generate(final FormulaFactory f, final Formula cnf, ComputationHandler handler); + LngResult generate(final FormulaFactory f, final Formula cnf, ComputationHandler handler); } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeLeaf.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeLeaf.java index ed2006fd..2736230e 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeLeaf.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeLeaf.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.knowledgecompilation.dnnf.DnnfSatSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.ArrayList; import java.util.BitSet; @@ -58,7 +58,7 @@ public void initialize(final DnnfSatSolver solver) { final int var = solver.variableIndex(literal); staticVarSet.set(var); staticVariables[i] = var; - literals[i] = LNGCoreSolver.mkLit(var, !literal.getPhase()); + literals[i] = LngCoreSolver.mkLit(var, !literal.getPhase()); i++; } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeNode.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeNode.java index d0100192..0ed14e60 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeNode.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeNode.java @@ -4,12 +4,12 @@ package com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.dtree; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Tristate; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.knowledgecompilation.dnnf.DnnfSatSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.BitSet; import java.util.List; @@ -111,7 +111,7 @@ public void initialize(final DnnfSatSolver solver) { localLeftVarSet = new BitSet(staticVariables[staticVariables.length - 1]); localRightVarSet = new BitSet(staticVariables[staticVariables.length - 1]); - final LNGIntVector lClauseContents = new LNGIntVector(); + final LngIntVector lClauseContents = new LngIntVector(); for (final DTreeLeaf leaf : leftLeafs) { for (final int i : leaf.literals()) { lClauseContents.push(i); @@ -119,7 +119,7 @@ public void initialize(final DnnfSatSolver solver) { lClauseContents.push(-leaf.getId() - 1); } leftClauseContents = lClauseContents.toArray(); - final LNGIntVector rClauseContents = new LNGIntVector(); + final LngIntVector rClauseContents = new LngIntVector(); for (final DTreeLeaf leaf : rightLeafs) { for (final int i : leaf.literals()) { rClauseContents.push(i); @@ -166,7 +166,7 @@ protected void varSet(final int[] clausesContents, final BitSet localVarSet) { if (!subsumed) { for (int n = i; n < j; n++) { if (solver.valueOf(clausesContents[n]) == Tristate.UNDEF) { - localVarSet.set(LNGCoreSolver.var(clausesContents[n])); + localVarSet.set(LngCoreSolver.var(clausesContents[n])); } } } @@ -194,7 +194,7 @@ public void cacheKey(final BitSet key, final int numberOfVariables) { key.set(-clauseContents[j] + 1 + numberOfVariables); for (int n = i; n < j; n++) { if (solver.valueOf(clauseContents[n]) == Tristate.UNDEF) { - key.set(LNGCoreSolver.var(clauseContents[n])); + key.set(LngCoreSolver.var(clauseContents[n])); } } } diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/EliminatingOrderDTreeGenerator.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/EliminatingOrderDTreeGenerator.java index 0927f38f..8739bdb9 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/EliminatingOrderDTreeGenerator.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/EliminatingOrderDTreeGenerator.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.ArrayList; import java.util.Iterator; @@ -33,15 +33,15 @@ public abstract class EliminatingOrderDTreeGenerator implements DTreeGenerator { * @param ordering the variable ordering * @return the DTree */ - public final LNGResult generateWithEliminatingOrder(final FormulaFactory f, final Formula cnf, + public final LngResult generateWithEliminatingOrder(final FormulaFactory f, final Formula cnf, final List ordering, final ComputationHandler handler) { assert cnf.variables(f).size() == ordering.size(); - if (!cnf.isCNF(f) || cnf.isAtomicFormula()) { + if (!cnf.isCnf(f) || cnf.isAtomicFormula()) { throw new IllegalArgumentException("Cannot generate DTree from a non-cnf formula or atomic formula"); } else if (cnf.getType() != FType.AND) { - return LNGResult.of(new DTreeLeaf(f, 0, cnf)); + return LngResult.of(new DTreeLeaf(f, 0, cnf)); } final List sigma = new ArrayList<>(); @@ -52,7 +52,7 @@ public final LNGResult generateWithEliminatingOrder(final FormulaFactory for (final Variable variable : ordering) { if (!handler.shouldResume(DNNF_DTREE_PROCESSING_NEXT_ORDER_VARIABLE)) { - return LNGResult.canceled(DNNF_DTREE_PROCESSING_NEXT_ORDER_VARIABLE); + return LngResult.canceled(DNNF_DTREE_PROCESSING_NEXT_ORDER_VARIABLE); } final List gamma = new ArrayList<>(); final Iterator sigmaIterator = sigma.iterator(); @@ -68,7 +68,7 @@ public final LNGResult generateWithEliminatingOrder(final FormulaFactory } } - return LNGResult.of(compose(f, sigma)); + return LngResult.of(compose(f, sigma)); } protected DTree compose(final FormulaFactory f, final List trees) { diff --git a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/MinFillDTreeGenerator.java b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/MinFillDTreeGenerator.java index fefdefbd..698825e9 100644 --- a/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/MinFillDTreeGenerator.java +++ b/core/src/main/java/com/booleworks/logicng/knowledgecompilation/dnnf/datastructures/dtree/MinFillDTreeGenerator.java @@ -7,13 +7,13 @@ import static com.booleworks.logicng.handlers.events.SimpleEvent.DNNF_DTREE_MIN_FILL_GRAPH_INITIALIZED; import static com.booleworks.logicng.handlers.events.SimpleEvent.DNNF_DTREE_MIN_FILL_NEW_ITERATION; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.ArrayList; import java.util.Arrays; @@ -32,14 +32,14 @@ public class MinFillDTreeGenerator extends EliminatingOrderDTreeGenerator { @Override - public LNGResult generate(final FormulaFactory f, final Formula cnf, final ComputationHandler handler) { + public LngResult generate(final FormulaFactory f, final Formula cnf, final ComputationHandler handler) { final Graph graph = new Graph(f, cnf); if (!handler.shouldResume(DNNF_DTREE_MIN_FILL_GRAPH_INITIALIZED)) { - return LNGResult.canceled(DNNF_DTREE_MIN_FILL_GRAPH_INITIALIZED); + return LngResult.canceled(DNNF_DTREE_MIN_FILL_GRAPH_INITIALIZED); } - final LNGResult> minFillOrdering = graph.getMinFillOrdering(handler); + final LngResult> minFillOrdering = graph.getMinFillOrdering(handler); if (!minFillOrdering.isSuccess()) { - return LNGResult.canceled(minFillOrdering.getCancelCause()); + return LngResult.canceled(minFillOrdering.getCancelCause()); } return generateWithEliminatingOrder(f, cnf, minFillOrdering.getResult(), handler); } @@ -108,10 +108,10 @@ public Graph(final FormulaFactory f, final Formula cnf) { } } - protected List getCopyOfEdgeList() { - final List result = new ArrayList<>(); + protected List getCopyOfEdgeList() { + final List result = new ArrayList<>(); for (final Set edge : edgeList) { - result.add(LNGIntVector.of(edge.stream().mapToInt(i -> i).toArray())); + result.add(LngIntVector.of(edge.stream().mapToInt(i -> i).toArray())); } return result; } @@ -124,9 +124,9 @@ protected boolean[][] getCopyOfAdjMatrix() { return result; } - protected LNGResult> getMinFillOrdering(final ComputationHandler handler) { + protected LngResult> getMinFillOrdering(final ComputationHandler handler) { final boolean[][] fillAdjMatrix = getCopyOfAdjMatrix(); - final List fillEdgeList = getCopyOfEdgeList(); + final List fillEdgeList = getCopyOfEdgeList(); final Variable[] ordering = new Variable[numberOfVertices]; final boolean[] processed = new boolean[numberOfVertices]; @@ -134,16 +134,16 @@ protected LNGResult> getMinFillOrdering(final ComputationHandler for (int iteration = 0; iteration < numberOfVertices; iteration++) { if (!handler.shouldResume(DNNF_DTREE_MIN_FILL_NEW_ITERATION)) { - return LNGResult.canceled(DNNF_DTREE_MIN_FILL_NEW_ITERATION); + return LngResult.canceled(DNNF_DTREE_MIN_FILL_NEW_ITERATION); } - final LNGIntVector possiblyBestVertices = new LNGIntVector(); + final LngIntVector possiblyBestVertices = new LngIntVector(); int minEdges = Integer.MAX_VALUE; for (int currentVertex = 0; currentVertex < numberOfVertices; currentVertex++) { if (processed[currentVertex]) { continue; } int edgesAdded = 0; - final LNGIntVector neighborList = fillEdgeList.get(currentVertex); + final LngIntVector neighborList = fillEdgeList.get(currentVertex); for (int i = 0; i < neighborList.size(); i++) { final int firstNeighbor = neighborList.get(i); if (processed[firstNeighbor]) { @@ -171,7 +171,7 @@ protected LNGResult> getMinFillOrdering(final ComputationHandler // or choose randomly final int bestVertex = possiblyBestVertices.get(0); - final LNGIntVector neighborList = fillEdgeList.get(bestVertex); + final LngIntVector neighborList = fillEdgeList.get(bestVertex); for (int i = 0; i < neighborList.size(); i++) { final int firstNeighbor = neighborList.get(i); if (processed[firstNeighbor]) { @@ -204,7 +204,7 @@ protected LNGResult> getMinFillOrdering(final ComputationHandler processed[bestVertex] = true; ordering[iteration] = vertices.get(bestVertex); } - return LNGResult.of(Arrays.asList(ordering)); + return LngResult.of(Arrays.asList(ordering)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/modelcounting/ModelCounter.java b/core/src/main/java/com/booleworks/logicng/modelcounting/ModelCounter.java index 3070d52a..52aba4df 100644 --- a/core/src/main/java/com/booleworks/logicng/modelcounting/ModelCounter.java +++ b/core/src/main/java/com/booleworks/logicng/modelcounting/ModelCounter.java @@ -15,14 +15,14 @@ import com.booleworks.logicng.graphs.datastructures.Node; import com.booleworks.logicng.graphs.generators.ConstraintGraphGenerator; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.knowledgecompilation.dnnf.DnnfCompiler; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.Dnnf; import com.booleworks.logicng.knowledgecompilation.dnnf.functions.DnnfModelCountFunction; import com.booleworks.logicng.transformations.PureExpansionTransformation; -import com.booleworks.logicng.transformations.cnf.CNFConfig; -import com.booleworks.logicng.transformations.cnf.CNFEncoder; +import com.booleworks.logicng.transformations.cnf.CnfConfig; +import com.booleworks.logicng.transformations.cnf.CnfEncoder; import com.booleworks.logicng.util.FormulaHelper; import java.math.BigInteger; @@ -75,7 +75,7 @@ public static BigInteger count(final FormulaFactory f, final Collection * @return the model count of the formulas for the variables or {@code null} * if the DNNF handler canceled the DNNF computation */ - public static LNGResult count(final FormulaFactory f, final Collection formulas, + public static LngResult count(final FormulaFactory f, final Collection formulas, final SortedSet variables, final ComputationHandler handler) { if (!variables.containsAll(FormulaHelper.variables(f, formulas))) { throw new IllegalArgumentException("Expected variables to contain all of the formulas' variables."); @@ -83,16 +83,16 @@ public static LNGResult count(final FormulaFactory f, final Collecti if (variables.isEmpty()) { final List remainingConstants = formulas.stream().filter(formula -> formula.getType() != FType.TRUE).collect(Collectors.toList()); - return LNGResult.of(remainingConstants.isEmpty() ? BigInteger.ONE : BigInteger.ZERO); + return LngResult.of(remainingConstants.isEmpty() ? BigInteger.ONE : BigInteger.ZERO); } final List cnfs = encodeAsCnf(f, formulas); final SimplificationResult simplification = simplify(f, cnfs); - final LNGResult count = count(f, simplification.simplifiedFormulas, handler); + final LngResult count = count(f, simplification.simplifiedFormulas, handler); if (!count.isSuccess()) { return count; } final SortedSet dontCareVariables = simplification.getDontCareVariables(variables); - return LNGResult.of(count.getResult().multiply(BigInteger.valueOf(2).pow(dontCareVariables.size()))); + return LngResult.of(count.getResult().multiply(BigInteger.valueOf(2).pow(dontCareVariables.size()))); } private static List encodeAsCnf(final FormulaFactory f, final Collection formulas) { @@ -100,11 +100,11 @@ private static List encodeAsCnf(final FormulaFactory f, final Collectio final List expandedFormulas = formulas.stream().map(formula -> formula.transform(expander)).collect(Collectors.toList()); - final CNFConfig cnfConfig = CNFConfig.builder() - .algorithm(CNFConfig.Algorithm.ADVANCED) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.TSEITIN).build(); + final CnfConfig cnfConfig = CnfConfig.builder() + .algorithm(CnfConfig.Algorithm.ADVANCED) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.TSEITIN).build(); - return expandedFormulas.stream().map(it -> CNFEncoder.encode(f, it, cnfConfig)).collect(Collectors.toList()); + return expandedFormulas.stream().map(it -> CnfEncoder.encode(f, it, cnfConfig)).collect(Collectors.toList()); } private static SimplificationResult simplify(final FormulaFactory f, final Collection formulas) { @@ -127,20 +127,20 @@ private static SimplificationResult simplify(final FormulaFactory f, final Colle return new SimplificationResult(f, backboneVariables, simplified); } - private static LNGResult count(final FormulaFactory f, final Collection formulas, + private static LngResult count(final FormulaFactory f, final Collection formulas, final ComputationHandler handler) { final Graph constraintGraph = ConstraintGraphGenerator.generateFromFormulas(f, formulas); final Set>> ccs = ConnectedComponentsComputation.compute(constraintGraph); final List> components = ConnectedComponentsComputation.splitFormulasByComponent(f, formulas, ccs); BigInteger count = BigInteger.ONE; for (final List component : components) { - final LNGResult dnnf = DnnfCompiler.compile(f, f.and(component), handler); + final LngResult dnnf = DnnfCompiler.compile(f, f.and(component), handler); if (!dnnf.isSuccess()) { - return LNGResult.canceled(dnnf.getCancelCause()); + return LngResult.canceled(dnnf.getCancelCause()); } count = count.multiply(dnnf.getResult().execute(new DnnfModelCountFunction(f))); } - return LNGResult.of(count); + return LngResult.of(count); } private static class SimplificationResult { diff --git a/core/src/main/java/com/booleworks/logicng/np/SetCover.java b/core/src/main/java/com/booleworks/logicng/np/SetCover.java index 2af7ded3..8ca1baf6 100644 --- a/core/src/main/java/com/booleworks/logicng/np/SetCover.java +++ b/core/src/main/java/com/booleworks/logicng/np/SetCover.java @@ -6,8 +6,8 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.MaxSatSolver; import com.booleworks.logicng.util.CollectionHelper; import java.util.ArrayList; @@ -60,19 +60,19 @@ public static List> compute(final FormulaFactory f, final Collection< elementOccurrences.computeIfAbsent(element, i -> new LinkedHashSet<>()).add(setVar); } } - final MaxSATSolver solver = MaxSATSolver.msu3(f); + final MaxSatSolver solver = MaxSatSolver.msu3(f); for (final Set occurrences : elementOccurrences.values()) { solver.addHardFormula(f.or(occurrences)); } for (final Variable setVar : setMap.keySet()) { solver.addSoftFormula(setVar.negate(f), 1); } - final MaxSATResult maxSATResult = solver.solve(); - if (!maxSATResult.isSatisfiable()) { + final MaxSatResult maxSatResult = solver.solve(); + if (!maxSatResult.isSatisfiable()) { throw new IllegalStateException("Internal optimization problem was not feasible."); } final ArrayList minimumCover = - CollectionHelper.intersection(maxSATResult.getModel().positiveVariables(), setMap.keySet(), ArrayList::new); + CollectionHelper.intersection(maxSatResult.getModel().positiveVariables(), setMap.keySet(), ArrayList::new); final List> result = new ArrayList<>(); for (final Variable setVar : minimumCover) { result.add(setMap.get(setVar)); diff --git a/core/src/main/java/com/booleworks/logicng/predicates/AIGPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/AigPredicate.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/predicates/AIGPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/AigPredicate.java index 3d1fb42d..d5d77973 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/AIGPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/AigPredicate.java @@ -17,7 +17,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class AIGPredicate extends CacheableFormulaPredicate { +public final class AigPredicate extends CacheableFormulaPredicate { /** * Constructs a new predicate. For a caching formula factory, the cache of @@ -25,7 +25,7 @@ public final class AIGPredicate extends CacheableFormulaPredicate { * be used. * @param f the formula factory to generate new formulas */ - public AIGPredicate(final FormulaFactory f) { + public AigPredicate(final FormulaFactory f) { super(f, PredicateCacheEntry.IS_AIG); } @@ -35,7 +35,7 @@ public AIGPredicate(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public AIGPredicate(final FormulaFactory f, final Map cache) { + public AigPredicate(final FormulaFactory f, final Map cache) { super(f, cache); } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/CNFPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/CnfPredicate.java similarity index 89% rename from core/src/main/java/com/booleworks/logicng/predicates/CNFPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/CnfPredicate.java index c41898a4..9c92000c 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/CNFPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/CnfPredicate.java @@ -17,7 +17,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class CNFPredicate extends CacheableFormulaPredicate { +public final class CnfPredicate extends CacheableFormulaPredicate { /** * Constructs a new predicate. For a caching formula factory, the cache of @@ -25,7 +25,7 @@ public final class CNFPredicate extends CacheableFormulaPredicate { * be used. * @param f the formula factory to generate new formulas */ - public CNFPredicate(final FormulaFactory f) { + public CnfPredicate(final FormulaFactory f) { super(f, PredicateCacheEntry.IS_CNF); } @@ -35,7 +35,7 @@ public CNFPredicate(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public CNFPredicate(final FormulaFactory f, final Map cache) { + public CnfPredicate(final FormulaFactory f, final Map cache) { super(f, cache); } @@ -57,7 +57,7 @@ public boolean test(final Formula formula) { case PBC: return false; case OR: - final boolean orIsCnf = ((Or) formula).isCNFClause(); + final boolean orIsCnf = ((Or) formula).isCnfClause(); setCache(formula, orIsCnf); return orIsCnf; case AND: @@ -71,6 +71,6 @@ public boolean test(final Formula formula) { private boolean isClause(final Formula formula) { return formula.getType() == FType.LITERAL || - formula.getType() == FType.OR && ((Or) formula).isCNFClause(); + formula.getType() == FType.OR && ((Or) formula).isCnfClause(); } } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/ContainsPBCPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/ContainsPbcPredicate.java similarity index 87% rename from core/src/main/java/com/booleworks/logicng/predicates/ContainsPBCPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/ContainsPbcPredicate.java index 5f6fa07f..af30257b 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/ContainsPBCPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/ContainsPbcPredicate.java @@ -15,14 +15,14 @@ * @version 3.0.0 * @since 2.0.0 */ -public final class ContainsPBCPredicate implements FormulaPredicate { +public final class ContainsPbcPredicate implements FormulaPredicate { - private final static ContainsPBCPredicate INSTANCE = new ContainsPBCPredicate(); + private final static ContainsPbcPredicate INSTANCE = new ContainsPbcPredicate(); /** * Private empty constructor. Singleton class. */ - private ContainsPBCPredicate() { + private ContainsPbcPredicate() { // Intentionally left empty } @@ -30,7 +30,7 @@ private ContainsPBCPredicate() { * Returns the singleton of the predicate. * @return the predicate instance */ - public static ContainsPBCPredicate get() { + public static ContainsPbcPredicate get() { return INSTANCE; } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/DNFPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/DnfPredicate.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/predicates/DNFPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/DnfPredicate.java index a218bd5f..d3f78dc0 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/DNFPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/DnfPredicate.java @@ -17,7 +17,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class DNFPredicate extends CacheableFormulaPredicate { +public final class DnfPredicate extends CacheableFormulaPredicate { /** * Constructs a new predicate. For a caching formula factory, the cache of @@ -25,7 +25,7 @@ public final class DNFPredicate extends CacheableFormulaPredicate { * be used. * @param f the formula factory to generate new formulas */ - public DNFPredicate(final FormulaFactory f) { + public DnfPredicate(final FormulaFactory f) { super(f, PredicateCacheEntry.IS_DNF); } @@ -35,7 +35,7 @@ public DNFPredicate(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public DNFPredicate(final FormulaFactory f, final Map cache) { + public DnfPredicate(final FormulaFactory f, final Map cache) { super(f, cache); } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicate.java index 6b7052ae..e6910662 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicate.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.Or; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import java.util.ArrayList; @@ -117,7 +117,7 @@ private Formula innerTest(final Formula formula, final boolean topLevel) { case AND: return handleAnd((And) formula, topLevel); case PBC: - return handlePBC((PBConstraint) formula); + return handlePbc((PbConstraint) formula); case PREDICATE: throw new UnsupportedOperationException( "Cannot evaluate a formula with predicates with a boolean assignment"); @@ -206,7 +206,7 @@ private Formula handleAnd(final And formula, final boolean topLevel) { return f.and(nops); } - private Formula handlePBC(final PBConstraint formula) { + private Formula handlePbc(final PbConstraint formula) { final Assignment assignment = new Assignment(); for (final Map.Entry entry : mapping.entrySet()) { assignment.addLiteral(f.literal(entry.getKey().getName(), entry.getValue())); diff --git a/core/src/main/java/com/booleworks/logicng/predicates/NNFPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/NnfPredicate.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/predicates/NNFPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/NnfPredicate.java index 6e1ea2f7..27e70c38 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/NNFPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/NnfPredicate.java @@ -15,7 +15,7 @@ * @version 3.0.0 * @since 1.5.1 */ -public final class NNFPredicate extends CacheableFormulaPredicate { +public final class NnfPredicate extends CacheableFormulaPredicate { /** * Constructs a new predicate. For a caching formula factory, the cache of @@ -23,7 +23,7 @@ public final class NNFPredicate extends CacheableFormulaPredicate { * be used. * @param f the formula factory to generate new formulas */ - public NNFPredicate(final FormulaFactory f) { + public NnfPredicate(final FormulaFactory f) { super(f, PredicateCacheEntry.IS_NNF); } @@ -33,7 +33,7 @@ public NNFPredicate(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public NNFPredicate(final FormulaFactory f, final Map cache) { + public NnfPredicate(final FormulaFactory f, final Map cache) { super(f, cache); } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContingencyPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContingencyPredicate.java index 3817322a..22038b35 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContingencyPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContingencyPredicate.java @@ -29,6 +29,6 @@ public ContingencyPredicate(final FormulaFactory f) { @Override public boolean test(final Formula formula) { - return formula.holds(new SATPredicate(f)) && !formula.holds(new TautologyPredicate(f)); + return formula.holds(new SatPredicate(f)) && !formula.holds(new TautologyPredicate(f)); } } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContradictionPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContradictionPredicate.java index 0fbf577a..bd90b162 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContradictionPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/ContradictionPredicate.java @@ -28,6 +28,6 @@ public ContradictionPredicate(final FormulaFactory f) { @Override public boolean test(final Formula formula) { - return !formula.holds(new SATPredicate(f)); + return !formula.holds(new SatPredicate(f)); } } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SATPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SatPredicate.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SATPredicate.java rename to core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SatPredicate.java index dc98654f..ba136188 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SATPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/SatPredicate.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.PredicateCacheEntry; import com.booleworks.logicng.predicates.CacheableFormulaPredicate; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Map; @@ -19,7 +19,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class SATPredicate extends CacheableFormulaPredicate { +public final class SatPredicate extends CacheableFormulaPredicate { /** * Constructs a new predicate. For a caching formula factory, the cache of @@ -27,7 +27,7 @@ public final class SATPredicate extends CacheableFormulaPredicate { * be used. * @param f the formula factory to generate new formulas */ - public SATPredicate(final FormulaFactory f) { + public SatPredicate(final FormulaFactory f) { super(f, PredicateCacheEntry.IS_SAT); } @@ -37,7 +37,7 @@ public SATPredicate(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public SATPredicate(final FormulaFactory f, final Map cache) { + public SatPredicate(final FormulaFactory f, final Map cache) { super(f, cache); } @@ -51,7 +51,7 @@ public boolean test(final Formula formula) { if (formula.getType() == FType.FALSE) { result = false; } else { - final var solver = SATSolver.newSolver(f); + final var solver = SatSolver.newSolver(f); solver.add(formula); result = solver.sat(); } diff --git a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/TautologyPredicate.java b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/TautologyPredicate.java index d400ffa7..49a8769e 100644 --- a/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/TautologyPredicate.java +++ b/core/src/main/java/com/booleworks/logicng/predicates/satisfiability/TautologyPredicate.java @@ -28,6 +28,6 @@ public TautologyPredicate(final FormulaFactory f) { @Override public boolean test(final Formula formula) { - return !formula.negate(f).holds(new SATPredicate(f)); + return !formula.negate(f).holds(new SatPredicate(f)); } } diff --git a/core/src/main/java/com/booleworks/logicng/primecomputation/NaivePrimeReduction.java b/core/src/main/java/com/booleworks/logicng/primecomputation/NaivePrimeReduction.java index c02021d1..353369d6 100644 --- a/core/src/main/java/com/booleworks/logicng/primecomputation/NaivePrimeReduction.java +++ b/core/src/main/java/com/booleworks/logicng/primecomputation/NaivePrimeReduction.java @@ -11,10 +11,10 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.util.FormulaHelper; import java.util.ArrayList; @@ -33,8 +33,8 @@ */ public final class NaivePrimeReduction { - private final SATSolver implicantSolver; - private final SATSolver implicateSolver; + private final SatSolver implicantSolver; + private final SatSolver implicateSolver; /** * Creates a new prime implicant computation for a given formula. @@ -42,11 +42,11 @@ public final class NaivePrimeReduction { * @param formula the formula */ public NaivePrimeReduction(final FormulaFactory f, final Formula formula) { - implicantSolver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + implicantSolver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); implicantSolver.add(formula.negate(f)); - implicateSolver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + implicateSolver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); implicateSolver.add(formula); } @@ -68,26 +68,26 @@ public SortedSet reduceImplicant(final SortedSet implicant) { * @param implicant the implicant * @param handler a SAT handler for the underlying SAT Solver * @return a prime implicant or null if the computation was canceled by the - * handler + * handler */ - public LNGResult> reduceImplicant(final Collection implicant, + public LngResult> reduceImplicant(final Collection implicant, final ComputationHandler handler) { if (!handler.shouldResume(IMPLICANT_REDUCTION_STARTED)) { - return LNGResult.canceled(IMPLICANT_REDUCTION_STARTED); + return LngResult.canceled(IMPLICANT_REDUCTION_STARTED); } final SortedSet primeImplicant = new TreeSet<>(implicant); for (final Literal lit : implicant) { primeImplicant.remove(lit); - final LNGResult sat = + final LngResult sat = implicantSolver.satCall().handler(handler).addFormulas(primeImplicant).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } if (sat.getResult()) { primeImplicant.add(lit); } } - return LNGResult.of(primeImplicant); + return LngResult.of(primeImplicant); } /** @@ -110,25 +110,25 @@ public SortedSet reduceImplicate(final FormulaFactory f, final SortedSe * @param implicate the implicate * @param handler a SAT handler for the underlying SAT Solver * @return a prime implicate of null if the computation was canceled by the - * handler + * handler */ - public LNGResult> reduceImplicate(final FormulaFactory f, final SortedSet implicate, + public LngResult> reduceImplicate(final FormulaFactory f, final SortedSet implicate, final ComputationHandler handler) { if (!handler.shouldResume(IMPLICATE_REDUCTION_STARTED)) { - return LNGResult.canceled(IMPLICATE_REDUCTION_STARTED); + return LngResult.canceled(IMPLICATE_REDUCTION_STARTED); } final SortedSet primeImplicate = new TreeSet<>(implicate); for (final Literal lit : implicate) { primeImplicate.remove(lit); final List assumptions = FormulaHelper.negateLiterals(f, primeImplicate, ArrayList::new); - final LNGResult sat = implicateSolver.satCall().handler(handler).addFormulas(assumptions).sat(); + final LngResult sat = implicateSolver.satCall().handler(handler).addFormulas(assumptions).sat(); if (!sat.isSuccess()) { - return LNGResult.canceled(sat.getCancelCause()); + return LngResult.canceled(sat.getCancelCause()); } if (sat.getResult()) { primeImplicate.add(lit); } } - return LNGResult.of(primeImplicate); + return LngResult.of(primeImplicate); } } diff --git a/core/src/main/java/com/booleworks/logicng/primecomputation/PrimeCompiler.java b/core/src/main/java/com/booleworks/logicng/primecomputation/PrimeCompiler.java index b6652f2f..f258adf0 100644 --- a/core/src/main/java/com/booleworks/logicng/primecomputation/PrimeCompiler.java +++ b/core/src/main/java/com/booleworks/logicng/primecomputation/PrimeCompiler.java @@ -12,12 +12,12 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.OptimizationFunction; -import com.booleworks.logicng.solvers.sat.SATCall; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatCall; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.transformations.LiteralSubstitution; import com.booleworks.logicng.util.FormulaHelper; import com.booleworks.logicng.util.Pair; @@ -106,59 +106,59 @@ public PrimeResult compute(final FormulaFactory f, final Formula formula, final * @return the prime result or null if the computation was canceled by the * handler */ - public LNGResult compute(final FormulaFactory f, final Formula formula, + public LngResult compute(final FormulaFactory f, final Formula formula, final PrimeResult.CoverageType type, final ComputationHandler handler) { if (!handler.shouldResume(PRIME_COMPUTATION_STARTED)) { - return LNGResult.canceled(PRIME_COMPUTATION_STARTED); + return LngResult.canceled(PRIME_COMPUTATION_STARTED); } final boolean completeImplicants = type == PrimeResult.CoverageType.IMPLICANTS_COMPLETE; final Formula formulaForComputation = completeImplicants ? formula : formula.negate(f); - final LNGResult>, List>>> genericResult = + final LngResult>, List>>> genericResult = computeGeneric(f, formulaForComputation, handler); if (!genericResult.isSuccess()) { - return LNGResult.canceled(genericResult.getCancelCause()); + return LngResult.canceled(genericResult.getCancelCause()); } final Pair>, List>> result = genericResult.getResult(); - return LNGResult.of(new PrimeResult( + return LngResult.of(new PrimeResult( completeImplicants ? result.getFirst() : negateAll(f, result.getSecond()), completeImplicants ? result.getSecond() : negateAll(f, result.getFirst()), type)); } - private LNGResult>, List>>> computeGeneric( + private LngResult>, List>>> computeGeneric( final FormulaFactory f, final Formula formula, final ComputationHandler handler) { final SubstitutionResult sub = createSubstitution(f, formula); - final SATSolver hSolver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver hSolver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); hSolver.add(sub.constraintFormula); - final SATSolver fSolver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver fSolver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); fSolver.add(formula.negate(f)); final NaivePrimeReduction primeReduction = new NaivePrimeReduction(f, formula); final List> primeImplicants = new ArrayList<>(); final List> primeImplicates = new ArrayList<>(); while (true) { if (!hSolver.sat()) { - return LNGResult.of(new Pair<>(primeImplicants, primeImplicates)); + return LngResult.of(new Pair<>(primeImplicants, primeImplicates)); } - final LNGResult hModelResult = hSolver.execute(computeWithMaximization + final LngResult hModelResult = hSolver.execute(computeWithMaximization ? OptimizationFunction.builder().literals(sub.newVar2oldLit.keySet()).maximize().build() : OptimizationFunction.builder().literals(sub.newVar2oldLit.keySet()).minimize().build(), handler); if (!hModelResult.isSuccess()) { - return LNGResult.canceled(hModelResult.getCancelCause()); + return LngResult.canceled(hModelResult.getCancelCause()); } final Model hModel = hModelResult.getResult(); final Model fModel = transformModel(hModel, sub.newVar2oldLit); - try (final SATCall fCall = fSolver.satCall().handler(handler).addFormulas(fModel.getLiterals()).solve()) { + try (final SatCall fCall = fSolver.satCall().handler(handler).addFormulas(fModel.getLiterals()).solve()) { if (!fCall.getSatResult().isSuccess()) { - return LNGResult.canceled(fCall.getSatResult().getCancelCause()); + return LngResult.canceled(fCall.getSatResult().getCancelCause()); } if (!fCall.getSatResult().getResult()) { - final LNGResult> primeImplicantResult = computeWithMaximization + final LngResult> primeImplicantResult = computeWithMaximization ? primeReduction.reduceImplicant(fModel.getLiterals(), handler) - : LNGResult.of(new TreeSet<>(fModel.getLiterals())); + : LngResult.of(new TreeSet<>(fModel.getLiterals())); if (!primeImplicantResult.isSuccess()) { - return LNGResult.canceled(primeImplicantResult.getCancelCause()); + return LngResult.canceled(primeImplicantResult.getCancelCause()); } final SortedSet primeImplicant = primeImplicantResult.getResult(); primeImplicants.add(primeImplicant); @@ -173,10 +173,10 @@ private LNGResult>, List>>> comp (computeWithMaximization ? fModel : fCall.model(formula.variables(f))).getLiterals()) { implicate.add(lit.negate(f)); } - final LNGResult> primeImplicateResult = + final LngResult> primeImplicateResult = primeReduction.reduceImplicate(f, implicate, handler); if (!primeImplicateResult.isSuccess()) { - return LNGResult.canceled(primeImplicateResult.getCancelCause()); + return LngResult.canceled(primeImplicateResult.getCancelCause()); } final SortedSet primeImplicate = primeImplicateResult.getResult(); primeImplicates.add(primeImplicate); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/MaxSATResult.java b/core/src/main/java/com/booleworks/logicng/solvers/MaxSatResult.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/solvers/MaxSATResult.java rename to core/src/main/java/com/booleworks/logicng/solvers/MaxSatResult.java index 51e20aba..f9810c6b 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/MaxSATResult.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/MaxSatResult.java @@ -13,7 +13,7 @@ * @since 3.0.0 */ // TODO rename or redefine or fix documentation of 'optimum' -public class MaxSATResult { +public class MaxSatResult { private final boolean satisfiable; private final int optimum; @@ -25,7 +25,7 @@ public class MaxSATResult { * @param optimum the optimum value * @param model the model for optimum solution */ - public MaxSATResult(final boolean satisfiable, final int optimum, final Model model) { + public MaxSatResult(final boolean satisfiable, final int optimum, final Model model) { this.satisfiable = satisfiable; this.optimum = optimum; this.model = model; @@ -66,7 +66,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final MaxSATResult that = (MaxSATResult) o; + final MaxSatResult that = (MaxSatResult) o; return satisfiable == that.satisfiable && optimum == that.optimum && Objects.equals(model, that.model); } @@ -77,7 +77,7 @@ public int hashCode() { @Override public String toString() { - return "MaxSATResult{" + + return "MaxSatResult{" + "satisfiable=" + satisfiable + ", optimum=" + optimum + ", model=" + model + diff --git a/core/src/main/java/com/booleworks/logicng/solvers/MaxSATSolver.java b/core/src/main/java/com/booleworks/logicng/solvers/MaxSatSolver.java similarity index 69% rename from core/src/main/java/com/booleworks/logicng/solvers/MaxSATSolver.java rename to core/src/main/java/com/booleworks/logicng/solvers/MaxSatSolver.java index f3b9b7fe..ac33c77c 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/MaxSATSolver.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/MaxSatSolver.java @@ -4,34 +4,34 @@ package com.booleworks.logicng.solvers; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod.FACTORY_CNF; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod.PG_ON_SOLVER; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod.FACTORY_CNF; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod.PG_ON_SOLVER; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.solvers.maxsat.algorithms.IncWBO; -import com.booleworks.logicng.solvers.maxsat.algorithms.LinearSU; -import com.booleworks.logicng.solvers.maxsat.algorithms.LinearUS; -import com.booleworks.logicng.solvers.maxsat.algorithms.MSU3; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATState; -import com.booleworks.logicng.solvers.maxsat.algorithms.OLL; -import com.booleworks.logicng.solvers.maxsat.algorithms.WBO; -import com.booleworks.logicng.solvers.maxsat.algorithms.WMSU3; -import com.booleworks.logicng.transformations.cnf.PlaistedGreenbaumTransformationMaxSATSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.IncWbo; +import com.booleworks.logicng.solvers.maxsat.algorithms.LinearSu; +import com.booleworks.logicng.solvers.maxsat.algorithms.LinearUs; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatState; +import com.booleworks.logicng.solvers.maxsat.algorithms.Msu3; +import com.booleworks.logicng.solvers.maxsat.algorithms.Oll; +import com.booleworks.logicng.solvers.maxsat.algorithms.Wbo; +import com.booleworks.logicng.solvers.maxsat.algorithms.Wmsu3; +import com.booleworks.logicng.transformations.cnf.PlaistedGreenbaumTransformationMaxSatSolver; /** * A wrapper for the OpenWBO solver. * @version 3.0.0 * @since 1.0 */ -public class MaxSATSolver { +public class MaxSatSolver { public static final String SEL_PREFIX = "@SEL_SOFT_"; @@ -45,13 +45,13 @@ public enum Algorithm { OLL } - protected final MaxSATConfig configuration; + protected final MaxSatConfig configuration; protected final Algorithm algorithm; - protected final PlaistedGreenbaumTransformationMaxSATSolver pgTransformation; + protected final PlaistedGreenbaumTransformationMaxSatSolver pgTransformation; protected final FormulaFactory f; - protected final MaxSAT solver; + protected final MaxSat solver; protected int selectorCounter; - protected LNGResult result; + protected LngResult result; /** * Constructs a new MaxSAT solver with a given configuration. @@ -60,39 +60,39 @@ public enum Algorithm { * @param algorithm the algorithm * @throws IllegalArgumentException if the algorithm was unknown */ - protected MaxSATSolver(final FormulaFactory f, final MaxSATConfig configuration, final Algorithm algorithm) { + protected MaxSatSolver(final FormulaFactory f, final MaxSatConfig configuration, final Algorithm algorithm) { this.f = f; this.algorithm = algorithm; this.configuration = configuration; result = null; switch (algorithm) { case WBO: - solver = new WBO(f, configuration); + solver = new Wbo(f, configuration); break; case INC_WBO: - solver = new IncWBO(f, configuration); + solver = new IncWbo(f, configuration); break; case LINEAR_SU: - solver = new LinearSU(f, configuration); + solver = new LinearSu(f, configuration); break; case LINEAR_US: - solver = new LinearUS(f, configuration); + solver = new LinearUs(f, configuration); break; case MSU3: - solver = new MSU3(f, configuration); + solver = new Msu3(f, configuration); break; case WMSU3: - solver = new WMSU3(f, configuration); + solver = new Wmsu3(f, configuration); break; case OLL: - solver = new OLL(f, configuration); + solver = new Oll(f, configuration); break; default: throw new IllegalArgumentException("Unknown MaxSAT algorithm: " + algorithm); } pgTransformation = configuration.getCnfMethod() == FACTORY_CNF ? null - : new PlaistedGreenbaumTransformationMaxSATSolver(f, configuration.getCnfMethod() == PG_ON_SOLVER, solver); + : new PlaistedGreenbaumTransformationMaxSatSolver(f, configuration.getCnfMethod() == PG_ON_SOLVER, solver); } /** @@ -101,8 +101,8 @@ protected MaxSATSolver(final FormulaFactory f, final MaxSATConfig configuration, * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver incWBO(final FormulaFactory f) { - return new MaxSATSolver(f, (MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.INC_WBO); + public static MaxSatSolver incWbo(final FormulaFactory f) { + return new MaxSatSolver(f, (MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.INC_WBO); } /** @@ -112,8 +112,8 @@ public static MaxSATSolver incWBO(final FormulaFactory f) { * @param config the configuration * @return the MaxSAT solver */ - public static MaxSATSolver incWBO(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.INC_WBO); + public static MaxSatSolver incWbo(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.INC_WBO); } /** @@ -122,10 +122,10 @@ public static MaxSATSolver incWBO(final FormulaFactory f, final MaxSATConfig con * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver linearSU(final FormulaFactory f) { - final MaxSATConfig conf = new MaxSATConfig((MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), - MaxSATConfig.CardinalityEncoding.MTOTALIZER); - return new MaxSATSolver(f, conf, Algorithm.LINEAR_SU); + public static MaxSatSolver linearSu(final FormulaFactory f) { + final MaxSatConfig conf = new MaxSatConfig((MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), + MaxSatConfig.CardinalityEncoding.MTOTALIZER); + return new MaxSatSolver(f, conf, Algorithm.LINEAR_SU); } /** @@ -135,8 +135,8 @@ public static MaxSATSolver linearSU(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver linearSU(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.LINEAR_SU); + public static MaxSatSolver linearSu(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.LINEAR_SU); } /** @@ -145,8 +145,8 @@ public static MaxSATSolver linearSU(final FormulaFactory f, final MaxSATConfig c * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver linearUS(final FormulaFactory f) { - return new MaxSATSolver(f, (MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.LINEAR_US); + public static MaxSatSolver linearUs(final FormulaFactory f) { + return new MaxSatSolver(f, (MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.LINEAR_US); } /** @@ -156,8 +156,8 @@ public static MaxSATSolver linearUS(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver linearUS(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.LINEAR_US); + public static MaxSatSolver linearUs(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.LINEAR_US); } /** @@ -166,8 +166,8 @@ public static MaxSATSolver linearUS(final FormulaFactory f, final MaxSATConfig c * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver msu3(final FormulaFactory f) { - return new MaxSATSolver(f, (MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.MSU3); + public static MaxSatSolver msu3(final FormulaFactory f) { + return new MaxSatSolver(f, (MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.MSU3); } /** @@ -177,8 +177,8 @@ public static MaxSATSolver msu3(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver msu3(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.MSU3); + public static MaxSatSolver msu3(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.MSU3); } /** @@ -187,8 +187,8 @@ public static MaxSATSolver msu3(final FormulaFactory f, final MaxSATConfig confi * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver wbo(final FormulaFactory f) { - return new MaxSATSolver(f, (MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.WBO); + public static MaxSatSolver wbo(final FormulaFactory f) { + return new MaxSatSolver(f, (MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), Algorithm.WBO); } /** @@ -198,8 +198,8 @@ public static MaxSATSolver wbo(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver wbo(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.WBO); + public static MaxSatSolver wbo(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.WBO); } /** @@ -208,10 +208,10 @@ public static MaxSATSolver wbo(final FormulaFactory f, final MaxSATConfig config * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver wmsu3(final FormulaFactory f) { - final MaxSATConfig conf = new MaxSATConfig((MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), - MaxSATConfig.IncrementalStrategy.ITERATIVE); - return new MaxSATSolver(f, conf, Algorithm.WMSU3); + public static MaxSatSolver wmsu3(final FormulaFactory f) { + final MaxSatConfig conf = new MaxSatConfig((MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), + MaxSatConfig.IncrementalStrategy.ITERATIVE); + return new MaxSatSolver(f, conf, Algorithm.WMSU3); } /** @@ -221,8 +221,8 @@ public static MaxSATSolver wmsu3(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver wmsu3(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.WMSU3); + public static MaxSatSolver wmsu3(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.WMSU3); } /** @@ -231,10 +231,10 @@ public static MaxSATSolver wmsu3(final FormulaFactory f, final MaxSATConfig conf * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver oll(final FormulaFactory f) { - final MaxSATConfig conf = new MaxSATConfig((MaxSATConfig) f.configurationFor(ConfigurationType.MAXSAT), - MaxSATConfig.IncrementalStrategy.ITERATIVE); - return new MaxSATSolver(f, conf, Algorithm.OLL); + public static MaxSatSolver oll(final FormulaFactory f) { + final MaxSatConfig conf = new MaxSatConfig((MaxSatConfig) f.configurationFor(ConfigurationType.MAXSAT), + MaxSatConfig.IncrementalStrategy.ITERATIVE); + return new MaxSatSolver(f, conf, Algorithm.OLL); } /** @@ -244,8 +244,8 @@ public static MaxSATSolver oll(final FormulaFactory f) { * @param f the formula factory * @return the MaxSAT solver */ - public static MaxSATSolver oll(final FormulaFactory f, final MaxSATConfig config) { - return new MaxSATSolver(f, config, Algorithm.OLL); + public static MaxSatSolver oll(final FormulaFactory f, final MaxSatConfig config) { + return new MaxSatSolver(f, config, Algorithm.OLL); } /** @@ -285,7 +285,7 @@ public void addSoftFormula(final Formula formula, final int weight) { * Saves the current solver state. * @return the current solver state */ - public MaxSATState saveState() { + public MaxSatState saveState() { return solver.saveState(); } @@ -301,7 +301,7 @@ public MaxSATState saveState() { * @param state the solver state to load * @throws IllegalArgumentException if the solver state is not valid anymore */ - public void loadState(final MaxSATState state) { + public void loadState(final MaxSatState state) { result = null; solver.loadState(state); if (pgTransformation != null) { @@ -312,7 +312,7 @@ public void loadState(final MaxSATState state) { private void addFormulaAsCnf(final Formula formula, final int weight) { result = null; if (configuration.getCnfMethod() == FACTORY_CNF) { - addCNF(formula.cnf(f), weight); + addCnf(formula.cnf(f), weight); } else { pgTransformation.addCnfToSolver(formula, weight); } @@ -323,7 +323,7 @@ private void addFormulaAsCnf(final Formula formula, final int weight) { * @param formula the formula in CNF * @param weight the weight of this CNF (or -1 for a hard constraint) */ - protected void addCNF(final Formula formula, final int weight) { + protected void addCnf(final Formula formula, final int weight) { switch (formula.getType()) { case TRUE: break; @@ -346,7 +346,7 @@ protected void addCNF(final Formula formula, final int weight) { * Solves the formula on the solver and returns the result. * @return the result (SAT, UNSAT, Optimum found) */ - public MaxSATResult solve() { + public MaxSatResult solve() { return solve(NopHandler.get()).getResult(); } @@ -356,14 +356,14 @@ public MaxSATResult solve() { * @return the result (SAT, UNSAT, Optimum found, or UNDEF if canceled by * the handler) */ - public LNGResult solve(final ComputationHandler handler) { + public LngResult solve(final ComputationHandler handler) { if (result != null && result.isSuccess()) { return result; } if (solver.currentWeight() == 1) { - solver.setProblemType(MaxSAT.ProblemType.UNWEIGHTED); + solver.setProblemType(MaxSat.ProblemType.UNWEIGHTED); } else { - solver.setProblemType(MaxSAT.ProblemType.WEIGHTED); + solver.setProblemType(MaxSat.ProblemType.WEIGHTED); } result = solver.search(handler); return result; @@ -373,7 +373,7 @@ public LNGResult solve(final ComputationHandler handler) { * Returns the stats of the underlying solver. * @return the stats of the underlying solver */ - public MaxSAT.Stats getStats() { + public MaxSat.Stats getStats() { return solver.stats(); } @@ -395,6 +395,6 @@ public FormulaFactory getFactory() { @Override public String toString() { - return String.format("MaxSATSolver{result=%s}", result); + return String.format("MaxSatSolver{result=%s}", result); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/SATSolver.java b/core/src/main/java/com/booleworks/logicng/solvers/SatSolver.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/solvers/SATSolver.java rename to core/src/main/java/com/booleworks/logicng/solvers/SatSolver.java index e6f1744e..228a02d6 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/SATSolver.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/SatSolver.java @@ -6,7 +6,7 @@ import com.booleworks.logicng.backbones.Backbone; import com.booleworks.logicng.backbones.BackboneType; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.datastructures.EncodingResult; import com.booleworks.logicng.datastructures.Model; @@ -18,20 +18,20 @@ import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.solvers.functions.BackboneFunction; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.SolverFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATCall; -import com.booleworks.logicng.solvers.sat.SATCallBuilder; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatCall; +import com.booleworks.logicng.solvers.sat.SatCallBuilder; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.transformations.cnf.PlaistedGreenbaumTransformationSolver; import java.util.Collection; @@ -43,11 +43,11 @@ * @since 1.0 */ // TODO sort and cleanup methods -public class SATSolver { +public class SatSolver { protected final FormulaFactory f; - protected final SATSolverConfig config; - protected final LNGCoreSolver solver; + protected final SatSolverConfig config; + protected final LngCoreSolver solver; protected final PlaistedGreenbaumTransformationSolver pgTransformation; protected final PlaistedGreenbaumTransformationSolver fullPgTransformation; @@ -56,10 +56,10 @@ public class SATSolver { * @param f the formula factory * @param config the solver configuration, must not be {@code null} */ - protected SATSolver(final FormulaFactory f, final SATSolverConfig config) { + protected SatSolver(final FormulaFactory f, final SatSolverConfig config) { this.f = f; this.config = config; - solver = new LNGCoreSolver(f, config); + solver = new LngCoreSolver(f, config); pgTransformation = new PlaistedGreenbaumTransformationSolver(f, true, solver); fullPgTransformation = new PlaistedGreenbaumTransformationSolver(f, false, solver); } @@ -71,7 +71,7 @@ protected SATSolver(final FormulaFactory f, final SATSolverConfig config) { * @param f the formula factory * @param underlyingSolver the underlying solver core */ - public SATSolver(final FormulaFactory f, final LNGCoreSolver underlyingSolver) { + public SatSolver(final FormulaFactory f, final LngCoreSolver underlyingSolver) { this.f = f; config = underlyingSolver.getConfig(); solver = underlyingSolver; @@ -85,8 +85,8 @@ public SATSolver(final FormulaFactory f, final LNGCoreSolver underlyingSolver) { * @param f the formula factory * @return the solver */ - public static SATSolver newSolver(final FormulaFactory f) { - return new SATSolver(f, (SATSolverConfig) f.configurationFor(ConfigurationType.SAT)); + public static SatSolver newSolver(final FormulaFactory f) { + return new SatSolver(f, (SatSolverConfig) f.configurationFor(ConfigurationType.SAT)); } /** @@ -95,8 +95,8 @@ public static SATSolver newSolver(final FormulaFactory f) { * @param config the configuration, must not be {@code null} * @return the solver */ - public static SATSolver newSolver(final FormulaFactory f, final SATSolverConfig config) { - return new SATSolver(f, config); + public static SatSolver newSolver(final FormulaFactory f, final SatSolverConfig config) { + return new SatSolver(f, config); } /** @@ -114,33 +114,33 @@ public void add(final Formula formula) { */ public void add(final Formula formula, final Proposition proposition) { if (formula.getType() == FType.PBC) { - final PBConstraint constraint = (PBConstraint) formula; - if (constraint.isCC()) { + final PbConstraint constraint = (PbConstraint) formula; + if (constraint.isCc()) { if (config.isUseAtMostClauses()) { if (constraint.comparator() == CType.LE) { - solver.addAtMost(LNGCoreSolver.generateClauseVector(constraint.getOperands(), solver), + solver.addAtMost(LngCoreSolver.generateClauseVector(constraint.getOperands(), solver), constraint.getRhs()); } else if (constraint.comparator() == CType.LT && constraint.getRhs() > 3) { - solver.addAtMost(LNGCoreSolver.generateClauseVector(constraint.getOperands(), solver), + solver.addAtMost(LngCoreSolver.generateClauseVector(constraint.getOperands(), solver), constraint.getRhs() - 1); } else if (constraint.comparator() == CType.EQ && constraint.getRhs() == 1) { - solver.addAtMost(LNGCoreSolver.generateClauseVector(constraint.getOperands(), solver), + solver.addAtMost(LngCoreSolver.generateClauseVector(constraint.getOperands(), solver), constraint.getRhs()); - solver.addClause(LNGCoreSolver.generateClauseVector(constraint.getOperands(), solver), + solver.addClause(LngCoreSolver.generateClauseVector(constraint.getOperands(), solver), proposition); } else { CcEncoder.encode((CardinalityConstraint) constraint, - EncodingResult.resultForSATSolver(f, solver, proposition)); + EncodingResult.resultForSatSolver(f, solver, proposition)); } } else { CcEncoder.encode((CardinalityConstraint) constraint, - EncodingResult.resultForSATSolver(f, solver, proposition)); + EncodingResult.resultForSatSolver(f, solver, proposition)); } } else { - PbEncoder.encode(constraint, EncodingResult.resultForSATSolver(f, solver, proposition)); + PbEncoder.encode(constraint, EncodingResult.resultForSatSolver(f, solver, proposition)); } } else { - addFormulaAsCNF(formula, proposition); + addFormulaAsCnf(formula, proposition); } } @@ -228,7 +228,7 @@ public void addWithRelaxation(final Variable relaxationVar, final Collection * A SAT solver may only have one "open" SATCall at a time. So - * a an existing SAT call must always be {@link SATCall#close() closed} + * a an existing SAT call must always be {@link SatCall#close() closed} * (ideally using a try-with construct) before the next call to this * method. * @return a new SATCall builder - * @see SATCallBuilder + * @see SatCallBuilder */ - public SATCallBuilder satCall() { - return SATCall.builder(this); + public SatCallBuilder satCall() { + return SatCall.builder(this); } /** @@ -294,7 +294,7 @@ public SATCallBuilder satCall() { * @return the satisfiability of the formula on the solver */ public boolean sat() { - try (final SATCall call = satCall().solve()) { + try (final SatCall call = satCall().solve()) { return call.getSatResult().getResult(); } } @@ -305,7 +305,7 @@ public boolean sat() { * @param the result type of the function * @return the result of executing the solver function on the current solver * @throws IllegalStateException if this solver is currently used in a - * {@link SATCall} + * {@link SatCall} */ public RESULT execute(final SolverFunction function) { solver.assertNotInSatCall(); @@ -320,9 +320,9 @@ public RESULT execute(final SolverFunction function) { * @return the (potentially canceled) result of executing the solver * function on the current solver * @throws IllegalStateException if this solver is currently used in a - * {@link SATCall} + * {@link SatCall} */ - public LNGResult execute(final SolverFunction function, final ComputationHandler handler) { + public LngResult execute(final SolverFunction function, final ComputationHandler handler) { solver.assertNotInSatCall(); return function.apply(this, handler); } @@ -410,7 +410,7 @@ public FormulaFactory getFactory() { * Returns the initial phase of literals of this solver. * @return the initial phase of literals of this solver */ - public SATSolverConfig getConfig() { + public SatSolverConfig getConfig() { return config; } @@ -421,16 +421,16 @@ public SATSolverConfig getConfig() { * things up completely! You should really know what you are doing. * @return the underlying core solver */ - public LNGCoreSolver getUnderlyingSolver() { + public LngCoreSolver getUnderlyingSolver() { return solver; } - protected void addFormulaAsCNF(final Formula formula, final Proposition proposition) { - if (config.getCnfMethod() == SATSolverConfig.CNFMethod.FACTORY_CNF) { + protected void addFormulaAsCnf(final Formula formula, final Proposition proposition) { + if (config.getCnfMethod() == SatSolverConfig.CnfMethod.FACTORY_CNF) { addClauseSet(formula.cnf(f), proposition); - } else if (config.getCnfMethod() == SATSolverConfig.CNFMethod.PG_ON_SOLVER) { + } else if (config.getCnfMethod() == SatSolverConfig.CnfMethod.PG_ON_SOLVER) { pgTransformation.addCnfToSolver(formula, proposition); - } else if (config.getCnfMethod() == SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER) { + } else if (config.getCnfMethod() == SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER) { fullPgTransformation.addCnfToSolver(formula, proposition); } else { throw new IllegalStateException("Unknown Solver CNF method: " + config.getCnfMethod()); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedIntQueue.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedIntQueue.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedIntQueue.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedIntQueue.java index 9990c7b6..325848ae 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedIntQueue.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedIntQueue.java @@ -44,15 +44,15 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; /** * A bounded integer queue (for Glucose) * @version 1.3 * @since 1.0 */ -public final class LNGBoundedIntQueue { - private final LNGIntVector elems; +public final class LngBoundedIntQueue { + private final LngIntVector elems; private int first; private int last; private long sumOfQueue; @@ -62,8 +62,8 @@ public final class LNGBoundedIntQueue { /** * Constructs a new bounded int queue. */ - public LNGBoundedIntQueue() { - elems = new LNGIntVector(); + public LngBoundedIntQueue() { + elems = new LngIntVector(); first = 0; last = 0; sumOfQueue = 0; @@ -71,7 +71,7 @@ public LNGBoundedIntQueue() { queueSize = 0; } - public LNGBoundedIntQueue(final LNGIntVector elems, final int first, final int last, final long sumOfQueue, + public LngBoundedIntQueue(final LngIntVector elems, final int first, final int last, final long sumOfQueue, final int maxSize, final int queueSize) { this.elems = elems; this.first = first; @@ -131,7 +131,7 @@ private void growTo(final int size) { last = 0; } - public LNGIntVector getElems() { + public LngIntVector getElems() { return elems; } @@ -157,7 +157,7 @@ public int getQueueSize() { @Override public String toString() { - return String.format("LNGBoundedIntQueue{first=%d, last=%d, sumOfQueue=%d, maxSize=%d, queueSize=%d, elems=%s}", + return String.format("LngBoundedIntQueue{first=%d, last=%d, sumOfQueue=%d, maxSize=%d, queueSize=%d, elems=%s}", first, last, sumOfQueue, maxSize, queueSize, elems); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedLongQueue.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedLongQueue.java similarity index 93% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedLongQueue.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedLongQueue.java index 5b10627a..da7913fe 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGBoundedLongQueue.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngBoundedLongQueue.java @@ -44,15 +44,15 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGLongVector; +import com.booleworks.logicng.collections.LngLongVector; /** * A bounded long queue (for Glucose) * @version 1.3 * @since 1.0 */ -public final class LNGBoundedLongQueue { - private final LNGLongVector elems; +public final class LngBoundedLongQueue { + private final LngLongVector elems; private int first; private int last; private long sumOfQueue; @@ -62,8 +62,8 @@ public final class LNGBoundedLongQueue { /** * Constructs a new bounded long queue. */ - public LNGBoundedLongQueue() { - elems = new LNGLongVector(); + public LngBoundedLongQueue() { + elems = new LngLongVector(); first = 0; last = 0; sumOfQueue = 0; @@ -71,7 +71,7 @@ public LNGBoundedLongQueue() { queueSize = 0; } - public LNGBoundedLongQueue(final LNGLongVector elems, final int first, final int last, final long sumOfQueue, + public LngBoundedLongQueue(final LngLongVector elems, final int first, final int last, final long sumOfQueue, final int maxSize, final int queueSize) { this.elems = elems; this.first = first; @@ -132,7 +132,7 @@ public boolean valid() { return queueSize == maxSize; } - public LNGLongVector getElems() { + public LngLongVector getElems() { return elems; } @@ -169,7 +169,7 @@ public void fastClear() { @Override public String toString() { return String.format( - "LNGBoundedLongQueue{first=%d, last=%d, sumOfQueue=%d, maxSize=%d, queueSize=%d, elems=%s}", + "LngBoundedLongQueue{first=%d, last=%d, sumOfQueue=%d, maxSize=%d, queueSize=%d, elems=%s}", first, last, sumOfQueue, maxSize, queueSize, elems); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGClause.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngClause.java similarity index 94% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGClause.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngClause.java index dab75b55..61bf84e4 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGClause.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngClause.java @@ -22,7 +22,7 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import java.util.Comparator; @@ -31,13 +31,13 @@ * @version 2.0.0 * @since 1.0 */ -public final class LNGClause { +public final class LngClause { /** * A comparator for clauses based on LBD and activity (used for the Glucose * solver). */ - public static final Comparator glucoseComparator = (x, y) -> { + public static final Comparator glucoseComparator = (x, y) -> { if (x.size() > 2 && y.size() == 2) { return -1; } @@ -56,7 +56,7 @@ public final class LNGClause { return x.activity() < y.activity() ? -1 : 1; }; - private final LNGIntVector data; + private final LngIntVector data; private final int learntOnState; private final boolean isAtMost; private double activity; @@ -72,7 +72,7 @@ public final class LNGClause { * @param learntOnState the index of the solver state on which this clause * was learnt or -1 if it is not a learnt clause */ - public LNGClause(final LNGIntVector ps, final int learntOnState) { + public LngClause(final LngIntVector ps, final int learntOnState) { this(ps, learntOnState, false); } @@ -84,8 +84,8 @@ public LNGClause(final LNGIntVector ps, final int learntOnState) { * @param isAtMost {@code true} if it is an at-most clause, * {@code false} otherwise */ - public LNGClause(final LNGIntVector ps, final int learntOnState, final boolean isAtMost) { - data = new LNGIntVector(ps.size()); + public LngClause(final LngIntVector ps, final int learntOnState, final boolean isAtMost) { + data = new LngIntVector(ps.size()); for (int i = 0; i < ps.size(); i++) { data.unsafePush(ps.get(i)); } @@ -98,7 +98,7 @@ public LNGClause(final LNGIntVector ps, final int learntOnState, final boolean i atMostWatchers = -1; } - public LNGClause(final LNGIntVector data, final int learntOnState, final boolean isAtMost, final double activity, + public LngClause(final LngIntVector data, final int learntOnState, final boolean isAtMost, final double activity, final boolean seen, final long lbd, final boolean canBeDel, final boolean oneWatched, final int atMostWatchers) { this.data = data; @@ -207,7 +207,7 @@ public long lbd() { * Sets the LBD of this clause. * @param lbd the LBD of this clause */ - public void setLBD(final long lbd) { + public void setLbd(final long lbd) { this.lbd = lbd; } @@ -293,7 +293,7 @@ public int cardinality() { * Returns the literals of this clause. * @return the literals of this clause */ - public LNGIntVector getData() { + public LngIntVector getData() { return data; } @@ -309,7 +309,7 @@ public boolean equals(final Object o) { @Override public String toString() { - final StringBuilder sb = new StringBuilder("MSClause{"); + final StringBuilder sb = new StringBuilder("LngClause{"); sb.append("activity=").append(activity).append(", "); sb.append("learntOnState=").append(learntOnState).append(", "); sb.append("seen=").append(seen).append(", "); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHardClause.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHardClause.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHardClause.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHardClause.java index 03f51e14..464e21d0 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHardClause.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHardClause.java @@ -22,36 +22,36 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; /** * A hard clause for the MaxSAT solver. * @version 1.0 * @since 1.0 */ -public final class LNGHardClause { +public final class LngHardClause { - private final LNGIntVector clause; + private final LngIntVector clause; /** * Constructs a new hard clause. * @param clause the clause */ - public LNGHardClause(final LNGIntVector clause) { - this.clause = new LNGIntVector(clause); + public LngHardClause(final LngIntVector clause) { + this.clause = new LngIntVector(clause); } /** * Returns the clause of this hard clause. * @return the clause */ - public LNGIntVector clause() { + public LngIntVector clause() { return clause; } @Override public String toString() { - final StringBuilder sb = new StringBuilder("MSHardClause{lits=["); + final StringBuilder sb = new StringBuilder("LngHardClause{lits=["); for (int i = 0; i < clause.size(); i++) { final int lit = clause.get(i); sb.append((lit & 1) == 1 ? "-" : "").append(lit >> 1); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHeap.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHeap.java similarity index 91% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHeap.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHeap.java index 2f3ee0f7..5991e65a 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGHeap.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngHeap.java @@ -22,19 +22,19 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * A minimalistic heap implementation. * @version 1.3 * @since 1.0 */ -public final class LNGHeap { +public final class LngHeap { - private final LNGCoreSolver s; - private final LNGIntVector heap; - private final LNGIntVector indices; + private final LngCoreSolver s; + private final LngIntVector heap; + private final LngIntVector indices; /** * Constructs a new heap for a given solver. The solver is required to @@ -42,13 +42,13 @@ public final class LNGHeap { * the heap is 1000 elements. * @param solver the solver */ - public LNGHeap(final LNGCoreSolver solver) { + public LngHeap(final LngCoreSolver solver) { s = solver; - heap = new LNGIntVector(1000); - indices = new LNGIntVector(1000); + heap = new LngIntVector(1000); + indices = new LngIntVector(1000); } - public LNGHeap(final LNGCoreSolver s, final LNGIntVector heap, final LNGIntVector indices) { + public LngHeap(final LngCoreSolver s, final LngIntVector heap, final LngIntVector indices) { this.s = s; this.heap = heap; this.indices = indices; @@ -176,7 +176,7 @@ public void remove(final int n) { * Rebuilds the heap from a given vector of elements. * @param ns the vector of elements */ - public void build(final LNGIntVector ns) { + public void build(final LngIntVector ns) { for (int i = 0; i < heap.size(); i++) { indices.set(heap.get(i), -1); } @@ -239,17 +239,17 @@ private void percolateDown(final int pos) { indices.set(y, p); } - public LNGIntVector getHeap() { + public LngIntVector getHeap() { return heap; } - public LNGIntVector getIndices() { + public LngIntVector getIndices() { return indices; } @Override public String toString() { - final StringBuilder sb = new StringBuilder("LNGHeap{"); + final StringBuilder sb = new StringBuilder("LngHeap{"); for (int i = 0; i < heap.size(); i++) { sb.append("[").append(heap.get(i)).append(", "); sb.append(indices.get(i)).append("]"); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGSoftClause.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngSoftClause.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGSoftClause.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngSoftClause.java index 658ead72..2d2b6ad8 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGSoftClause.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngSoftClause.java @@ -22,17 +22,17 @@ package com.booleworks.logicng.solvers.datastructures; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; /** * A soft clause for the MaxSAT solver. * @version 1.0 * @since 1.0 */ -public final class LNGSoftClause { +public final class LngSoftClause { - private final LNGIntVector clause; - private final LNGIntVector relaxationVars; + private final LngIntVector clause; + private final LngIntVector relaxationVars; private int weight; private int assumptionVar; @@ -43,19 +43,19 @@ public final class LNGSoftClause { * @param assumptionVar the assumption variables of this clause * @param relaxationVars the relaxation variables */ - public LNGSoftClause(final LNGIntVector clause, final int weight, final int assumptionVar, - final LNGIntVector relaxationVars) { - this.clause = new LNGIntVector(clause); + public LngSoftClause(final LngIntVector clause, final int weight, final int assumptionVar, + final LngIntVector relaxationVars) { + this.clause = new LngIntVector(clause); this.weight = weight; this.assumptionVar = assumptionVar; - this.relaxationVars = new LNGIntVector(relaxationVars); + this.relaxationVars = new LngIntVector(relaxationVars); } /** * Returns the clause of this soft clause. * @return the clause */ - public LNGIntVector clause() { + public LngIntVector clause() { return clause; } @@ -79,7 +79,7 @@ public void setWeight(final int weight) { * Returns the relaxation variables of this soft clause. * @return the relaxation variables */ - public LNGIntVector relaxationVars() { + public LngIntVector relaxationVars() { return relaxationVars; } @@ -102,7 +102,7 @@ public void setAssumptionVar(final int assumptionVar) { @Override public String toString() { final StringBuilder sb = - new StringBuilder(String.format("MSSoftClause{weight=%d, assumption=%d lits=[", weight, assumptionVar)); + new StringBuilder(String.format("LngSoftClause{weight=%d, assumption=%d lits=[", weight, assumptionVar)); for (int i = 0; i < clause.size(); i++) { final int lit = clause.get(i); sb.append((lit & 1) == 1 ? "-" : "").append(lit >> 1); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGVariable.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngVariable.java similarity index 90% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGVariable.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngVariable.java index 42c8ede9..fc3d7c0e 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGVariable.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngVariable.java @@ -13,10 +13,10 @@ * @version 2.0.0 * @since 1.0 */ -public final class LNGVariable { +public final class LngVariable { private Tristate assignment; private int level; - private LNGClause reason; + private LngClause reason; private double activity; private boolean polarity; private boolean decision; @@ -25,7 +25,7 @@ public final class LNGVariable { * Constructs a new variable with a given initial polarity. * @param polarity the initial polarity */ - public LNGVariable(final boolean polarity) { + public LngVariable(final boolean polarity) { assignment = Tristate.UNDEF; level = -1; reason = null; @@ -34,7 +34,7 @@ public LNGVariable(final boolean polarity) { decision = false; } - public LNGVariable(final Tristate assignment, final int level, final LNGClause reason, final double activity, + public LngVariable(final Tristate assignment, final int level, final LngClause reason, final double activity, final boolean polarity, final boolean decision) { this.assignment = assignment; this.level = level; @@ -64,7 +64,7 @@ public int level() { * Sets the reason for this variable. * @param reason the reason for this variable */ - public void setReason(final LNGClause reason) { + public void setReason(final LngClause reason) { this.reason = reason; } @@ -72,7 +72,7 @@ public void setReason(final LNGClause reason) { * Returns the reason for this variable. * @return the reason for this variable */ - public LNGClause reason() { + public LngClause reason() { return reason; } @@ -154,7 +154,7 @@ public void setDecision(final boolean decision) { @Override public String toString() { return String.format(Locale.ENGLISH, - "MSVariable{assignment=%s, level=%d, reason=%s, activity=%f, polarity=%s, decision=%s}", + "LngVariable{assignment=%s, level=%d, reason=%s, activity=%f, polarity=%s, decision=%s}", assignment, level, reason, activity, polarity, decision); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGWatcher.java b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngWatcher.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGWatcher.java rename to core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngWatcher.java index 3eee9664..de5808e0 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LNGWatcher.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/datastructures/LngWatcher.java @@ -9,8 +9,8 @@ * @version 1.0.1 * @since 1.0 */ -public final class LNGWatcher { - private final LNGClause clause; +public final class LngWatcher { + private final LngClause clause; private final int blocker; /** @@ -18,7 +18,7 @@ public final class LNGWatcher { * @param clause the watched clause * @param blocker the blocking literal */ - public LNGWatcher(final LNGClause clause, final int blocker) { + public LngWatcher(final LngClause clause, final int blocker) { this.clause = clause; this.blocker = blocker; } @@ -35,7 +35,7 @@ public int blocker() { * Returns the watched clause of this watcher. * @return the watched clause of this watcher */ - public LNGClause clause() { + public LngClause clause() { return clause; } @@ -46,11 +46,11 @@ public int hashCode() { @Override public boolean equals(final Object other) { - return this == other || other instanceof LNGWatcher && clause == (((LNGWatcher) other).clause); + return this == other || other instanceof LngWatcher && clause == (((LngWatcher) other).clause); } @Override public String toString() { - return String.format("MSWatcher{clause=%s, blocker=%d}", clause, blocker); + return String.format("LngWatcher{clause=%s, blocker=%d}", clause, blocker); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/BackboneFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/BackboneFunction.java index d0b20ec2..7745959d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/BackboneFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/BackboneFunction.java @@ -8,8 +8,8 @@ import com.booleworks.logicng.backbones.BackboneType; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Arrays; import java.util.Collection; @@ -40,7 +40,7 @@ public static Builder builder() { } @Override - public LNGResult apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult apply(final SatSolver solver, final ComputationHandler handler) { return solver.getUnderlyingSolver().computeBackbone(variables, type, handler); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/FormulaOnSolverFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/FormulaOnSolverFunction.java index 3e44e346..0a484513 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/FormulaOnSolverFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/FormulaOnSolverFunction.java @@ -6,7 +6,7 @@ import static com.booleworks.logicng.datastructures.Tristate.TRUE; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.CFalse; import com.booleworks.logicng.formulas.CType; import com.booleworks.logicng.formulas.Formula; @@ -14,10 +14,10 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngVariable; import java.util.ArrayList; import java.util.LinkedHashSet; @@ -34,7 +34,7 @@ *

    * If the formula on the solver is known to be unsatisfiable, this function will * add {@link CFalse falsum} to the returned set of formulas. However, as long - * as {@link SATSolver#sat()} was not called on the current solver state, the + * as {@link SatSolver#sat()} was not called on the current solver state, the * absence of {@link CFalse falsum} does not imply that the formula is * satisfiable. *

    @@ -63,10 +63,10 @@ public static FormulaOnSolverFunction get() { } @Override - public LNGResult> apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult> apply(final SatSolver solver, final ComputationHandler handler) { final FormulaFactory f = solver.getFactory(); final Set formulas = new LinkedHashSet<>(); - for (final LNGClause clause : solver.getUnderlyingSolver().getClauses()) { + for (final LngClause clause : solver.getUnderlyingSolver().getClauses()) { final List lits = new ArrayList<>(); for (int i = 0; i < clause.size(); i++) { final int litInt = clause.get(i); @@ -83,9 +83,9 @@ public LNGResult> apply(final SATSolver solver, final ComputationHa formulas.add(f.cc(CType.LE, rhs, vars)); } } - final LNGVector variables = solver.getUnderlyingSolver().getVariables(); + final LngVector variables = solver.getUnderlyingSolver().getVariables(); for (int i = 0; i < variables.size(); i++) { - final LNGVariable var = variables.get(i); + final LngVariable var = variables.get(i); if (var.level() == 0) { formulas.add(f.literal(solver.getUnderlyingSolver().nameForIdx(i), var.assignment() == TRUE)); } @@ -93,6 +93,6 @@ public LNGResult> apply(final SATSolver solver, final ComputationHa if (!solver.getUnderlyingSolver().ok()) { formulas.add(f.falsum()); } - return LNGResult.of(formulas); + return LngResult.of(formulas); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelCountingFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelCountingFunction.java index 9294d047..4dd2348d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelCountingFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelCountingFunction.java @@ -8,15 +8,15 @@ import static com.booleworks.logicng.handlers.events.SimpleEvent.MODEL_ENUMERATION_ROLLBACK; import static java.util.Arrays.asList; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.AbstractModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollector; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -108,8 +108,8 @@ public ModelCountingFunction build() { static class ModelCountCollector implements EnumerationCollector { private BigInteger committedCount = BigInteger.ZERO; - private final List uncommittedModels = new ArrayList<>(100); - private final List uncommittedIndices = new ArrayList<>(100); + private final List uncommittedModels = new ArrayList<>(100); + private final List uncommittedIndices = new ArrayList<>(100); private final BigInteger dontCareFactor; public ModelCountCollector(final int numberDontCareVariablesNotOnSolver) { @@ -117,8 +117,8 @@ public ModelCountCollector(final int numberDontCareVariablesNotOnSolver) { } @Override - public LNGEvent addModel(final LNGBooleanVector modelFromSolver, final SATSolver solver, - final LNGIntVector relevantAllIndices, final ComputationHandler handler) { + public LngEvent addModel(final LngBooleanVector modelFromSolver, final SatSolver solver, + final LngIntVector relevantAllIndices, final ComputationHandler handler) { final EnumerationFoundModelsEvent event = new EnumerationFoundModelsEvent(dontCareFactor.intValue()); uncommittedModels.add(modelFromSolver); uncommittedIndices.add(relevantAllIndices); @@ -126,20 +126,20 @@ public LNGEvent addModel(final LNGBooleanVector modelFromSolver, final SATSolver } @Override - public LNGEvent commit(final ComputationHandler handler) { + public LngEvent commit(final ComputationHandler handler) { committedCount = committedCount.add(BigInteger.valueOf(uncommittedModels.size()).multiply(dontCareFactor)); clearUncommitted(); return handler.shouldResume(MODEL_ENUMERATION_COMMIT) ? null : MODEL_ENUMERATION_COMMIT; } @Override - public LNGEvent rollback(final ComputationHandler handler) { + public LngEvent rollback(final ComputationHandler handler) { clearUncommitted(); return handler.shouldResume(MODEL_ENUMERATION_ROLLBACK) ? null : MODEL_ENUMERATION_ROLLBACK; } @Override - public List rollbackAndReturnModels(final SATSolver solver, final ComputationHandler handler) { + public List rollbackAndReturnModels(final SatSolver solver, final ComputationHandler handler) { final List modelsToReturn = new ArrayList<>(uncommittedModels.size()); for (int i = 0; i < uncommittedModels.size(); i++) { modelsToReturn.add(new Model(solver.getUnderlyingSolver().convertInternalModel(uncommittedModels.get(i), diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunction.java index 4ad02fd4..a7e6019b 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunction.java @@ -10,16 +10,16 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.AbstractModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollector; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -149,8 +149,8 @@ public ModelEnumerationCollector(final FormulaFactory f, final SortedSet modelLiterals = new ArrayList<>(additionalVariablesNotOnSolver); @@ -161,20 +161,20 @@ public LNGEvent addModel(final LNGBooleanVector modelFromSolver, final SATSolver } @Override - public LNGEvent commit(final ComputationHandler handler) { + public LngEvent commit(final ComputationHandler handler) { committedModels.addAll(expandUncommittedModels()); uncommittedModels.clear(); return !handler.shouldResume(MODEL_ENUMERATION_COMMIT) ? MODEL_ENUMERATION_COMMIT : null; } @Override - public LNGEvent rollback(final ComputationHandler handler) { + public LngEvent rollback(final ComputationHandler handler) { uncommittedModels.clear(); return !handler.shouldResume(MODEL_ENUMERATION_ROLLBACK) ? MODEL_ENUMERATION_ROLLBACK : null; } @Override - public List rollbackAndReturnModels(final SATSolver solver, final ComputationHandler handler) { + public List rollbackAndReturnModels(final SatSolver solver, final ComputationHandler handler) { final List modelsToReturn = uncommittedModels.stream().map(Model::new).collect(Collectors.toList()); rollback(handler); return modelsToReturn; diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunction.java index 0392d089..efadcafa 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunction.java @@ -8,19 +8,19 @@ import static com.booleworks.logicng.handlers.events.SimpleEvent.MODEL_ENUMERATION_ROLLBACK; import static java.util.Arrays.asList; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.AbstractModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollector; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -43,7 +43,7 @@ * @version 3.0.0 * @since 3.0.0 */ -public class ModelEnumerationToBddFunction extends AbstractModelEnumerationFunction { +public class ModelEnumerationToBddFunction extends AbstractModelEnumerationFunction { ModelEnumerationToBddFunction(final SortedSet variables, final ModelEnumerationConfig config) { super(variables, Collections.emptySortedSet(), configuration(variables, config)); @@ -70,7 +70,7 @@ public static Builder builder(final Variable[] variables) { } @Override - protected EnumerationCollector newCollector(final FormulaFactory f, final SortedSet knownVariables, + protected EnumerationCollector newCollector(final FormulaFactory f, final SortedSet knownVariables, final SortedSet dontCareVariablesNotOnSolver, final SortedSet additionalVariablesNotOnSolver) { return new BddModelEnumerationCollector(f, variables, knownVariables, dontCareVariablesNotOnSolver.size()); @@ -112,9 +112,9 @@ public ModelEnumerationToBddFunction build() { } } - static class BddModelEnumerationCollector implements EnumerationCollector { - private final BDDKernel kernel; - private BDD committedModels; + static class BddModelEnumerationCollector implements EnumerationCollector { + private final BddKernel kernel; + private Bdd committedModels; private final List uncommittedModels = new ArrayList<>(); private final int dontCareFactor; @@ -124,14 +124,14 @@ public BddModelEnumerationCollector(final FormulaFactory f, final SortedSet sortedVariables = variables != null ? new ArrayList<>(variables) : new ArrayList<>(knownVariables); final int numVars = sortedVariables.size(); - kernel = new BDDKernel(f, sortedVariables, numVars * 30, numVars * 50); - committedModels = BDDFactory.build(f, f.falsum(), kernel); + kernel = new BddKernel(f, sortedVariables, numVars * 30, numVars * 50); + committedModels = BddFactory.build(f, f.falsum(), kernel); dontCareFactor = (int) Math.pow(2, numberDontCareVariablesNotOnSolver); } @Override - public LNGEvent addModel(final LNGBooleanVector modelFromSolver, final SATSolver solver, - final LNGIntVector relevantAllIndices, + public LngEvent addModel(final LngBooleanVector modelFromSolver, final SatSolver solver, + final LngIntVector relevantAllIndices, final ComputationHandler handler) { final EnumerationFoundModelsEvent event = new EnumerationFoundModelsEvent(dontCareFactor); final Model model = @@ -141,7 +141,7 @@ public LNGEvent addModel(final LNGBooleanVector modelFromSolver, final SATSolver } @Override - public LNGEvent commit(final ComputationHandler handler) { + public LngEvent commit(final ComputationHandler handler) { for (final Model uncommittedModel : uncommittedModels) { committedModels = committedModels.or(model2Bdd(uncommittedModel)); } @@ -149,29 +149,29 @@ public LNGEvent commit(final ComputationHandler handler) { return handler.shouldResume(MODEL_ENUMERATION_COMMIT) ? null : MODEL_ENUMERATION_COMMIT; } - private BDD model2Bdd(final Model model) { - BDD bdd = BDDFactory.build(kernel.factory(), kernel.factory().verum(), kernel); + private Bdd model2Bdd(final Model model) { + Bdd bdd = BddFactory.build(kernel.factory(), kernel.factory().verum(), kernel); for (final Literal literal : model.getLiterals()) { - bdd = bdd.and(BDDFactory.build(kernel.factory(), literal, kernel)); + bdd = bdd.and(BddFactory.build(kernel.factory(), literal, kernel)); } return bdd; } @Override - public LNGEvent rollback(final ComputationHandler handler) { + public LngEvent rollback(final ComputationHandler handler) { uncommittedModels.clear(); return handler.shouldResume(MODEL_ENUMERATION_ROLLBACK) ? null : MODEL_ENUMERATION_ROLLBACK; } @Override - public List rollbackAndReturnModels(final SATSolver solver, final ComputationHandler handler) { + public List rollbackAndReturnModels(final SatSolver solver, final ComputationHandler handler) { final List modelsToReturn = new ArrayList<>(uncommittedModels); rollback(handler); return modelsToReturn; } @Override - public BDD getResult() { + public Bdd getResult() { return committedModels; } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/OptimizationFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/OptimizationFunction.java index c3bd9204..82cc4820 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/OptimizationFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/OptimizationFunction.java @@ -15,11 +15,11 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.OptimizationFoundBetterBoundEvent; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATCall; +import com.booleworks.logicng.solvers.sat.SatCall; import java.util.Arrays; import java.util.Collection; @@ -87,18 +87,18 @@ public static OptimizationFunction minimize(final Collection } @Override - public LNGResult apply( - final SATSolver solver, final ComputationHandler handler) { + public LngResult apply( + final SatSolver solver, final ComputationHandler handler) { final SolverState initialState = solver.saveState(); - final LNGResult model = maximize(solver, handler); + final LngResult model = maximize(solver, handler); solver.loadState(initialState); return model; } - private LNGResult maximize( - final SATSolver solver, final ComputationHandler handler) { + private LngResult maximize( + final SatSolver solver, final ComputationHandler handler) { if (!handler.shouldResume(OPTIMIZATION_FUNCTION_STARTED)) { - return LNGResult.canceled(OPTIMIZATION_FUNCTION_STARTED); + return LngResult.canceled(OPTIMIZATION_FUNCTION_STARTED); } final FormulaFactory f = solver.getFactory(); final Map selectorMap = new TreeMap<>(); @@ -116,9 +116,9 @@ private LNGResult maximize( } Model lastResultModel; Model currentSelectorModel; - try (final SATCall satCall = solver.satCall().handler(handler).solve()) { + try (final SatCall satCall = solver.satCall().handler(handler).solve()) { if (!satCall.getSatResult().isSuccess()) { - return LNGResult.canceled(satCall.getSatResult().getCancelCause()); + return LngResult.canceled(satCall.getSatResult().getCancelCause()); } if (!satCall.getSatResult().getResult()) { throw new IllegalArgumentException("The given formula must be satisfiable"); @@ -128,18 +128,18 @@ private LNGResult maximize( if (currentSelectorModel.positiveVariables().size() == selectors.size()) { // all optimization literals satisfied -- no need for further // optimization - return LNGResult.of(satCall.model(resultModelVariables)); + return LngResult.of(satCall.model(resultModelVariables)); } } int currentBound = currentSelectorModel.positiveVariables().size(); if (currentBound == 0) { solver.add(f.cc(CType.GE, 1, selectors)); - try (final SATCall satCall = solver.satCall().handler(handler).solve()) { - final LNGResult satResult = satCall.getSatResult(); + try (final SatCall satCall = solver.satCall().handler(handler).solve()) { + final LngResult satResult = satCall.getSatResult(); if (!satResult.isSuccess()) { - return LNGResult.partial(lastResultModel, satResult.getCancelCause()); + return LngResult.partial(lastResultModel, satResult.getCancelCause()); } else if (!satResult.getResult()) { - return LNGResult.of(lastResultModel); + return LngResult.of(lastResultModel); } else { lastResultModel = satCall.model(resultModelVariables); currentSelectorModel = satCall.model(selectors); @@ -151,22 +151,22 @@ private LNGResult maximize( assert cc instanceof CardinalityConstraint; final CcIncrementalData incrementalData = solver.addIncrementalCc((CardinalityConstraint) cc); while (true) { - try (final SATCall satCall = solver.satCall().handler(handler).solve()) { - final LNGResult satResult = satCall.getSatResult(); + try (final SatCall satCall = solver.satCall().handler(handler).solve()) { + final LngResult satResult = satCall.getSatResult(); if (!satResult.isSuccess()) { - return LNGResult.partial(lastResultModel, satResult.getCancelCause()); + return LngResult.partial(lastResultModel, satResult.getCancelCause()); } else if (!satResult.getResult()) { - return LNGResult.of(lastResultModel); + return LngResult.of(lastResultModel); } lastResultModel = satCall.model(resultModelVariables); final OptimizationFoundBetterBoundEvent betterBoundEvent = new OptimizationFoundBetterBoundEvent(() -> satCall.model(resultModelVariables)); if (!handler.shouldResume(betterBoundEvent)) { - return LNGResult.partial(lastResultModel, betterBoundEvent); + return LngResult.partial(lastResultModel, betterBoundEvent); } currentSelectorModel = satCall.model(selectors); currentBound = currentSelectorModel.positiveVariables().size(); if (currentBound == selectors.size()) { - return LNGResult.of(lastResultModel); + return LngResult.of(lastResultModel); } } incrementalData.newLowerBoundForSolver(currentBound + 1); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/SolverFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/SolverFunction.java index c8bd7c38..7e3cd0dc 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/SolverFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/SolverFunction.java @@ -5,9 +5,9 @@ package com.booleworks.logicng.solvers.functions; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; /** * An interface for a function which works on a given SAT solver and its state. @@ -26,14 +26,14 @@ public interface SolverFunction { * @param handler the computation handler * @return the (potentially canceled) result of the function application */ - LNGResult apply(SATSolver solver, ComputationHandler handler); + LngResult apply(SatSolver solver, ComputationHandler handler); /** * Applies this function to the given solver. * @param solver the solver on which the function should work on * @return the result of the function application */ - default RESULT apply(final SATSolver solver) { + default RESULT apply(final SatSolver solver) { return apply(solver, NopHandler.get()).getResult(); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunction.java index aed2f82c..b20495e6 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunction.java @@ -4,18 +4,18 @@ package com.booleworks.logicng.solvers.functions; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.explanations.UNSATCore; -import com.booleworks.logicng.explanations.drup.DRUPTrim; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.explanations.UnsatCore; +import com.booleworks.logicng.explanations.drup.DrupTrim; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.ArrayList; import java.util.Collections; @@ -29,7 +29,7 @@ * @version 2.0.0 * @since 2.0.0 */ -public final class UnsatCoreFunction implements SolverFunction> { +public final class UnsatCoreFunction implements SolverFunction> { private final static UnsatCoreFunction INSTANCE = new UnsatCoreFunction(); @@ -49,15 +49,15 @@ public static UnsatCoreFunction get() { } @Override - public LNGResult> apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult> apply(final SatSolver solver, final ComputationHandler handler) { if (!solver.getConfig().isProofGeneration()) { throw new IllegalStateException("Cannot generate an unsat core if proof generation is not turned on"); } - final DRUPTrim trimmer = new DRUPTrim(); + final DrupTrim trimmer = new DrupTrim(); final Map clause2proposition = new HashMap<>(); - final LNGVector clauses = new LNGVector<>(solver.getUnderlyingSolver().pgOriginalClauses().size()); - for (final LNGCoreSolver.ProofInformation pi : solver.getUnderlyingSolver().pgOriginalClauses()) { + final LngVector clauses = new LngVector<>(solver.getUnderlyingSolver().pgOriginalClauses().size()); + for (final LngCoreSolver.ProofInformation pi : solver.getUnderlyingSolver().pgOriginalClauses()) { clauses.push(pi.getClause()); final Formula clause = getFormulaForVector(solver, pi.getClause()); Proposition proposition = pi.getProposition(); @@ -69,22 +69,22 @@ public LNGResult> apply(final SATSolver solver, final Com if (containsEmptyClause(clauses)) { final Proposition emptyClause = clause2proposition.get(solver.getFactory().falsum()); - return LNGResult.of(new UNSATCore<>(Collections.singletonList(emptyClause), true)); + return LngResult.of(new UnsatCore<>(Collections.singletonList(emptyClause), true)); } - final DRUPTrim.DRUPResult result = trimmer.compute(clauses, solver.getUnderlyingSolver().pgProof()); + final DrupTrim.DrupResult result = trimmer.compute(clauses, solver.getUnderlyingSolver().pgProof()); if (result.isTrivialUnsat()) { - return LNGResult.of(handleTrivialCase(solver)); + return LngResult.of(handleTrivialCase(solver)); } final LinkedHashSet propositions = new LinkedHashSet<>(); - for (final LNGIntVector vector : result.getUnsatCore()) { + for (final LngIntVector vector : result.getUnsatCore()) { propositions.add(clause2proposition.get(getFormulaForVector(solver, vector))); } - return LNGResult.of(new UNSATCore<>(new ArrayList<>(propositions), false)); + return LngResult.of(new UnsatCore<>(new ArrayList<>(propositions), false)); } - private UNSATCore handleTrivialCase(final SATSolver solver) { - final LNGVector clauses = solver.getUnderlyingSolver().pgOriginalClauses(); + private UnsatCore handleTrivialCase(final SatSolver solver) { + final LngVector clauses = solver.getUnderlyingSolver().pgOriginalClauses(); for (int i = 0; i < clauses.size(); i++) { for (int j = i + 1; j < clauses.size(); j++) { if (clauses.get(i).getClause().size() == 1 && clauses.get(j).getClause().size() == 1 && @@ -96,15 +96,15 @@ private UNSATCore handleTrivialCase(final SATSolver solver) { : new StandardProposition(getFormulaForVector(solver, clauses.get(i).getClause()))); propositions.add(pj != null ? pj : new StandardProposition(getFormulaForVector(solver, clauses.get(j).getClause()))); - return new UNSATCore<>(new ArrayList<>(propositions), false); + return new UnsatCore<>(new ArrayList<>(propositions), false); } } } throw new IllegalStateException("Should be a trivial unsat core, but did not found one."); } - private boolean containsEmptyClause(final LNGVector clauses) { - for (final LNGIntVector clause : clauses) { + private boolean containsEmptyClause(final LngVector clauses) { + for (final LngIntVector clause : clauses) { if (clause.isEmpty()) { return true; } @@ -112,7 +112,7 @@ private boolean containsEmptyClause(final LNGVector clauses) { return false; } - private Formula getFormulaForVector(final SATSolver solver, final LNGIntVector vector) { + private Formula getFormulaForVector(final SatSolver solver, final LngIntVector vector) { final List literals = new ArrayList<>(vector.size()); for (int i = 0; i < vector.size(); i++) { final int lit = vector.get(i); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/UpZeroLiteralsFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/UpZeroLiteralsFunction.java index f22efae4..13cd882d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/UpZeroLiteralsFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/UpZeroLiteralsFunction.java @@ -4,12 +4,12 @@ package com.booleworks.logicng.solvers.functions; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.SortedSet; import java.util.TreeSet; @@ -41,17 +41,17 @@ public static UpZeroLiteralsFunction get() { } @Override - public LNGResult> apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult> apply(final SatSolver solver, final ComputationHandler handler) { if (!solver.sat()) { - return LNGResult.of(new TreeSet<>()); + return LngResult.of(new TreeSet<>()); } - final LNGIntVector literals = solver.getUnderlyingSolver().upZeroLiterals(); + final LngIntVector literals = solver.getUnderlyingSolver().upZeroLiterals(); final SortedSet upZeroLiterals = new TreeSet<>(); for (int i = 0; i < literals.size(); ++i) { final int lit = literals.get(i); - upZeroLiterals.add(solver.getFactory().literal(solver.getUnderlyingSolver().nameForIdx(LNGCoreSolver.var(lit)), - !LNGCoreSolver.sign(lit))); + upZeroLiterals.add(solver.getFactory().literal(solver.getUnderlyingSolver().nameForIdx(LngCoreSolver.var(lit)), + !LngCoreSolver.sign(lit))); } - return LNGResult.of(upZeroLiterals); + return LngResult.of(upZeroLiterals); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunction.java index 7f2e3ac0..a9f64b63 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunction.java @@ -4,18 +4,18 @@ package com.booleworks.logicng.solvers.functions; -import static com.booleworks.logicng.solvers.sat.LNGCoreSolver.var; +import static com.booleworks.logicng.solvers.sat.LngCoreSolver.var; import static com.booleworks.logicng.util.CollectionHelper.nullSafe; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngVariable; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.HashMap; import java.util.Map; @@ -58,27 +58,27 @@ public VariableOccurrencesOnSolverFunction(final Set relevantVariables } @Override - public LNGResult> apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult> apply(final SatSolver solver, final ComputationHandler handler) { final FormulaFactory f = solver.getFactory(); - final LNGCoreSolver underlyingSolver = solver.getUnderlyingSolver(); + final LngCoreSolver underlyingSolver = solver.getUnderlyingSolver(); final Map counts = initResultMap(underlyingSolver); - for (final LNGClause clause : underlyingSolver.getClauses()) { + for (final LngClause clause : underlyingSolver.getClauses()) { for (int i = 0; i < clause.size(); i++) { final String key = underlyingSolver.nameForIdx(var(clause.get(i))); counts.computeIfPresent(key, (u, old) -> old + 1); } } - return LNGResult.of(counts.entrySet().stream() + return LngResult.of(counts.entrySet().stream() .collect(Collectors.toMap(v -> f.variable(v.getKey()), Map.Entry::getValue))); } - private Map initResultMap(final LNGCoreSolver underlyingSolver) { + private Map initResultMap(final LngCoreSolver underlyingSolver) { // start with Strings to prevent repeated variable lookups in // FormulaFactory final Map counts = new HashMap<>(); - final LNGVector variables = underlyingSolver.getVariables(); + final LngVector variables = underlyingSolver.getVariables(); for (int i = 0; i < variables.size(); i++) { - final LNGVariable var = variables.get(i); + final LngVariable var = variables.get(i); final String name = underlyingSolver.nameForIdx(i); if (relevantVariables == null || relevantVariables.contains(name)) { counts.put(name, var.level() == 0 ? 1 : 0); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/AbstractModelEnumerationFunction.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/AbstractModelEnumerationFunction.java index 8bea666e..660e47fe 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/AbstractModelEnumerationFunction.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/AbstractModelEnumerationFunction.java @@ -11,17 +11,17 @@ import static com.booleworks.logicng.util.CollectionHelper.difference; import static com.booleworks.logicng.util.CollectionHelper.nullSafe; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.SolverFunction; @@ -57,9 +57,9 @@ protected abstract EnumerationCollector newCollector(final FormulaFactor SortedSet additionalVariablesNotOnSolver); @Override - public LNGResult apply(final SATSolver solver, final ComputationHandler handler) { + public LngResult apply(final SatSolver solver, final ComputationHandler handler) { if (!handler.shouldResume(MODEL_ENUMERATION_STARTED)) { - return LNGResult.canceled(MODEL_ENUMERATION_STARTED); + return LngResult.canceled(MODEL_ENUMERATION_STARTED); } final SortedSet knownVariables = solver.getUnderlyingSolver().knownVariables(); final SortedSet additionalVarsNotOnSolver = @@ -71,29 +71,29 @@ public LNGResult apply(final SATSolver solver, final ComputationHandler knownVariables.stream().filter(variables::contains).collect(Collectors.toCollection(TreeSet::new)); final SortedSet initialSplitVars = nullSafe(() -> strategy.splitVarsForRecursionDepth(enumerationVars, solver, 0), TreeSet::new); - final LNGEvent cancelCause = enumerateRecursive(collector, solver, new TreeSet<>(), enumerationVars, initialSplitVars, 0, handler); + final LngEvent cancelCause = enumerateRecursive(collector, solver, new TreeSet<>(), enumerationVars, initialSplitVars, 0, handler); final RESULT result = collector.getResult(); if (cancelCause == null) { - return LNGResult.of(result); + return LngResult.of(result); } else { - return LNGResult.partial(result, cancelCause); + return LngResult.partial(result, cancelCause); } } - private LNGEvent enumerateRecursive(final EnumerationCollector collector, final SATSolver solver, + private LngEvent enumerateRecursive(final EnumerationCollector collector, final SatSolver solver, final SortedSet splitModel, final SortedSet enumerationVars, final SortedSet splitVars, final int recursionDepth, final ComputationHandler handler) { final int maxNumberOfModelsForEnumeration = strategy.maxNumberOfModelsForEnumeration(recursionDepth); final SolverState state = solver.saveState(); solver.add(splitModel); - final LNGResult enumerationSucceeded = enumerate(collector, solver, enumerationVars, + final LngResult enumerationSucceeded = enumerate(collector, solver, enumerationVars, additionalVariables, maxNumberOfModelsForEnumeration, handler); if (!enumerationSucceeded.isSuccess()) { collector.commit(handler); return enumerationSucceeded.getCancelCause(); } if (!enumerationSucceeded.getResult()) { - final LNGEvent cancelCause = collector.rollback(handler); + final LngEvent cancelCause = collector.rollback(handler); if (cancelCause != null) { solver.loadState(state); return cancelCause; @@ -102,7 +102,7 @@ private LNGEvent enumerateRecursive(final EnumerationCollector collector final int maxNumberOfModelsForSplitAssignments = strategy.maxNumberOfModelsForSplitAssignments(recursionDepth); while (true) { - final LNGResult enumerationForSplit = enumerate( + final LngResult enumerationForSplit = enumerate( collector, solver, newSplitVars, null, maxNumberOfModelsForSplitAssignments, handler); if (!enumerationForSplit.isSuccess()) { solver.loadState(state); @@ -111,7 +111,7 @@ private LNGEvent enumerateRecursive(final EnumerationCollector collector } else if (enumerationForSplit.getResult()) { break; } else { - final LNGEvent cancelationOnRollback = collector.rollback(handler); + final LngEvent cancelationOnRollback = collector.rollback(handler); if (cancelationOnRollback != null) { solver.loadState(state); return cancelationOnRollback; @@ -134,14 +134,14 @@ private LNGEvent enumerateRecursive(final EnumerationCollector collector recursiveSplitModel.addAll(splitModel); enumerateRecursive(collector, solver, recursiveSplitModel, enumerationVars, recursiveSplitVars, recursionDepth + 1, handler); - final LNGEvent commitEvent = collector.commit(handler); + final LngEvent commitEvent = collector.commit(handler); if (commitEvent != null) { solver.loadState(state); return commitEvent; } } } else { - final LNGEvent commitEvent = collector.commit(handler); + final LngEvent commitEvent = collector.commit(handler); if (commitEvent != null) { solver.loadState(state); return commitEvent; @@ -151,37 +151,37 @@ private LNGEvent enumerateRecursive(final EnumerationCollector collector return null; } - protected static LNGResult enumerate(final EnumerationCollector collector, final SATSolver solver, + protected static LngResult enumerate(final EnumerationCollector collector, final SatSolver solver, final SortedSet variables, final SortedSet additionalVariables, final int maxModels, final ComputationHandler handler) { final SolverState stateBeforeEnumeration = solver.saveState(); - final LNGIntVector relevantIndices = relevantIndicesFromSolver(variables, solver); - final LNGIntVector relevantAllIndices = + final LngIntVector relevantIndices = relevantIndicesFromSolver(variables, solver); + final LngIntVector relevantAllIndices = relevantAllIndicesFromSolver(variables, additionalVariables, relevantIndices, solver); int foundModels = 0; - LNGEvent cancelCause = null; - while (modelEnumerationSATCall(solver, handler)) { - final LNGBooleanVector modelFromSolver = solver.getUnderlyingSolver().model(); + LngEvent cancelCause = null; + while (modelEnumerationSatCall(solver, handler)) { + final LngBooleanVector modelFromSolver = solver.getUnderlyingSolver().model(); if (++foundModels >= maxModels) { solver.loadState(stateBeforeEnumeration); - return LNGResult.of(false); + return LngResult.of(false); } cancelCause = collector.addModel(modelFromSolver, solver, relevantAllIndices, handler); - if (cancelCause == null && modelFromSolver.size() > 0) { - final LNGIntVector blockingClause = generateBlockingClause(modelFromSolver, relevantIndices); + if (cancelCause == null && !modelFromSolver.isEmpty()) { + final LngIntVector blockingClause = generateBlockingClause(modelFromSolver, relevantIndices); solver.getUnderlyingSolver().addClause(blockingClause, null); } else { break; } } solver.loadState(stateBeforeEnumeration); - return cancelCause == null ? LNGResult.of(true) : LNGResult.canceled(cancelCause); + return cancelCause == null ? LngResult.of(true) : LngResult.canceled(cancelCause); } - private static boolean modelEnumerationSATCall(final SATSolver solver, final ComputationHandler handler) { - final LNGResult sat = solver.satCall().handler(handler).sat(); + private static boolean modelEnumerationSatCall(final SatSolver solver, final ComputationHandler handler) { + final LngResult sat = solver.satCall().handler(handler).sat(); return sat.isSuccess() && sat.getResult(); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/DefaultModelEnumerationStrategy.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/DefaultModelEnumerationStrategy.java index 5a74eb90..c8a36955 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/DefaultModelEnumerationStrategy.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/DefaultModelEnumerationStrategy.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.MostCommonVariablesProvider; import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.SplitVariableProvider; @@ -76,7 +76,7 @@ public int maxNumberOfModelsForSplitAssignments(final int recursionDepth) { } @Override - public SortedSet splitVarsForRecursionDepth(final Collection variables, final SATSolver solver, + public SortedSet splitVarsForRecursionDepth(final Collection variables, final SatSolver solver, final int recursionDepth) { if (recursionDepth == 0) { return splitVariableProvider.getSplitVars(solver, variables); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollector.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollector.java index 697f9c67..c53b331f 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollector.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollector.java @@ -4,12 +4,12 @@ package com.booleworks.logicng.solvers.functions.modelenumeration; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.SatSolver; import java.util.List; @@ -17,7 +17,7 @@ * An interface for enumeration collectors. *

    * An enumeration collector gathers the found models given by - * {@link #addModel(LNGBooleanVector, SATSolver, LNGIntVector, ComputationHandler)}. + * {@link #addModel(LngBooleanVector, SatSolver, LngIntVector, ComputationHandler)}. * Added Models added can potentially be discarded later via * {@link #rollback(ComputationHandler)}. To prevent models from being * rolled back one can call {@link #commit(ComputationHandler)}. With @@ -39,7 +39,7 @@ public interface EnumerationCollector { * @return an event if the handler canceled the computation, * otherwise {@code null} */ - LNGEvent addModel(LNGBooleanVector modelFromSolver, SATSolver solver, LNGIntVector relevantAllIndices, + LngEvent addModel(LngBooleanVector modelFromSolver, SatSolver solver, LngIntVector relevantAllIndices, ComputationHandler handler); /** @@ -51,7 +51,7 @@ LNGEvent addModel(LNGBooleanVector modelFromSolver, SATSolver solver, LNGIntVect * @return an event if the handler canceled the computation, * otherwise {@code null} */ - LNGEvent commit(ComputationHandler handler); + LngEvent commit(ComputationHandler handler); /** * All found models since the last commit should be discarded. @@ -62,7 +62,7 @@ LNGEvent addModel(LNGBooleanVector modelFromSolver, SATSolver solver, LNGIntVect * @return an event if the handler canceled the computation, * otherwise {@code null} */ - LNGEvent rollback(ComputationHandler handler); + LngEvent rollback(ComputationHandler handler); /** * All found models since the last commit will be discarded and returned. @@ -72,7 +72,7 @@ LNGEvent addModel(LNGBooleanVector modelFromSolver, SATSolver solver, LNGIntVect * @param handler the computation handler * @return list of all discarded models */ - List rollbackAndReturnModels(final SATSolver solver, ComputationHandler handler); + List rollbackAndReturnModels(final SatSolver solver, ComputationHandler handler); /** * Returns the currently committed state of the collector. diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationCommon.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationCommon.java index 4eeaf1b7..ee529a60 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationCommon.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationCommon.java @@ -4,10 +4,10 @@ package com.booleworks.logicng.solvers.functions.modelenumeration; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.Collections; @@ -30,11 +30,11 @@ public interface ModelEnumerationCommon { * {@code null} all variables are relevant. * @return the blocking clause for the given model and relevant variables */ - static LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolver, - final LNGIntVector relevantVars) { - final LNGIntVector blockingClause; + static LngIntVector generateBlockingClause(final LngBooleanVector modelFromSolver, + final LngIntVector relevantVars) { + final LngIntVector blockingClause; if (relevantVars != null) { - blockingClause = new LNGIntVector(relevantVars.size()); + blockingClause = new LngIntVector(relevantVars.size()); for (int i = 0; i < relevantVars.size(); i++) { final int varIndex = relevantVars.get(i); if (varIndex != -1) { @@ -43,7 +43,7 @@ static LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolve } } } else { - blockingClause = new LNGIntVector(modelFromSolver.size()); + blockingClause = new LngIntVector(modelFromSolver.size()); for (int i = 0; i < modelFromSolver.size(); i++) { final boolean varAssignment = modelFromSolver.get(i); blockingClause.push(varAssignment ? (i * 2) ^ 1 : i * 2); @@ -66,13 +66,13 @@ static LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolve * @param solver the solver from which the indices should be extracted * @return a list of the internal indices */ - static LNGIntVector relevantIndicesFromSolver(final Collection variables, final SATSolver solver) { + static LngIntVector relevantIndicesFromSolver(final Collection variables, final SatSolver solver) { if (variables == null) { throw new IllegalArgumentException( "Model enumeration must always be calles with a valid set of variables."); } - final LNGIntVector relevantIndices; - relevantIndices = new LNGIntVector(variables.size()); + final LngIntVector relevantIndices; + relevantIndices = new LngIntVector(variables.size()); for (final Variable var : variables) { relevantIndices.push(solver.getUnderlyingSolver().idxForName(var.getName())); } @@ -91,11 +91,11 @@ static LNGIntVector relevantIndicesFromSolver(final Collection variabl * extracted * @return {@code relevantIndices} + the newly obtained additional indices */ - static LNGIntVector relevantAllIndicesFromSolver(final Collection variables, + static LngIntVector relevantAllIndicesFromSolver(final Collection variables, final Collection additionalVariables, - final LNGIntVector relevantIndices, - final SATSolver solver) { - LNGIntVector relevantAllIndices = null; + final LngIntVector relevantIndices, + final SatSolver solver) { + LngIntVector relevantAllIndices = null; final SortedSet uniqueAdditionalVariables = new TreeSet<>(additionalVariables == null ? Collections.emptyList() : additionalVariables); uniqueAdditionalVariables.removeAll(variables); @@ -103,7 +103,7 @@ static LNGIntVector relevantAllIndicesFromSolver(final Collection vari if (uniqueAdditionalVariables.isEmpty()) { relevantAllIndices = relevantIndices; } else { - relevantAllIndices = new LNGIntVector(relevantIndices.size() + uniqueAdditionalVariables.size()); + relevantAllIndices = new LngIntVector(relevantIndices.size() + uniqueAdditionalVariables.size()); for (int i = 0; i < relevantIndices.size(); ++i) { relevantAllIndices.push(relevantIndices.get(i)); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationStrategy.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationStrategy.java index 2401cece..ebc67e04 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationStrategy.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/ModelEnumerationStrategy.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.SortedSet; @@ -61,7 +61,7 @@ public interface ModelEnumerationStrategy { * depth 1 * @return the split variables which is a subset of the given variables */ - SortedSet splitVarsForRecursionDepth(Collection variables, SATSolver solver, + SortedSet splitVarsForRecursionDepth(Collection variables, SatSolver solver, int recursionDepth); /** diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/NoSplitModelEnumerationStrategy.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/NoSplitModelEnumerationStrategy.java index ac793483..6602bb69 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/NoSplitModelEnumerationStrategy.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/NoSplitModelEnumerationStrategy.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.Collections; @@ -43,7 +43,7 @@ public int maxNumberOfModelsForSplitAssignments(final int recursionDepth) { } @Override - public SortedSet splitVarsForRecursionDepth(final Collection variables, final SATSolver solver, + public SortedSet splitVarsForRecursionDepth(final Collection variables, final SatSolver solver, final int recursionDepth) { return Collections.emptySortedSet(); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/FixedVariableProvider.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/FixedVariableProvider.java index ef8c2d90..ba2b2bfa 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/FixedVariableProvider.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/FixedVariableProvider.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.SortedSet; @@ -30,7 +30,7 @@ public FixedVariableProvider(final SortedSet splitVariables) { } @Override - public SortedSet getSplitVars(final SATSolver solver, final Collection variables) { + public SortedSet getSplitVars(final SatSolver solver, final Collection variables) { return splitVariables; } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/LeastCommonVariablesProvider.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/LeastCommonVariablesProvider.java index b937c263..b71fadd9 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/LeastCommonVariablesProvider.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/LeastCommonVariablesProvider.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.SortedSet; @@ -44,7 +44,7 @@ public LeastCommonVariablesProvider(final double takeRate, final int maximumNumb } @Override - public SortedSet getSplitVars(final SATSolver solver, final Collection variables) { + public SortedSet getSplitVars(final SatSolver solver, final Collection variables) { return chooseVariablesByOccurrences(solver, variables, false); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/MostCommonVariablesProvider.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/MostCommonVariablesProvider.java index 114c0e9e..809cf10f 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/MostCommonVariablesProvider.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/MostCommonVariablesProvider.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.Collection; import java.util.SortedSet; @@ -44,7 +44,7 @@ public MostCommonVariablesProvider(final double takeRate, final int maximumNumbe } @Override - public SortedSet getSplitVars(final SATSolver solver, final Collection variables) { + public SortedSet getSplitVars(final SatSolver solver, final Collection variables) { return chooseVariablesByOccurrences(solver, variables, true); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProvider.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProvider.java index 9cace6f1..59a92bce 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProvider.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProvider.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import java.util.Collection; @@ -28,5 +28,5 @@ public interface SplitVariableProvider { * chosen * @return the split variables */ - SortedSet getSplitVars(final SATSolver solver, final Collection variables); + SortedSet getSplitVars(final SatSolver solver, final Collection variables); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderWithTakeRate.java b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderWithTakeRate.java index c51d12d9..8510222d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderWithTakeRate.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderWithTakeRate.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.VariableOccurrencesOnSolverFunction; import java.util.Collection; @@ -55,7 +55,7 @@ protected SplitVariableProviderWithTakeRate(final double takeRate, final int max * should be selected * @return a subset of the most or least common variables */ - protected SortedSet chooseVariablesByOccurrences(final SATSolver solver, + protected SortedSet chooseVariablesByOccurrences(final SatSolver solver, final Collection variables, final boolean mostCommon) { final Comparator> comparator = diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWBO.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWbo.java similarity index 72% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWBO.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWbo.java index ec5e835a..923f6538 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWBO.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/IncWbo.java @@ -22,16 +22,16 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import com.booleworks.logicng.util.Pair; import java.io.PrintStream; @@ -43,10 +43,10 @@ * @version 3.0.0 * @since 1.0 */ -public class IncWBO extends WBO { +public class IncWbo extends Wbo { protected Encoder encoder; - protected final LNGBooleanVector incSoft; + protected final LngBooleanVector incSoft; protected final PrintStream output; protected boolean firstBuild; @@ -54,8 +54,8 @@ public class IncWBO extends WBO { * Constructs a new solver with default values. * @param f the formula factory */ - public IncWBO(final FormulaFactory f) { - this(f, MaxSATConfig.builder().build()); + public IncWbo(final FormulaFactory f) { + this(f, MaxSatConfig.builder().build()); } /** @@ -63,7 +63,7 @@ public IncWBO(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public IncWBO(final FormulaFactory f, final MaxSATConfig config) { + public IncWbo(final FormulaFactory f, final MaxSatConfig config) { super(f, config); solver = null; verbosity = config.verbosity; @@ -73,19 +73,19 @@ public IncWBO(final FormulaFactory f, final MaxSATConfig config) { symmetryBreakingLimit = config.limit; firstBuild = true; coreMapping = new TreeMap<>(); - assumptions = new LNGIntVector(); - indexSoftCore = new LNGIntVector(); - softMapping = new LNGVector<>(); - relaxationMapping = new LNGVector<>(); + assumptions = new LngIntVector(); + indexSoftCore = new LngIntVector(); + softMapping = new LngVector<>(); + relaxationMapping = new LngVector<>(); duplicatedSymmetryClauses = new HashSet<>(); - incSoft = new LNGBooleanVector(); + incSoft = new LngBooleanVector(); output = config.output; } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { - encoder = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - encoder.setAMOEncoding(config.amoEncoding); + protected LngResult internalSearch(final ComputationHandler handler) { + encoder = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + encoder.setAmoEncoding(config.amoEncoding); nbInitialVariables = nVars(); coreMapping.clear(); assumptions.clear(); @@ -96,26 +96,26 @@ protected LNGResult internalSearch(final ComputationHandler handle incSoft.clear(); firstBuild = true; if (currentWeight == 1) { - weightStrategy = MaxSATConfig.WeightStrategy.NONE; + weightStrategy = MaxSatConfig.WeightStrategy.NONE; } if (symmetryStrategy) { initSymmetry(); } - if (problemType == ProblemType.UNWEIGHTED || weightStrategy == MaxSATConfig.WeightStrategy.NONE) { + if (problemType == ProblemType.UNWEIGHTED || weightStrategy == MaxSatConfig.WeightStrategy.NONE) { return normalSearch(handler); - } else if (weightStrategy == MaxSATConfig.WeightStrategy.NORMAL || - weightStrategy == MaxSATConfig.WeightStrategy.DIVERSIFY) { + } else if (weightStrategy == MaxSatConfig.WeightStrategy.NORMAL || + weightStrategy == MaxSatConfig.WeightStrategy.DIVERSIFY) { return weightSearch(handler); } throw new IllegalArgumentException("Unknown problem type."); } - protected void incrementalBuildWeightSolver(final MaxSATConfig.WeightStrategy strategy) { - assert strategy == MaxSATConfig.WeightStrategy.NORMAL || strategy == MaxSATConfig.WeightStrategy.DIVERSIFY; + protected void incrementalBuildWeightSolver(final MaxSatConfig.WeightStrategy strategy) { + assert strategy == MaxSatConfig.WeightStrategy.NORMAL || strategy == MaxSatConfig.WeightStrategy.DIVERSIFY; if (firstBuild) { - solver = newSATSolver(); + solver = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(solver); + newSatVariable(solver); } for (int i = 0; i < hardClauses.size(); i++) { solver.addClause(hardClauses.get(i).clause(), null); @@ -125,12 +125,12 @@ protected void incrementalBuildWeightSolver(final MaxSATConfig.WeightStrategy st } firstBuild = false; } - LNGIntVector clause; + LngIntVector clause; nbCurrentSoft = 0; for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= currentWeight && softClauses.get(i).weight() != 0) { nbCurrentSoft++; - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -140,22 +140,22 @@ protected void incrementalBuildWeightSolver(final MaxSATConfig.WeightStrategy st } } - protected void relaxCore(final LNGIntVector conflict, final int weightCore) { + protected void relaxCore(final LngIntVector conflict, final int weightCore) { assert conflict.size() > 0; assert weightCore > 0; - final LNGIntVector lits = new LNGIntVector(); + final LngIntVector lits = new LngIntVector(); for (int i = 0; i < conflict.size(); i++) { final int indexSoft = coreMapping.get(conflict.get(i)); if (softClauses.get(indexSoft).weight() == weightCore) { - final LNGIntVector clause = new LNGIntVector(softClauses.get(indexSoft).clause()); - final LNGIntVector vars = new LNGIntVector(softClauses.get(indexSoft).relaxationVars()); + final LngIntVector clause = new LngIntVector(softClauses.get(indexSoft).clause()); + final LngIntVector vars = new LngIntVector(softClauses.get(indexSoft).relaxationVars()); final int p = newLiteral(false); - newSATVariable(solver); + newSatVariable(solver); vars.push(p); lits.push(p); addSoftClause(weightCore, clause, vars); final int l = newLiteral(false); - newSATVariable(solver); + newSatVariable(solver); softClauses.get(softClauses.size() - 1).setAssumptionVar(l); coreMapping.put(l, softClauses.size() - 1); incSoft.set(indexSoft, true); @@ -169,27 +169,27 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore) { clause.push(softClauses.get(indexSoft).assumptionVar()); solver.addClause(clause, null); if (symmetryStrategy) { - softMapping.push(new LNGIntVector(softMapping.get(indexSoft))); + softMapping.push(new LngIntVector(softMapping.get(indexSoft))); softMapping.get(indexSoft).clear(); - relaxationMapping.push(new LNGIntVector(relaxationMapping.get(indexSoft))); + relaxationMapping.push(new LngIntVector(relaxationMapping.get(indexSoft))); relaxationMapping.get(indexSoft).clear(); symmetryLog(softClauses.size() - 1); } } else { assert softClauses.get(indexSoft).weight() - weightCore > 0; softClauses.get(indexSoft).setWeight(softClauses.get(indexSoft).weight() - weightCore); - LNGIntVector clause = new LNGIntVector(softClauses.get(indexSoft).clause()); - LNGIntVector vars = new LNGIntVector(softClauses.get(indexSoft).relaxationVars()); + LngIntVector clause = new LngIntVector(softClauses.get(indexSoft).clause()); + LngIntVector vars = new LngIntVector(softClauses.get(indexSoft).relaxationVars()); addSoftClause(softClauses.get(indexSoft).weight(), clause, vars); if (symmetryStrategy) { - softMapping.push(new LNGIntVector(softMapping.get(indexSoft))); + softMapping.push(new LngIntVector(softMapping.get(indexSoft))); softMapping.get(indexSoft).clear(); - relaxationMapping.push(new LNGIntVector(relaxationMapping.get(indexSoft))); + relaxationMapping.push(new LngIntVector(relaxationMapping.get(indexSoft))); relaxationMapping.get(indexSoft).clear(); } incSoft.set(indexSoft, true); int l = newLiteral(false); - newSATVariable(solver); + newSatVariable(solver); softClauses.get(softClauses.size() - 1).setAssumptionVar(l); coreMapping.put(l, softClauses.size() - 1); incSoft.push(false); @@ -200,15 +200,15 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore) { solver.addClause(clause, null); clause.clear(); vars.clear(); - clause = new LNGIntVector(softClauses.get(indexSoft).clause()); - vars = new LNGIntVector(softClauses.get(indexSoft).relaxationVars()); + clause = new LngIntVector(softClauses.get(indexSoft).clause()); + vars = new LngIntVector(softClauses.get(indexSoft).relaxationVars()); l = newLiteral(false); - newSATVariable(solver); + newSatVariable(solver); vars.push(l); lits.push(l); addSoftClause(weightCore, clause, vars); l = newLiteral(false); - newSATVariable(solver); + newSatVariable(solver); softClauses.get(softClauses.size() - 1).setAssumptionVar(l); coreMapping.put(l, softClauses.size() - 1); incSoft.push(false); @@ -221,13 +221,13 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore) { clause.push(softClauses.get(indexSoft).assumptionVar()); solver.addClause(clause, null); if (symmetryStrategy) { - softMapping.push(new LNGIntVector()); - relaxationMapping.push(new LNGIntVector()); + softMapping.push(new LngIntVector()); + relaxationMapping.push(new LngIntVector()); symmetryLog(softClauses.size() - 1); } } } - encoder.encodeAMO(solver, lits); + encoder.encodeAmo(solver, lits); nbVars = solver.nVars(); if (symmetryStrategy) { symmetryBreaking(); @@ -238,16 +238,16 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore) { @Override protected void symmetryBreaking() { if (indexSoftCore.size() != 0 && nbSymmetryClauses < symmetryBreakingLimit) { - final LNGIntVector[] coreIntersection = new LNGIntVector[nbCores]; - final LNGIntVector[] coreIntersectionCurrent = new LNGIntVector[nbCores]; + final LngIntVector[] coreIntersection = new LngIntVector[nbCores]; + final LngIntVector[] coreIntersectionCurrent = new LngIntVector[nbCores]; for (int i = 0; i < nbCores; i++) { - coreIntersection[i] = new LNGIntVector(); - coreIntersectionCurrent[i] = new LNGIntVector(); + coreIntersection[i] = new LngIntVector(); + coreIntersectionCurrent[i] = new LngIntVector(); } - final LNGIntVector coreList = new LNGIntVector(); + final LngIntVector coreList = new LngIntVector(); for (int i = 0; i < indexSoftCore.size(); i++) { final int p = indexSoftCore.get(i); - final LNGIntVector addCores = new LNGIntVector(); + final LngIntVector addCores = new LngIntVector(); for (int j = 0; j < softMapping.get(p).size() - 1; j++) { final int core = softMapping.get(p).get(j); addCores.push(core); @@ -255,30 +255,30 @@ protected void symmetryBreaking() { coreList.push(core); } assert j < relaxationMapping.get(p).size(); - assert LNGCoreSolver.var(relaxationMapping.get(p).get(j)) > nbInitialVariables; + assert LngCoreSolver.var(relaxationMapping.get(p).get(j)) > nbInitialVariables; coreIntersection[core].push(relaxationMapping.get(p).get(j)); } for (int j = 0; j < addCores.size(); j++) { final int core = addCores.get(j); final int b = softMapping.get(p).size() - 1; assert b < relaxationMapping.get(p).size(); - assert LNGCoreSolver.var(relaxationMapping.get(p).get(b)) > nbInitialVariables; + assert LngCoreSolver.var(relaxationMapping.get(p).get(b)) > nbInitialVariables; coreIntersectionCurrent[core].push(relaxationMapping.get(p).get(b)); } for (int k = 0; k < coreList.size(); k++) { for (int m = 0; m < coreIntersection[coreList.get(k)].size(); m++) { for (int j = m + 1; j < coreIntersectionCurrent[coreList.get(k)].size(); j++) { - final LNGIntVector clause = new LNGIntVector(); - clause.push(LNGCoreSolver.not(coreIntersection[coreList.get(k)].get(m))); - clause.push(LNGCoreSolver.not(coreIntersectionCurrent[coreList.get(k)].get(j))); + final LngIntVector clause = new LngIntVector(); + clause.push(LngCoreSolver.not(coreIntersection[coreList.get(k)].get(m))); + clause.push(LngCoreSolver.not(coreIntersectionCurrent[coreList.get(k)].get(j))); Pair symClause = - new Pair<>(LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m)), - LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))); - if (LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m)) > - LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))) { + new Pair<>(LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m)), + LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))); + if (LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m)) > + LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))) { symClause = - new Pair<>(LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j)), - LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m))); + new Pair<>(LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j)), + LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m))); } if (!duplicatedSymmetryClauses.contains(symClause)) { duplicatedSymmetryClauses.add(symClause); @@ -306,12 +306,12 @@ protected void symmetryBreaking() { } @Override - protected LNGResult weightSearch(final ComputationHandler handler) { - assert weightStrategy == MaxSATConfig.WeightStrategy.NORMAL || - weightStrategy == MaxSATConfig.WeightStrategy.DIVERSIFY; - final LNGResult unsatResult = unsatSearch(handler); + protected LngResult weightSearch(final ComputationHandler handler) { + assert weightStrategy == MaxSatConfig.WeightStrategy.NORMAL || + weightStrategy == MaxSatConfig.WeightStrategy.DIVERSIFY; + final LngResult unsatResult = unsatSearch(handler); if (!unsatResult.isSuccess()) { - return LNGResult.canceled(unsatResult.getCancelCause()); + return LngResult.canceled(unsatResult.getCancelCause()); } else if (!unsatResult.getResult()) { return unsat(); } @@ -323,23 +323,23 @@ protected LNGResult weightSearch(final ComputationHandler handler) assumptions.clear(); for (int i = 0; i < incSoft.size(); i++) { if (!incSoft.get(i)) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (!res.getResult()) { nbCores++; assert solver.assumptionsConflict().size() > 0; final int coreCost = computeCostCore(solver.assumptionsConflict()); lbCost += coreCost; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.printf("c LB : %d CS : %d W : %d%n", lbCost, solver.assumptionsConflict().size(), coreCost); } - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } relaxCore(solver.assumptionsConflict(), coreCost); incrementalBuildWeightSolver(weightStrategy); @@ -347,13 +347,13 @@ protected LNGResult weightSearch(final ComputationHandler handler) nbSatisfiable++; if (nbCurrentSoft == softClauses.size()) { assert incComputeCostModel(solver.model()) == lbCost; - if (lbCost == ubCost && verbosity != MaxSATConfig.Verbosity.NONE) { + if (lbCost == ubCost && verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } if (lbCost < ubCost) { ubCost = lbCost; saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + lbCost); } } @@ -364,19 +364,19 @@ protected LNGResult weightSearch(final ComputationHandler handler) if (cost < ubCost) { ubCost = cost; saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + ubCost); } } if (lbCost == ubCost) { - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } incrementalBuildWeightSolver(weightStrategy); @@ -385,7 +385,7 @@ protected LNGResult weightSearch(final ComputationHandler handler) } } - protected int incComputeCostModel(final LNGBooleanVector currentModel) { + protected int incComputeCostModel(final LngBooleanVector currentModel) { int currentCost = 0; for (int i = 0; i < softClauses.size(); i++) { boolean unsatisfied = true; @@ -394,11 +394,11 @@ protected int incComputeCostModel(final LNGBooleanVector currentModel) { unsatisfied = false; continue; } - assert LNGCoreSolver.var(softClauses.get(i).clause().get(j)) < currentModel.size(); - if ((LNGCoreSolver.sign(softClauses.get(i).clause().get(j)) && - !currentModel.get(LNGCoreSolver.var(softClauses.get(i).clause().get(j)))) || - (!LNGCoreSolver.sign(softClauses.get(i).clause().get(j)) && - currentModel.get(LNGCoreSolver.var(softClauses.get(i).clause().get(j))))) { + assert LngCoreSolver.var(softClauses.get(i).clause().get(j)) < currentModel.size(); + if ((LngCoreSolver.sign(softClauses.get(i).clause().get(j)) && + !currentModel.get(LngCoreSolver.var(softClauses.get(i).clause().get(j)))) || + (!LngCoreSolver.sign(softClauses.get(i).clause().get(j)) && + currentModel.get(LngCoreSolver.var(softClauses.get(i).clause().get(j))))) { unsatisfied = false; break; } @@ -411,10 +411,10 @@ protected int incComputeCostModel(final LNGBooleanVector currentModel) { } @Override - protected LNGResult normalSearch(final ComputationHandler handler) { - final LNGResult unsatResult = unsatSearch(handler); + protected LngResult normalSearch(final ComputationHandler handler) { + final LngResult unsatResult = unsatSearch(handler); if (!unsatResult.isSuccess()) { - return LNGResult.canceled(unsatResult.getCancelCause()); + return LngResult.canceled(unsatResult.getCancelCause()); } else if (!unsatResult.getResult()) { return unsat(); } @@ -425,36 +425,36 @@ protected LNGResult normalSearch(final ComputationHandler handler) assumptions.clear(); for (int i = 0; i < incSoft.size(); i++) { if (!incSoft.get(i)) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (!res.getResult()) { nbCores++; assert solver.assumptionsConflict().size() > 0; final int coreCost = computeCostCore(solver.assumptionsConflict()); lbCost += coreCost; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.printf("c LB : %d CS : %d W : %d%n", lbCost, solver.assumptionsConflict().size(), coreCost); } if (lbCost == ubCost) { - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); } - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } relaxCore(solver.assumptionsConflict(), coreCost); } else { nbSatisfiable++; ubCost = incComputeCostModel(solver.model()); assert lbCost == ubCost; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + lbCost); } saveModel(solver.model()); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSU.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSu.java similarity index 76% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSU.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSu.java index ceb8b6a4..8cee5541 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSU.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearSu.java @@ -22,20 +22,20 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.CardinalityEncoding; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.Verbosity; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.CardinalityEncoding; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.Verbosity; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.datastructures.LNGSoftClause; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.datastructures.LngSoftClause; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.io.PrintStream; @@ -44,22 +44,22 @@ * @version 3.0.0 * @since 1.0 */ -public class LinearSU extends MaxSAT { +public class LinearSu extends MaxSat { protected Encoder encoder; protected final boolean bmoMode; // Enables BMO mode. - protected final LNGIntVector objFunction; - protected final LNGIntVector coeffs; + protected final LngIntVector objFunction; + protected final LngIntVector coeffs; protected final PrintStream output; - protected LNGCoreSolver solver; + protected LngCoreSolver solver; protected boolean isBmo; // Stores if the formula is BMO or not. /** * Constructs a new solver with default values. * @param f the formula factory */ - public LinearSU(final FormulaFactory f) { - this(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).build()); + public LinearSu(final FormulaFactory f) { + this(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).build()); } /** @@ -67,26 +67,26 @@ public LinearSU(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public LinearSU(final FormulaFactory f, final MaxSATConfig config) { + public LinearSu(final FormulaFactory f, final MaxSatConfig config) { super(f, config); solver = null; verbosity = config.verbosity; bmoMode = config.bmo; isBmo = false; - objFunction = new LNGIntVector(); - coeffs = new LNGIntVector(); + objFunction = new LngIntVector(); + coeffs = new LngIntVector(); output = config.output; } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { encoder = new Encoder(config.cardinalityEncoding); - encoder.setPBEncoding(config.pbEncoding); + encoder.setPbEncoding(config.pbEncoding); nbInitialVariables = nVars(); objFunction.clear(); coeffs.clear(); if (problemType == ProblemType.WEIGHTED) { - isBmo = isBMO(true); + isBmo = isBmo(true); if (bmoMode && isBmo) { return bmoSearch(handler); } else { @@ -97,21 +97,21 @@ protected LNGResult internalSearch(final ComputationHandler handle } } - protected LNGResult bmoSearch(final ComputationHandler handler) { + protected LngResult bmoSearch(final ComputationHandler handler) { assert orderWeights.size() > 0; initRelaxation(); int currentWeight = orderWeights.get(0); final int minWeight = orderWeights.get(orderWeights.size() - 1); int posWeight = 0; - final LNGVector functions = new LNGVector<>(); - final LNGIntVector weights = new LNGIntVector(); - solver = rebuildBMO(functions, weights, currentWeight); + final LngVector functions = new LngVector<>(); + final LngIntVector weights = new LngIntVector(); + solver = rebuildBmo(functions, weights, currentWeight); int localCost = 0; ubCost = 0; while (true) { - final LNGResult res = searchSATSolver(solver, handler); + final LngResult res = searchSatSolver(solver, handler); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } if (res.getResult()) { nbSatisfiable++; @@ -123,9 +123,9 @@ protected LNGResult bmoSearch(final ComputationHandler handler) { } ubCost = newCost + lbCost; if (newCost > 0) { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } } else if (verbosity != Verbosity.NONE) { @@ -135,12 +135,12 @@ protected LNGResult bmoSearch(final ComputationHandler handler) { return optimum(); } else { if (newCost == 0) { - functions.push(new LNGIntVector(objFunction)); + functions.push(new LngIntVector(objFunction)); localCost = newCost; weights.push(0); posWeight++; currentWeight = orderWeights.get(posWeight); - solver = rebuildBMO(functions, weights, currentWeight); + solver = rebuildBmo(functions, weights, currentWeight); if (verbosity != Verbosity.NONE) { output.println("c LB : " + lbCost); } @@ -163,17 +163,17 @@ protected LNGResult bmoSearch(final ComputationHandler handler) { return optimum(); } } else { - functions.push(new LNGIntVector(objFunction)); + functions.push(new LngIntVector(objFunction)); weights.push(localCost / currentWeight); lbCost += localCost; posWeight++; currentWeight = orderWeights.get(posWeight); localCost = 0; - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } - solver = rebuildBMO(functions, weights, currentWeight); + solver = rebuildBmo(functions, weights, currentWeight); if (verbosity != Verbosity.NONE) { output.println("c LB : " + lbCost); } @@ -182,13 +182,13 @@ protected LNGResult bmoSearch(final ComputationHandler handler) { } } - protected LNGResult normalSearch(final ComputationHandler handler) { + protected LngResult normalSearch(final ComputationHandler handler) { initRelaxation(); solver = rebuildSolver(1); while (true) { - final LNGResult res = searchSATSolver(solver, handler); + final LngResult res = searchSatSolver(solver, handler); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); @@ -201,10 +201,10 @@ protected LNGResult normalSearch(final ComputationHandler handler) return optimum(); } else { if (problemType == ProblemType.WEIGHTED) { - if (!encoder.hasPBEncoding()) { - encoder.encodePB(solver, objFunction, coeffs, newCost - 1); + if (!encoder.hasPbEncoding()) { + encoder.encodePb(solver, objFunction, coeffs, newCost - 1); } else { - encoder.updatePB(solver, newCost - 1); + encoder.updatePb(solver, newCost - 1); } } else { if (!encoder.hasCardEncoding()) { @@ -214,9 +214,9 @@ protected LNGResult normalSearch(final ComputationHandler handler) } } ubCost = newCost; - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } } else { @@ -236,12 +236,12 @@ protected LNGResult normalSearch(final ComputationHandler handler) * @param minWeight the minimal weight * @return the rebuilt solver */ - protected LNGCoreSolver rebuildSolver(final int minWeight) { - final LNGBooleanVector seen = new LNGBooleanVector(nVars()); + protected LngCoreSolver rebuildSolver(final int minWeight) { + final LngBooleanVector seen = new LngBooleanVector(nVars()); seen.growTo(nVars(), false); - final LNGCoreSolver s = newSATSolver(); + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); @@ -250,7 +250,7 @@ protected LNGCoreSolver rebuildSolver(final int minWeight) { if (softClauses.get(i).weight() < minWeight) { continue; } - final LNGIntVector clause = new LNGIntVector(softClauses.get(i).clause()); + final LngIntVector clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -266,10 +266,10 @@ protected LNGCoreSolver rebuildSolver(final int minWeight) { * @param currentWeight the current weight * @return the rebuilt solver */ - protected LNGCoreSolver rebuildBMO(final LNGVector functions, final LNGIntVector rhs, + protected LngCoreSolver rebuildBmo(final LngVector functions, final LngIntVector rhs, final int currentWeight) { assert functions.size() == rhs.size(); - final LNGCoreSolver s = rebuildSolver(currentWeight); + final LngCoreSolver s = rebuildSolver(currentWeight); objFunction.clear(); coeffs.clear(); for (int i = 0; i < softClauses.size(); i++) { @@ -289,7 +289,7 @@ protected LNGCoreSolver rebuildBMO(final LNGVector functions, fina * 'relaxationVars' of each soft clause. */ protected void initRelaxation() { - for (final LNGSoftClause softClause : softClauses) { + for (final LngSoftClause softClause : softClauses) { final int l = newLiteral(false); softClause.relaxationVars().push(l); objFunction.push(l); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUS.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUs.java similarity index 71% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUS.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUs.java index a6a3d4c7..2f9b31fe 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUS.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/LinearUs.java @@ -22,14 +22,14 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.io.PrintStream; @@ -38,18 +38,18 @@ * @version 3.0.0 * @since 1.0 */ -public class LinearUS extends MaxSAT { +public class LinearUs extends MaxSat { protected Encoder encoder; - protected final MaxSATConfig.IncrementalStrategy incrementalStrategy; + protected final MaxSatConfig.IncrementalStrategy incrementalStrategy; protected final PrintStream output; /** * Constructs a new solver with default values. * @param f the formula factory */ - public LinearUS(final FormulaFactory f) { - this(f, MaxSATConfig.builder().build()); + public LinearUs(final FormulaFactory f) { + this(f, MaxSatConfig.builder().build()); } /** @@ -57,7 +57,7 @@ public LinearUS(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public LinearUS(final FormulaFactory f, final MaxSATConfig config) { + public LinearUs(final FormulaFactory f, final MaxSatConfig config) { super(f, config); verbosity = config.verbosity; incrementalStrategy = config.incrementalStrategy; @@ -65,7 +65,7 @@ public LinearUS(final FormulaFactory f, final MaxSATConfig config) { } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { encoder = new Encoder(config.cardinalityEncoding); if (problemType == ProblemType.WEIGHTED) { throw new IllegalStateException("Error: Currently LinearUS does not support weighted MaxSAT instances."); @@ -74,7 +74,7 @@ protected LNGResult internalSearch(final ComputationHandler handle case NONE: return none(handler); case ITERATIVE: - if (encoder.cardEncoding() != MaxSATConfig.CardinalityEncoding.TOTALIZER) { + if (encoder.cardEncoding() != MaxSatConfig.CardinalityEncoding.TOTALIZER) { throw new IllegalStateException( "Error: Currently iterative encoding in LinearUS only supports the Totalizer encoding."); } @@ -84,31 +84,31 @@ protected LNGResult internalSearch(final ComputationHandler handle } } - protected LNGResult none(final ComputationHandler handler) { + protected LngResult none(final ComputationHandler handler) { nbInitialVariables = nVars(); - final LNGIntVector objFunction = new LNGIntVector(); + final LngIntVector objFunction = new LngIntVector(); initRelaxation(objFunction); - LNGCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.NONE); + LngCoreSolver solver = rebuildSolver(); + final LngIntVector assumptions = new LngIntVector(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.NONE); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + newCost); } ubCost = newCost; if (nbSatisfiable == 1) { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } - if (encoder.cardEncoding() == MaxSATConfig.CardinalityEncoding.MTOTALIZER) { + if (encoder.cardEncoding() == MaxSatConfig.CardinalityEncoding.MTOTALIZER) { encoder.setModulo((int) Math.ceil(Math.sqrt(ubCost + 1.0))); } encoder.encodeCardinality(solver, objFunction, 0); @@ -117,14 +117,14 @@ protected LNGResult none(final ComputationHandler handler) { } } else { lbCost++; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB : " + lbCost); } if (nbSatisfiable == 0) { return unsat(); } else if (lbCost == ubCost) { if (nbSatisfiable > 0) { - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); @@ -132,9 +132,9 @@ protected LNGResult none(final ComputationHandler handler) { return unsat(); } } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } solver = rebuildSolver(); @@ -143,33 +143,33 @@ protected LNGResult none(final ComputationHandler handler) { } } - protected LNGResult iterative(final ComputationHandler handler) { - assert encoder.cardEncoding() == MaxSATConfig.CardinalityEncoding.TOTALIZER; - final LNGIntVector objFunction = new LNGIntVector(); + protected LngResult iterative(final ComputationHandler handler) { + assert encoder.cardEncoding() == MaxSatConfig.CardinalityEncoding.TOTALIZER; + final LngIntVector objFunction = new LngIntVector(); nbInitialVariables = nVars(); initRelaxation(objFunction); - final LNGCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final LngCoreSolver solver = rebuildSolver(); + final LngIntVector assumptions = new LngIntVector(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + newCost); } ubCost = newCost; if (nbSatisfiable == 1) { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } for (int i = 0; i < objFunction.size(); i++) { - assumptions.push(LNGCoreSolver.not(objFunction.get(i))); + assumptions.push(LngCoreSolver.not(objFunction.get(i))); } } else { assert lbCost == ubCost; @@ -178,7 +178,7 @@ protected LNGResult iterative(final ComputationHandler handler) { } else { nbCores++; lbCost++; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB : " + lbCost); } if (nbSatisfiable == 0) { @@ -186,7 +186,7 @@ protected LNGResult iterative(final ComputationHandler handler) { } if (lbCost == ubCost) { if (nbSatisfiable > 0) { - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); @@ -194,30 +194,30 @@ protected LNGResult iterative(final ComputationHandler handler) { return unsat(); } } - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } if (!encoder.hasCardEncoding()) { encoder.buildCardinality(solver, objFunction, lbCost); } - final LNGIntVector join = new LNGIntVector(); + final LngIntVector join = new LngIntVector(); encoder.incUpdateCardinality(solver, join, objFunction, lbCost, assumptions); } } } - protected LNGCoreSolver rebuildSolver() { - final LNGCoreSolver s = newSATSolver(); + protected LngCoreSolver rebuildSolver() { + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); } - LNGIntVector clause; + LngIntVector clause; for (int i = 0; i < softClauses.size(); i++) { - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -226,7 +226,7 @@ protected LNGCoreSolver rebuildSolver() { return s; } - protected void initRelaxation(final LNGIntVector objFunction) { + protected void initRelaxation(final LngIntVector objFunction) { for (int i = 0; i < softClauses.size(); i++) { final int l = newLiteral(false); softClauses.get(i).relaxationVars().push(l); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSAT.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSat.java similarity index 81% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSAT.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSat.java index 66469d8d..0a679009 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSAT.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSat.java @@ -24,28 +24,28 @@ import static com.booleworks.logicng.handlers.events.ComputationFinishedEvent.MAX_SAT_CALL_FINISHED; import static com.booleworks.logicng.handlers.events.ComputationStartedEvent.MAX_SAT_CALL_STARTED; -import static com.booleworks.logicng.solvers.MaxSATSolver.SEL_PREFIX; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.Verbosity; -import static com.booleworks.logicng.solvers.sat.LNGCoreSolver.LIT_UNDEF; +import static com.booleworks.logicng.solvers.MaxSatSolver.SEL_PREFIX; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.Verbosity; +import static com.booleworks.logicng.solvers.sat.LngCoreSolver.LIT_UNDEF; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.MaxSatNewLowerBoundEvent; import com.booleworks.logicng.handlers.events.MaxSatNewUpperBoundEvent; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.datastructures.LNGHardClause; -import com.booleworks.logicng.solvers.datastructures.LNGSoftClause; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.datastructures.LngHardClause; +import com.booleworks.logicng.solvers.datastructures.LngSoftClause; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import java.util.ArrayList; import java.util.List; @@ -60,8 +60,8 @@ * @version 3.0.0 * @since 1.0 */ -public abstract class MaxSAT { - private static final MaxSATResult UNSAT = new MaxSATResult(false, -1, null); +public abstract class MaxSat { + private static final MaxSatResult UNSAT = new MaxSatResult(false, -1, null); /** * The MaxSAT problem type: {@code UNWEIGHTED} or {@code WEIGHTED}. @@ -72,13 +72,13 @@ public enum ProblemType { } protected final FormulaFactory f; - protected final MaxSATConfig config; - protected final LNGBooleanVector model; + protected final MaxSatConfig config; + protected final LngBooleanVector model; protected SortedMap var2index; protected SortedMap index2var; - final LNGVector softClauses; - final LNGVector hardClauses; - final LNGIntVector orderWeights; + final LngVector softClauses; + final LngVector hardClauses; + final LngIntVector orderWeights; protected Verbosity verbosity; final int hardWeight; ProblemType problemType; @@ -91,10 +91,10 @@ public enum ProblemType { int ubCost; int lbCost; int currentWeight; - MaxSAT.Stats lastStats; + MaxSat.Stats lastStats; // bookkeeping of solver states - protected LNGIntVector validStates; + protected LngIntVector validStates; protected int nextStateId; /** @@ -102,27 +102,27 @@ public enum ProblemType { * @param f the formula factory * @param config the solver configuration */ - protected MaxSAT(final FormulaFactory f, final MaxSATConfig config) { + protected MaxSat(final FormulaFactory f, final MaxSatConfig config) { this.f = f; this.config = config; var2index = new TreeMap<>(); index2var = new TreeMap<>(); - hardClauses = new LNGVector<>(); - softClauses = new LNGVector<>(); + hardClauses = new LngVector<>(); + softClauses = new LngVector<>(); hardWeight = Integer.MAX_VALUE; problemType = ProblemType.UNWEIGHTED; nbVars = 0; nbInitialVariables = 0; currentWeight = 1; - model = new LNGBooleanVector(); + model = new LngBooleanVector(); ubCost = 0; lbCost = 0; nbSymmetryClauses = 0; nbCores = 0; nbSatisfiable = 0; sumSizeCores = 0; - orderWeights = new LNGIntVector(); - validStates = new LNGIntVector(); + orderWeights = new LngIntVector(); + validStates = new LngIntVector(); nextStateId = 0; } @@ -130,7 +130,7 @@ protected MaxSAT(final FormulaFactory f, final MaxSATConfig config) { * Creates a new variable in the SAT solver. * @param s the SAT solver */ - public static void newSATVariable(final LNGCoreSolver s) { + public static void newSatVariable(final LngCoreSolver s) { s.newVar(true, true); } @@ -142,8 +142,8 @@ public static void newSATVariable(final LNGCoreSolver s) { * @param assumptions the assumptions * @return the result of the solving process */ - public static LNGResult searchSATSolver(final LNGCoreSolver s, final ComputationHandler handler, - final LNGIntVector assumptions) { + public static LngResult searchSatSolver(final LngCoreSolver s, final ComputationHandler handler, + final LngIntVector assumptions) { return s.internalSolve(handler, assumptions); } @@ -153,7 +153,7 @@ public static LNGResult searchSATSolver(final LNGCoreSolver s, final Co * @param handler the handler * @return the result of the solving process */ - public static LNGResult searchSATSolver(final LNGCoreSolver s, final ComputationHandler handler) { + public static LngResult searchSatSolver(final LngCoreSolver s, final ComputationHandler handler) { return s.internalSolve(handler); } @@ -163,14 +163,14 @@ public static LNGResult searchSATSolver(final LNGCoreSolver s, final Co * @return the result of the solving process * @throws IllegalArgumentException if the configuration was not valid */ - public final LNGResult search(final ComputationHandler handler) { + public final LngResult search(final ComputationHandler handler) { if (!handler.shouldResume(MAX_SAT_CALL_STARTED)) { - return LNGResult.canceled(MAX_SAT_CALL_STARTED); + return LngResult.canceled(MAX_SAT_CALL_STARTED); } - final MaxSATState stateBeforeSolving = saveState(); - final LNGResult result = internalSearch(handler); + final MaxSatState stateBeforeSolving = saveState(); + final LngResult result = internalSearch(handler); if (!handler.shouldResume(MAX_SAT_CALL_FINISHED)) { - return LNGResult.canceled(MAX_SAT_CALL_FINISHED); + return LngResult.canceled(MAX_SAT_CALL_FINISHED); } lastStats = new Stats(); loadState(stateBeforeSolving); @@ -181,14 +181,14 @@ public final LNGResult search(final ComputationHandler handler) { * Saves and returns the solver state. * @return the current solver state */ - public MaxSATState saveState() { + public MaxSatState saveState() { final int[] softWeights = new int[softClauses.size()]; for (int i = 0; i < softClauses.size(); i++) { softWeights[i] = softClauses.get(i).weight(); } final int stateId = nextStateId++; validStates.push(stateId); - return new MaxSATState(stateId, nbVars, hardClauses.size(), softClauses.size(), ubCost, currentWeight, softWeights); + return new MaxSatState(stateId, nbVars, hardClauses.size(), softClauses.size(), ubCost, currentWeight, softWeights); } /** @@ -203,7 +203,7 @@ public MaxSATState saveState() { * @param state the solver state to load * @throws IllegalArgumentException if the solver state is not valid anymore */ - public void loadState(final MaxSATState state) { + public void loadState(final MaxSatState state) { int index = -1; for (int i = validStates.size() - 1; i >= 0 && index == -1; i--) { if (validStates.get(i) == state.stateId) { @@ -233,7 +233,7 @@ public void loadState(final MaxSATState state) { lbCost = 0; currentWeight = state.currentWeight; for (int i = 0; i < softClauses.size(); i++) { - final LNGSoftClause clause = softClauses.get(i); + final LngSoftClause clause = softClauses.get(i); clause.relaxationVars().clear(); clause.setWeight(state.softWeights[i]); clause.setAssumptionVar(LIT_UNDEF); @@ -260,7 +260,7 @@ protected Model createModel() { * @return the result of the solving process * @throws IllegalArgumentException if the configuration was not valid */ - protected abstract LNGResult internalSearch(ComputationHandler handler); + protected abstract LngResult internalSearch(ComputationHandler handler); /** * Returns the number of variables in the working MaxSAT formula. @@ -283,8 +283,8 @@ public int newVar() { * Adds a new hard clause to the hard clause database. * @param lits the literals of the hard clause */ - public void addHardClause(final LNGIntVector lits) { - hardClauses.push(new LNGHardClause(lits)); + public void addHardClause(final LngIntVector lits) { + hardClauses.push(new LngHardClause(lits)); } /** @@ -292,8 +292,8 @@ public void addHardClause(final LNGIntVector lits) { * @param weight the weight of the soft clause * @param lits the literals of the soft clause */ - public void addSoftClause(final int weight, final LNGIntVector lits) { - addSoftClause(weight, lits, new LNGIntVector()); + public void addSoftClause(final int weight, final LngIntVector lits) { + addSoftClause(weight, lits, new LngIntVector()); } /** @@ -303,8 +303,8 @@ public void addSoftClause(final int weight, final LNGIntVector lits) { * @param lits the literals of the soft clause * @param vars the relaxation variables of the soft clause */ - protected void addSoftClause(final int weight, final LNGIntVector lits, final LNGIntVector vars) { - softClauses.push(new LNGSoftClause(lits, weight, LIT_UNDEF, vars)); + protected void addSoftClause(final int weight, final LngIntVector lits, final LngIntVector vars) { + softClauses.push(new LngSoftClause(lits, weight, LIT_UNDEF, vars)); } /** @@ -313,7 +313,7 @@ protected void addSoftClause(final int weight, final LNGIntVector lits, final LN * @param weight the weight of the clause (or -1 for a hard clause) */ public void addClause(final Formula formula, final int weight) { - final LNGIntVector clauseVec = new LNGIntVector((int) formula.numberOfAtoms(f)); + final LngIntVector clauseVec = new LngIntVector((int) formula.numberOfAtoms(f)); for (final Literal lit : formula.literals(f)) { Integer index = var2index.get(lit.variable()); if (index == null) { @@ -333,7 +333,7 @@ public void addClause(final Formula formula, final int weight) { * @param clauseVec the clause * @param weight the weight of the clause (or -1 for a hard clause) */ - public void addClause(final LNGIntVector clauseVec, final int weight) { + public void addClause(final LngIntVector clauseVec, final int weight) { if (weight == -1) { addHardClause(clauseVec); } else { @@ -360,7 +360,7 @@ public int literal(final Literal lit) { * @return the new literal */ public int newLiteral(final boolean sign) { - return LNGCoreSolver.mkLit(newVar(), sign); + return LngCoreSolver.mkLit(newVar(), sign); } /** @@ -412,15 +412,15 @@ public int currentWeight() { * Creates an empty SAT Solver. * @return the empty SAT solver */ - public LNGCoreSolver newSATSolver() { - return new LNGCoreSolver(f, SATSolverConfig.builder().build()); + public LngCoreSolver newSatSolver() { + return new LngCoreSolver(f, SatSolverConfig.builder().build()); } /** * Saves the current model found by the SAT solver. * @param currentModel the model found by the solver */ - public void saveModel(final LNGBooleanVector currentModel) { + public void saveModel(final LngBooleanVector currentModel) { model.clear(); for (int i = 0; i < nbInitialVariables; i++) { model.push(currentModel.get(i)); @@ -436,7 +436,7 @@ public void saveModel(final LNGBooleanVector currentModel) { * @param weight the weight * @return the cost of the given model */ - public int computeCostModel(final LNGBooleanVector currentModel, final int weight) { + public int computeCostModel(final LngBooleanVector currentModel, final int weight) { int currentCost = 0; for (int i = 0; i < softClauses.size(); i++) { boolean unsatisfied = true; @@ -445,11 +445,11 @@ public int computeCostModel(final LNGBooleanVector currentModel, final int weigh unsatisfied = false; continue; } - assert LNGCoreSolver.var(softClauses.get(i).clause().get(j)) < currentModel.size(); - if ((LNGCoreSolver.sign(softClauses.get(i).clause().get(j)) && - !currentModel.get(LNGCoreSolver.var(softClauses.get(i).clause().get(j)))) || - (!LNGCoreSolver.sign(softClauses.get(i).clause().get(j)) && - currentModel.get(LNGCoreSolver.var(softClauses.get(i).clause().get(j))))) { + assert LngCoreSolver.var(softClauses.get(i).clause().get(j)) < currentModel.size(); + if ((LngCoreSolver.sign(softClauses.get(i).clause().get(j)) && + !currentModel.get(LngCoreSolver.var(softClauses.get(i).clause().get(j)))) || + (!LngCoreSolver.sign(softClauses.get(i).clause().get(j)) && + currentModel.get(LngCoreSolver.var(softClauses.get(i).clause().get(j))))) { unsatisfied = false; break; } @@ -467,7 +467,7 @@ public int computeCostModel(final LNGBooleanVector currentModel, final int weigh * @return {@code true} if the formula has lexicographical optimization * criterion */ - public boolean isBMO(final boolean cache) { + public boolean isBmo(final boolean cache) { assert orderWeights.size() == 0; boolean bmo = true; final SortedSet partitionWeights = new TreeSet<>(); @@ -515,7 +515,7 @@ public Stats stats() { * @return the event if the handler canceled the computation, otherwise * {@code null} */ - LNGEvent foundLowerBound(final int lowerBound, final ComputationHandler handler) { + LngEvent foundLowerBound(final int lowerBound, final ComputationHandler handler) { final MaxSatNewLowerBoundEvent event = new MaxSatNewLowerBoundEvent(lowerBound); return handler.shouldResume(event) ? null : event; } @@ -529,7 +529,7 @@ LNGEvent foundLowerBound(final int lowerBound, final ComputationHandler handler) * @return the event if the handler canceled the computation, otherwise * {@code null} */ - LNGEvent foundUpperBound(final int upperBound, final ComputationHandler handler) { + LngEvent foundUpperBound(final int upperBound, final ComputationHandler handler) { final MaxSatNewUpperBoundEvent event = new MaxSatNewUpperBoundEvent(upperBound); return handler.shouldResume(event) ? null : event; } @@ -539,16 +539,16 @@ LNGEvent foundUpperBound(final int upperBound, final ComputationHandler handler) * optimum and model. * @return the result */ - public LNGResult optimum() { - return LNGResult.of(new MaxSATResult(true, ubCost, createModel())); + public LngResult optimum() { + return LngResult.of(new MaxSatResult(true, ubCost, createModel())); } /** * Creates a new result for an unsatisfiable MaxSAT problem. * @return the result */ - public LNGResult unsat() { - return LNGResult.of(UNSAT); + public LngResult unsat() { + return LngResult.of(UNSAT); } /** @@ -558,15 +558,15 @@ public class Stats { protected final int ubC; protected final int nbS; protected final int nbC; - protected final double avgCS; - protected final int nbSC; + protected final double avgCs; + protected final int nbSc; protected Stats() { ubC = model.size() == 0 ? -1 : ubCost; nbS = nbSatisfiable; nbC = nbCores; - avgCS = nbCores != 0 ? (double) sumSizeCores / nbCores : 0.0; - nbSC = nbSymmetryClauses; + avgCs = nbCores != 0 ? (double) sumSizeCores / nbCores : 0.0; + nbSc = nbSymmetryClauses; } /** @@ -598,7 +598,7 @@ public int unsatCalls() { * @return the average core size */ public double averageCoreSize() { - return avgCS; + return avgCs; } /** @@ -606,14 +606,14 @@ public double averageCoreSize() { * @return the number of symmetry clauses */ public int symmetryClauses() { - return nbSC; + return nbSc; } @Override public String toString() { return String.format(Locale.ENGLISH, - "MaxSAT.Stats{best solution=%d, #sat calls=%d, #unsat calls=%d, average core size=%.2f, #symmetry clauses=%d}", - ubC, nbS, nbC, avgCS, nbSC); + "MaxSat.Stats{best solution=%d, #sat calls=%d, #unsat calls=%d, average core size=%.2f, #symmetry clauses=%d}", + ubC, nbS, nbC, avgCs, nbSc); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATConfig.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatConfig.java similarity index 88% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATConfig.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatConfig.java index 706db7e7..c8cc9683 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATConfig.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatConfig.java @@ -6,7 +6,7 @@ import com.booleworks.logicng.configurations.Configuration; import com.booleworks.logicng.configurations.ConfigurationType; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import java.io.PrintStream; @@ -15,7 +15,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class MaxSATConfig extends Configuration { +public final class MaxSatConfig extends Configuration { /** * The incremental strategy for cardinality and pseudo-boolean constraints. @@ -28,14 +28,14 @@ public enum IncrementalStrategy { /** * The AMO encoding. */ - public enum AMOEncoding { + public enum AmoEncoding { LADDER } /** * The pseudo Boolean encoding. */ - public enum PBEncoding { + public enum PbEncoding { SWC } @@ -64,10 +64,10 @@ public enum Verbosity { SOME } - final SATSolverConfig.CNFMethod cnfMethod; + final SatSolverConfig.CnfMethod cnfMethod; final IncrementalStrategy incrementalStrategy; - final AMOEncoding amoEncoding; - final PBEncoding pbEncoding; + final AmoEncoding amoEncoding; + final PbEncoding pbEncoding; final CardinalityEncoding cardinalityEncoding; final WeightStrategy weightStrategy; final Verbosity verbosity; @@ -80,7 +80,7 @@ public enum Verbosity { * Constructor for a MaxSAT configuration. * @param builder the builder */ - private MaxSATConfig(final Builder builder) { + private MaxSatConfig(final Builder builder) { super(ConfigurationType.MAXSAT); cnfMethod = builder.cnfMethod; incrementalStrategy = builder.incrementalStrategy; @@ -100,7 +100,7 @@ private MaxSATConfig(final Builder builder) { * @param config the configuration to copy * @param cardinalityEncoding the cardinality encoding */ - public MaxSATConfig(final MaxSATConfig config, final CardinalityEncoding cardinalityEncoding) { + public MaxSatConfig(final MaxSatConfig config, final CardinalityEncoding cardinalityEncoding) { super(ConfigurationType.MAXSAT); cnfMethod = config.cnfMethod; incrementalStrategy = config.incrementalStrategy; @@ -120,7 +120,7 @@ public MaxSATConfig(final MaxSATConfig config, final CardinalityEncoding cardina * @param config the configuration to copy * @param incrementalStrategy the incrementality strategy */ - public MaxSATConfig(final MaxSATConfig config, final IncrementalStrategy incrementalStrategy) { + public MaxSatConfig(final MaxSatConfig config, final IncrementalStrategy incrementalStrategy) { super(ConfigurationType.MAXSAT); cnfMethod = config.cnfMethod; this.incrementalStrategy = incrementalStrategy; @@ -139,7 +139,7 @@ public MaxSATConfig(final MaxSATConfig config, final IncrementalStrategy increme * Returns the CNF method. * @return the CNF method */ - public SATSolverConfig.CNFMethod getCnfMethod() { + public SatSolverConfig.CnfMethod getCnfMethod() { return cnfMethod; } @@ -153,7 +153,7 @@ public static Builder builder() { @Override public String toString() { - final StringBuilder sb = new StringBuilder("MaxSATConfig{").append(System.lineSeparator()); + final StringBuilder sb = new StringBuilder("MaxSatConfig{").append(System.lineSeparator()); sb.append("cnfMethod=").append(cnfMethod).append(System.lineSeparator()); sb.append("incrementalStrategy=").append(incrementalStrategy).append(System.lineSeparator()); sb.append("pbEncoding=").append(amoEncoding).append(System.lineSeparator()); @@ -172,9 +172,9 @@ public String toString() { * The builder for a MaxSAT configuration. */ public static class Builder { - private final AMOEncoding amoEncoding; - private final PBEncoding pbEncoding; - private SATSolverConfig.CNFMethod cnfMethod = SATSolverConfig.CNFMethod.PG_ON_SOLVER; + private final AmoEncoding amoEncoding; + private final PbEncoding pbEncoding; + private SatSolverConfig.CnfMethod cnfMethod = SatSolverConfig.CnfMethod.PG_ON_SOLVER; private IncrementalStrategy incrementalStrategy = IncrementalStrategy.NONE; private CardinalityEncoding cardinalityEncoding = CardinalityEncoding.TOTALIZER; private WeightStrategy weightStrategy = WeightStrategy.NONE; @@ -188,16 +188,16 @@ public static class Builder { * Constructor for the builder. */ private Builder() { - amoEncoding = AMOEncoding.LADDER; - pbEncoding = PBEncoding.SWC; + amoEncoding = AmoEncoding.LADDER; + pbEncoding = PbEncoding.SWC; } /** - * Sets the cnf method. The default value is {@link SATSolverConfig.CNFMethod#PG_ON_SOLVER} + * Sets the cnf method. The default value is {@link SatSolverConfig.CnfMethod#PG_ON_SOLVER} * @param cnfMethod the cnf method * @return the builder */ - public Builder cnfMethod(final SATSolverConfig.CNFMethod cnfMethod) { + public Builder cnfMethod(final SatSolverConfig.CnfMethod cnfMethod) { this.cnfMethod = cnfMethod; return this; } @@ -293,8 +293,8 @@ public Builder output(final PrintStream output) { * Builds the configuration. * @return the configuration. */ - public MaxSATConfig build() { - return new MaxSATConfig(this); + public MaxSatConfig build() { + return new MaxSatConfig(this); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATState.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatState.java similarity index 91% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATState.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatState.java index 167fefa5..da055cd3 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSATState.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MaxSatState.java @@ -1,16 +1,16 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatSolver; import java.util.Arrays; import java.util.Objects; /** - * The state of a {@link MaxSATSolver}. + * The state of a {@link MaxSatSolver}. * @version 3.0.0 * @since 3.0.0 */ -public class MaxSATState { +public class MaxSatState { protected final int stateId; protected final int nbVars; protected final int nbHard; @@ -30,7 +30,8 @@ public class MaxSATState { * @param softWeights the weights in each soft clause, * must have length {@code nbSoft} */ - public MaxSATState(final int stateId, final int nbVars, final int nbHard, final int nbSoft, final int ubCost, final int currentWeight, final int[] softWeights) { + public MaxSatState(final int stateId, final int nbVars, final int nbHard, final int nbSoft, final int ubCost, final int currentWeight, + final int[] softWeights) { this.stateId = stateId; this.nbVars = nbVars; this.nbHard = nbHard; @@ -104,7 +105,7 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final MaxSATState that = (MaxSATState) o; + final MaxSatState that = (MaxSatState) o; return stateId == that.stateId && nbVars == that.nbVars && nbHard == that.nbHard && nbSoft == that.nbSoft && ubCost == that.ubCost && currentWeight == that.currentWeight && Objects.deepEquals(softWeights, that.softWeights); @@ -117,7 +118,7 @@ public int hashCode() { @Override public String toString() { - return "MaxSATState{" + + return "MaxSatState{" + "stateId=" + stateId + ", nbVars=" + nbVars + ", nbHard=" + nbHard + diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MSU3.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Msu3.java similarity index 79% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MSU3.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Msu3.java index 2ee679c5..1b2c5f7d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/MSU3.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Msu3.java @@ -22,19 +22,19 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.CardinalityEncoding; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.IncrementalStrategy; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.Verbosity; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.CardinalityEncoding; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.IncrementalStrategy; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.Verbosity; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.io.PrintStream; import java.util.SortedMap; @@ -45,7 +45,7 @@ * @version 3.0.0 * @since 1.0 */ -public class MSU3 extends MaxSAT { +public class Msu3 extends MaxSat { protected Encoder encoder; protected final IncrementalStrategy incrementalStrategy; @@ -55,8 +55,8 @@ public class MSU3 extends MaxSAT { * Constructs a new solver with default values. * @param f the formula factory */ - public MSU3(final FormulaFactory f) { - this(f, MaxSATConfig.builder().build()); + public Msu3(final FormulaFactory f) { + this(f, MaxSatConfig.builder().build()); } /** @@ -64,7 +64,7 @@ public MSU3(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public MSU3(final FormulaFactory f, final MaxSATConfig config) { + public Msu3(final FormulaFactory f, final MaxSatConfig config) { super(f, config); verbosity = config.verbosity; incrementalStrategy = config.incrementalStrategy; @@ -72,7 +72,7 @@ public MSU3(final FormulaFactory f, final MaxSATConfig config) { } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { encoder = new Encoder(config.cardinalityEncoding); if (problemType == ProblemType.WEIGHTED) { throw new IllegalStateException( @@ -92,23 +92,23 @@ protected LNGResult internalSearch(final ComputationHandler handle } } - protected LNGResult none(final ComputationHandler handler) { + protected LngResult none(final ComputationHandler handler) { nbInitialVariables = nVars(); - final LNGIntVector objFunction = new LNGIntVector(); + final LngIntVector objFunction = new LngIntVector(); final SortedMap coreMapping = new TreeMap<>(); initRelaxation(objFunction); - LNGCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector currentObjFunction = new LNGIntVector(); + LngCoreSolver solver = rebuildSolver(); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector currentObjFunction = new LngIntVector(); encoder.setIncremental(IncrementalStrategy.NONE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); @@ -118,12 +118,12 @@ protected LNGResult none(final ComputationHandler handler) { } ubCost = newCost; if (nbSatisfiable == 1) { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } for (int i = 0; i < objFunction.size(); i++) { - assumptions.push(LNGCoreSolver.not(objFunction.get(i))); + assumptions.push(LngCoreSolver.not(objFunction.get(i))); } } else { return optimum(); @@ -143,9 +143,9 @@ protected LNGResult none(final ComputationHandler handler) { } return optimum(); } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } sumSizeCores += solver.assumptionsConflict().size(); @@ -159,7 +159,7 @@ protected LNGResult none(final ComputationHandler handler) { if (activeSoft.get(i)) { currentObjFunction.push(softClauses.get(i).relaxationVars().get(0)); } else { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } if (verbosity != Verbosity.NONE) { @@ -171,29 +171,29 @@ protected LNGResult none(final ComputationHandler handler) { } } - protected LNGResult iterative(final ComputationHandler handler) { + protected LngResult iterative(final ComputationHandler handler) { if (encoder.cardEncoding() != CardinalityEncoding.TOTALIZER) { throw new IllegalStateException( "Error: Currently algorithm MSU3 with iterative encoding only supports the totalizer encoding."); } nbInitialVariables = nVars(); - final LNGIntVector objFunction = new LNGIntVector(); + final LngIntVector objFunction = new LngIntVector(); final SortedMap coreMapping = new TreeMap<>(); initRelaxation(objFunction); - final LNGCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector joinObjFunction = new LNGIntVector(); - final LNGIntVector currentObjFunction = new LNGIntVector(); - final LNGIntVector encodingAssumptions = new LNGIntVector(); + final LngCoreSolver solver = rebuildSolver(); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector joinObjFunction = new LngIntVector(); + final LngIntVector currentObjFunction = new LngIntVector(); + final LngIntVector encodingAssumptions = new LngIntVector(); encoder.setIncremental(IncrementalStrategy.ITERATIVE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); @@ -203,12 +203,12 @@ protected LNGResult iterative(final ComputationHandler handler) { } ubCost = newCost; if (nbSatisfiable == 1) { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } for (int i = 0; i < objFunction.size(); i++) { - assumptions.push(LNGCoreSolver.not(objFunction.get(i))); + assumptions.push(LngCoreSolver.not(objFunction.get(i))); } } else { assert lbCost == newCost; @@ -234,9 +234,9 @@ protected LNGResult iterative(final ComputationHandler handler) { if (solver.assumptionsConflict().size() == 0) { return unsat(); } - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } joinObjFunction.clear(); for (int i = 0; i < solver.assumptionsConflict().size(); i++) { @@ -253,7 +253,7 @@ protected LNGResult iterative(final ComputationHandler handler) { if (activeSoft.get(i)) { currentObjFunction.push(softClauses.get(i).relaxationVars().get(0)); } else { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } if (verbosity != Verbosity.NONE) { @@ -277,17 +277,17 @@ protected LNGResult iterative(final ComputationHandler handler) { } } - protected LNGCoreSolver rebuildSolver() { - final LNGCoreSolver s = newSATSolver(); + protected LngCoreSolver rebuildSolver() { + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); } - LNGIntVector clause; + LngIntVector clause; for (int i = 0; i < softClauses.size(); i++) { - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -296,7 +296,7 @@ protected LNGCoreSolver rebuildSolver() { return s; } - protected void initRelaxation(final LNGIntVector objFunction) { + protected void initRelaxation(final LngIntVector objFunction) { for (int i = 0; i < softClauses.size(); i++) { final int l = newLiteral(false); softClauses.get(i).relaxationVars().push(l); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/OLL.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Oll.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/OLL.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Oll.java index dcad3c5c..2e047579 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/OLL.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Oll.java @@ -4,15 +4,15 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.MaxSATResult; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.MaxSatResult; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.LinkedHashSet; import java.util.Set; @@ -27,15 +27,15 @@ * @version 3.0.0 * @since 2.4.0 */ -public class OLL extends MaxSAT { +public class Oll extends MaxSat { private Encoder encoder; /** * Constructs a new solver with default values. * @param f the formula factory */ - public OLL(final FormulaFactory f) { - this(f, MaxSATConfig.builder().build()); + public Oll(final FormulaFactory f) { + this(f, MaxSatConfig.builder().build()); } /** @@ -43,18 +43,18 @@ public OLL(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public OLL(final FormulaFactory f, final MaxSATConfig config) { + public Oll(final FormulaFactory f, final MaxSatConfig config) { super(f, config); verbosity = config.verbosity; - if (config.cardinalityEncoding != MaxSATConfig.CardinalityEncoding.TOTALIZER) { + if (config.cardinalityEncoding != MaxSatConfig.CardinalityEncoding.TOTALIZER) { throw new IllegalStateException("Error: Currently OLL only supports the totalizer encoding."); } } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { encoder = new Encoder(config.cardinalityEncoding); - encoder.setPBEncoding(config.pbEncoding); + encoder.setPbEncoding(config.pbEncoding); if (problemType == ProblemType.WEIGHTED) { return weighted(handler); } else { @@ -62,18 +62,18 @@ protected LNGResult internalSearch(final ComputationHandler handle } } - private LNGCoreSolver rebuildSolver() { - final LNGCoreSolver s = newSATSolver(); + private LngCoreSolver rebuildSolver() { + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); } - LNGIntVector clause; + LngIntVector clause; for (int i = 0; i < softClauses.size(); i++) { - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -83,33 +83,33 @@ private LNGCoreSolver rebuildSolver() { return s; } - private LNGResult unweighted(final ComputationHandler handler) { + private LngResult unweighted(final ComputationHandler handler) { final SortedMap coreMapping = new TreeMap<>(); final SortedMap boundMapping = new TreeMap<>(); nbInitialVariables = nVars(); initRelaxation(); - final LNGCoreSolver solver = rebuildSolver(); + final LngCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector joinObjFunction = new LNGIntVector(); - final LNGIntVector encodingAssumptions = new LNGIntVector(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector joinObjFunction = new LngIntVector(); + final LngIntVector encodingAssumptions = new LngIntVector(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } final LinkedHashSet cardinalityAssumptions = new LinkedHashSet<>(); - final LNGVector softCardinality = new LNGVector<>(); + final LngVector softCardinality = new LngVector<>(); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; - final LNGBooleanVector model = solver.model(); + final LngBooleanVector model = solver.model(); final int newCost = computeCostModel(model, Integer.MAX_VALUE); saveModel(model); @@ -119,7 +119,7 @@ private LNGResult unweighted(final ComputationHandler handler) { return optimum(); } for (int i = 0; i < softClauses.size(); i++) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } else { assert lbCost == newCost; @@ -136,8 +136,8 @@ private LNGResult unweighted(final ComputationHandler handler) { return optimum(); } sumSizeCores += solver.assumptionsConflict().size(); - final LNGIntVector softRelax = new LNGIntVector(); - final LNGIntVector cardinalityRelax = new LNGIntVector(); + final LngIntVector softRelax = new LngIntVector(); + final LngIntVector cardinalityRelax = new LngIntVector(); for (int i = 0; i < solver.assumptionsConflict().size(); i++) { final int p = solver.assumptionsConflict().get(i); @@ -183,12 +183,12 @@ private LNGResult unweighted(final ComputationHandler handler) { } if (softRelax.size() + cardinalityRelax.size() > 1) { - final LNGIntVector relaxHarden = new LNGIntVector(softRelax); + final LngIntVector relaxHarden = new LngIntVector(softRelax); for (int i = 0; i < cardinalityRelax.size(); i++) { relaxHarden.push(cardinalityRelax.get(i)); } - final Encoder e = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - e.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final Encoder e = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + e.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); e.buildCardinality(solver, relaxHarden, 1); softCardinality.push(e); assert e.outputs().size() > 1; @@ -202,44 +202,44 @@ private LNGResult unweighted(final ComputationHandler handler) { assumptions.clear(); for (int i = 0; i < softClauses.size(); i++) { if (!activeSoft.get(i)) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } for (final Integer it : cardinalityAssumptions) { - assumptions.push(LNGCoreSolver.not(it)); + assumptions.push(LngCoreSolver.not(it)); } } } } - private LNGResult weighted(final ComputationHandler handler) { + private LngResult weighted(final ComputationHandler handler) { final SortedMap coreMapping = new TreeMap<>(); final SortedMap boundMapping = new TreeMap<>(); nbInitialVariables = nVars(); initRelaxation(); - final LNGCoreSolver solver = rebuildSolver(); + final LngCoreSolver solver = rebuildSolver(); - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector joinObjFunction = new LNGIntVector(); - final LNGIntVector encodingAssumptions = new LNGIntVector(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector joinObjFunction = new LngIntVector(); + final LngIntVector encodingAssumptions = new LngIntVector(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } final LinkedHashSet cardinalityAssumptions = new LinkedHashSet<>(); - final LNGVector softCardinality = new LNGVector<>(); + final LngVector softCardinality = new LngVector<>(); int minWeight = currentWeight; while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; - final LNGBooleanVector model = solver.model(); + final LngBooleanVector model = solver.model(); final int newCost = computeCostModel(model, Integer.MAX_VALUE); if (newCost < ubCost || nbSatisfiable == 1) { saveModel(model); @@ -249,7 +249,7 @@ private LNGResult weighted(final ComputationHandler handler) { minWeight = findNextWeightDiversity(minWeight, cardinalityAssumptions, boundMapping); for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= minWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } } else { @@ -272,14 +272,14 @@ private LNGResult weighted(final ComputationHandler handler) { assumptions.clear(); for (int i = 0; i < softClauses.size(); i++) { if (!activeSoft.get(i) && softClauses.get(i).weight() >= minWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } for (final Integer it : cardinalityAssumptions) { final IntTriple softId = boundMapping.get(it); assert softId != null; if (softId.weight >= minWeight) { - assumptions.push(LNGCoreSolver.not(it)); + assumptions.push(LngCoreSolver.not(it)); } } } else { @@ -315,8 +315,8 @@ private LNGResult weighted(final ComputationHandler handler) { return optimum(); } sumSizeCores += solver.assumptionsConflict().size(); - final LNGIntVector softRelax = new LNGIntVector(); - final LNGIntVector cardinalityRelax = new LNGIntVector(); + final LngIntVector softRelax = new LngIntVector(); + final LngIntVector cardinalityRelax = new LngIntVector(); for (int i = 0; i < solver.assumptionsConflict().size(); i++) { final int p = solver.assumptionsConflict().get(i); @@ -329,8 +329,8 @@ private LNGResult weighted(final ComputationHandler handler) { // Update the weight of the soft clause. softClauses.get(indexSoft).setWeight(softClauses.get(indexSoft).weight() - minCore); - final LNGIntVector clause = new LNGIntVector(softClauses.get(indexSoft).clause()); - final LNGIntVector vars = new LNGIntVector(); + final LngIntVector clause = new LngIntVector(softClauses.get(indexSoft).clause()); + final LngIntVector vars = new LngIntVector(); // Since cardinality constraints are added the // variables are not in sync... @@ -346,7 +346,7 @@ private LNGResult weighted(final ComputationHandler handler) { activeSoft.push(true); // Add information to the SAT solver - newSATVariable(solver); + newSatVariable(solver); clause.push(l); solver.addClause(clause, null); assert clause.size() - 1 == softClauses.get(indexSoft).clause().size(); @@ -396,8 +396,8 @@ private LNGResult weighted(final ComputationHandler handler) { } } else { // Duplicate cardinality constraint - final Encoder e = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - e.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final Encoder e = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + e.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); e.buildCardinality(solver, softCardinality.get(softId.id).lits(), softId.bound); assert e.outputs().size() > softId.bound; final int out = e.outputs().get(softId.bound); @@ -434,12 +434,12 @@ private LNGResult weighted(final ComputationHandler handler) { solver.addClause(softRelax.get(0), null); } if (softRelax.size() + cardinalityRelax.size() > 1) { - final LNGIntVector relaxHarden = new LNGIntVector(softRelax); + final LngIntVector relaxHarden = new LngIntVector(softRelax); for (int i = 0; i < cardinalityRelax.size(); i++) { relaxHarden.push(cardinalityRelax.get(i)); } - final Encoder e = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - e.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final Encoder e = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + e.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); e.buildCardinality(solver, relaxHarden, 1); softCardinality.push(e); assert e.outputs().size() > 1; @@ -450,14 +450,14 @@ private LNGResult weighted(final ComputationHandler handler) { assumptions.clear(); for (int i = 0; i < softClauses.size(); i++) { if (!activeSoft.get(i) && softClauses.get(i).weight() >= minWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } for (final Integer it : cardinalityAssumptions) { final IntTriple softId = boundMapping.get(it); assert softId != null; if (softId.weight >= minWeight) { - assumptions.push(LNGCoreSolver.not(it)); + assumptions.push(LngCoreSolver.not(it)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WBO.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wbo.java similarity index 78% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WBO.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wbo.java index 05c8e99e..14134d3f 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WBO.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wbo.java @@ -22,17 +22,17 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.Verbosity; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.WeightStrategy; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.Verbosity; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.WeightStrategy; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import com.booleworks.logicng.util.Pair; import java.io.PrintStream; @@ -48,18 +48,18 @@ * @version 3.0.0 * @since 1.0 */ -public class WBO extends MaxSAT { +public class Wbo extends MaxSat { protected final PrintStream output; - protected LNGCoreSolver solver; + protected LngCoreSolver solver; protected int nbCurrentSoft; protected WeightStrategy weightStrategy; protected SortedMap coreMapping; - protected LNGIntVector assumptions; + protected LngIntVector assumptions; protected boolean symmetryStrategy; - protected LNGIntVector indexSoftCore; - protected LNGVector softMapping; - protected LNGVector relaxationMapping; + protected LngIntVector indexSoftCore; + protected LngVector softMapping; + protected LngVector relaxationMapping; protected Set> duplicatedSymmetryClauses; protected int symmetryBreakingLimit; @@ -67,8 +67,8 @@ public class WBO extends MaxSAT { * Constructs a new solver with default values. * @param f the formula factory */ - public WBO(final FormulaFactory f) { - this(f, MaxSATConfig.builder().build()); + public Wbo(final FormulaFactory f) { + this(f, MaxSatConfig.builder().build()); } /** @@ -76,7 +76,7 @@ public WBO(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public WBO(final FormulaFactory f, final MaxSATConfig config) { + public Wbo(final FormulaFactory f, final MaxSatConfig config) { super(f, config); solver = null; verbosity = config.verbosity; @@ -85,16 +85,16 @@ public WBO(final FormulaFactory f, final MaxSATConfig config) { symmetryStrategy = config.symmetry; symmetryBreakingLimit = config.limit; coreMapping = new TreeMap<>(); - assumptions = new LNGIntVector(); - indexSoftCore = new LNGIntVector(); - softMapping = new LNGVector<>(); - relaxationMapping = new LNGVector<>(); + assumptions = new LngIntVector(); + indexSoftCore = new LngIntVector(); + softMapping = new LngVector<>(); + relaxationMapping = new LngVector<>(); duplicatedSymmetryClauses = new HashSet<>(); output = config.output; } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { nbInitialVariables = nVars(); coreMapping.clear(); assumptions.clear(); @@ -116,11 +116,11 @@ protected LNGResult internalSearch(final ComputationHandler handle throw new IllegalArgumentException("Unknown problem type."); } - protected LNGCoreSolver rebuildWeightSolver(final WeightStrategy strategy) { + protected LngCoreSolver rebuildWeightSolver(final WeightStrategy strategy) { assert strategy == WeightStrategy.NORMAL || strategy == WeightStrategy.DIVERSIFY; - final LNGCoreSolver s = newSATSolver(); + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); @@ -128,13 +128,13 @@ protected LNGCoreSolver rebuildWeightSolver(final WeightStrategy strategy) { if (symmetryStrategy) { symmetryBreaking(); } - LNGIntVector clause = new LNGIntVector(); + LngIntVector clause = new LngIntVector(); nbCurrentSoft = 0; for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= currentWeight) { nbCurrentSoft++; clause.clear(); - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -146,11 +146,11 @@ protected LNGCoreSolver rebuildWeightSolver(final WeightStrategy strategy) { return s; } - LNGCoreSolver rebuildSolver() { + LngCoreSolver rebuildSolver() { assert weightStrategy == WeightStrategy.NONE; - final LNGCoreSolver s = newSATSolver(); + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); @@ -158,9 +158,9 @@ LNGCoreSolver rebuildSolver() { if (symmetryStrategy) { symmetryBreaking(); } - LNGIntVector clause; + LngIntVector clause; for (int i = 0; i < softClauses.size(); i++) { - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } @@ -170,10 +170,10 @@ LNGCoreSolver rebuildSolver() { return s; } - protected LNGCoreSolver rebuildHardSolver() { - final LNGCoreSolver s = newSATSolver(); + protected LngCoreSolver rebuildHardSolver() { + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); @@ -234,14 +234,14 @@ protected int findNextWeightDiversity(final int weight) { return nextWeight; } - protected void encodeEO(final LNGIntVector lits) { + protected void encodeEo(final LngIntVector lits) { assert lits.size() != 0; - final LNGIntVector clause = new LNGIntVector(); + final LngIntVector clause = new LngIntVector(); if (lits.size() == 1) { clause.push(lits.get(0)); addHardClause(clause); } else { - final LNGIntVector auxVariables = new LNGIntVector(); + final LngIntVector auxVariables = new LngIntVector(); for (int i = 0; i < lits.size() - 1; i++) { auxVariables.push(newLiteral(false)); } @@ -249,10 +249,10 @@ protected void encodeEO(final LNGIntVector lits) { if (i == 0) { clause.clear(); clause.push(lits.get(i)); - clause.push(LNGCoreSolver.not(auxVariables.get(i))); + clause.push(LngCoreSolver.not(auxVariables.get(i))); addHardClause(clause); clause.clear(); - clause.push(LNGCoreSolver.not(lits.get(i))); + clause.push(LngCoreSolver.not(lits.get(i))); clause.push(auxVariables.get(i)); addHardClause(clause); } else if (i == lits.size() - 1) { @@ -261,36 +261,36 @@ protected void encodeEO(final LNGIntVector lits) { clause.push(auxVariables.get(i - 1)); addHardClause(clause); clause.clear(); - clause.push(LNGCoreSolver.not(lits.get(i))); - clause.push(LNGCoreSolver.not(auxVariables.get(i - 1))); + clause.push(LngCoreSolver.not(lits.get(i))); + clause.push(LngCoreSolver.not(auxVariables.get(i - 1))); addHardClause(clause); } else { clause.clear(); - clause.push(LNGCoreSolver.not(auxVariables.get(i - 1))); + clause.push(LngCoreSolver.not(auxVariables.get(i - 1))); clause.push(auxVariables.get(i)); addHardClause(clause); clause.clear(); clause.push(lits.get(i)); - clause.push(LNGCoreSolver.not(auxVariables.get(i))); + clause.push(LngCoreSolver.not(auxVariables.get(i))); clause.push(auxVariables.get(i - 1)); addHardClause(clause); clause.clear(); - clause.push(LNGCoreSolver.not(lits.get(i))); + clause.push(LngCoreSolver.not(lits.get(i))); clause.push(auxVariables.get(i)); addHardClause(clause); clause.clear(); - clause.push(LNGCoreSolver.not(lits.get(i))); - clause.push(LNGCoreSolver.not(auxVariables.get(i - 1))); + clause.push(LngCoreSolver.not(lits.get(i))); + clause.push(LngCoreSolver.not(auxVariables.get(i - 1))); addHardClause(clause); } } } } - protected void relaxCore(final LNGIntVector conflict, final int weightCore, final LNGIntVector assumps) { + protected void relaxCore(final LngIntVector conflict, final int weightCore, final LngIntVector assumps) { assert conflict.size() > 0; assert weightCore > 0; - final LNGIntVector lits = new LNGIntVector(); + final LngIntVector lits = new LngIntVector(); for (int i = 0; i < conflict.size(); i++) { final int indexSoft = coreMapping.get(conflict.get(i)); @@ -304,8 +304,8 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore, fina } else { assert softClauses.get(indexSoft).weight() - weightCore > 0; softClauses.get(indexSoft).setWeight(softClauses.get(indexSoft).weight() - weightCore); - final LNGIntVector clause = new LNGIntVector(softClauses.get(indexSoft).clause()); - final LNGIntVector vars = new LNGIntVector(softClauses.get(indexSoft).relaxationVars()); + final LngIntVector clause = new LngIntVector(softClauses.get(indexSoft).clause()); + final LngIntVector vars = new LngIntVector(softClauses.get(indexSoft).relaxationVars()); final int p = newLiteral(false); vars.push(p); lits.push(p); @@ -315,17 +315,17 @@ protected void relaxCore(final LNGIntVector conflict, final int weightCore, fina // Map the new soft clause to its assumption literal coreMapping.put(l, softClauses.size() - 1); // Update the assumption vector - assumps.push(LNGCoreSolver.not(l)); + assumps.push(LngCoreSolver.not(l)); if (symmetryStrategy) { symmetryLog(softClauses.size() - 1); } } } - encodeEO(lits); + encodeEo(lits); sumSizeCores += conflict.size(); } - int computeCostCore(final LNGIntVector conflict) { + int computeCostCore(final LngIntVector conflict) { assert conflict.size() != 0; if (problemType == ProblemType.UNWEIGHTED) { return 1; @@ -342,16 +342,16 @@ int computeCostCore(final LNGIntVector conflict) { void initSymmetry() { for (int i = 0; i < softClauses.size(); i++) { - softMapping.push(new LNGIntVector()); - relaxationMapping.push(new LNGIntVector()); + softMapping.push(new LngIntVector()); + relaxationMapping.push(new LngIntVector()); } } void symmetryLog(final int p) { if (nbSymmetryClauses < symmetryBreakingLimit) { while (softMapping.size() <= p) { - softMapping.push(new LNGIntVector()); - relaxationMapping.push(new LNGIntVector()); + softMapping.push(new LngIntVector()); + relaxationMapping.push(new LngIntVector()); } softMapping.get(p).push(nbCores); relaxationMapping.get(p).push(softClauses.get(p).relaxationVars().back()); @@ -363,16 +363,16 @@ void symmetryLog(final int p) { protected void symmetryBreaking() { if (indexSoftCore.size() != 0 && nbSymmetryClauses < symmetryBreakingLimit) { - final LNGIntVector[] coreIntersection = new LNGIntVector[nbCores]; - final LNGIntVector[] coreIntersectionCurrent = new LNGIntVector[nbCores]; + final LngIntVector[] coreIntersection = new LngIntVector[nbCores]; + final LngIntVector[] coreIntersectionCurrent = new LngIntVector[nbCores]; for (int i = 0; i < nbCores; i++) { - coreIntersection[i] = new LNGIntVector(); - coreIntersectionCurrent[i] = new LNGIntVector(); + coreIntersection[i] = new LngIntVector(); + coreIntersectionCurrent[i] = new LngIntVector(); } - final LNGIntVector coreList = new LNGIntVector(); + final LngIntVector coreList = new LngIntVector(); for (int i = 0; i < indexSoftCore.size(); i++) { final int p = indexSoftCore.get(i); - final LNGIntVector addCores = new LNGIntVector(); + final LngIntVector addCores = new LngIntVector(); for (int j = 0; j < softMapping.get(p).size() - 1; j++) { final int core = softMapping.get(p).get(j); addCores.push(core); @@ -380,30 +380,30 @@ protected void symmetryBreaking() { coreList.push(core); } assert j < relaxationMapping.get(p).size(); - assert LNGCoreSolver.var(relaxationMapping.get(p).get(j)) > nbInitialVariables; + assert LngCoreSolver.var(relaxationMapping.get(p).get(j)) > nbInitialVariables; coreIntersection[core].push(relaxationMapping.get(p).get(j)); } for (int j = 0; j < addCores.size(); j++) { final int core = addCores.get(j); final int b = softMapping.get(p).size() - 1; assert b < relaxationMapping.get(p).size(); - assert LNGCoreSolver.var(relaxationMapping.get(p).get(b)) > nbInitialVariables; + assert LngCoreSolver.var(relaxationMapping.get(p).get(b)) > nbInitialVariables; coreIntersectionCurrent[core].push(relaxationMapping.get(p).get(b)); } for (int k = 0; k < coreList.size(); k++) { for (int m = 0; m < coreIntersection[coreList.get(k)].size(); m++) { for (int j = m + 1; j < coreIntersectionCurrent[coreList.get(k)].size(); j++) { - final LNGIntVector clause = new LNGIntVector(); - clause.push(LNGCoreSolver.not(coreIntersection[coreList.get(k)].get(m))); - clause.push(LNGCoreSolver.not(coreIntersectionCurrent[coreList.get(k)].get(j))); + final LngIntVector clause = new LngIntVector(); + clause.push(LngCoreSolver.not(coreIntersection[coreList.get(k)].get(m))); + clause.push(LngCoreSolver.not(coreIntersectionCurrent[coreList.get(k)].get(j))); Pair symClause = - new Pair<>(LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m)), - LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))); - if (LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m)) > - LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))) { + new Pair<>(LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m)), + LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))); + if (LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m)) > + LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j))) { symClause = - new Pair<>(LNGCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j)), - LNGCoreSolver.var(coreIntersection[coreList.get(k)].get(m))); + new Pair<>(LngCoreSolver.var(coreIntersectionCurrent[coreList.get(k)].get(j)), + LngCoreSolver.var(coreIntersection[coreList.get(k)].get(m))); } if (!duplicatedSymmetryClauses.contains(symClause)) { duplicatedSymmetryClauses.add(symClause); @@ -430,12 +430,12 @@ protected void symmetryBreaking() { indexSoftCore.clear(); } - LNGResult unsatSearch(final ComputationHandler handler) { + LngResult unsatSearch(final ComputationHandler handler) { assert assumptions.size() == 0; solver = rebuildHardSolver(); - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (!res.getResult()) { nbCores++; } else { @@ -452,11 +452,11 @@ LNGResult unsatSearch(final ComputationHandler handler) { return res; } - protected LNGResult weightSearch(final ComputationHandler handler) { + protected LngResult weightSearch(final ComputationHandler handler) { assert weightStrategy == WeightStrategy.NORMAL || weightStrategy == WeightStrategy.DIVERSIFY; - final LNGResult unsatResult = unsatSearch(handler); + final LngResult unsatResult = unsatSearch(handler); if (!unsatResult.isSuccess()) { - return LNGResult.canceled(unsatResult.getCancelCause()); + return LngResult.canceled(unsatResult.getCancelCause()); } else if (!unsatResult.getResult()) { return unsat(); } @@ -464,9 +464,9 @@ protected LNGResult weightSearch(final ComputationHandler handler) updateCurrentWeight(weightStrategy); solver = rebuildWeightSolver(weightStrategy); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (!res.getResult()) { nbCores++; assert solver.assumptionsConflict().size() > 0; @@ -475,9 +475,9 @@ protected LNGResult weightSearch(final ComputationHandler handler) if (verbosity != Verbosity.NONE) { output.printf("c LB : %d CS : %d W : %d%n", lbCost, solver.assumptionsConflict().size(), coreCost); } - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } relaxCore(solver.assumptionsConflict(), coreCost, assumptions); solver = rebuildWeightSolver(weightStrategy); @@ -512,9 +512,9 @@ protected LNGResult weightSearch(final ComputationHandler handler) } return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } solver = rebuildWeightSolver(weightStrategy); @@ -523,19 +523,19 @@ protected LNGResult weightSearch(final ComputationHandler handler) } } - protected LNGResult normalSearch(final ComputationHandler handler) { - final LNGResult unsatResult = unsatSearch(handler); + protected LngResult normalSearch(final ComputationHandler handler) { + final LngResult unsatResult = unsatSearch(handler); if (!unsatResult.isSuccess()) { - return LNGResult.canceled(unsatResult.getCancelCause()); + return LngResult.canceled(unsatResult.getCancelCause()); } else if (!unsatResult.getResult()) { return unsat(); } initAssumptions(); solver = rebuildSolver(); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (!res.getResult()) { nbCores++; assert solver.assumptionsConflict().size() > 0; @@ -550,9 +550,9 @@ protected LNGResult normalSearch(final ComputationHandler handler) } return optimum(); } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } relaxCore(solver.assumptionsConflict(), coreCost, assumptions); @@ -575,7 +575,7 @@ void initAssumptions() { final int l = newLiteral(false); softClauses.get(i).setAssumptionVar(l); coreMapping.put(l, i); - assumptions.push(LNGCoreSolver.not(l)); + assumptions.push(LngCoreSolver.not(l)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WMSU3.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wmsu3.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WMSU3.java rename to core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wmsu3.java index e42785e1..0d18ebd3 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/WMSU3.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/algorithms/Wmsu3.java @@ -22,16 +22,16 @@ package com.booleworks.logicng.solvers.maxsat.algorithms; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; -import com.booleworks.logicng.solvers.MaxSATResult; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; +import com.booleworks.logicng.solvers.MaxSatResult; import com.booleworks.logicng.solvers.maxsat.encodings.Encoder; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.io.PrintStream; import java.util.SortedMap; @@ -42,19 +42,19 @@ * @version 3.0.0 * @since 1.0 */ -public class WMSU3 extends MaxSAT { +public class Wmsu3 extends MaxSat { protected final boolean bmoStrategy; protected Encoder encoder; - protected final MaxSATConfig.IncrementalStrategy incrementalStrategy; + protected final MaxSatConfig.IncrementalStrategy incrementalStrategy; protected final PrintStream output; /** * Constructs a new solver with default values. * @param f the formula factory */ - public WMSU3(final FormulaFactory f) { - this(f, MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE).build()); + public Wmsu3(final FormulaFactory f) { + this(f, MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE).build()); } /** @@ -62,7 +62,7 @@ public WMSU3(final FormulaFactory f) { * @param f the formula factory * @param config the configuration */ - public WMSU3(final FormulaFactory f, final MaxSATConfig config) { + public Wmsu3(final FormulaFactory f, final MaxSatConfig config) { super(f, config); verbosity = config.verbosity; incrementalStrategy = config.incrementalStrategy; @@ -70,7 +70,7 @@ public WMSU3(final FormulaFactory f, final MaxSATConfig config) { output = config.output; } - protected static boolean subsetSum(final LNGIntVector set, final int sum) { + protected static boolean subsetSum(final LngIntVector set, final int sum) { final int n = set.size(); final boolean[][] subset = new boolean[sum + 1][]; for (int i = 0; i <= sum; i++) { @@ -94,14 +94,14 @@ protected static boolean subsetSum(final LNGIntVector set, final int sum) { } @Override - protected LNGResult internalSearch(final ComputationHandler handler) { + protected LngResult internalSearch(final ComputationHandler handler) { if (problemType == ProblemType.UNWEIGHTED) { throw new IllegalStateException( "Error: Currently algorithm WMSU3 does not support unweighted MaxSAT instances."); } encoder = new Encoder(config.cardinalityEncoding); - encoder.setPBEncoding(config.pbEncoding); - final boolean isBmo = bmoStrategy && isBMO(true); + encoder.setPbEncoding(config.pbEncoding); + final boolean isBmo = bmoStrategy && isBmo(true); if (!isBmo) { currentWeight = 1; } @@ -110,7 +110,7 @@ protected LNGResult internalSearch(final ComputationHandler handle return none(handler); case ITERATIVE: if (isBmo) { - if (encoder.cardEncoding() != MaxSATConfig.CardinalityEncoding.TOTALIZER) { + if (encoder.cardEncoding() != MaxSatConfig.CardinalityEncoding.TOTALIZER) { throw new IllegalStateException( "Error: Currently iterative encoding in WMSU3 only supports the Totalizer encoding."); } @@ -123,30 +123,30 @@ protected LNGResult internalSearch(final ComputationHandler handle } } - protected LNGResult iterative(final ComputationHandler handler) { + protected LngResult iterative(final ComputationHandler handler) { final SortedMap coreMapping = new TreeMap<>(); nbInitialVariables = nVars(); initRelaxation(); - final LNGCoreSolver solver = rebuildSolver(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngCoreSolver solver = rebuildSolver(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector coeffs = new LNGIntVector(); - final LNGIntVector fullObjFunction = new LNGIntVector(); - final LNGIntVector fullCoeffsFunction = new LNGIntVector(); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector coeffs = new LngIntVector(); + final LngIntVector fullObjFunction = new LngIntVector(); + final LngIntVector fullCoeffsFunction = new LngIntVector(); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); if (newCost < ubCost || nbSatisfiable == 1) { saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + newCost); } ubCost = newCost; @@ -156,14 +156,14 @@ protected LNGResult iterative(final ComputationHandler handler) { assert nbSatisfiable > 0; return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= currentWeight && !activeSoft.get(i)) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } } else { @@ -172,18 +172,18 @@ protected LNGResult iterative(final ComputationHandler handler) { return unsat(); } else if (lbCost == ubCost) { assert nbSatisfiable > 0; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } sumSizeCores += solver.assumptionsConflict().size(); - final LNGIntVector objFunction = new LNGIntVector(); + final LngIntVector objFunction = new LngIntVector(); coeffs.clear(); assumptions.clear(); for (int i = 0; i < solver.assumptionsConflict().size(); i++) { @@ -199,55 +199,55 @@ protected LNGResult iterative(final ComputationHandler handler) { } for (int i = 0; i < softClauses.size(); i++) { if (!activeSoft.get(i) && softClauses.get(i).weight() >= currentWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } for (int i = 0; i < coeffs.size(); i++) { fullCoeffsFunction.push(coeffs.get(i)); fullObjFunction.push(objFunction.get(i)); } - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.printf("c Relaxed soft clauses %d / %d%n", fullCoeffsFunction.size(), softClauses.size()); } lbCost++; while (!subsetSum(fullCoeffsFunction, lbCost)) { lbCost++; } - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB : " + lbCost); } - if (!encoder.hasPBEncoding()) { - encoder.incEncodePB(solver, objFunction, coeffs, lbCost, assumptions, softClauses.size()); + if (!encoder.hasPbEncoding()) { + encoder.incEncodePb(solver, objFunction, coeffs, lbCost, assumptions, softClauses.size()); } else { - encoder.incUpdatePB(solver, objFunction, coeffs, lbCost); - encoder.incUpdatePBAssumptions(assumptions); + encoder.incUpdatePb(solver, objFunction, coeffs, lbCost); + encoder.incUpdatePbAssumptions(assumptions); } } } } - protected LNGResult none(final ComputationHandler handler) { + protected LngResult none(final ComputationHandler handler) { final SortedMap coreMapping = new TreeMap<>(); nbInitialVariables = nVars(); initRelaxation(); - LNGCoreSolver solver = rebuildSolver(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.NONE); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + LngCoreSolver solver = rebuildSolver(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.NONE); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector coeffs = new LNGIntVector(); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector coeffs = new LngIntVector(); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); if (newCost < ubCost || nbSatisfiable == 1) { saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + newCost); } ubCost = newCost; @@ -256,14 +256,14 @@ protected LNGResult none(final ComputationHandler handler) { assert nbSatisfiable > 0; return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= currentWeight && !activeSoft.get(i)) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } } else { @@ -272,14 +272,14 @@ protected LNGResult none(final ComputationHandler handler) { return unsat(); } else if (lbCost == ubCost) { assert nbSatisfiable > 0; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } sumSizeCores += solver.assumptionsConflict().size(); @@ -288,7 +288,7 @@ protected LNGResult none(final ComputationHandler handler) { assert !activeSoft.get(indexSoft); activeSoft.set(indexSoft, true); } - final LNGIntVector objFunction = new LNGIntVector(); + final LngIntVector objFunction = new LngIntVector(); coeffs.clear(); assumptions.clear(); for (int i = 0; i < softClauses.size(); i++) { @@ -296,10 +296,10 @@ protected LNGResult none(final ComputationHandler handler) { objFunction.push(softClauses.get(i).relaxationVars().get(0)); coeffs.push(softClauses.get(i).weight()); } else if (softClauses.get(i).weight() >= currentWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.printf("c Relaxed soft clauses %d / %d%n", objFunction.size(), softClauses.size()); } solver = rebuildSolver(); @@ -307,53 +307,53 @@ protected LNGResult none(final ComputationHandler handler) { while (!subsetSum(coeffs, lbCost)) { lbCost++; } - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB : " + lbCost); } - encoder.encodePB(solver, objFunction, coeffs, lbCost); + encoder.encodePb(solver, objFunction, coeffs, lbCost); } } } - protected LNGResult iterativeBmo(final ComputationHandler handler) { + protected LngResult iterativeBmo(final ComputationHandler handler) { final SortedMap coreMapping = new TreeMap<>(); nbInitialVariables = nVars(); initRelaxation(); - final LNGCoreSolver solver = rebuildSolver(); - encoder.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); - final LNGIntVector joinObjFunction = new LNGIntVector(); - final LNGIntVector encodingAssumptions = new LNGIntVector(); - final LNGIntVector joinCoeffs = new LNGIntVector(); - final LNGBooleanVector activeSoft = new LNGBooleanVector(softClauses.size(), false); + final LngCoreSolver solver = rebuildSolver(); + encoder.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); + final LngIntVector joinObjFunction = new LngIntVector(); + final LngIntVector encodingAssumptions = new LngIntVector(); + final LngIntVector joinCoeffs = new LngIntVector(); + final LngBooleanVector activeSoft = new LngBooleanVector(softClauses.size(), false); for (int i = 0; i < softClauses.size(); i++) { coreMapping.put(softClauses.get(i).assumptionVar(), i); } int minWeight = 0; int posWeight = 0; int localCost = 0; - final LNGVector functions = new LNGVector<>(); - final LNGIntVector weights = new LNGIntVector(); - final LNGVector bmoEncodings = new LNGVector<>(); - final LNGBooleanVector firstEncoding = new LNGBooleanVector(); - functions.push(new LNGIntVector()); + final LngVector functions = new LngVector<>(); + final LngIntVector weights = new LngIntVector(); + final LngVector bmoEncodings = new LngVector<>(); + final LngBooleanVector firstEncoding = new LngBooleanVector(); + functions.push(new LngIntVector()); weights.push(0); - final LNGIntVector objFunction = new LNGIntVector(); - Encoder e = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - e.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final LngIntVector objFunction = new LngIntVector(); + Encoder e = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + e.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); bmoEncodings.push(e); firstEncoding.push(true); - final LNGIntVector assumptions = new LNGIntVector(); - final LNGIntVector coeffs = new LNGIntVector(); + final LngIntVector assumptions = new LngIntVector(); + final LngIntVector coeffs = new LngIntVector(); while (true) { - final LNGResult res = searchSATSolver(solver, handler, assumptions); + final LngResult res = searchSatSolver(solver, handler, assumptions); if (!res.isSuccess()) { - return LNGResult.canceled(res.getCancelCause()); + return LngResult.canceled(res.getCancelCause()); } else if (res.getResult()) { nbSatisfiable++; final int newCost = computeCostModel(solver.model(), Integer.MAX_VALUE); if (newCost < ubCost || nbSatisfiable == 1) { saveModel(solver.model()); - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("o " + newCost); } ubCost = newCost; @@ -362,9 +362,9 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) if (ubCost == 0) { return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } } assert orderWeights.size() > 0; @@ -373,16 +373,16 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) currentWeight = orderWeights.get(0); for (int i = 0; i < softClauses.size(); i++) { if (softClauses.get(i).weight() >= currentWeight) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } } else { if (currentWeight == 1 || currentWeight == minWeight) { return optimum(); } else { - final LNGEvent upperBoundEvent = foundUpperBound(ubCost, handler); + final LngEvent upperBoundEvent = foundUpperBound(ubCost, handler); if (upperBoundEvent != null) { - return LNGResult.canceled(upperBoundEvent); + return LngResult.canceled(upperBoundEvent); } assumptions.clear(); final int previousWeight = currentWeight; @@ -390,13 +390,13 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) assert posWeight < orderWeights.size(); currentWeight = orderWeights.get(posWeight); if (objFunction.size() > 0) { - functions.set(functions.size() - 1, new LNGIntVector(objFunction)); + functions.set(functions.size() - 1, new LngIntVector(objFunction)); } - functions.push(new LNGIntVector()); + functions.push(new LngIntVector()); weights.push(0); localCost = 0; - e = new Encoder(MaxSATConfig.CardinalityEncoding.TOTALIZER); - e.setIncremental(MaxSATConfig.IncrementalStrategy.ITERATIVE); + e = new Encoder(MaxSatConfig.CardinalityEncoding.TOTALIZER); + e.setIncremental(MaxSatConfig.IncrementalStrategy.ITERATIVE); bmoEncodings.push(e); firstEncoding.push(true); for (int i = 0; i < encodingAssumptions.size(); i++) { @@ -405,10 +405,10 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) encodingAssumptions.clear(); for (int i = 0; i < softClauses.size(); i++) { if (!activeSoft.get(i) && previousWeight == softClauses.get(i).weight()) { - solver.addClause(LNGCoreSolver.not(softClauses.get(i).assumptionVar()), null); + solver.addClause(LngCoreSolver.not(softClauses.get(i).assumptionVar()), null); } if (currentWeight == softClauses.get(i).weight()) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } if (activeSoft.get(i)) { assert softClauses.get(i).weight() == previousWeight; @@ -421,21 +421,21 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) localCost++; lbCost += currentWeight; nbCores++; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB : " + lbCost); } if (nbSatisfiable == 0) { return unsat(); } else if (lbCost == ubCost) { assert nbSatisfiable > 0; - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.println("c LB = UB"); } return optimum(); } else { - final LNGEvent lowerBoundEvent = foundLowerBound(lbCost, handler); + final LngEvent lowerBoundEvent = foundLowerBound(lbCost, handler); if (lowerBoundEvent != null) { - return LNGResult.canceled(lowerBoundEvent); + return LngResult.canceled(lowerBoundEvent); } } sumSizeCores += solver.assumptionsConflict().size(); @@ -463,14 +463,14 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) objFunction.push(softClauses.get(i).relaxationVars().get(0)); coeffs.push(softClauses.get(i).weight()); } else if (currentWeight == softClauses.get(i).weight()) { - assumptions.push(LNGCoreSolver.not(softClauses.get(i).assumptionVar())); + assumptions.push(LngCoreSolver.not(softClauses.get(i).assumptionVar())); } } - if (verbosity != MaxSATConfig.Verbosity.NONE) { + if (verbosity != MaxSatConfig.Verbosity.NONE) { output.printf("c Relaxed soft clauses %d / %d%n", objFunction.size(), softClauses.size()); } assert posWeight < functions.size(); - functions.set(posWeight, new LNGIntVector(objFunction)); + functions.set(posWeight, new LngIntVector(objFunction)); weights.set(posWeight, localCost); if (firstEncoding.get(posWeight)) { if (weights.get(posWeight) != objFunction.size()) { @@ -491,17 +491,17 @@ protected LNGResult iterativeBmo(final ComputationHandler handler) } } - protected LNGCoreSolver rebuildSolver() { - final LNGCoreSolver s = newSATSolver(); + protected LngCoreSolver rebuildSolver() { + final LngCoreSolver s = newSatSolver(); for (int i = 0; i < nVars(); i++) { - newSATVariable(s); + newSatVariable(s); } for (int i = 0; i < hardClauses.size(); i++) { s.addClause(hardClauses.get(i).clause(), null); } - LNGIntVector clause; + LngIntVector clause; for (int i = 0; i < softClauses.size(); i++) { - clause = new LNGIntVector(softClauses.get(i).clause()); + clause = new LngIntVector(softClauses.get(i).clause()); for (int j = 0; j < softClauses.get(i).relaxationVars().size(); j++) { clause.push(softClauses.get(i).relaxationVars().get(j)); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoder.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoder.java index 304c6eaf..0a235ac4 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoder.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoder.java @@ -22,13 +22,13 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.AMOEncoding; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.CardinalityEncoding; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.IncrementalStrategy; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.PBEncoding; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.AmoEncoding; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.CardinalityEncoding; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.IncrementalStrategy; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.PbEncoding; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * Encoders for cardinality constraints, pseudo Booleans and AMO constraints. @@ -43,15 +43,15 @@ public class Encoder { protected final Totalizer totalizer; protected final SequentialWeightCounter swc; protected IncrementalStrategy incrementalStrategy; - protected PBEncoding pbEncoding; - protected AMOEncoding amoEncoding; + protected PbEncoding pbEncoding; + protected AmoEncoding amoEncoding; /** * Constructs a new Encoder. * @param cardinality the cardinality constraint encoder */ public Encoder(final CardinalityEncoding cardinality) { - this(IncrementalStrategy.NONE, cardinality, AMOEncoding.LADDER, PBEncoding.SWC); + this(IncrementalStrategy.NONE, cardinality, AmoEncoding.LADDER, PbEncoding.SWC); } /** @@ -62,7 +62,7 @@ public Encoder(final CardinalityEncoding cardinality) { * @param pb the pseudo Boolean encoder */ protected Encoder(final IncrementalStrategy incremental, final CardinalityEncoding cardinality, - final AMOEncoding amo, final PBEncoding pb) { + final AmoEncoding amo, final PbEncoding pb) { incrementalStrategy = incremental; cardinalityEncoding = cardinality; amoEncoding = amo; @@ -85,7 +85,7 @@ public CardinalityEncoding cardEncoding() { * Sets the pseudo Boolean encoding. * @param enc the pseudo Boolean encoding */ - public void setPBEncoding(final PBEncoding enc) { + public void setPbEncoding(final PbEncoding enc) { pbEncoding = enc; } @@ -93,7 +93,7 @@ public void setPBEncoding(final PBEncoding enc) { * Sets the AMO encoding. * @param enc the AMO encoding */ - public void setAMOEncoding(final AMOEncoding enc) { + public void setAmoEncoding(final AmoEncoding enc) { amoEncoding = enc; } @@ -120,7 +120,7 @@ public void setIncremental(final IncrementalStrategy incremental) { * @param lits the literals for the constraint * @throws IllegalStateException if the AMO encoding is unknown */ - public void encodeAMO(final LNGCoreSolver s, final LNGIntVector lits) { + public void encodeAmo(final LngCoreSolver s, final LngIntVector lits) { switch (amoEncoding) { case LADDER: ladder.encode(s, lits); @@ -137,7 +137,7 @@ public void encodeAMO(final LNGCoreSolver s, final LNGIntVector lits) { * @param rhs the right-hand side of the constraint * @throws IllegalStateException if the cardinality encoding is unknown */ - public void encodeCardinality(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { + public void encodeCardinality(final LngCoreSolver s, final LngIntVector lits, final int rhs) { switch (cardinalityEncoding) { case TOTALIZER: totalizer.build(s, lits, rhs); @@ -159,7 +159,7 @@ public void encodeCardinality(final LNGCoreSolver s, final LNGIntVector lits, fi * @param rhs the new right-hand side * @throws IllegalStateException if the cardinality encoding is unknown */ - public void updateCardinality(final LNGCoreSolver s, final int rhs) { + public void updateCardinality(final LngCoreSolver s, final int rhs) { switch (cardinalityEncoding) { case TOTALIZER: totalizer.update(s, rhs); @@ -181,7 +181,7 @@ public void updateCardinality(final LNGCoreSolver s, final int rhs) { * @throws IllegalStateException if the cardinality encoding does not * support incrementality */ - public void buildCardinality(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { + public void buildCardinality(final LngCoreSolver s, final LngIntVector lits, final int rhs) { assert incrementalStrategy != IncrementalStrategy.NONE; switch (cardinalityEncoding) { case TOTALIZER: @@ -203,8 +203,8 @@ public void buildCardinality(final LNGCoreSolver s, final LNGIntVector lits, fin * @throws IllegalStateException if the cardinality encoding does not * support incrementality */ - public void incUpdateCardinality(final LNGCoreSolver s, final LNGIntVector join, final LNGIntVector lits, - final int rhs, final LNGIntVector assumptions) { + public void incUpdateCardinality(final LngCoreSolver s, final LngIntVector join, final LngIntVector lits, + final int rhs, final LngIntVector assumptions) { assert incrementalStrategy == IncrementalStrategy.ITERATIVE; switch (cardinalityEncoding) { case TOTALIZER: @@ -228,7 +228,7 @@ public void incUpdateCardinality(final LNGCoreSolver s, final LNGIntVector join, * @param rhs the right-hand side of the constraint * @throws IllegalStateException if the pseudo-Boolean encoding is unknown */ - public void encodePB(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs, final int rhs) { + public void encodePb(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs, final int rhs) { switch (pbEncoding) { case SWC: swc.encode(s, lits, coeffs, rhs); @@ -244,7 +244,7 @@ public void encodePB(final LNGCoreSolver s, final LNGIntVector lits, final LNGIn * @param rhs the new right-hand side * @throws IllegalStateException if the pseudo-Boolean encoding is unknown */ - public void updatePB(final LNGCoreSolver s, final int rhs) { + public void updatePb(final LngCoreSolver s, final int rhs) { switch (pbEncoding) { case SWC: swc.update(s, rhs); @@ -264,8 +264,8 @@ public void updatePB(final LNGCoreSolver s, final int rhs) { * @param size the size * @throws IllegalStateException if the pseudo-Boolean encoding is unknown */ - public void incEncodePB(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs, - final int rhs, final LNGIntVector assumptions, final int size) { + public void incEncodePb(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs, + final int rhs, final LngIntVector assumptions, final int size) { assert incrementalStrategy == IncrementalStrategy.ITERATIVE; switch (pbEncoding) { case SWC: @@ -284,7 +284,7 @@ public void incEncodePB(final LNGCoreSolver s, final LNGIntVector lits, final LN * @param rhs the new right-hand side of the constraint * @throws IllegalStateException if the pseudo-Boolean encoding is unknown */ - public void incUpdatePB(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs, final int rhs) { + public void incUpdatePb(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs, final int rhs) { assert incrementalStrategy == IncrementalStrategy.ITERATIVE; switch (pbEncoding) { case SWC: @@ -301,7 +301,7 @@ public void incUpdatePB(final LNGCoreSolver s, final LNGIntVector lits, final LN * @param assumptions the assumptions * @throws IllegalStateException if the pseudo-Boolean encoding is unknown */ - public void incUpdatePBAssumptions(final LNGIntVector assumptions) { + public void incUpdatePbAssumptions(final LngIntVector assumptions) { assert incrementalStrategy == IncrementalStrategy.ITERATIVE; switch (pbEncoding) { case SWC: @@ -333,15 +333,15 @@ public boolean hasCardEncoding() { * {@code false} otherwise. * @return {@code true} if the pseudo-Boolean encoding was built */ - public boolean hasPBEncoding() { - return pbEncoding == PBEncoding.SWC && swc.hasCreatedEncoding(); + public boolean hasPbEncoding() { + return pbEncoding == PbEncoding.SWC && swc.hasCreatedEncoding(); } /** * Returns the totalizer's literals. * @return the literals */ - public LNGIntVector lits() { + public LngIntVector lits() { assert cardinalityEncoding == CardinalityEncoding.TOTALIZER && incrementalStrategy == IncrementalStrategy.ITERATIVE; return totalizer.lits(); @@ -351,7 +351,7 @@ public LNGIntVector lits() { * Returns the totalizer's output literals. * @return the literals */ - public LNGIntVector outputs() { + public LngIntVector outputs() { assert cardinalityEncoding == CardinalityEncoding.TOTALIZER && incrementalStrategy == IncrementalStrategy.ITERATIVE; return totalizer.outputs(); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoding.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoding.java index 23de0e03..de2dba63 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoding.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Encoding.java @@ -22,8 +22,8 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * Super-class for the different encodings. @@ -32,14 +32,14 @@ */ public abstract class Encoding { - protected final LNGIntVector clause; + protected final LngIntVector clause; boolean hasEncoding; /** * Constructor. */ Encoding() { - clause = new LNGIntVector(); + clause = new LngIntVector(); } /** @@ -47,8 +47,8 @@ public abstract class Encoding { * @param s the sat solver * @param a the unit literal */ - void addUnitClause(final LNGCoreSolver s, final int a) { - addUnitClause(s, a, LNGCoreSolver.LIT_UNDEF); + void addUnitClause(final LngCoreSolver s, final int a) { + addUnitClause(s, a, LngCoreSolver.LIT_UNDEF); } /** @@ -57,12 +57,12 @@ void addUnitClause(final LNGCoreSolver s, final int a) { * @param a the unit literal * @param blocking the blocking literal */ - private void addUnitClause(final LNGCoreSolver s, final int a, final int blocking) { + private void addUnitClause(final LngCoreSolver s, final int a, final int blocking) { assert clause.size() == 0; - assert a != LNGCoreSolver.LIT_UNDEF; - assert LNGCoreSolver.var(a) < s.nVars(); + assert a != LngCoreSolver.LIT_UNDEF; + assert LngCoreSolver.var(a) < s.nVars(); clause.push(a); - if (blocking != LNGCoreSolver.LIT_UNDEF) { + if (blocking != LngCoreSolver.LIT_UNDEF) { clause.push(blocking); } s.addClause(clause, null); @@ -75,8 +75,8 @@ private void addUnitClause(final LNGCoreSolver s, final int a, final int blockin * @param a the first literal * @param b the second literal */ - void addBinaryClause(final LNGCoreSolver s, final int a, final int b) { - addBinaryClause(s, a, b, LNGCoreSolver.LIT_UNDEF); + void addBinaryClause(final LngCoreSolver s, final int a, final int b) { + addBinaryClause(s, a, b, LngCoreSolver.LIT_UNDEF); } /** @@ -86,13 +86,13 @@ void addBinaryClause(final LNGCoreSolver s, final int a, final int b) { * @param b the second literal * @param blocking the blocking literal */ - void addBinaryClause(final LNGCoreSolver s, final int a, final int b, final int blocking) { + void addBinaryClause(final LngCoreSolver s, final int a, final int b, final int blocking) { assert clause.size() == 0; - assert a != LNGCoreSolver.LIT_UNDEF && b != LNGCoreSolver.LIT_UNDEF; - assert LNGCoreSolver.var(a) < s.nVars() && LNGCoreSolver.var(b) < s.nVars(); + assert a != LngCoreSolver.LIT_UNDEF && b != LngCoreSolver.LIT_UNDEF; + assert LngCoreSolver.var(a) < s.nVars() && LngCoreSolver.var(b) < s.nVars(); clause.push(a); clause.push(b); - if (blocking != LNGCoreSolver.LIT_UNDEF) { + if (blocking != LngCoreSolver.LIT_UNDEF) { clause.push(blocking); } s.addClause(clause, null); @@ -106,8 +106,8 @@ void addBinaryClause(final LNGCoreSolver s, final int a, final int b, final int * @param b the second literal * @param c the third literal */ - void addTernaryClause(final LNGCoreSolver s, final int a, final int b, final int c) { - addTernaryClause(s, a, b, c, LNGCoreSolver.LIT_UNDEF); + void addTernaryClause(final LngCoreSolver s, final int a, final int b, final int c) { + addTernaryClause(s, a, b, c, LngCoreSolver.LIT_UNDEF); } /** @@ -118,14 +118,14 @@ void addTernaryClause(final LNGCoreSolver s, final int a, final int b, final int * @param c the third literal * @param blocking the blocking literal */ - void addTernaryClause(final LNGCoreSolver s, final int a, final int b, final int c, final int blocking) { + void addTernaryClause(final LngCoreSolver s, final int a, final int b, final int c, final int blocking) { assert clause.size() == 0; - assert a != LNGCoreSolver.LIT_UNDEF && b != LNGCoreSolver.LIT_UNDEF && c != LNGCoreSolver.LIT_UNDEF; - assert LNGCoreSolver.var(a) < s.nVars() && LNGCoreSolver.var(b) < s.nVars() && LNGCoreSolver.var(c) < s.nVars(); + assert a != LngCoreSolver.LIT_UNDEF && b != LngCoreSolver.LIT_UNDEF && c != LngCoreSolver.LIT_UNDEF; + assert LngCoreSolver.var(a) < s.nVars() && LngCoreSolver.var(b) < s.nVars() && LngCoreSolver.var(c) < s.nVars(); clause.push(a); clause.push(b); clause.push(c); - if (blocking != LNGCoreSolver.LIT_UNDEF) { + if (blocking != LngCoreSolver.LIT_UNDEF) { clause.push(blocking); } s.addClause(clause, null); @@ -140,8 +140,8 @@ void addTernaryClause(final LNGCoreSolver s, final int a, final int b, final int * @param c the third literal * @param d the fourth literal */ - void addQuaternaryClause(final LNGCoreSolver s, final int a, final int b, final int c, final int d) { - addQuaternaryClause(s, a, b, c, d, LNGCoreSolver.LIT_UNDEF); + void addQuaternaryClause(final LngCoreSolver s, final int a, final int b, final int c, final int d) { + addQuaternaryClause(s, a, b, c, d, LngCoreSolver.LIT_UNDEF); } /** @@ -153,18 +153,18 @@ void addQuaternaryClause(final LNGCoreSolver s, final int a, final int b, final * @param d the fourth literal * @param blocking the blocking literal */ - private void addQuaternaryClause(final LNGCoreSolver s, final int a, final int b, final int c, final int d, + private void addQuaternaryClause(final LngCoreSolver s, final int a, final int b, final int c, final int d, final int blocking) { assert clause.size() == 0; - assert a != LNGCoreSolver.LIT_UNDEF && b != LNGCoreSolver.LIT_UNDEF && c != LNGCoreSolver.LIT_UNDEF && - d != LNGCoreSolver.LIT_UNDEF; - assert LNGCoreSolver.var(a) < s.nVars() && LNGCoreSolver.var(b) < s.nVars() && - LNGCoreSolver.var(c) < s.nVars() && LNGCoreSolver.var(d) < s.nVars(); + assert a != LngCoreSolver.LIT_UNDEF && b != LngCoreSolver.LIT_UNDEF && c != LngCoreSolver.LIT_UNDEF && + d != LngCoreSolver.LIT_UNDEF; + assert LngCoreSolver.var(a) < s.nVars() && LngCoreSolver.var(b) < s.nVars() && + LngCoreSolver.var(c) < s.nVars() && LngCoreSolver.var(d) < s.nVars(); clause.push(a); clause.push(b); clause.push(c); clause.push(d); - if (blocking != LNGCoreSolver.LIT_UNDEF) { + if (blocking != LngCoreSolver.LIT_UNDEF) { clause.push(blocking); } s.addClause(clause, null); diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Ladder.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Ladder.java index 394babf9..058b7834 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Ladder.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Ladder.java @@ -22,9 +22,9 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * Encodes that exactly one literal from 'lits' is assigned value true. Uses the @@ -39,28 +39,28 @@ public class Ladder extends Encoding { * @param s the solver * @param lits the literals for the constraint */ - public void encode(final LNGCoreSolver s, final LNGIntVector lits) { + public void encode(final LngCoreSolver s, final LngIntVector lits) { assert lits.size() != 0; if (lits.size() == 1) { addUnitClause(s, lits.get(0)); } else { - final LNGIntVector seqAuxiliary = new LNGIntVector(); + final LngIntVector seqAuxiliary = new LngIntVector(); for (int i = 0; i < lits.size() - 1; i++) { - seqAuxiliary.push(LNGCoreSolver.mkLit(s.nVars(), false)); - MaxSAT.newSATVariable(s); + seqAuxiliary.push(LngCoreSolver.mkLit(s.nVars(), false)); + MaxSat.newSatVariable(s); } for (int i = 0; i < lits.size(); i++) { if (i == 0) { - addBinaryClause(s, lits.get(i), LNGCoreSolver.not(seqAuxiliary.get(i))); - addBinaryClause(s, LNGCoreSolver.not(lits.get(i)), seqAuxiliary.get(i)); + addBinaryClause(s, lits.get(i), LngCoreSolver.not(seqAuxiliary.get(i))); + addBinaryClause(s, LngCoreSolver.not(lits.get(i)), seqAuxiliary.get(i)); } else if (i == lits.size() - 1) { addBinaryClause(s, lits.get(i), seqAuxiliary.get(i - 1)); - addBinaryClause(s, LNGCoreSolver.not(lits.get(i)), LNGCoreSolver.not(seqAuxiliary.get(i - 1))); + addBinaryClause(s, LngCoreSolver.not(lits.get(i)), LngCoreSolver.not(seqAuxiliary.get(i - 1))); } else { - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliary.get(i - 1)), seqAuxiliary.get(i)); - addTernaryClause(s, lits.get(i), LNGCoreSolver.not(seqAuxiliary.get(i)), seqAuxiliary.get(i - 1)); - addBinaryClause(s, LNGCoreSolver.not(lits.get(i)), seqAuxiliary.get(i)); - addBinaryClause(s, LNGCoreSolver.not(lits.get(i)), LNGCoreSolver.not(seqAuxiliary.get(i - 1))); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliary.get(i - 1)), seqAuxiliary.get(i)); + addTernaryClause(s, lits.get(i), LngCoreSolver.not(seqAuxiliary.get(i)), seqAuxiliary.get(i - 1)); + addBinaryClause(s, LngCoreSolver.not(lits.get(i)), seqAuxiliary.get(i)); + addBinaryClause(s, LngCoreSolver.not(lits.get(i)), LngCoreSolver.not(seqAuxiliary.get(i - 1))); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/ModularTotalizer.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/ModularTotalizer.java index e6c07162..44e52a7d 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/ModularTotalizer.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/ModularTotalizer.java @@ -22,9 +22,9 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * Encodes that at most 'rhs' literals can be assigned value true. Uses the @@ -38,22 +38,22 @@ public class ModularTotalizer extends Encoding { protected static final int LIT_ERROR = -2; protected final int h0; - protected final LNGIntVector cardinalityUpoutlits; - protected final LNGIntVector cardinalityLwoutlits; + protected final LngIntVector cardinalityUpoutlits; + protected final LngIntVector cardinalityLwoutlits; protected int modulo; - protected LNGIntVector cardinalityInlits; + protected LngIntVector cardinalityInlits; protected int currentCardinalityRhs; /** * Constructs a new modular totalizer. */ ModularTotalizer() { - h0 = LNGCoreSolver.LIT_UNDEF; + h0 = LngCoreSolver.LIT_UNDEF; modulo = -1; currentCardinalityRhs = -1; - cardinalityInlits = new LNGIntVector(); - cardinalityUpoutlits = new LNGIntVector(); - cardinalityLwoutlits = new LNGIntVector(); + cardinalityInlits = new LngIntVector(); + cardinalityUpoutlits = new LngIntVector(); + cardinalityLwoutlits = new LngIntVector(); } /** @@ -78,13 +78,13 @@ boolean hasCreatedEncoding() { * @param lits the literals of the constraint * @param rhs the right-hand side of the constraint */ - public void encode(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { + public void encode(final LngCoreSolver s, final LngIntVector lits, final int rhs) { hasEncoding = false; cardinalityUpoutlits.clear(); cardinalityLwoutlits.clear(); if (rhs == 0) { for (int i = 0; i < lits.size(); i++) { - addUnitClause(s, LNGCoreSolver.not(lits.get(i))); + addUnitClause(s, LngCoreSolver.not(lits.get(i))); } return; } @@ -100,21 +100,21 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final int rhs mod = modulo; } for (int i = 0; i < lits.size() / mod; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); cardinalityUpoutlits.push(p); } for (int i = 0; i < mod - 1; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); cardinalityLwoutlits.push(p); } - cardinalityInlits = new LNGIntVector(lits); + cardinalityInlits = new LngIntVector(lits); currentCardinalityRhs = rhs + 1; if (cardinalityUpoutlits.size() == 0) { cardinalityUpoutlits.push(h0); } - toCNF(s, mod, cardinalityUpoutlits, cardinalityLwoutlits, lits.size()); + toCnf(s, mod, cardinalityUpoutlits, cardinalityLwoutlits, lits.size()); assert cardinalityInlits.size() == 0; update(s, rhs); } @@ -124,14 +124,14 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final int rhs * @param s the solver * @param rhs the new right-hand side */ - public void update(final LNGCoreSolver s, final int rhs) { + public void update(final LngCoreSolver s, final int rhs) { assert currentCardinalityRhs != -1; assert hasEncoding; encodeOutput(s, rhs); currentCardinalityRhs = rhs + 1; } - protected void encodeOutput(final LNGCoreSolver s, final int rhs) { + protected void encodeOutput(final LngCoreSolver s, final int rhs) { assert hasEncoding; assert cardinalityUpoutlits.size() != 0 || cardinalityLwoutlits.size() != 0; final int mod = modulo; @@ -140,31 +140,31 @@ protected void encodeOutput(final LNGCoreSolver s, final int rhs) { assert ulimit <= cardinalityUpoutlits.size(); assert llimit <= cardinalityLwoutlits.size(); for (int i = ulimit; i < cardinalityUpoutlits.size(); i++) { - addUnitClause(s, LNGCoreSolver.not(cardinalityUpoutlits.get(i))); + addUnitClause(s, LngCoreSolver.not(cardinalityUpoutlits.get(i))); } if (ulimit != 0 && llimit != 0) { for (int i = llimit - 1; i < cardinalityLwoutlits.size(); i++) { - addBinaryClause(s, LNGCoreSolver.not(cardinalityUpoutlits.get(ulimit - 1)), - LNGCoreSolver.not(cardinalityLwoutlits.get(i))); + addBinaryClause(s, LngCoreSolver.not(cardinalityUpoutlits.get(ulimit - 1)), + LngCoreSolver.not(cardinalityLwoutlits.get(i))); } } else { if (ulimit == 0) { assert llimit != 0; for (int i = llimit - 1; i < cardinalityLwoutlits.size(); i++) { - addUnitClause(s, LNGCoreSolver.not(cardinalityLwoutlits.get(i))); + addUnitClause(s, LngCoreSolver.not(cardinalityLwoutlits.get(i))); } } else { - addUnitClause(s, LNGCoreSolver.not(cardinalityUpoutlits.get(ulimit - 1))); + addUnitClause(s, LngCoreSolver.not(cardinalityUpoutlits.get(ulimit - 1))); } } } - protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ublits, final LNGIntVector lwlits, + protected void toCnf(final LngCoreSolver s, final int mod, final LngIntVector ublits, final LngIntVector lwlits, final int rhs) { - final LNGIntVector lupper = new LNGIntVector(); - final LNGIntVector llower = new LNGIntVector(); - final LNGIntVector rupper = new LNGIntVector(); - final LNGIntVector rlower = new LNGIntVector(); + final LngIntVector lupper = new LngIntVector(); + final LngIntVector llower = new LngIntVector(); + final LngIntVector rupper = new LngIntVector(); + final LngIntVector rlower = new LngIntVector(); assert rhs > 1; final int split = rhs / 2; int left = 1; @@ -177,8 +177,8 @@ protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ub } else { left = split / mod; for (int i = 0; i < left; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); lupper.push(p); } int limit = mod - 1; @@ -186,8 +186,8 @@ protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ub limit = split; } for (int i = 0; i < limit; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); llower.push(p); } } @@ -199,8 +199,8 @@ protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ub } else { right = (rhs - split) / mod; for (int i = 0; i < right; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); rupper.push(p); } int limit = mod - 1; @@ -208,8 +208,8 @@ protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ub limit = rhs - split; } for (int i = 0; i < limit; i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); rlower.push(p); } } @@ -221,22 +221,22 @@ protected void toCNF(final LNGCoreSolver s, final int mod, final LNGIntVector ub } adder(s, mod, ublits, lwlits, rupper, rlower, lupper, llower); if (left * mod + split - left * mod > 1) { - toCNF(s, mod, lupper, llower, left * mod + split - left * mod); + toCnf(s, mod, lupper, llower, left * mod + split - left * mod); } if (right * mod + (rhs - split) - right * mod > 1) { - toCNF(s, mod, rupper, rlower, right * mod + (rhs - split) - right * mod); + toCnf(s, mod, rupper, rlower, right * mod + (rhs - split) - right * mod); } } - protected void adder(final LNGCoreSolver s, final int mod, final LNGIntVector upper, final LNGIntVector lower, - final LNGIntVector lupper, final LNGIntVector llower, final LNGIntVector rupper, - final LNGIntVector rlower) { + protected void adder(final LngCoreSolver s, final int mod, final LngIntVector upper, final LngIntVector lower, + final LngIntVector lupper, final LngIntVector llower, final LngIntVector rupper, + final LngIntVector rlower) { assert upper.size() != 0; assert lower.size() >= llower.size() && lower.size() >= rlower.size(); - int carry = LNGCoreSolver.LIT_UNDEF; + int carry = LngCoreSolver.LIT_UNDEF; if (upper.get(0) != h0) { - carry = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + carry = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); } for (int i = 0; i <= llower.size(); i++) { for (int j = 0; j <= rlower.size(); j++) { @@ -246,34 +246,34 @@ protected void adder(final LNGCoreSolver s, final int mod, final LNGIntVector up if (i + j < mod) { if (i == 0 && j != 0) { if (upper.get(0) != h0) { - addTernaryClause(s, LNGCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1), carry); + addTernaryClause(s, LngCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1), carry); } else { - addBinaryClause(s, LNGCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1)); + addBinaryClause(s, LngCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1)); } } else if (j == 0 && i != 0) { if (upper.get(0) != h0) { - addTernaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), lower.get(i + j - 1), carry); + addTernaryClause(s, LngCoreSolver.not(llower.get(i - 1)), lower.get(i + j - 1), carry); } else { - addBinaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), lower.get(i + j - 1)); + addBinaryClause(s, LngCoreSolver.not(llower.get(i - 1)), lower.get(i + j - 1)); } } else if (i != 0) { if (upper.get(0) != h0) { - addQuaternaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), - LNGCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1), carry); + addQuaternaryClause(s, LngCoreSolver.not(llower.get(i - 1)), + LngCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1), carry); } else { assert i + j - 1 < lower.size(); - addTernaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), - LNGCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1)); + addTernaryClause(s, LngCoreSolver.not(llower.get(i - 1)), + LngCoreSolver.not(rlower.get(j - 1)), lower.get(i + j - 1)); } } } else if (i + j > mod) { assert i + j > 0; - addTernaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), LNGCoreSolver.not(rlower.get(j - 1)), + addTernaryClause(s, LngCoreSolver.not(llower.get(i - 1)), LngCoreSolver.not(rlower.get(j - 1)), lower.get((i + j) % mod - 1)); } else { assert i + j == mod; - assert carry != LNGCoreSolver.LIT_UNDEF; - addTernaryClause(s, LNGCoreSolver.not(llower.get(i - 1)), LNGCoreSolver.not(rlower.get(j - 1)), + assert carry != LngCoreSolver.LIT_UNDEF; + addTernaryClause(s, LngCoreSolver.not(llower.get(i - 1)), LngCoreSolver.not(rlower.get(j - 1)), carry); } } @@ -304,28 +304,28 @@ protected void adder(final LNGCoreSolver s, final int mod, final LNGIntVector up if (i + j < upper.size()) { d = upper.get(i + j); } - if (c != LNGCoreSolver.LIT_UNDEF && c != LIT_ERROR) { - final LNGIntVector clause = new LNGIntVector(); - if (a != LNGCoreSolver.LIT_UNDEF && a != LIT_ERROR) { - clause.push(LNGCoreSolver.not(a)); + if (c != LngCoreSolver.LIT_UNDEF && c != LIT_ERROR) { + final LngIntVector clause = new LngIntVector(); + if (a != LngCoreSolver.LIT_UNDEF && a != LIT_ERROR) { + clause.push(LngCoreSolver.not(a)); } - if (b != LNGCoreSolver.LIT_UNDEF && b != LIT_ERROR) { - clause.push(LNGCoreSolver.not(b)); + if (b != LngCoreSolver.LIT_UNDEF && b != LIT_ERROR) { + clause.push(LngCoreSolver.not(b)); } clause.push(c); if (clause.size() > 1) { s.addClause(clause, null); } } - final LNGIntVector clause = new LNGIntVector(); - clause.push(LNGCoreSolver.not(carry)); - if (a != LNGCoreSolver.LIT_UNDEF && a != LIT_ERROR) { - clause.push(LNGCoreSolver.not(a)); + final LngIntVector clause = new LngIntVector(); + clause.push(LngCoreSolver.not(carry)); + if (a != LngCoreSolver.LIT_UNDEF && a != LIT_ERROR) { + clause.push(LngCoreSolver.not(a)); } - if (b != LNGCoreSolver.LIT_UNDEF && b != LIT_ERROR) { - clause.push(LNGCoreSolver.not(b)); + if (b != LngCoreSolver.LIT_UNDEF && b != LIT_ERROR) { + clause.push(LngCoreSolver.not(b)); } - if (d != LIT_ERROR && d != LNGCoreSolver.LIT_UNDEF) { + if (d != LIT_ERROR && d != LngCoreSolver.LIT_UNDEF) { clause.push(d); } if (clause.size() > 1) { diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/SequentialWeightCounter.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/SequentialWeightCounter.java index 35ef4e3f..351d24ad 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/SequentialWeightCounter.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/SequentialWeightCounter.java @@ -22,11 +22,11 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT.newSATVariable; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat.newSatVariable; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * A sequential weight counter for the encoding of pseudo-Boolean constraints in @@ -36,37 +36,37 @@ */ public class SequentialWeightCounter extends Encoding { - protected final LNGIntVector pbOutlits; - protected final LNGIntVector unitLits; - protected final LNGIntVector unitCoeffs; + protected final LngIntVector pbOutlits; + protected final LngIntVector unitLits; + protected final LngIntVector unitCoeffs; protected int currentPbRhs; protected int currentLitBlocking; - protected LNGVector seqAuxiliaryInc; - protected LNGIntVector litsInc; - protected LNGIntVector coeffsInc; + protected LngVector seqAuxiliaryInc; + protected LngIntVector litsInc; + protected LngIntVector coeffsInc; /** * Constructs a new sequential weight counter encoder. */ SequentialWeightCounter() { currentPbRhs = -1; - currentLitBlocking = LNGCoreSolver.LIT_UNDEF; - pbOutlits = new LNGIntVector(); - unitLits = new LNGIntVector(); - unitCoeffs = new LNGIntVector(); - seqAuxiliaryInc = new LNGVector<>(); - litsInc = new LNGIntVector(); - coeffsInc = new LNGIntVector(); + currentLitBlocking = LngCoreSolver.LIT_UNDEF; + pbOutlits = new LngIntVector(); + unitLits = new LngIntVector(); + unitCoeffs = new LngIntVector(); + seqAuxiliaryInc = new LngVector<>(); + litsInc = new LngIntVector(); + coeffsInc = new LngIntVector(); } /** * Updates the assumptions with the unit literals. * @param assumptions the current assumptions */ - void updateAssumptions(final LNGIntVector assumptions) { - assumptions.push(LNGCoreSolver.not(currentLitBlocking)); + void updateAssumptions(final LngIntVector assumptions) { + assumptions.push(LngCoreSolver.not(currentLitBlocking)); for (int i = 0; i < unitLits.size(); i++) { - assumptions.push(LNGCoreSolver.not(unitLits.get(i))); + assumptions.push(LngCoreSolver.not(unitLits.get(i))); } } @@ -85,13 +85,13 @@ boolean hasCreatedEncoding() { * @param coeffs the coefficients of the constraints * @param rhs the right-hand side of the constraint */ - public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs, final int rhs) { + public void encode(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs, final int rhs) { if (rhs == Integer.MAX_VALUE) { throw new IllegalArgumentException("Overflow in the encoding."); } hasEncoding = false; - final LNGIntVector simpLits = new LNGIntVector(lits); - final LNGIntVector simpCoeffs = new LNGIntVector(coeffs); + final LngIntVector simpLits = new LngIntVector(lits); + final LngIntVector simpCoeffs = new LngIntVector(coeffs); lits.clear(); coeffs.clear(); for (int i = 0; i < simpLits.size(); i++) { @@ -99,26 +99,26 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV lits.push(simpLits.get(i)); coeffs.push(simpCoeffs.get(i)); } else { - addUnitClause(s, LNGCoreSolver.not(simpLits.get(i))); + addUnitClause(s, LngCoreSolver.not(simpLits.get(i))); } } if (lits.size() == 1) { - addUnitClause(s, LNGCoreSolver.not(lits.get(0))); + addUnitClause(s, LngCoreSolver.not(lits.get(0))); return; } if (lits.size() == 0) { return; } final int n = lits.size(); - final LNGIntVector[] seqAuxiliary = new LNGIntVector[n + 1]; + final LngIntVector[] seqAuxiliary = new LngIntVector[n + 1]; for (int i = 0; i < n + 1; i++) { - seqAuxiliary[i] = new LNGIntVector(); + seqAuxiliary[i] = new LngIntVector(); seqAuxiliary[i].growTo(rhs + 1, -1); } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= rhs; ++j) { - seqAuxiliary[i].set(j, LNGCoreSolver.mkLit(s.nVars(), false)); - newSATVariable(s); + seqAuxiliary[i].set(j, LngCoreSolver.mkLit(s.nVars(), false)); + newSatVariable(s); } } for (int i = 1; i <= rhs; ++i) { @@ -129,19 +129,19 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV assert wi <= rhs; for (int j = 1; j <= rhs; j++) { if (i >= 2 && i <= n && j <= rhs) { - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliary[i - 1].get(j)), seqAuxiliary[i].get(j)); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliary[i - 1].get(j)), seqAuxiliary[i].get(j)); } if (i <= n && j <= wi) { - addBinaryClause(s, LNGCoreSolver.not(lits.get(i - 1)), seqAuxiliary[i].get(j)); + addBinaryClause(s, LngCoreSolver.not(lits.get(i - 1)), seqAuxiliary[i].get(j)); } if (i >= 2 && i <= n && j <= rhs - wi) { - addTernaryClause(s, LNGCoreSolver.not(seqAuxiliary[i - 1].get(j)), - LNGCoreSolver.not(lits.get(i - 1)), seqAuxiliary[i].get(j + wi)); + addTernaryClause(s, LngCoreSolver.not(seqAuxiliary[i - 1].get(j)), + LngCoreSolver.not(lits.get(i - 1)), seqAuxiliary[i].get(j + wi)); } } if (i >= 2) { - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliary[i - 1].get(rhs + 1 - wi)), - LNGCoreSolver.not(lits.get(i - 1))); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliary[i - 1].get(rhs + 1 - wi)), + LngCoreSolver.not(lits.get(i - 1))); } } currentPbRhs = rhs; @@ -157,18 +157,18 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV * @param assumptions the current assumptions * @param size the size */ - public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs, - final int rhs, final LNGIntVector assumptions, final int size) { + public void encode(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs, + final int rhs, final LngIntVector assumptions, final int size) { if (rhs == Integer.MAX_VALUE) { throw new IllegalArgumentException("Overflow in the encoding."); } hasEncoding = false; - final LNGIntVector simpLits = new LNGIntVector(lits); - final LNGIntVector simpCoeffs = new LNGIntVector(coeffs); + final LngIntVector simpLits = new LngIntVector(lits); + final LngIntVector simpCoeffs = new LngIntVector(coeffs); lits.clear(); coeffs.clear(); - final LNGIntVector simpUnitLits = new LNGIntVector(unitLits); - final LNGIntVector simpUnitCoeffs = new LNGIntVector(unitCoeffs); + final LngIntVector simpUnitLits = new LngIntVector(unitLits); + final LngIntVector simpUnitCoeffs = new LngIntVector(unitCoeffs); unitLits.clear(); unitCoeffs.clear(); for (int i = 0; i < simpUnitLits.size(); i++) { @@ -191,7 +191,7 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV } if (lits.size() == 1) { for (int i = 0; i < unitLits.size(); i++) { - assumptions.push(LNGCoreSolver.not(unitLits.get(i))); + assumptions.push(LngCoreSolver.not(unitLits.get(i))); } unitLits.push(lits.get(0)); unitCoeffs.push(coeffs.get(0)); @@ -199,54 +199,54 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV } if (lits.size() == 0) { for (int i = 0; i < unitLits.size(); i++) { - assumptions.push(LNGCoreSolver.not(unitLits.get(i))); + assumptions.push(LngCoreSolver.not(unitLits.get(i))); } return; } final int n = lits.size(); - seqAuxiliaryInc = new LNGVector<>(size + 1); + seqAuxiliaryInc = new LngVector<>(size + 1); for (int i = 0; i <= n; i++) { - seqAuxiliaryInc.set(i, new LNGIntVector()); + seqAuxiliaryInc.set(i, new LngIntVector()); seqAuxiliaryInc.get(i).growTo(rhs + 1, -1); } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= rhs; ++j) { - seqAuxiliaryInc.get(i).set(j, LNGCoreSolver.mkLit(s.nVars(), false)); - newSATVariable(s); + seqAuxiliaryInc.get(i).set(j, LngCoreSolver.mkLit(s.nVars(), false)); + newSatVariable(s); } } - final int blocking = LNGCoreSolver.mkLit(s.nVars(), false); - newSATVariable(s); + final int blocking = LngCoreSolver.mkLit(s.nVars(), false); + newSatVariable(s); currentLitBlocking = blocking; - assumptions.push(LNGCoreSolver.not(blocking)); + assumptions.push(LngCoreSolver.not(blocking)); for (int i = 1; i <= n; i++) { final int wi = coeffs.get(i - 1); assert rhs >= wi; for (int j = 1; j <= rhs; j++) { if (i >= 2 && i <= n) { - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), seqAuxiliaryInc.get(i).get(j)); } if (i <= n && j <= wi) { - addBinaryClause(s, LNGCoreSolver.not(lits.get(i - 1)), seqAuxiliaryInc.get(i).get(j)); + addBinaryClause(s, LngCoreSolver.not(lits.get(i - 1)), seqAuxiliaryInc.get(i).get(j)); } if (i >= 2 && i <= n && j <= rhs - wi) { - addTernaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), - LNGCoreSolver.not(lits.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); + addTernaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), + LngCoreSolver.not(lits.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); } } if (i >= 2) { - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), - LNGCoreSolver.not(lits.get(i - 1)), blocking); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), + LngCoreSolver.not(lits.get(i - 1)), blocking); } } for (int i = 0; i < unitLits.size(); i++) { - assumptions.push(LNGCoreSolver.not(unitLits.get(i))); + assumptions.push(LngCoreSolver.not(unitLits.get(i))); } currentPbRhs = rhs; hasEncoding = true; - litsInc = new LNGIntVector(lits); - coeffsInc = new LNGIntVector(coeffs); + litsInc = new LngIntVector(lits); + coeffsInc = new LngIntVector(coeffs); } /** @@ -256,10 +256,10 @@ public void encode(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntV * @param s the solver * @param rhs the new right-hand side */ - public void update(final LNGCoreSolver s, final int rhs) { + public void update(final LngCoreSolver s, final int rhs) { assert currentPbRhs != -1; for (int i = rhs; i < currentPbRhs; i++) { - addUnitClause(s, LNGCoreSolver.not(pbOutlits.get(i))); + addUnitClause(s, LngCoreSolver.not(pbOutlits.get(i))); } currentPbRhs = rhs; } @@ -269,8 +269,8 @@ public void update(final LNGCoreSolver s, final int rhs) { * @param s the solver * @param rhs the new right-hand side */ - public void updateInc(final LNGCoreSolver s, final int rhs) { - if (currentLitBlocking != LNGCoreSolver.LIT_UNDEF) { + public void updateInc(final LngCoreSolver s, final int rhs) { + if (currentLitBlocking != LngCoreSolver.LIT_UNDEF) { addUnitClause(s, currentLitBlocking); } final int n = litsInc.size(); @@ -278,21 +278,21 @@ public void updateInc(final LNGCoreSolver s, final int rhs) { assert currentPbRhs < rhs; for (int i = 1; i <= n; i++) { for (int j = offset; j <= rhs; j++) { - seqAuxiliaryInc.get(i).push(LNGCoreSolver.LIT_UNDEF); + seqAuxiliaryInc.get(i).push(LngCoreSolver.LIT_UNDEF); } } for (int i = 1; i <= n; ++i) { for (int j = offset; j <= rhs; ++j) { assert seqAuxiliaryInc.get(i).size() > j; - seqAuxiliaryInc.get(i).set(j, LNGCoreSolver.mkLit(s.nVars(), false)); - newSATVariable(s); + seqAuxiliaryInc.get(i).set(j, LngCoreSolver.mkLit(s.nVars(), false)); + newSatVariable(s); } } for (int i = 1; i < litsInc.size(); i++) { assert seqAuxiliaryInc.get(i).size() == rhs + 1; } - currentLitBlocking = LNGCoreSolver.mkLit(s.nVars(), false); - newSATVariable(s); + currentLitBlocking = LngCoreSolver.mkLit(s.nVars(), false); + newSatVariable(s); for (int i = 1; i <= n; i++) { final int wi = coeffsInc.get(i - 1); assert wi > 0; @@ -300,20 +300,20 @@ public void updateInc(final LNGCoreSolver s, final int rhs) { for (int j = 1; j <= rhs; j++) { if (i >= 2 && i <= n && j <= rhs && j >= offset) { assert seqAuxiliaryInc.get(i).size() > j; - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), seqAuxiliaryInc.get(i).get(j)); } if (i >= 2 && i <= n && j <= rhs - wi && j >= offset - wi) { - addTernaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), - LNGCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); + addTernaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), + LngCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); } } if (i >= 2) { assert seqAuxiliaryInc.get(i - 1).size() > rhs + 1 - wi; assert rhs + 1 - wi > 0; assert i - 1 < litsInc.size(); - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), - LNGCoreSolver.not(litsInc.get(i - 1)), currentLitBlocking); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), + LngCoreSolver.not(litsInc.get(i - 1)), currentLitBlocking); } } currentPbRhs = rhs; @@ -326,14 +326,14 @@ public void updateInc(final LNGCoreSolver s, final int rhs) { * @param lits the literals of the constraint * @param coeffs the coefficients of the constraint */ - void join(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coeffs) { - assert currentLitBlocking != LNGCoreSolver.LIT_UNDEF; + void join(final LngCoreSolver s, final LngIntVector lits, final LngIntVector coeffs) { + assert currentLitBlocking != LngCoreSolver.LIT_UNDEF; final int rhs = currentPbRhs; if (rhs == Integer.MAX_VALUE) { throw new IllegalArgumentException("Overflow in the encoding."); } - final LNGIntVector simpUnitLits = new LNGIntVector(unitLits); - final LNGIntVector simpUnitCoeffs = new LNGIntVector(unitCoeffs); + final LngIntVector simpUnitLits = new LngIntVector(unitLits); + final LngIntVector simpUnitCoeffs = new LngIntVector(unitCoeffs); unitLits.clear(); unitCoeffs.clear(); final int lhsJoin = litsInc.size(); @@ -361,13 +361,13 @@ void join(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coe final int n = litsInc.size(); assert seqAuxiliaryInc.get(lhsJoin).size() > 0; for (int i = lhsJoin + 1; i <= n; i++) { - seqAuxiliaryInc.set(i, new LNGIntVector()); + seqAuxiliaryInc.set(i, new LngIntVector()); seqAuxiliaryInc.get(i).growTo(rhs + 1, -1); } for (int i = lhsJoin + 1; i <= n; ++i) { for (int j = 1; j <= rhs; ++j) { - seqAuxiliaryInc.get(i).set(j, LNGCoreSolver.mkLit(s.nVars(), false)); - newSATVariable(s); + seqAuxiliaryInc.get(i).set(j, LngCoreSolver.mkLit(s.nVars(), false)); + newSatVariable(s); } } for (int i = 1; i <= n; i++) { @@ -380,23 +380,23 @@ void join(final LNGCoreSolver s, final LNGIntVector lits, final LNGIntVector coe for (int j = 1; j <= rhs; j++) { assert seqAuxiliaryInc.get(i).size() > j; assert seqAuxiliaryInc.get(i - 1).size() > j; - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), seqAuxiliaryInc.get(i).get(j)); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), seqAuxiliaryInc.get(i).get(j)); if (j <= wi) { assert seqAuxiliaryInc.get(i).size() > j; assert i - 1 < litsInc.size() && i - 1 >= 0; - addBinaryClause(s, LNGCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j)); + addBinaryClause(s, LngCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j)); } if (j <= rhs - wi) { - addTernaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), - LNGCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); + addTernaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(j)), + LngCoreSolver.not(litsInc.get(i - 1)), seqAuxiliaryInc.get(i).get(j + wi)); } } if (i > lhsJoin) { assert rhs + 1 - wi >= 0; assert seqAuxiliaryInc.get(i - 1).size() > rhs + 1 - wi; assert i - 1 < litsInc.size(); - addBinaryClause(s, LNGCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), - LNGCoreSolver.not(litsInc.get(i - 1)), currentLitBlocking); + addBinaryClause(s, LngCoreSolver.not(seqAuxiliaryInc.get(i - 1).get(rhs + 1 - wi)), + LngCoreSolver.not(litsInc.get(i - 1)), currentLitBlocking); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Totalizer.java b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Totalizer.java index 6c46e96d..a1dacdcb 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Totalizer.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/maxsat/encodings/Totalizer.java @@ -22,11 +22,11 @@ package com.booleworks.logicng.solvers.maxsat.encodings; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * Encodes that at most 'rhs' literals can be assigned value true. Uses the @@ -36,34 +36,34 @@ */ public class Totalizer extends Encoding { - protected final LNGVector totalizerIterativeLeft; - protected final LNGVector totalizerIterativeRight; - protected final LNGVector totalizerIterativeOutput; - protected final LNGIntVector totalizerIterativeRhs; + protected final LngVector totalizerIterativeLeft; + protected final LngVector totalizerIterativeRight; + protected final LngVector totalizerIterativeOutput; + protected final LngIntVector totalizerIterativeRhs; protected final int blocking; - protected final LNGIntVector cardinalityOutlits; - protected LNGIntVector cardinalityInlits; - protected MaxSATConfig.IncrementalStrategy incrementalStrategy; + protected final LngIntVector cardinalityOutlits; + protected LngIntVector cardinalityInlits; + protected MaxSatConfig.IncrementalStrategy incrementalStrategy; protected int currentCardinalityRhs; protected boolean joinMode; - private LNGIntVector ilits; + private LngIntVector ilits; /** * Constructs a new totalizer with a given incremental strategy. * @param strategy the incremental strategy */ - Totalizer(final MaxSATConfig.IncrementalStrategy strategy) { - blocking = LNGCoreSolver.LIT_UNDEF; + Totalizer(final MaxSatConfig.IncrementalStrategy strategy) { + blocking = LngCoreSolver.LIT_UNDEF; joinMode = false; currentCardinalityRhs = -1; incrementalStrategy = strategy; - totalizerIterativeLeft = new LNGVector<>(); - totalizerIterativeRight = new LNGVector<>(); - totalizerIterativeOutput = new LNGVector<>(); - totalizerIterativeRhs = new LNGIntVector(); - cardinalityInlits = new LNGIntVector(); - cardinalityOutlits = new LNGIntVector(); - ilits = new LNGIntVector(); + totalizerIterativeLeft = new LngVector<>(); + totalizerIterativeRight = new LngVector<>(); + totalizerIterativeOutput = new LngVector<>(); + totalizerIterativeRhs = new LngIntVector(); + cardinalityInlits = new LngIntVector(); + cardinalityOutlits = new LngIntVector(); + ilits = new LngIntVector(); } /** @@ -71,8 +71,8 @@ public class Totalizer extends Encoding { * @param s the solver * @param rhs the new right-hand side */ - public void update(final LNGCoreSolver s, final int rhs) { - final LNGIntVector assumptions = new LNGIntVector(); + public void update(final LngCoreSolver s, final int rhs) { + final LngIntVector assumptions = new LngIntVector(); update(s, rhs, assumptions); } @@ -88,7 +88,7 @@ boolean hasCreatedEncoding() { * Sets the incremental strategy. * @param incremental the incremental strategy */ - public void setIncremental(final MaxSATConfig.IncrementalStrategy incremental) { + public void setIncremental(final MaxSatConfig.IncrementalStrategy incremental) { incrementalStrategy = incremental; } @@ -96,7 +96,7 @@ public void setIncremental(final MaxSATConfig.IncrementalStrategy incremental) { * Returns the incremental strategy. * @return the incremental strategy */ - public MaxSATConfig.IncrementalStrategy incremental() { + public MaxSatConfig.IncrementalStrategy incremental() { return incrementalStrategy; } @@ -106,9 +106,9 @@ public MaxSATConfig.IncrementalStrategy incremental() { * @param lits the literals of the constraint * @param rhs the right-hand side of the constraint */ - void join(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { - assert incrementalStrategy == MaxSATConfig.IncrementalStrategy.ITERATIVE; - final LNGIntVector leftCardinalityOutlits = new LNGIntVector(cardinalityOutlits); + void join(final LngCoreSolver s, final LngIntVector lits, final int rhs) { + assert incrementalStrategy == MaxSatConfig.IncrementalStrategy.ITERATIVE; + final LngIntVector leftCardinalityOutlits = new LngIntVector(cardinalityOutlits); final int oldCardinality = currentCardinalityRhs; if (lits.size() > 1) { build(s, lits, Math.min(rhs, lits.size())); @@ -117,11 +117,11 @@ void join(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { cardinalityOutlits.clear(); cardinalityOutlits.push(lits.get(0)); } - final LNGIntVector rightCardinalityOutlits = new LNGIntVector(cardinalityOutlits); + final LngIntVector rightCardinalityOutlits = new LngIntVector(cardinalityOutlits); cardinalityOutlits.clear(); for (int i = 0; i < leftCardinalityOutlits.size() + rightCardinalityOutlits.size(); i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); cardinalityOutlits.push(p); } currentCardinalityRhs = rhs; @@ -139,19 +139,19 @@ void join(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { * @param assumptions the assumptions * @throws IllegalStateException if the incremental strategy is unknown */ - public void update(final LNGCoreSolver s, final int rhs, final LNGIntVector assumptions) { + public void update(final LngCoreSolver s, final int rhs, final LngIntVector assumptions) { assert hasEncoding; switch (incrementalStrategy) { case NONE: for (int i = rhs; i < cardinalityOutlits.size(); i++) { - addUnitClause(s, LNGCoreSolver.not(cardinalityOutlits.get(i))); + addUnitClause(s, LngCoreSolver.not(cardinalityOutlits.get(i))); } break; case ITERATIVE: incremental(s, rhs); assumptions.clear(); for (int i = rhs; i < cardinalityOutlits.size(); i++) { - assumptions.push(LNGCoreSolver.not(cardinalityOutlits.get(i))); + assumptions.push(LngCoreSolver.not(cardinalityOutlits.get(i))); } break; default: @@ -165,41 +165,41 @@ public void update(final LNGCoreSolver s, final int rhs, final LNGIntVector assu * @param lits the literals of the constraint * @param rhs the right-hand side of the constraint */ - public void build(final LNGCoreSolver s, final LNGIntVector lits, final int rhs) { + public void build(final LngCoreSolver s, final LngIntVector lits, final int rhs) { cardinalityOutlits.clear(); hasEncoding = false; if (rhs == 0) { for (int i = 0; i < lits.size(); i++) { - addUnitClause(s, LNGCoreSolver.not(lits.get(i))); + addUnitClause(s, LngCoreSolver.not(lits.get(i))); } return; } assert rhs >= 1 && rhs <= lits.size(); - if (incrementalStrategy == MaxSATConfig.IncrementalStrategy.NONE && rhs == lits.size()) { + if (incrementalStrategy == MaxSatConfig.IncrementalStrategy.NONE && rhs == lits.size()) { return; } if (rhs == lits.size() && !joinMode) { return; } for (int i = 0; i < lits.size(); i++) { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); cardinalityOutlits.push(p); } - cardinalityInlits = new LNGIntVector(lits); + cardinalityInlits = new LngIntVector(lits); currentCardinalityRhs = rhs; - toCNF(s, cardinalityOutlits); + toCnf(s, cardinalityOutlits); assert cardinalityInlits.size() == 0; if (!joinMode) { joinMode = true; } hasEncoding = true; - ilits = new LNGIntVector(lits); + ilits = new LngIntVector(lits); } - protected void toCNF(final LNGCoreSolver s, final LNGIntVector lits) { - final LNGIntVector left = new LNGIntVector(); - final LNGIntVector right = new LNGIntVector(); + protected void toCnf(final LngCoreSolver s, final LngIntVector lits) { + final LngIntVector left = new LngIntVector(); + final LngIntVector right = new LngIntVector(); assert lits.size() > 1; final int split = lits.size() / 2; for (int i = 0; i < lits.size(); i++) { @@ -209,8 +209,8 @@ protected void toCNF(final LNGCoreSolver s, final LNGIntVector lits) { left.push(cardinalityInlits.back()); cardinalityInlits.pop(); } else { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); left.push(p); } } else { @@ -219,28 +219,28 @@ protected void toCNF(final LNGCoreSolver s, final LNGIntVector lits) { right.push(cardinalityInlits.back()); cardinalityInlits.pop(); } else { - final int p = LNGCoreSolver.mkLit(s.nVars(), false); - MaxSAT.newSATVariable(s); + final int p = LngCoreSolver.mkLit(s.nVars(), false); + MaxSat.newSatVariable(s); right.push(p); } } } adder(s, left, right, lits); if (left.size() > 1) { - toCNF(s, left); + toCnf(s, left); } if (right.size() > 1) { - toCNF(s, right); + toCnf(s, right); } } - protected void adder(final LNGCoreSolver s, final LNGIntVector left, final LNGIntVector right, - final LNGIntVector output) { + protected void adder(final LngCoreSolver s, final LngIntVector left, final LngIntVector right, + final LngIntVector output) { assert output.size() == left.size() + right.size(); - if (incrementalStrategy == MaxSATConfig.IncrementalStrategy.ITERATIVE) { - totalizerIterativeLeft.push(new LNGIntVector(left)); - totalizerIterativeRight.push(new LNGIntVector(right)); - totalizerIterativeOutput.push(new LNGIntVector(output)); + if (incrementalStrategy == MaxSatConfig.IncrementalStrategy.ITERATIVE) { + totalizerIterativeLeft.push(new LngIntVector(left)); + totalizerIterativeRight.push(new LngIntVector(right)); + totalizerIterativeOutput.push(new LngIntVector(output)); totalizerIterativeRhs.push(currentCardinalityRhs); } for (int i = 0; i <= left.size(); i++) { @@ -252,18 +252,18 @@ protected void adder(final LNGCoreSolver s, final LNGIntVector left, final LNGIn continue; } if (i == 0) { - addBinaryClause(s, LNGCoreSolver.not(right.get(j - 1)), output.get(j - 1), blocking); + addBinaryClause(s, LngCoreSolver.not(right.get(j - 1)), output.get(j - 1), blocking); } else if (j == 0) { - addBinaryClause(s, LNGCoreSolver.not(left.get(i - 1)), output.get(i - 1), blocking); + addBinaryClause(s, LngCoreSolver.not(left.get(i - 1)), output.get(i - 1), blocking); } else { - addTernaryClause(s, LNGCoreSolver.not(left.get(i - 1)), LNGCoreSolver.not(right.get(j - 1)), + addTernaryClause(s, LngCoreSolver.not(left.get(i - 1)), LngCoreSolver.not(right.get(j - 1)), output.get(i + j - 1), blocking); } } } } - protected void incremental(final LNGCoreSolver s, final int rhs) { + protected void incremental(final LngCoreSolver s, final int rhs) { for (int z = 0; z < totalizerIterativeRhs.size(); z++) { for (int i = 0; i <= totalizerIterativeLeft.get(z).size(); i++) { for (int j = 0; j <= totalizerIterativeRight.get(z).size(); j++) { @@ -274,14 +274,14 @@ protected void incremental(final LNGCoreSolver s, final int rhs) { continue; } if (i == 0) { - addBinaryClause(s, LNGCoreSolver.not(totalizerIterativeRight.get(z).get(j - 1)), + addBinaryClause(s, LngCoreSolver.not(totalizerIterativeRight.get(z).get(j - 1)), totalizerIterativeOutput.get(z).get(j - 1)); } else if (j == 0) { - addBinaryClause(s, LNGCoreSolver.not(totalizerIterativeLeft.get(z).get(i - 1)), + addBinaryClause(s, LngCoreSolver.not(totalizerIterativeLeft.get(z).get(i - 1)), totalizerIterativeOutput.get(z).get(i - 1)); } else { - addTernaryClause(s, LNGCoreSolver.not(totalizerIterativeLeft.get(z).get(i - 1)), - LNGCoreSolver.not(totalizerIterativeRight.get(z).get(j - 1)), + addTernaryClause(s, LngCoreSolver.not(totalizerIterativeLeft.get(z).get(i - 1)), + LngCoreSolver.not(totalizerIterativeRight.get(z).get(j - 1)), totalizerIterativeOutput.get(z).get(i + j - 1)); } } @@ -294,7 +294,7 @@ protected void incremental(final LNGCoreSolver s, final int rhs) { * Returns the totalizer's literals. * @return the literals */ - public LNGIntVector lits() { + public LngIntVector lits() { return ilits; } @@ -302,7 +302,7 @@ public LNGIntVector lits() { * Returns the totalizer's output literals. * @return the literals */ - public LNGIntVector outputs() { + public LngIntVector outputs() { return cardinalityOutlits; } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/sat/LNGCoreSolver.java b/core/src/main/java/com/booleworks/logicng/solvers/sat/LngCoreSolver.java similarity index 85% rename from core/src/main/java/com/booleworks/logicng/solvers/sat/LNGCoreSolver.java rename to core/src/main/java/com/booleworks/logicng/solvers/sat/LngCoreSolver.java index 8fcfe5f9..6cfa2941 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/sat/LNGCoreSolver.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/sat/LngCoreSolver.java @@ -32,26 +32,26 @@ import com.booleworks.logicng.backbones.Backbone; import com.booleworks.logicng.backbones.BackboneType; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.Tristate; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedIntQueue; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedLongQueue; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGHeap; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; -import com.booleworks.logicng.solvers.datastructures.LNGWatcher; +import com.booleworks.logicng.solvers.datastructures.LngBoundedIntQueue; +import com.booleworks.logicng.solvers.datastructures.LngBoundedLongQueue; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngHeap; +import com.booleworks.logicng.solvers.datastructures.LngVariable; +import com.booleworks.logicng.solvers.datastructures.LngWatcher; import java.util.ArrayList; import java.util.Collection; @@ -69,14 +69,14 @@ *

    * This core solver should usually not be used directly. It exposes a lot of * methods which should only be called if you really require to tweak with the - * internals of the SAT Solver. Using {@link SATSolver} will be sufficient in + * internals of the SAT Solver. Using {@link SatSolver} will be sufficient in * almost all cases. * @version 3.0.0 * @since 3.0.0 */ // TODO: cleanup and sort methods, add links (and licences?) to MiniSat, // Glucose, and MiniCard -public class LNGCoreSolver { +public class LngCoreSolver { /** * The undefined literal. @@ -99,8 +99,8 @@ public class LNGCoreSolver { protected static final int LB_BLOCKING_RESTART = 10000; protected FormulaFactory f; - protected SATSolverConfig config; - protected SATSolverLowLevelConfig llConfig; + protected SatSolverConfig config; + protected SatSolverLowLevelConfig llConfig; protected boolean inSatCall; // mapping of variable names to variable indices @@ -108,25 +108,25 @@ public class LNGCoreSolver { protected Map idx2name = new TreeMap<>(); // bookkeeping of solver states - protected LNGIntVector validStates = new LNGIntVector(); + protected LngIntVector validStates = new LngIntVector(); protected int nextStateId = 0; // internal solver state protected boolean ok = true; protected int qhead = 0; - protected LNGIntVector unitClauses = new LNGIntVector(); - protected LNGVector clauses = new LNGVector<>(); - protected LNGVector learnts = new LNGVector<>(); - protected LNGVector> watches = new LNGVector<>(); - protected LNGVector vars = new LNGVector<>(); - protected LNGHeap orderHeap = new LNGHeap(this); - protected LNGIntVector trail = new LNGIntVector(); - protected LNGIntVector trailLim = new LNGIntVector(); - protected LNGBooleanVector model = new LNGBooleanVector(); - protected LNGIntVector assumptionsConflict = new LNGIntVector(); - protected LNGIntVector assumptions = new LNGIntVector(); - protected LNGVector assumptionPropositions = new LNGVector<>(); - protected LNGBooleanVector seen = new LNGBooleanVector(); + protected LngIntVector unitClauses = new LngIntVector(); + protected LngVector clauses = new LngVector<>(); + protected LngVector learnts = new LngVector<>(); + protected LngVector> watches = new LngVector<>(); + protected LngVector vars = new LngVector<>(); + protected LngHeap orderHeap = new LngHeap(this); + protected LngIntVector trail = new LngIntVector(); + protected LngIntVector trailLim = new LngIntVector(); + protected LngBooleanVector model = new LngBooleanVector(); + protected LngIntVector assumptionsConflict = new LngIntVector(); + protected LngIntVector assumptions = new LngIntVector(); + protected LngVector assumptionPropositions = new LngVector<>(); + protected LngBooleanVector seen = new LngBooleanVector(); protected int analyzeBtLevel = 0; protected double claInc = 1; protected double varInc; @@ -135,31 +135,31 @@ public class LNGCoreSolver { protected int learntsLiterals = 0; // Proof generating information - protected LNGVector pgOriginalClauses = new LNGVector<>(); - protected LNGVector pgProof = new LNGVector<>(); + protected LngVector pgOriginalClauses = new LngVector<>(); + protected LngVector pgProof = new LngVector<>(); // backbone computation protected boolean computingBackbone = false; protected Stack backboneCandidates; - protected LNGIntVector backboneAssumptions; + protected LngIntVector backboneAssumptions; protected HashMap backboneMap; // Selection order - protected LNGIntVector selectionOrder = new LNGIntVector(); + protected LngIntVector selectionOrder = new LngIntVector(); protected int selectionOrderIdx = 0; // internal glucose-related state - protected LNGVector> watchesBin = new LNGVector<>(); - protected LNGIntVector permDiff = new LNGIntVector(); - protected LNGIntVector lastDecisionLevel = new LNGIntVector(); - protected LNGBoundedLongQueue lbdQueue = new LNGBoundedLongQueue(); - protected LNGBoundedIntQueue trailQueue = new LNGBoundedIntQueue(); + protected LngVector> watchesBin = new LngVector<>(); + protected LngIntVector permDiff = new LngIntVector(); + protected LngIntVector lastDecisionLevel = new LngIntVector(); + protected LngBoundedLongQueue lbdQueue = new LngBoundedLongQueue(); + protected LngBoundedIntQueue trailQueue = new LngBoundedIntQueue(); protected int myflag = 0; - protected long analyzeLBD = 0; + protected long analyzeLbd = 0; protected int nbClausesBeforeReduce; protected int conflicts = 0; protected int conflictsRestarts = 0; - protected double sumLBD = 0; + protected double sumLbd = 0; protected int curRestart = 1; /** @@ -168,21 +168,21 @@ public class LNGCoreSolver { * @param f the formula factory * @param config the configuration */ - public LNGCoreSolver(final FormulaFactory f, final SATSolverConfig config) { + public LngCoreSolver(final FormulaFactory f, final SatSolverConfig config) { this.f = f; this.config = config; llConfig = config.lowLevelConfig; varInc = llConfig.varInc; varDecay = llConfig.varDecay; - lbdQueue.initSize(llConfig.sizeLBDQueue); + lbdQueue.initSize(llConfig.sizeLbdQueue); trailQueue.initSize(llConfig.sizeTrailQueue); - nbClausesBeforeReduce = llConfig.firstReduceDB; + nbClausesBeforeReduce = llConfig.firstReduceDb; } /** * Generates a clause vector of a collection of literals for a given SAT * Solver and configuration. If variables are unknown, they will be added - * with {@link LNGCoreSolver#newVar} and the given initial phase and the + * with {@link LngCoreSolver#newVar} and the given initial phase and the * decision variable flag. * @param literals the literals * @param solver the internal solver @@ -191,10 +191,10 @@ public LNGCoreSolver(final FormulaFactory f, final SATSolverConfig config) { * variable * @return the clause vector */ - public static LNGIntVector generateClauseVector(final Collection literals, - final LNGCoreSolver solver, + public static LngIntVector generateClauseVector(final Collection literals, + final LngCoreSolver solver, final boolean initialPhase, final boolean decisionVar) { - final LNGIntVector clauseVec = new LNGIntVector(literals.size()); + final LngIntVector clauseVec = new LngIntVector(literals.size()); for (final Literal lit : literals) { clauseVec.unsafePush(solverLiteral(lit, solver, initialPhase, decisionVar)); } @@ -208,8 +208,8 @@ public static LNGIntVector generateClauseVector(final Collection literals, - final LNGCoreSolver solver) { + public static LngIntVector generateClauseVector(final Collection literals, + final LngCoreSolver solver) { return generateClauseVector(literals, solver, solver.getConfig().getInitialPhase(), true); } @@ -224,7 +224,7 @@ public static LNGIntVector generateClauseVector(final Collection> 1); } @@ -374,13 +374,13 @@ public void addName(final String name, final int id) { */ public int newVar(final boolean sign, final boolean dvar) { final int v = nVars(); - final LNGVariable newVar = new LNGVariable(sign); + final LngVariable newVar = new LngVariable(sign); vars.push(newVar); - watches.push(new LNGVector<>()); - watches.push(new LNGVector<>()); + watches.push(new LngVector<>()); + watches.push(new LngVector<>()); seen.push(false); - watchesBin.push(new LNGVector<>()); - watchesBin.push(new LNGVector<>()); + watchesBin.push(new LngVector<>()); + watchesBin.push(new LngVector<>()); permDiff.push(0); newVar.setDecision(dvar); insertVarOrder(v); @@ -393,7 +393,7 @@ public int newVar(final boolean sign, final boolean dvar) { * @param proposition a proposition (if required for proof tracing) */ public void addClause(final int lit, final Proposition proposition) { - final LNGIntVector unit = new LNGIntVector(1); + final LngIntVector unit = new LngIntVector(1); unit.push(lit); addClause(unit, proposition); } @@ -404,17 +404,17 @@ public void addClause(final int lit, final Proposition proposition) { * @param proposition a proposition (if required for proof tracing) * @return {@code true} if the clause was added successfully, {@code false} * otherwise - * @throws IllegalStateException if a {@link SATCall} is currently running + * @throws IllegalStateException if a {@link SatCall} is currently running * on this solver */ - public boolean addClause(final LNGIntVector ps, final Proposition proposition) { + public boolean addClause(final LngIntVector ps, final Proposition proposition) { assertNotInSatCall(); assert decisionLevel() == 0; int p; int i; int j; if (config.proofGeneration) { - final LNGIntVector vec = new LNGIntVector(ps.size()); + final LngIntVector vec = new LngIntVector(ps.size()); for (i = 0; i < ps.size(); i++) { vec.push((var(ps.get(i)) + 1) * (-2 * (sign(ps.get(i)) ? 1 : 0) + 1)); } @@ -426,9 +426,9 @@ public boolean addClause(final LNGIntVector ps, final Proposition proposition) { ps.sort(); boolean flag = false; - LNGIntVector oc = null; + LngIntVector oc = null; if (config.proofGeneration) { - oc = new LNGIntVector(); + oc = new LngIntVector(); for (i = 0, p = LIT_UNDEF; i < ps.size(); i++) { oc.push(ps.get(i)); if (value(ps.get(i)) == TRUE || ps.get(i) == not(p) || value(ps.get(i)) == FALSE) { @@ -448,14 +448,14 @@ public boolean addClause(final LNGIntVector ps, final Proposition proposition) { ps.removeElements(i - j); if (flag) { - LNGIntVector vec = new LNGIntVector(ps.size() + 1); + LngIntVector vec = new LngIntVector(ps.size() + 1); vec.push(1); for (i = 0; i < ps.size(); i++) { vec.push((var(ps.get(i)) + 1) * (-2 * (sign(ps.get(i)) ? 1 : 0) + 1)); } pgProof.push(vec); - vec = new LNGIntVector(oc.size() + 1); + vec = new LngIntVector(oc.size() + 1); vec.push(-1); for (i = 0; i < oc.size(); i++) { vec.push((var(oc.get(i)) + 1) * (-2 * (sign(oc.get(i)) ? 1 : 0) + 1)); @@ -466,7 +466,7 @@ public boolean addClause(final LNGIntVector ps, final Proposition proposition) { if (ps.isEmpty()) { ok = false; if (config.proofGeneration) { - pgProof.push(LNGIntVector.of(0)); + pgProof.push(LngIntVector.of(0)); } return false; } else if (ps.size() == 1) { @@ -474,11 +474,11 @@ public boolean addClause(final LNGIntVector ps, final Proposition proposition) { ok = propagate() == null; unitClauses.push(ps.get(0)); if (!ok && config.proofGeneration) { - pgProof.push(LNGIntVector.of(0)); + pgProof.push(LngIntVector.of(0)); } return ok; } else { - final LNGClause c = new LNGClause(ps, -1); + final LngClause c = new LngClause(ps, -1); clauses.push(c); attachClause(c); } @@ -492,34 +492,34 @@ public boolean addClause(final LNGIntVector ps, final Proposition proposition) { * @param handler a handler * @return the result of the solve call */ - public LNGResult internalSolve(final ComputationHandler handler) { + public LngResult internalSolve(final ComputationHandler handler) { if (!handler.shouldResume(SAT_CALL_STARTED)) { - return LNGResult.canceled(SAT_CALL_STARTED); + return LngResult.canceled(SAT_CALL_STARTED); } model.clear(); assumptionsConflict.clear(); if (!ok) { - return LNGResult.of(false); + return LngResult.of(false); } - LNGResult status = LNGResult.of(UNDEF); + LngResult status = LngResult.of(UNDEF); while (status.isSuccess() && status.getResult() == UNDEF) { status = search(handler); } if (!status.isSuccess()) { cancelUntil(0); - return LNGResult.canceled(status.getCancelCause()); + return LngResult.canceled(status.getCancelCause()); } final boolean result = status.getResult() == TRUE; if (config.proofGeneration && assumptions.isEmpty() && !result) { - pgProof.push(LNGIntVector.of(0)); + pgProof.push(LngIntVector.of(0)); } if (result) { - model = new LNGBooleanVector(vars.size()); - for (final LNGVariable v : vars) { + model = new LngBooleanVector(vars.size()); + for (final LngVariable v : vars) { model.push(v.assignment() == TRUE); } } else if (assumptionsConflict.isEmpty()) { @@ -527,9 +527,9 @@ public LNGResult internalSolve(final ComputationHandler handler) { } cancelUntil(0); if (!handler.shouldResume(SAT_CALL_FINISHED)) { - return LNGResult.canceled(SAT_CALL_FINISHED); + return LngResult.canceled(SAT_CALL_FINISHED); } - return LNGResult.of(result); + return LngResult.of(result); } /** @@ -541,9 +541,9 @@ public LNGResult internalSolve(final ComputationHandler handler) { * @param assumptions the assumptions as a given vector of literals * @return the result of the solve call */ - public LNGResult internalSolve(final ComputationHandler handler, final LNGIntVector assumptions) { - this.assumptions = new LNGIntVector(assumptions); - final LNGResult result = internalSolve(handler); + public LngResult internalSolve(final ComputationHandler handler, final LngIntVector assumptions) { + this.assumptions = new LngIntVector(assumptions); + final LngResult result = internalSolve(handler); this.assumptions.clear(); return result; } @@ -553,7 +553,7 @@ public LNGResult internalSolve(final ComputationHandler handler, final * none. * @return the current model of the solver */ - public LNGBooleanVector model() { + public LngBooleanVector model() { return model; } @@ -571,7 +571,7 @@ public boolean ok() { * Returns the conflict of the solver or an empty vector if there is none. * @return the conflict of the solver */ - public LNGIntVector assumptionsConflict() { + public LngIntVector assumptionsConflict() { return assumptionsConflict; } @@ -634,7 +634,7 @@ public void loadState(final SolverState solverState) { clauses.shrinkTo(newClausesSize); int newLearntsLength = 0; for (int i = 0; i < learnts.size(); i++) { - final LNGClause learnt = learnts.get(i); + final LngClause learnt = learnts.get(i); if (learnt.getLearntOnState() <= solverState.getId()) { learnts.set(newLearntsLength++, learnt); } else { @@ -723,8 +723,8 @@ protected int pickBranchLit() { while (selectionOrderIdx < selectionOrder.size()) { final int lit = selectionOrder.get(selectionOrderIdx++); final int var = var(lit); - final LNGVariable LNGVariable = vars.get(var); - if (LNGVariable.assignment() == UNDEF) { + final LngVariable lngVariable = vars.get(var); + if (lngVariable.assignment() == UNDEF) { return lit; } } @@ -761,10 +761,10 @@ protected void varBumpActivity(final int v) { * @param inc the increment value */ protected void varBumpActivity(final int v, final double inc) { - final LNGVariable var = vars.get(v); + final LngVariable var = vars.get(v); var.incrementActivity(inc); if (var.activity() > 1e100) { - for (final LNGVariable variable : vars) { + for (final LngVariable variable : vars) { variable.rescaleActivity(); } varInc *= 1e-100; @@ -780,7 +780,7 @@ protected void varBumpActivity(final int v, final double inc) { * @param c the clause * @return {@code true} if the given clause is locked */ - protected boolean locked(final LNGClause c) { + protected boolean locked(final LngClause c) { return value(c.get(0)) == TRUE && v(c.get(0)).reason() != null && v(c.get(0)).reason() == c; } @@ -795,10 +795,10 @@ protected void claDecayActivity() { * Bumps the activity of the given clause. * @param c the clause */ - protected void claBumpActivity(final LNGClause c) { + protected void claBumpActivity(final LngClause c) { c.incrementActivity(claInc); if (c.activity() > 1e20) { - for (final LNGClause clause : learnts) { + for (final LngClause clause : learnts) { clause.rescaleActivity(); } claInc *= 1e-20; @@ -811,9 +811,9 @@ protected void claBumpActivity(final LNGClause c) { * @param reason the reason clause of the assignment (conflict resolution) * or {@code null} if it was a decision */ - protected void uncheckedEnqueue(final int lit, final LNGClause reason) { + protected void uncheckedEnqueue(final int lit, final LngClause reason) { assert value(lit) == UNDEF; - final LNGVariable var = v(lit); + final LngVariable var = v(lit); var.assign(Tristate.fromBool(!sign(lit))); var.setReason(reason); var.setLevel(decisionLevel()); @@ -825,21 +825,21 @@ protected void uncheckedEnqueue(final int lit, final LNGClause reason) { * are initialized). * @param c the clause */ - protected void attachClause(final LNGClause c) { + protected void attachClause(final LngClause c) { if (c.isAtMost()) { for (int i = 0; i < c.atMostWatchers(); i++) { final int l = c.get(i); - watches.get(l).push(new LNGWatcher(c, LIT_UNDEF)); + watches.get(l).push(new LngWatcher(c, LIT_UNDEF)); } clausesLiterals += c.size(); } else { assert c.size() > 1; if (c.size() == 2) { - watchesBin.get(not(c.get(0))).push(new LNGWatcher(c, c.get(1))); - watchesBin.get(not(c.get(1))).push(new LNGWatcher(c, c.get(0))); + watchesBin.get(not(c.get(0))).push(new LngWatcher(c, c.get(1))); + watchesBin.get(not(c.get(1))).push(new LngWatcher(c, c.get(0))); } else { - watches.get(not(c.get(0))).push(new LNGWatcher(c, c.get(1))); - watches.get(not(c.get(1))).push(new LNGWatcher(c, c.get(0))); + watches.get(not(c.get(0))).push(new LngWatcher(c, c.get(1))); + watches.get(not(c.get(1))).push(new LngWatcher(c, c.get(0))); } if (c.learnt()) { learntsLiterals += c.size(); @@ -854,7 +854,7 @@ protected void attachClause(final LNGClause c) { * clause). * @param c the clause */ - protected void detachClause(final LNGClause c) { + protected void detachClause(final LngClause c) { simpleRemoveClause(c); if (c.learnt()) { learntsLiterals -= c.size(); @@ -867,10 +867,10 @@ protected void detachClause(final LNGClause c) { * Removes a given clause. * @param c the clause to remove */ - protected void removeClause(final LNGClause c) { + protected void removeClause(final LngClause c) { assert !c.isAtMost(); if (config.proofGeneration) { - final LNGIntVector vec = new LNGIntVector(c.size()); + final LngIntVector vec = new LngIntVector(c.size()); vec.push(-1); for (int i = 0; i < c.size(); i++) { vec.push((var(c.get(i)) + 1) * (-2 * (sign(c.get(i)) ? 1 : 0) + 1)); @@ -888,14 +888,14 @@ protected void removeClause(final LNGClause c) { * @return the conflicting clause if a conflict arose during unit * propagation or {@code null} if there was none */ - protected LNGClause propagate() { - LNGClause confl = null; + protected LngClause propagate() { + LngClause confl = null; while (qhead < trail.size()) { final int p = trail.get(qhead++); - final LNGVector ws = watches.get(p); + final LngVector ws = watches.get(p); int iInd = 0; int jInd = 0; - final LNGVector wbin = watchesBin.get(p); + final LngVector wbin = watchesBin.get(p); for (int k = 0; k < wbin.size(); k++) { final int imp = wbin.get(k).blocker(); if (value(imp) == FALSE) { @@ -906,14 +906,14 @@ protected LNGClause propagate() { } } while (iInd < ws.size()) { - final LNGWatcher i = ws.get(iInd); + final LngWatcher i = ws.get(iInd); final int blocker = i.blocker(); if (blocker != LIT_UNDEF && value(blocker) == TRUE) { ws.set(jInd++, i); iInd++; continue; } - final LNGClause c = i.clause(); + final LngClause c = i.clause(); if (c.isAtMost()) { final int newWatch = findNewWatchForAtMostClause(c, p); @@ -935,7 +935,7 @@ protected LNGClause propagate() { ws.set(jInd++, ws.get(iInd++)); } else { iInd++; - final LNGWatcher w = new LNGWatcher(c, LIT_UNDEF); + final LngWatcher w = new LngWatcher(c, LIT_UNDEF); watches.get(newWatch).push(w); } } else { @@ -947,7 +947,7 @@ protected LNGClause propagate() { assert c.get(1) == falseLit; iInd++; final int first = c.get(0); - final LNGWatcher w = new LNGWatcher(c, first); + final LngWatcher w = new LngWatcher(c, first); if (first != blocker && value(first) == TRUE) { ws.set(jInd++, w); continue; @@ -989,13 +989,13 @@ protected LNGClause propagate() { * @return {@code true} if a given literal is redundant in the current * conflict analysis */ - protected boolean litRedundant(final int p, final int abstractLevels, final LNGIntVector analyzeToClear) { - final LNGIntVector analyzeStack = new LNGIntVector(); + protected boolean litRedundant(final int p, final int abstractLevels, final LngIntVector analyzeToClear) { + final LngIntVector analyzeStack = new LngIntVector(); analyzeStack.push(p); final int top = analyzeToClear.size(); while (analyzeStack.size() > 0) { assert v(analyzeStack.back()).reason() != null; - final LNGClause c = v(analyzeStack.back()).reason(); + final LngClause c = v(analyzeStack.back()).reason(); analyzeStack.pop(); if (c.isAtMost()) { for (int i = 0; i < c.size(); i++) { @@ -1057,7 +1057,7 @@ protected void analyzeAssumptionConflict(final int p) { } seen.set(var(p), true); int x; - LNGVariable v; + LngVariable v; for (int i = trail.size() - 1; i >= trailLim.get(0); i--) { x = var(trail.get(i)); if (seen.get(x)) { @@ -1066,7 +1066,7 @@ protected void analyzeAssumptionConflict(final int p) { assert v.level() > 0; assumptionsConflict.push(not(trail.get(i))); } else { - final LNGClause c = v.reason(); + final LngClause c = v.reason(); if (!c.isAtMost()) { for (int j = c.size() == 2 ? 0 : 1; j < c.size(); j++) { if (v(c.get(j)).level() > 0) { @@ -1091,7 +1091,7 @@ protected void cancelUntil(final int level) { if (decisionLevel() > level) { for (int c = trail.size() - 1; c >= trailLim.get(level); c--) { final int x = var(trail.get(c)); - final LNGVariable v = vars.get(x); + final LngVariable v = vars.get(x); v.assign(UNDEF); v.setPolarity(!computingBackbone && sign(trail.get(c))); insertVarOrder(x); @@ -1108,19 +1108,19 @@ protected void cancelUntil(final int level) { * removed if it is not locked, i.e. is the reason of an assignment for a * variable. */ - protected void reduceDB() { + protected void reduceDb() { int i; int j; - learnts.manualSort(LNGClause.glucoseComparator); + learnts.manualSort(LngClause.glucoseComparator); if (learnts.get(learnts.size() / RATIO_REMOVE_CLAUSES).lbd() <= 3) { - nbClausesBeforeReduce += llConfig.specialIncReduceDB; + nbClausesBeforeReduce += llConfig.specialIncReduceDb; } if (learnts.back().lbd() <= 5) { - nbClausesBeforeReduce += llConfig.specialIncReduceDB; + nbClausesBeforeReduce += llConfig.specialIncReduceDb; } int limit = learnts.size() / 2; for (i = j = 0; i < learnts.size(); i++) { - final LNGClause c = learnts.get(i); + final LngClause c = learnts.get(i); if (c.lbd() > 2 && c.size() > 2 && c.canBeDel() && !locked(c) && i < limit) { removeClause(learnts.get(i)); } else { @@ -1138,7 +1138,7 @@ protected void reduceDB() { * Returns the original clauses for proof generation. * @return the original clauses for proof generation */ - public LNGVector pgOriginalClauses() { + public LngVector pgOriginalClauses() { return pgOriginalClauses; } @@ -1146,7 +1146,7 @@ public LNGVector pgOriginalClauses() { * Returns the proof clauses for proof generation. * @return the proof clauses for proof generation */ - public LNGVector pgProof() { + public LngVector pgProof() { return pgProof; } @@ -1157,17 +1157,17 @@ public LNGVector pgProof() { * {@code UNDEF} if the state is not known yet (restart) or the * handler canceled the computation */ - protected LNGResult search(final ComputationHandler handler) { + protected LngResult search(final ComputationHandler handler) { if (!ok) { - return LNGResult.of(FALSE); + return LngResult.of(FALSE); } - final LNGIntVector learntClause = new LNGIntVector(); + final LngIntVector learntClause = new LngIntVector(); selectionOrderIdx = 0; while (true) { - final LNGClause confl = propagate(); + final LngClause confl = propagate(); if (confl != null) { if (!handler.shouldResume(SAT_CONFLICT_DETECTED)) { - return LNGResult.canceled(SAT_CONFLICT_DETECTED); + return LngResult.canceled(SAT_CONFLICT_DETECTED); } conflicts++; conflictsRestarts++; @@ -1175,7 +1175,7 @@ protected LNGResult search(final ComputationHandler handler) { varDecay += 0.01; } if (decisionLevel() == 0) { - return LNGResult.of(FALSE); + return LngResult.of(FALSE); } trailQueue.push(trail.size()); if (conflictsRestarts > LB_BLOCKING_RESTART && lbdQueue.valid() && @@ -1184,15 +1184,15 @@ protected LNGResult search(final ComputationHandler handler) { } learntClause.clear(); analyze(confl, learntClause); - lbdQueue.push(analyzeLBD); - sumLBD += analyzeLBD; + lbdQueue.push(analyzeLbd); + sumLbd += analyzeLbd; cancelUntil(analyzeBtLevel); if (analyzeBtLevel < selectionOrder.size()) { selectionOrderIdx = analyzeBtLevel; } if (config.proofGeneration) { - final LNGIntVector vec = new LNGIntVector(learntClause.size() + 1); + final LngIntVector vec = new LngIntVector(learntClause.size() + 1); vec.push(1); for (int i = 0; i < learntClause.size(); i++) { vec.push((var(learntClause.get(i)) + 1) * (-2 * (sign(learntClause.get(i)) ? 1 : 0) + 1)); @@ -1204,8 +1204,8 @@ protected LNGResult search(final ComputationHandler handler) { uncheckedEnqueue(learntClause.get(0), null); unitClauses.push(learntClause.get(0)); } else { - final LNGClause cr = new LNGClause(learntClause, nextStateId); - cr.setLBD(analyzeLBD); + final LngClause cr = new LngClause(learntClause, nextStateId); + cr.setLbd(analyzeLbd); cr.setOneWatched(false); learnts.push(cr); attachClause(cr); @@ -1215,15 +1215,15 @@ protected LNGResult search(final ComputationHandler handler) { varDecayActivity(); claDecayActivity(); } else { - if (lbdQueue.valid() && (lbdQueue.avg() * llConfig.factorK) > (sumLBD / conflictsRestarts)) { + if (lbdQueue.valid() && (lbdQueue.avg() * llConfig.factorK) > (sumLbd / conflictsRestarts)) { lbdQueue.fastClear(); cancelUntil(0); - return LNGResult.of(UNDEF); + return LngResult.of(UNDEF); } if (conflicts >= (curRestart * nbClausesBeforeReduce) && learnts.size() > 0) { curRestart = (conflicts / nbClausesBeforeReduce) + 1; - reduceDB(); - nbClausesBeforeReduce += llConfig.incReduceDB; + reduceDb(); + nbClausesBeforeReduce += llConfig.incReduceDb; } int next = LIT_UNDEF; while (decisionLevel() < assumptions.size()) { @@ -1233,15 +1233,15 @@ protected LNGResult search(final ComputationHandler handler) { } else if (value(p) == FALSE) { if (config.proofGeneration) { final int drupLit = (var(p) + 1) * (-2 * (sign(p) ? 1 : 0) + 1); - pgOriginalClauses.push(new ProofInformation(LNGIntVector.of(drupLit), + pgOriginalClauses.push(new ProofInformation(LngIntVector.of(drupLit), assumptionPropositions.get(decisionLevel()))); } analyzeAssumptionConflict(not(p)); - return LNGResult.of(FALSE); + return LngResult.of(FALSE); } else { if (config.proofGeneration) { final int drupLit = (var(p) + 1) * (-2 * (sign(p) ? 1 : 0) + 1); - pgOriginalClauses.push(new ProofInformation(LNGIntVector.of(drupLit), + pgOriginalClauses.push(new ProofInformation(LngIntVector.of(drupLit), assumptionPropositions.get(decisionLevel()))); } next = p; @@ -1251,7 +1251,7 @@ protected LNGResult search(final ComputationHandler handler) { if (next == LIT_UNDEF) { next = pickBranchLit(); if (next == LIT_UNDEF) { - return LNGResult.of(TRUE); + return LngResult.of(TRUE); } } trailLim.push(trail.size()); @@ -1269,8 +1269,8 @@ protected LNGResult search(final ComputationHandler handler) { * @param outLearnt the vector where the new learnt 1-UIP clause is * stored */ - protected void analyze(final LNGClause conflictClause, final LNGIntVector outLearnt) { - LNGClause c = conflictClause; + protected void analyze(final LngClause conflictClause, final LngIntVector outLearnt) { + LngClause c = conflictClause; int pathC = 0; int p = LIT_UNDEF; outLearnt.push(-1); @@ -1308,12 +1308,12 @@ protected void analyze(final LNGClause conflictClause, final LNGIntVector outLea } } if (c.learnt() && c.lbd() > 2) { - final long nblevels = computeLBD(c); + final long nblevels = computeLbd(c); if (nblevels + 1 < c.lbd()) { - if (c.lbd() <= llConfig.lbLBDFrozenClause) { + if (c.lbd() <= llConfig.lbLbdFrozenClause) { c.setCanBeDel(false); } - c.setLBD(nblevels); + c.setLbd(nblevels); } } for (int j = (p == LIT_UNDEF) ? 0 : 1; j < c.size(); j++) { @@ -1348,11 +1348,11 @@ protected void analyze(final LNGClause conflictClause, final LNGIntVector outLea * the solver configuration. * @param outLearnt the learnt clause which should be minimized */ - protected void simplifyClause(final LNGIntVector outLearnt) { + protected void simplifyClause(final LngIntVector outLearnt) { int i; int j; - final LNGIntVector analyzeToClear = new LNGIntVector(outLearnt); - if (config.clauseMinimization == SATSolverConfig.ClauseMinimization.DEEP) { + final LngIntVector analyzeToClear = new LngIntVector(outLearnt); + if (config.clauseMinimization == SatSolverConfig.ClauseMinimization.DEEP) { int abstractLevel = 0; for (i = 1; i < outLearnt.size(); i++) { abstractLevel |= abstractLevel(var(outLearnt.get(i))); @@ -1363,9 +1363,9 @@ protected void simplifyClause(final LNGIntVector outLearnt) { outLearnt.set(j++, outLearnt.get(i)); } } - } else if (config.clauseMinimization == SATSolverConfig.ClauseMinimization.BASIC) { + } else if (config.clauseMinimization == SatSolverConfig.ClauseMinimization.BASIC) { for (i = j = 1; i < outLearnt.size(); i++) { - final LNGClause c = v(outLearnt.get(i)).reason(); + final LngClause c = v(outLearnt.get(i)).reason(); if (c == null) { outLearnt.set(j++, outLearnt.get(i)); } else { @@ -1397,9 +1397,9 @@ protected void simplifyClause(final LNGIntVector outLearnt) { outLearnt.set(1, p); analyzeBtLevel = v(p).level(); } - analyzeLBD = computeLBD(outLearnt); + analyzeLbd = computeLbd(outLearnt); for (int k = 0; k < lastDecisionLevel.size(); k++) { - if ((v(lastDecisionLevel.get(k)).reason()).lbd() < analyzeLBD) { + if ((v(lastDecisionLevel.get(k)).reason()).lbd() < analyzeLbd) { varBumpActivity(var(lastDecisionLevel.get(k))); } } @@ -1414,8 +1414,8 @@ protected void simplifyClause(final LNGIntVector outLearnt) { * @param c the clause * @return the LBD */ - protected long computeLBD(final LNGClause c) { - return computeLBD(c.getData()); + protected long computeLbd(final LngClause c) { + return computeLbd(c.getData()); } /** @@ -1423,7 +1423,7 @@ protected long computeLBD(final LNGClause c) { * @param lits the vector of literals * @return the LBD */ - protected long computeLBD(final LNGIntVector lits) { + protected long computeLbd(final LngIntVector lits) { long nbLevels = 0; myflag++; for (int i = 0; i < lits.size(); i++) { @@ -1446,16 +1446,16 @@ protected long computeLBD(final LNGIntVector lits) { * A special clause minimization by binary resolution for small clauses. * @param outLearnt the vector where the new learnt 1-UIP clause is stored */ - protected void minimisationWithBinaryResolution(final LNGIntVector outLearnt) { - final long lbd = computeLBD(outLearnt); + protected void minimisationWithBinaryResolution(final LngIntVector outLearnt) { + final long lbd = computeLbd(outLearnt); int p = not(outLearnt.get(0)); - if (lbd <= llConfig.lbLBDMinimizingClause) { + if (lbd <= llConfig.lbLbdMinimizingClause) { myflag++; for (int i = 1; i < outLearnt.size(); i++) { permDiff.set(var(outLearnt.get(i)), myflag); } int nb = 0; - for (final LNGWatcher wbin : watchesBin.get(p)) { + for (final LngWatcher wbin : watchesBin.get(p)) { final int imp = wbin.blocker(); if (permDiff.get(var(imp)) == myflag && value(imp) == TRUE) { nb++; @@ -1483,7 +1483,7 @@ protected void minimisationWithBinaryResolution(final LNGIntVector outLearnt) { */ protected void completeBacktrack() { for (int v = 0; v < vars.size(); v++) { - final LNGVariable var = vars.get(v); + final LngVariable var = vars.get(v); var.assign(UNDEF); var.setReason(null); if (!orderHeap.inHeap(v) && var.decision()) { @@ -1500,17 +1500,17 @@ protected void completeBacktrack() { * state. * @param c the clause to remove */ - protected void simpleRemoveClause(final LNGClause c) { + protected void simpleRemoveClause(final LngClause c) { if (c.isAtMost()) { for (int i = 0; i < c.atMostWatchers(); i++) { - watches.get(c.get(i)).remove(new LNGWatcher(c, c.get(i))); + watches.get(c.get(i)).remove(new LngWatcher(c, c.get(i))); } } else if (c.size() == 2) { - watchesBin.get(not(c.get(0))).remove(new LNGWatcher(c, c.get(1))); - watchesBin.get(not(c.get(1))).remove(new LNGWatcher(c, c.get(0))); + watchesBin.get(not(c.get(0))).remove(new LngWatcher(c, c.get(1))); + watchesBin.get(not(c.get(1))).remove(new LngWatcher(c, c.get(0))); } else { - watches.get(not(c.get(0))).remove(new LNGWatcher(c, c.get(1))); - watches.get(not(c.get(1))).remove(new LNGWatcher(c, c.get(0))); + watches.get(not(c.get(0))).remove(new LngWatcher(c, c.get(1))); + watches.get(not(c.get(1))).remove(new LngWatcher(c, c.get(0))); } } @@ -1519,7 +1519,7 @@ protected void simpleRemoveClause(final LNGClause c) { * @param ps the literals of the constraint * @param rhs the right-hand side of the constraint */ - public void addAtMost(final LNGIntVector ps, final int rhs) { + public void addAtMost(final LngIntVector ps, final int rhs) { int k = rhs; assert decisionLevel() == 0; if (!ok) { @@ -1557,13 +1557,13 @@ public void addAtMost(final LNGIntVector ps, final int rhs) { ok = propagate() == null; return; } - final LNGClause cr = new LNGClause(ps, -1, true); + final LngClause cr = new LngClause(ps, -1, true); cr.setAtMostWatchers(ps.size() - k + 1); clauses.push(cr); attachClause(cr); } - protected int findNewWatchForAtMostClause(final LNGClause c, final int p) { + protected int findNewWatchForAtMostClause(final LngClause c, final int p) { assert c.isAtMost(); int numFalse = 0; int numTrue = 0; @@ -1605,8 +1605,8 @@ protected int findNewWatchForAtMostClause(final LNGClause c, final int p) { * @param relevantIndices the indices of the relevant variables * @return the external model */ - public List convertInternalModel(final LNGBooleanVector internalModel, - final LNGIntVector relevantIndices) { + public List convertInternalModel(final LngBooleanVector internalModel, + final LngIntVector relevantIndices) { final List literals = new ArrayList<>(internalModel.size()); for (int i = 0; i < relevantIndices.size(); i++) { final int index = relevantIndices.get(i); @@ -1618,9 +1618,9 @@ public List convertInternalModel(final LNGBooleanVector internalModel, } /** - * Returns {@code true} if a {@link SATCall} is currently using this solver, + * Returns {@code true} if a {@link SatCall} is currently using this solver, * otherwise {@code false}. - * @return {@code true} if a {@link SATCall} is currently using this solver, + * @return {@code true} if a {@link SatCall} is currently using this solver, * otherwise {@code false} */ public boolean inSatCall() { @@ -1628,7 +1628,7 @@ public boolean inSatCall() { } /** - * Checks if this solver is currently used in a {@link SATCall} and throws + * Checks if this solver is currently used in a {@link SatCall} and throws * an {@link IllegalStateException} in this case. Otherwise, nothing * happens. * @throws IllegalStateException if this solver is currently used in a SAT @@ -1669,7 +1669,7 @@ public String toString() { * Class containing the information required for generating a proof. */ public static class ProofInformation { - protected final LNGIntVector clause; + protected final LngIntVector clause; protected final Proposition proposition; /** @@ -1677,7 +1677,7 @@ public static class ProofInformation { * @param clause the clause * @param proposition the proposition */ - public ProofInformation(final LNGIntVector clause, final Proposition proposition) { + public ProofInformation(final LngIntVector clause, final Proposition proposition) { this.clause = clause; this.proposition = proposition; } @@ -1686,7 +1686,7 @@ public ProofInformation(final LNGIntVector clause, final Proposition proposition * Returns the clause. * @return the clause */ - public LNGIntVector getClause() { + public LngIntVector getClause() { return clause; } @@ -1711,8 +1711,8 @@ public String toString() { * Returns the unit propagated literals on level zero. * @return unit propagated literal on level zero */ - public LNGIntVector upZeroLiterals() { - final LNGIntVector upZeroLiterals = new LNGIntVector(); + public LngIntVector upZeroLiterals() { + final LngIntVector upZeroLiterals = new LngIntVector(); for (int i = 0; i < trail.size(); ++i) { final int lit = trail.get(i); if (v(lit).level() > 0) { @@ -1733,7 +1733,7 @@ public LNGIntVector upZeroLiterals() { * @param type backbone type * @return the backbone projected to the relevant variables */ - public LNGResult computeBackbone(final Collection variables, final BackboneType type) { + public LngResult computeBackbone(final Collection variables, final BackboneType type) { return computeBackbone(variables, type, NopHandler.get()); } @@ -1746,30 +1746,30 @@ public LNGResult computeBackbone(final Collection variables, * @return the backbone projected to the relevant variables or {@code null} * if the computation was canceled by the handler */ - public LNGResult computeBackbone(final Collection variables, final BackboneType type, + public LngResult computeBackbone(final Collection variables, final BackboneType type, final ComputationHandler handler) { if (!handler.shouldResume(BACKBONE_COMPUTATION_STARTED)) { - return LNGResult.canceled(BACKBONE_COMPUTATION_STARTED); + return LngResult.canceled(BACKBONE_COMPUTATION_STARTED); } final SolverState stateBeforeBackbone = saveState(); - final LNGResult solveResult = internalSolve(handler); - final LNGResult result; + final LngResult solveResult = internalSolve(handler); + final LngResult result; if (!solveResult.isSuccess()) { - result = LNGResult.canceled(solveResult.getCancelCause()); + result = LngResult.canceled(solveResult.getCancelCause()); } else if (solveResult.getResult()) { computingBackbone = true; final List relevantVarIndices = getRelevantVarIndices(variables); initBackboneDS(relevantVarIndices); - final LNGEvent backboneEvent = computeBackbone(relevantVarIndices, type, handler); + final LngEvent backboneEvent = computeBackbone(relevantVarIndices, type, handler); if (backboneEvent != null) { - result = LNGResult.canceled(backboneEvent); + result = LngResult.canceled(backboneEvent); } else { final Backbone backbone = buildBackbone(variables, type); - result = LNGResult.of(backbone); + result = LngResult.of(backbone); } computingBackbone = false; } else { - result = LNGResult.of(Backbone.unsatBackbone()); + result = LngResult.of(Backbone.unsatBackbone()); } loadState(stateBeforeBackbone); return result; @@ -1801,7 +1801,7 @@ protected List getRelevantVarIndices(final Collection variabl */ protected void initBackboneDS(final List variables) { backboneCandidates = new Stack<>(); - backboneAssumptions = new LNGIntVector(variables.size()); + backboneAssumptions = new LngIntVector(variables.size()); backboneMap = new HashMap<>(); for (final Integer var : variables) { backboneMap.put(var, UNDEF); @@ -1814,11 +1814,11 @@ protected void initBackboneDS(final List variables) { * @param type the type of the backbone * @param handler the handler */ - protected LNGEvent computeBackbone(final List variables, final BackboneType type, final ComputationHandler handler) { + protected LngEvent computeBackbone(final List variables, final BackboneType type, final ComputationHandler handler) { createInitialCandidates(variables, type); while (!backboneCandidates.isEmpty()) { final int lit = backboneCandidates.pop(); - final LNGResult satResult = solveWithLit(lit, handler); + final LngResult satResult = solveWithLit(lit, handler); if (!satResult.isSuccess()) { return satResult.getCancelCause(); } else if (satResult.getResult()) { @@ -1837,7 +1837,7 @@ protected LNGEvent computeBackbone(final List variables, final Backbone */ protected void createInitialCandidates(final List variables, final BackboneType type) { for (final Integer var : variables) { - if (isUPZeroLit(var)) { + if (isUpZeroLit(var)) { final int backboneLit = mkLit(var, !model.get(var)); addBackboneLiteral(backboneLit); } else { @@ -1859,7 +1859,7 @@ protected void createInitialCandidates(final List variables, final Back protected void refineUpperBound() { for (final Integer lit : new ArrayList<>(backboneCandidates)) { final int var = var(lit); - if (isUPZeroLit(var)) { + if (isUpZeroLit(var)) { backboneCandidates.remove(lit); addBackboneLiteral(lit); } else if (model.get(var) == sign(lit)) { @@ -1877,9 +1877,9 @@ protected void refineUpperBound() { * @param handler the handler * @return {@code true} if satisfiable, otherwise {@code false} */ - protected LNGResult solveWithLit(final int lit, final ComputationHandler handler) { + protected LngResult solveWithLit(final int lit, final ComputationHandler handler) { backboneAssumptions.push(not(lit)); - final LNGResult result = internalSolve(handler, backboneAssumptions); + final LngResult result = internalSolve(handler, backboneAssumptions); backboneAssumptions.pop(); return result; } @@ -1935,7 +1935,7 @@ protected Backbone buildBackbone(final Collection variables, final Bac * @return {@code true} if the variable is a unit propagated literal on * level 0, otherwise {@code false} */ - protected boolean isUPZeroLit(final int var) { + protected boolean isUpZeroLit(final int var) { return vars.get(var).level() == 0; } @@ -1945,7 +1945,7 @@ protected boolean isUPZeroLit(final int var) { * @param clause clause containing the literal * @return {@code true} if the literal is unit, {@code false} otherwise */ - protected boolean isUnit(final int lit, final LNGClause clause) { + protected boolean isUnit(final int lit, final LngClause clause) { if (!clause.isAtMost()) { for (int i = 0; i < clause.size(); ++i) { final int clauseLit = clause.get(i); @@ -1979,13 +1979,13 @@ protected boolean isRotatable(final int lit) { if (v(lit).reason() != null) { return false; } - for (final LNGWatcher watcher : watchesBin.get(not(lit))) { + for (final LngWatcher watcher : watchesBin.get(not(lit))) { if (isUnit(lit, watcher.clause())) { return false; } } // A rotatable literal MUST NOT be unit - for (final LNGWatcher watcher : watches.get(not(lit))) { + for (final LngWatcher watcher : watches.get(not(lit))) { if (isUnit(lit, watcher.clause())) { return false; } @@ -2019,7 +2019,7 @@ protected boolean isBothType(final BackboneType type) { * Returns the clauses loaded on the solver. * @return the clauses loaded on the solver */ - public LNGVector getClauses() { + public LngVector getClauses() { return clauses; } @@ -2027,7 +2027,7 @@ public LNGVector getClauses() { * Returns the variables known by the solver. * @return the variables */ - public LNGVector getVariables() { + public LngVector getVariables() { return vars; } @@ -2052,7 +2052,7 @@ public void setSelectionOrder(final List selectionOrder) { } } - public SATSolverConfig getConfig() { + public SatSolverConfig getConfig() { return config; } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATCall.java b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatCall.java similarity index 84% rename from core/src/main/java/com/booleworks/logicng/solvers/sat/SATCall.java rename to core/src/main/java/com/booleworks/logicng/solvers/sat/SatCall.java index 250b2e21..0243a5e1 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATCall.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatCall.java @@ -1,18 +1,18 @@ package com.booleworks.logicng.solvers.sat; -import static com.booleworks.logicng.solvers.sat.LNGCoreSolver.generateClauseVector; +import static com.booleworks.logicng.solvers.sat.LngCoreSolver.generateClauseVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; import com.booleworks.logicng.datastructures.Model; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.UnsatCoreFunction; @@ -21,7 +21,7 @@ import java.util.List; /** - * Encapsulates the data used for a single SAT call to a {@link SATSolver}. + * Encapsulates the data used for a single SAT call to a {@link SatSolver}. *

    * A SAT Solver is stateful and features like assumptions, selection order, * handler etc. require manual housekeeping. This class aims to facilitate the @@ -31,10 +31,10 @@ * must always {@link #close()} an existing SAT call before creating a new * one. *

    - * A SAT call is generated by acquiring a {@link SATCallBuilder} from a solver - * using {@link SATSolver#satCall()} and then (after potentially adding + * A SAT call is generated by acquiring a {@link SatCallBuilder} from a solver + * using {@link SatSolver#satCall()} and then (after potentially adding * assumptions or a handler) creating the SAT call via - * {@link SATCallBuilder#solve()}. + * {@link SatCallBuilder#solve()}. *

    * This class basically provides three methods: *

      @@ -42,27 +42,27 @@ * satisfiable or not *
    • {@link #model} returns a model of the solver if it is satisfiable
    • *
    • {@link #unsatCore()} returns an UNSAT core if the formula in - * unsatisfiable (and {@link SATSolverConfig#proofGeneration proof generation} + * unsatisfiable (and {@link SatSolverConfig#proofGeneration proof generation} * is enabled)
    • *
    */ -public class SATCall implements AutoCloseable { +public class SatCall implements AutoCloseable { - private final SATSolver solverWrapper; - private final LNGCoreSolver solver; + private final SatSolver solverWrapper; + private final LngCoreSolver solver; private SolverState initialState; private int pgOriginalClausesLength = -1; - private LNGResult satResult; + private LngResult satResult; - SATCall(final SATSolver solverWrapper, final ComputationHandler handler, + SatCall(final SatSolver solverWrapper, final ComputationHandler handler, final List additionalPropositions, final List selectionOrder) { this.solverWrapper = solverWrapper; solver = solverWrapper.getUnderlyingSolver(); initAndSolve(handler, additionalPropositions, selectionOrder); } - public static SATCallBuilder builder(final SATSolver solver) { - return new SATCallBuilder(solver); + public static SatCallBuilder builder(final SatSolver solver) { + return new SatCallBuilder(solver); } private void initAndSolve(final ComputationHandler handler, final List additionalPropositions, @@ -74,7 +74,7 @@ private void initAndSolve(final ComputationHandler handler, final List(additionals.propositionsForLiterals); + solver.assumptionPropositions = new LngVector<>(additionals.propositionsForLiterals); } if (!additionals.additionalFormulas.isEmpty()) { initialState = solver.saveState(); @@ -106,7 +106,7 @@ private Additionals splitPropsIntoLiteralsAndFormulas(final List getSatResult() { + public LngResult getSatResult() { return satResult; } @@ -128,7 +128,7 @@ public Model model(final Collection variables) { return null; } else { final List unknowns = new ArrayList<>(); - final LNGIntVector relevantIndices = new LNGIntVector(variables.size()); + final LngIntVector relevantIndices = new LngIntVector(variables.size()); for (final Variable var : variables) { final int element = solver.idxForName(var.getName()); if (element != -1) { @@ -146,7 +146,7 @@ public Model model(final Collection variables) { /** * Returns an unsat core of the current problem. *

    - * {@link SATSolverConfig#isProofGeneration() Proof generation} must be + * {@link SatSolverConfig#isProofGeneration() Proof generation} must be * enabled in order to use this method, otherwise an * {@link IllegalStateException} is thrown. *

    @@ -154,7 +154,7 @@ public Model model(final Collection variables) { *

    * @return the unsat core or {@code null} if the SAT call was satisfiable */ - public UNSATCore unsatCore() { + public UnsatCore unsatCore() { if (!solver.getConfig().isProofGeneration()) { throw new IllegalStateException("Cannot generate an unsat core if proof generation is not turned on"); } @@ -166,8 +166,8 @@ public UNSATCore unsatCore() { @Override public void close() { - solver.assumptions = new LNGIntVector(); - solver.assumptionPropositions = new LNGVector<>(); + solver.assumptions = new LngIntVector(); + solver.assumptionPropositions = new LngVector<>(); if (solver.config.proofGeneration) { solver.pgOriginalClauses.shrinkTo(pgOriginalClausesLength); } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATCallBuilder.java b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatCallBuilder.java similarity index 79% rename from core/src/main/java/com/booleworks/logicng/solvers/sat/SATCallBuilder.java rename to core/src/main/java/com/booleworks/logicng/solvers/sat/SatCallBuilder.java index 55e2850c..f21366bc 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATCallBuilder.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatCallBuilder.java @@ -1,16 +1,16 @@ package com.booleworks.logicng.solvers.sat; import com.booleworks.logicng.datastructures.Model; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.util.ArrayList; import java.util.Arrays; @@ -18,17 +18,17 @@ import java.util.List; /** - * Builder for a {@link SATCall}. New instances should be created with - * {@link SATSolver#satCall()}. - * @see SATSolver#satCall() + * Builder for a {@link SatCall}. New instances should be created with + * {@link SatSolver#satCall()}. + * @see SatSolver#satCall() */ -public class SATCallBuilder { - private final SATSolver solver; +public class SatCallBuilder { + private final SatSolver solver; private ComputationHandler handler; private final List additionalPropositions; private List selectionOrder; - SATCallBuilder(final SATSolver solver) { + SatCallBuilder(final SatSolver solver) { this.solver = solver; handler = NopHandler.get(); additionalPropositions = new ArrayList<>(); @@ -39,8 +39,8 @@ public class SATCallBuilder { * builder and returns a respective SAT call. * @return the SAT call */ - public SATCall solve() { - return new SATCall(solver, handler, additionalPropositions, selectionOrder); + public SatCall solve() { + return new SatCall(solver, handler, additionalPropositions, selectionOrder); } /** @@ -48,7 +48,7 @@ public SATCall solve() { * @param handler the handler * @return this builder */ - public SATCallBuilder handler(final ComputationHandler handler) { + public SatCallBuilder handler(final ComputationHandler handler) { this.handler = handler; return this; } @@ -61,7 +61,7 @@ public SATCallBuilder handler(final ComputationHandler handler) { */ // TODO could be removed (when we're sure about the API) @Deprecated - public SATCallBuilder assumptions(final Collection assumptions) { + public SatCallBuilder assumptions(final Collection assumptions) { return addFormulas(assumptions); } @@ -73,7 +73,7 @@ public SATCallBuilder assumptions(final Collection assumption */ // TODO could be removed (when we're sure about the API) @Deprecated - public SATCallBuilder assumptions(final Literal... assumptions) { + public SatCallBuilder assumptions(final Literal... assumptions) { return addFormulas(assumptions); } @@ -83,7 +83,7 @@ public SATCallBuilder assumptions(final Literal... assumptions) { * @param formulas the additional formulas * @return this builder */ - public SATCallBuilder addFormulas(final Collection formulas) { + public SatCallBuilder addFormulas(final Collection formulas) { for (final Formula formula : formulas) { additionalPropositions.add(new StandardProposition(formula)); } @@ -97,7 +97,7 @@ public SATCallBuilder addFormulas(final Collection formulas) * @return this builder */ // TODO do we need the varargs variants? - public SATCallBuilder addFormulas(final Formula... formulas) { + public SatCallBuilder addFormulas(final Formula... formulas) { return addFormulas(Arrays.asList(formulas)); } @@ -107,7 +107,7 @@ public SATCallBuilder addFormulas(final Formula... formulas) { * @param propositions the additional propositions * @return this builder */ - public SATCallBuilder addPropositions(final Collection propositions) { + public SatCallBuilder addPropositions(final Collection propositions) { additionalPropositions.addAll(propositions); return this; } @@ -118,7 +118,7 @@ public SATCallBuilder addPropositions(final Collection pr * @param propositions the additional propositions * @return this builder */ - public SATCallBuilder addPropositions(final Proposition... propositions) { + public SatCallBuilder addPropositions(final Proposition... propositions) { additionalPropositions.addAll(List.of(propositions)); return this; } @@ -128,7 +128,7 @@ public SATCallBuilder addPropositions(final Proposition... propositions) { * @param selectionOrder the selection order * @return this builder */ - public SATCallBuilder selectionOrder(final List selectionOrder) { + public SatCallBuilder selectionOrder(final List selectionOrder) { this.selectionOrder = selectionOrder; return this; } @@ -140,8 +140,8 @@ public SATCallBuilder selectionOrder(final List selectionOrde * builder. * @return the satisfiability result */ - public LNGResult sat() { - try (final SATCall call = solve()) { + public LngResult sat() { + try (final SatCall call = solve()) { return call.getSatResult(); } } @@ -157,7 +157,7 @@ public LNGResult sat() { * @throws IllegalArgumentException if the given variables are {@code null} */ public Model model(final Collection variables) { - try (final SATCall call = solve()) { + try (final SatCall call = solve()) { return call.model(variables); } } @@ -165,7 +165,7 @@ public Model model(final Collection variables) { /** * Directly computes an unsat core of the current problem. *

    - * {@link SATSolverConfig#isProofGeneration() Proof generation} must be + * {@link SatSolverConfig#isProofGeneration() Proof generation} must be * enabled in order to use this method, otherwise an * {@link IllegalStateException} is thrown. *

    @@ -173,8 +173,8 @@ public Model model(final Collection variables) { *

    * @return the unsat core or {@code null} if the SAT call was satisfiable */ - public UNSATCore unsatCore() { - try (final SATCall call = solve()) { + public UnsatCore unsatCore() { + try (final SatCall call = solve()) { return call.unsatCore(); } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverConfig.java b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverConfig.java similarity index 91% rename from core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverConfig.java rename to core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverConfig.java index 8aeb1a72..14927651 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverConfig.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverConfig.java @@ -16,21 +16,21 @@ * @version 2.0.0 * @since 1.0 */ -public final class SATSolverConfig extends Configuration { +public final class SatSolverConfig extends Configuration { final boolean proofGeneration; final boolean useAtMostClauses; - final CNFMethod cnfMethod; + final CnfMethod cnfMethod; final ClauseMinimization clauseMinimization; final boolean initialPhase; - final SATSolverLowLevelConfig lowLevelConfig; + final SatSolverLowLevelConfig lowLevelConfig; /** * Constructs a new SAT solver configuration from a given builder. * @param builder the builder */ - private SATSolverConfig(final Builder builder) { + private SatSolverConfig(final Builder builder) { super(ConfigurationType.SAT); proofGeneration = builder.proofGeneration; useAtMostClauses = !builder.proofGeneration && builder.useAtMostClauses; @@ -54,7 +54,7 @@ public static Builder builder() { * @param config the configuration to copy * @return the builder */ - public static Builder copy(final SATSolverConfig config) { + public static Builder copy(final SatSolverConfig config) { return new Builder() .proofGeneration(config.proofGeneration) .useAtMostClauses(config.useAtMostClauses) @@ -86,7 +86,7 @@ public boolean isUseAtMostClauses() { * Returns the CNF method which should be used. * @return the CNF method */ - public CNFMethod getCnfMethod() { + public CnfMethod getCnfMethod() { return cnfMethod; } @@ -110,7 +110,7 @@ public boolean getInitialPhase() { * Returns the low level configuration of the solver. * @return the low level configuration of the solver */ - public SATSolverLowLevelConfig getLowLevelConfig() { + public SatSolverLowLevelConfig getLowLevelConfig() { return lowLevelConfig; } @@ -122,7 +122,7 @@ public boolean equals(final Object object) { if (object == null || getClass() != object.getClass()) { return false; } - final SATSolverConfig that = (SATSolverConfig) object; + final SatSolverConfig that = (SatSolverConfig) object; return proofGeneration == that.proofGeneration && useAtMostClauses == that.useAtMostClauses && initialPhase == that.initialPhase && @@ -138,7 +138,7 @@ public int hashCode() { @Override public String toString() { - return "SATSolverConfig{" + + return "SatSolverConfig{" + "proofGeneration=" + proofGeneration + ", useAtMostClauses=" + useAtMostClauses + ", cnfMethod=" + cnfMethod + @@ -184,7 +184,7 @@ public enum ClauseMinimization { * and the heap will not be polluted with intermediate formulas. * */ - public enum CNFMethod { + public enum CnfMethod { FACTORY_CNF, PG_ON_SOLVER, FULL_PG_ON_SOLVER @@ -198,10 +198,10 @@ public enum CNFMethod { public static class Builder { private boolean proofGeneration = false; private boolean useAtMostClauses = false; - private CNFMethod cnfMethod = CNFMethod.PG_ON_SOLVER; + private CnfMethod cnfMethod = CnfMethod.PG_ON_SOLVER; private boolean initialPhase = false; private ClauseMinimization clauseMinimization = ClauseMinimization.DEEP; - private SATSolverLowLevelConfig lowLevelConfig = SATSolverLowLevelConfig.builder().build(); + private SatSolverLowLevelConfig lowLevelConfig = SatSolverLowLevelConfig.builder().build(); private Builder() { // Initialize only via factory @@ -242,7 +242,7 @@ public Builder useAtMostClauses(final boolean useAtMostClauses) { * @param cnfMethod the CNF method * @return the builder */ - public Builder cnfMethod(final CNFMethod cnfMethod) { + public Builder cnfMethod(final CnfMethod cnfMethod) { this.cnfMethod = cnfMethod; return this; } @@ -274,7 +274,7 @@ public Builder initialPhase(final boolean initialPhase) { * @param lowLevelConfig the low level configuration * @return the builder */ - public Builder lowLevelConfig(final SATSolverLowLevelConfig lowLevelConfig) { + public Builder lowLevelConfig(final SatSolverLowLevelConfig lowLevelConfig) { this.lowLevelConfig = lowLevelConfig; return this; } @@ -283,8 +283,8 @@ public Builder lowLevelConfig(final SATSolverLowLevelConfig lowLevelConfig) { * Builds the SAT solver configuration. * @return the configuration */ - public SATSolverConfig build() { - return new SATSolverConfig(this); + public SatSolverConfig build() { + return new SatSolverConfig(this); } } } diff --git a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverLowLevelConfig.java b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverLowLevelConfig.java similarity index 76% rename from core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverLowLevelConfig.java rename to core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverLowLevelConfig.java index 18b059a6..30a41571 100644 --- a/core/src/main/java/com/booleworks/logicng/solvers/sat/SATSolverLowLevelConfig.java +++ b/core/src/main/java/com/booleworks/logicng/solvers/sat/SatSolverLowLevelConfig.java @@ -6,7 +6,7 @@ import java.util.Objects; -public final class SATSolverLowLevelConfig { +public final class SatSolverLowLevelConfig { // MiniSat-related configuration final double varDecay; final double varInc; @@ -15,35 +15,35 @@ public final class SATSolverLowLevelConfig { final double clauseDecay; // Glucose-related configuration - final int lbLBDMinimizingClause; - final int lbLBDFrozenClause; + final int lbLbdMinimizingClause; + final int lbLbdFrozenClause; final int lbSizeMinimizingClause; - final int firstReduceDB; - final int specialIncReduceDB; - final int incReduceDB; + final int firstReduceDb; + final int specialIncReduceDb; + final int incReduceDb; final double factorK; final double factorR; - final int sizeLBDQueue; + final int sizeLbdQueue; final int sizeTrailQueue; final boolean reduceOnSize; final int reduceOnSizeSize; final double maxVarDecay; - private SATSolverLowLevelConfig(final Builder builder) { + private SatSolverLowLevelConfig(final Builder builder) { varDecay = builder.varDecay; varInc = builder.varInc; restartFirst = builder.restartFirst; restartInc = builder.restartInc; clauseDecay = builder.clauseDecay; - lbLBDMinimizingClause = builder.lbLBDMinimizingClause; - lbLBDFrozenClause = builder.lbLBDFrozenClause; + lbLbdMinimizingClause = builder.lbLbdMinimizingClause; + lbLbdFrozenClause = builder.lbLbdFrozenClause; lbSizeMinimizingClause = builder.lbSizeMinimizingClause; - firstReduceDB = builder.firstReduceDB; - specialIncReduceDB = builder.specialIncReduceDB; - incReduceDB = builder.incReduceDB; + firstReduceDb = builder.firstReduceDb; + specialIncReduceDb = builder.specialIncReduceDb; + incReduceDb = builder.incReduceDb; factorK = builder.factorK; factorR = builder.factorR; - sizeLBDQueue = builder.sizeLBDQueue; + sizeLbdQueue = builder.sizeLbdQueue; sizeTrailQueue = builder.sizeTrailQueue; reduceOnSize = builder.reduceOnSize; reduceOnSizeSize = builder.reduceOnSizeSize; @@ -74,28 +74,28 @@ public double getClauseDecay() { return clauseDecay; } - public int getLbLBDMinimizingClause() { - return lbLBDMinimizingClause; + public int getLbLbdMinimizingClause() { + return lbLbdMinimizingClause; } - public int getLbLBDFrozenClause() { - return lbLBDFrozenClause; + public int getLbLbdFrozenClause() { + return lbLbdFrozenClause; } public int getLbSizeMinimizingClause() { return lbSizeMinimizingClause; } - public int getFirstReduceDB() { - return firstReduceDB; + public int getFirstReduceDb() { + return firstReduceDb; } - public int getSpecialIncReduceDB() { - return specialIncReduceDB; + public int getSpecialIncReduceDb() { + return specialIncReduceDb; } - public int getIncReduceDB() { - return incReduceDB; + public int getIncReduceDb() { + return incReduceDb; } public double getFactorK() { @@ -106,8 +106,8 @@ public double getFactorR() { return factorR; } - public int getSizeLBDQueue() { - return sizeLBDQueue; + public int getSizeLbdQueue() { + return sizeLbdQueue; } public int getSizeTrailQueue() { @@ -128,21 +128,21 @@ public double getMaxVarDecay() { @Override public String toString() { - final StringBuilder sb = new StringBuilder("SATSolverLowLevelConfig{").append(System.lineSeparator()); + final StringBuilder sb = new StringBuilder("SatSolverLowLevelConfig{").append(System.lineSeparator()); sb.append("varDecay=").append(varDecay).append(System.lineSeparator()); sb.append("varInc=").append(varInc).append(System.lineSeparator()); sb.append("restartFirst=").append(restartFirst).append(System.lineSeparator()); sb.append("restartInc=").append(restartInc).append(System.lineSeparator()); sb.append("clauseDecay=").append(clauseDecay).append(System.lineSeparator()); - sb.append("lbLBDMinimizingClause=").append(lbLBDMinimizingClause).append(System.lineSeparator()); - sb.append("lbLBDFrozenClause=").append(lbLBDFrozenClause).append(System.lineSeparator()); + sb.append("lbLbdMinimizingClause=").append(lbLbdMinimizingClause).append(System.lineSeparator()); + sb.append("lbLbdFrozenClause=").append(lbLbdFrozenClause).append(System.lineSeparator()); sb.append("lbSizeMinimizingClause=").append(lbSizeMinimizingClause).append(System.lineSeparator()); - sb.append("firstReduceDB=").append(firstReduceDB).append(System.lineSeparator()); - sb.append("specialIncReduceDB=").append(specialIncReduceDB).append(System.lineSeparator()); - sb.append("incReduceDB=").append(incReduceDB).append(System.lineSeparator()); + sb.append("firstReduceDb=").append(firstReduceDb).append(System.lineSeparator()); + sb.append("specialIncReduceDb=").append(specialIncReduceDb).append(System.lineSeparator()); + sb.append("incReduceDb=").append(incReduceDb).append(System.lineSeparator()); sb.append("factorK=").append(factorK).append(System.lineSeparator()); sb.append("factorR=").append(factorR).append(System.lineSeparator()); - sb.append("sizeLBDQueue=").append(sizeLBDQueue).append(System.lineSeparator()); + sb.append("sizeLbdQueue=").append(sizeLbdQueue).append(System.lineSeparator()); sb.append("sizeTrailQueue=").append(sizeTrailQueue).append(System.lineSeparator()); sb.append("reduceOnSize=").append(reduceOnSize).append(System.lineSeparator()); sb.append("reduceOnSizeSize=").append(reduceOnSizeSize).append(System.lineSeparator()); @@ -159,21 +159,21 @@ public boolean equals(final Object object) { if (object == null || getClass() != object.getClass()) { return false; } - final SATSolverLowLevelConfig that = (SATSolverLowLevelConfig) object; + final SatSolverLowLevelConfig that = (SatSolverLowLevelConfig) object; return Double.compare(varDecay, that.varDecay) == 0 && Double.compare(varInc, that.varInc) == 0 && restartFirst == that.restartFirst && Double.compare(restartInc, that.restartInc) == 0 && Double.compare(clauseDecay, that.clauseDecay) == 0 && - lbLBDMinimizingClause == that.lbLBDMinimizingClause && - lbLBDFrozenClause == that.lbLBDFrozenClause && + lbLbdMinimizingClause == that.lbLbdMinimizingClause && + lbLbdFrozenClause == that.lbLbdFrozenClause && lbSizeMinimizingClause == that.lbSizeMinimizingClause && - firstReduceDB == that.firstReduceDB && - specialIncReduceDB == that.specialIncReduceDB && - incReduceDB == that.incReduceDB && + firstReduceDb == that.firstReduceDb && + specialIncReduceDb == that.specialIncReduceDb && + incReduceDb == that.incReduceDb && Double.compare(factorK, that.factorK) == 0 && Double.compare(factorR, that.factorR) == 0 && - sizeLBDQueue == that.sizeLBDQueue && + sizeLbdQueue == that.sizeLbdQueue && sizeTrailQueue == that.sizeTrailQueue && reduceOnSize == that.reduceOnSize && reduceOnSizeSize == that.reduceOnSizeSize && @@ -182,9 +182,9 @@ public boolean equals(final Object object) { @Override public int hashCode() { - return Objects.hash(varDecay, varInc, restartFirst, restartInc, clauseDecay, lbLBDMinimizingClause, - lbLBDFrozenClause, lbSizeMinimizingClause, firstReduceDB, specialIncReduceDB, incReduceDB, - factorK, factorR, sizeLBDQueue, sizeTrailQueue, reduceOnSize, reduceOnSizeSize, maxVarDecay); + return Objects.hash(varDecay, varInc, restartFirst, restartInc, clauseDecay, lbLbdMinimizingClause, + lbLbdFrozenClause, lbSizeMinimizingClause, firstReduceDb, specialIncReduceDb, incReduceDb, + factorK, factorR, sizeLbdQueue, sizeTrailQueue, reduceOnSize, reduceOnSizeSize, maxVarDecay); } public static class Builder { @@ -193,15 +193,15 @@ public static class Builder { private int restartFirst = 100; private double restartInc = 2.0; private double clauseDecay = 0.999; - private int lbLBDMinimizingClause = 6; - private int lbLBDFrozenClause = 30; + private int lbLbdMinimizingClause = 6; + private int lbLbdFrozenClause = 30; private int lbSizeMinimizingClause = 30; - private int firstReduceDB = 2000; - private int specialIncReduceDB = 1000; - private int incReduceDB = 300; + private int firstReduceDb = 2000; + private int specialIncReduceDb = 1000; + private int incReduceDb = 300; private double factorK = 0.8; private double factorR = 1.4; - private int sizeLBDQueue = 50; + private int sizeLbdQueue = 50; private int sizeTrailQueue = 5000; private boolean reduceOnSize = false; private int reduceOnSizeSize = 12; @@ -269,22 +269,22 @@ public Builder clauseDecay(final double clauseDecay) { /** * Sets the minimal LBD required to minimize a clause to a given value. * The default value is 6. - * @param lbLBDMinimizingClause the value (should be at least 3) + * @param lbLbdMinimizingClause the value (should be at least 3) * @return the builder */ - public Builder lbLBDMinimizingClause(final int lbLBDMinimizingClause) { - this.lbLBDMinimizingClause = lbLBDMinimizingClause; + public Builder lbLbdMinimizingClause(final int lbLbdMinimizingClause) { + this.lbLbdMinimizingClause = lbLbdMinimizingClause; return this; } /** * Sets the value to protect clauses if their LBD decrease and is lower * than it (for one turn). The default value is 30. - * @param lbLBDFrozenClause the value + * @param lbLbdFrozenClause the value * @return the builder */ - public Builder lbLBDFrozenClause(final int lbLBDFrozenClause) { - this.lbLBDFrozenClause = lbLBDFrozenClause; + public Builder lbLbdFrozenClause(final int lbLbdFrozenClause) { + this.lbLbdFrozenClause = lbLbdFrozenClause; return this; } @@ -302,33 +302,33 @@ public Builder lbSizeMinimizingClause(final int lbSizeMinimizingClause) { /** * Sets the number of conflicts before the first DB reduction to a given * value. The default value is 2000. - * @param firstReduceDB the value + * @param firstReduceDb the value * @return the builder */ - public Builder firstReduceDB(final int firstReduceDB) { - this.firstReduceDB = firstReduceDB; + public Builder firstReduceDb(final int firstReduceDb) { + this.firstReduceDb = firstReduceDb; return this; } /** * Sets the special increment for the DB reduction to a given value. The * default value is 1000. - * @param specialIncReduceDB the value + * @param specialIncReduceDb the value * @return the builder */ - public Builder specialIncReduceDB(final int specialIncReduceDB) { - this.specialIncReduceDB = specialIncReduceDB; + public Builder specialIncReduceDb(final int specialIncReduceDb) { + this.specialIncReduceDb = specialIncReduceDb; return this; } /** * Sets the increment for the DB reduction to a given value. The default * value is 300. - * @param incReduceDB the value + * @param incReduceDb the value * @return the builder */ - public Builder incReduceDB(final int incReduceDB) { - this.incReduceDB = incReduceDB; + public Builder incReduceDb(final int incReduceDb) { + this.incReduceDb = incReduceDb; return this; } @@ -357,11 +357,11 @@ public Builder factorR(final double factorR) { /** * Sets the size of moving average for LBD (restarts) to a given value. * The default value is 50. - * @param sizeLBDQueue the value (should be at least 10) + * @param sizeLbdQueue the value (should be at least 10) * @return the builder */ - public Builder sizeLBDQueue(final int sizeLBDQueue) { - this.sizeLBDQueue = sizeLBDQueue; + public Builder sizeLbdQueue(final int sizeLbdQueue) { + this.sizeLbdQueue = sizeLbdQueue; return this; } @@ -414,8 +414,8 @@ public Builder maxVarDecay(final double maxVarDecay) { * Builds the SAT solver configuration. * @return the configuration */ - public SATSolverLowLevelConfig build() { - return new SATSolverLowLevelConfig(this); + public SatSolverLowLevelConfig build() { + return new SatSolverLowLevelConfig(this); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/AIGTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/AigTransformation.java similarity index 92% rename from core/src/main/java/com/booleworks/logicng/transformations/AIGTransformation.java rename to core/src/main/java/com/booleworks/logicng/transformations/AigTransformation.java index 766c2d14..341d713d 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/AIGTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/AigTransformation.java @@ -13,7 +13,7 @@ import com.booleworks.logicng.formulas.Or; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.LinkedHashSet; import java.util.Map; @@ -24,7 +24,7 @@ * @version 3.0.0 * @since 1.0 */ -public final class AIGTransformation extends CacheableFormulaTransformation { +public final class AigTransformation extends CacheableFormulaTransformation { /** * Constructs a new transformation. For a caching formula factory, the cache @@ -32,7 +32,7 @@ public final class AIGTransformation extends CacheableFormulaTransformation { * will be used. * @param f the formula factory to generate new formulas */ - public AIGTransformation(final FormulaFactory f) { + public AigTransformation(final FormulaFactory f) { super(f, TransformationCacheEntry.AIG); } @@ -42,13 +42,13 @@ public AIGTransformation(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public AIGTransformation(final FormulaFactory f, final Map cache) { + public AigTransformation(final FormulaFactory f, final Map cache) { super(f, cache); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(transform(formula)); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(transform(formula)); } private Formula transform(final Formula formula) { diff --git a/core/src/main/java/com/booleworks/logicng/transformations/Anonymizer.java b/core/src/main/java/com/booleworks/logicng/transformations/Anonymizer.java index e63822fe..161032bb 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/Anonymizer.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/Anonymizer.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; /** * An anonymizer replaces all variables in a formula with new variables @@ -80,15 +80,15 @@ public Substitution getSubstitution() { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { if (formula.variables(f).isEmpty()) { - return LNGResult.of(formula); + return LngResult.of(formula); } for (final Variable variable : formula.variables(f)) { if (state.getSubstitution(variable) == null) { state.addMapping(variable, f.variable(prefix + counter++)); } } - return LNGResult.of(formula.substitute(f, state)); + return LngResult.of(formula.substitute(f, state)); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/BDDNormalFormTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/BddNormalFormTransformation.java similarity index 80% rename from core/src/main/java/com/booleworks/logicng/transformations/BDDNormalFormTransformation.java rename to core/src/main/java/com/booleworks/logicng/transformations/BddNormalFormTransformation.java index 3c0e532d..138352b7 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/BDDNormalFormTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/BddNormalFormTransformation.java @@ -9,10 +9,10 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import java.util.Map; @@ -22,7 +22,7 @@ * @version 3.0.0 * @since 2.3.0 */ -public abstract class BDDNormalFormTransformation extends CacheableAndStatefulFormulaTransformation { +public abstract class BddNormalFormTransformation extends CacheableAndStatefulFormulaTransformation { private final boolean cnf; @@ -38,7 +38,7 @@ public abstract class BDDNormalFormTransformation extends CacheableAndStatefulFo * transformation * @param kernel the optional BDD kernel */ - public BDDNormalFormTransformation(final FormulaFactory f, final boolean cnf, final BDDKernel kernel) { + public BddNormalFormTransformation(final FormulaFactory f, final boolean cnf, final BddKernel kernel) { super(f, cnf ? TransformationCacheEntry.BDD_CNF : TransformationCacheEntry.BDD_DNF, kernel); this.cnf = cnf; } @@ -56,7 +56,7 @@ public BDDNormalFormTransformation(final FormulaFactory f, final boolean cnf, fi * @param kernel the optional BDD kernel * @param cache the cache to use for the transformation */ - public BDDNormalFormTransformation(final FormulaFactory f, final boolean cnf, final BDDKernel kernel, + public BddNormalFormTransformation(final FormulaFactory f, final boolean cnf, final BddKernel kernel, final Map cache) { super(f, cache, kernel); this.cnf = cnf; @@ -69,20 +69,20 @@ public BDDNormalFormTransformation(final FormulaFactory f, final boolean cnf, fi * @return a (potentially canceled) LNGResult with the normal form (CNF or * DNF) of the formula */ - protected LNGResult compute(final Formula formula, final ComputationHandler handler) { + protected LngResult compute(final Formula formula, final ComputationHandler handler) { if (formula.getType().getPrecedence() >= FType.LITERAL.getPrecedence() || hasNormalForm(formula, cnf)) { - return LNGResult.of(formula); + return LngResult.of(formula); } final Formula cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } - final LNGResult bdd = BDDFactory.build(f, formula, state, handler); + final LngResult bdd = BddFactory.build(f, formula, state, handler); if (!bdd.isSuccess()) { - return LNGResult.canceled(bdd.getCancelCause()); + return LngResult.canceled(bdd.getCancelCause()); } final Formula normalForm = cnf ? bdd.getResult().cnf() : bdd.getResult().dnf(); - final LNGResult simplifiedNormalForm; + final LngResult simplifiedNormalForm; final UnitPropagation up = new UnitPropagation(f); if (cnf) { simplifiedNormalForm = normalForm.transform(up, handler); @@ -100,6 +100,6 @@ protected LNGResult compute(final Formula formula, final ComputationHan } private boolean hasNormalForm(final Formula formula, final boolean cnf) { - return cnf ? formula.isCNF(f) : formula.isDNF(f); + return cnf ? formula.isCnf(f) : formula.isDnf(f); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/CanonicalEnumeration.java b/core/src/main/java/com/booleworks/logicng/transformations/CanonicalEnumeration.java index 80656ed7..e1a8c315 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/CanonicalEnumeration.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/CanonicalEnumeration.java @@ -9,8 +9,8 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import com.booleworks.logicng.util.FormulaHelper; @@ -41,19 +41,19 @@ public CanonicalEnumeration(final FormulaFactory f) { * @param cnf {@code true} if the canonical CNF should be computed, * {@code false} if the canonical DNF should be computed * @return the (potentially canceled) result with the canonical normal form - * (CNF or DNF) of the formula + * (CNF or DNF) of the formula */ - protected LNGResult compute(final Formula formula, final ComputationHandler handler, final boolean cnf) { - final SATSolver solver = SATSolver.newSolver(f); + protected LngResult compute(final Formula formula, final ComputationHandler handler, final boolean cnf) { + final SatSolver solver = SatSolver.newSolver(f); solver.add(cnf ? formula.negate(f) : formula); - final LNGResult> enumerationResult = solver.execute( + final LngResult> enumerationResult = solver.execute( ModelEnumerationFunction.builder(formula.variables(f)).build(), handler); if (!enumerationResult.isSuccess()) { - return LNGResult.canceled(enumerationResult.getCancelCause()); + return LngResult.canceled(enumerationResult.getCancelCause()); } else { final List enumeration = enumerationResult.getResult(); if (enumeration.isEmpty()) { - return LNGResult.of(f.constant(cnf)); + return LngResult.of(f.constant(cnf)); } final List ops = new ArrayList<>(); for (final Model model : enumeration) { @@ -62,7 +62,7 @@ protected LNGResult compute(final Formula formula, final ComputationHan cnf ? f.or(FormulaHelper.negate(f, literals, ArrayList::new)) : f.and(model.getLiterals()); ops.add(term); } - return LNGResult.of(cnf ? f.and(ops) : f.or(ops)); + return LngResult.of(cnf ? f.and(ops) : f.or(ops)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/FormulaFactoryImporter.java b/core/src/main/java/com/booleworks/logicng/transformations/FormulaFactoryImporter.java index aff71a51..b2324cc1 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/FormulaFactoryImporter.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/FormulaFactoryImporter.java @@ -13,9 +13,9 @@ import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.Or; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.ArrayList; import java.util.LinkedHashSet; @@ -40,8 +40,8 @@ public FormulaFactoryImporter(final FormulaFactory f) { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(applyRec(formula)); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(applyRec(formula)); } private Formula applyRec(final Formula formula) { @@ -74,7 +74,7 @@ private Formula applyRec(final Formula formula) { final And and = (And) formula; return f.and(gatherAppliedOperands(and)); case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; final List literals = new ArrayList<>(pbc.getOperands().size()); for (final Literal op : pbc.getOperands()) { literals.add((Literal) apply(op)); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/LiteralSubstitution.java b/core/src/main/java/com/booleworks/logicng/transformations/LiteralSubstitution.java index 17833392..a6a63201 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/LiteralSubstitution.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/LiteralSubstitution.java @@ -9,9 +9,9 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.ArrayList; import java.util.List; @@ -43,8 +43,8 @@ public LiteralSubstitution(final FormulaFactory f, final Map s } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(substitute(formula)); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(substitute(formula)); } private Formula substitute(final Formula formula) { @@ -78,7 +78,7 @@ private Formula substitute(final Formula formula) { } return f.naryOperator(formula.getType(), operands); case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; final List originalOperands = pbc.getOperands(); final List literals = new ArrayList<>(originalOperands.size()); for (final Literal originalOperand : originalOperands) { diff --git a/core/src/main/java/com/booleworks/logicng/transformations/NNFTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/NnfTransformation.java similarity index 90% rename from core/src/main/java/com/booleworks/logicng/transformations/NNFTransformation.java rename to core/src/main/java/com/booleworks/logicng/transformations/NnfTransformation.java index f09e37fa..2cd82cb3 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/NNFTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/NnfTransformation.java @@ -10,10 +10,10 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Implication; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import java.util.Iterator; import java.util.LinkedHashSet; @@ -25,7 +25,7 @@ * @version 3.0.0 * @since 2.2.0 */ -public class NNFTransformation extends CacheableFormulaTransformation { +public class NnfTransformation extends CacheableFormulaTransformation { /** * Constructs a new transformation. For a caching formula factory, the cache @@ -33,7 +33,7 @@ public class NNFTransformation extends CacheableFormulaTransformation { * will be used. * @param f the formula factory to generate new formulas */ - public NNFTransformation(final FormulaFactory f) { + public NnfTransformation(final FormulaFactory f) { super(f, TransformationCacheEntry.NNF); } @@ -43,13 +43,13 @@ public NNFTransformation(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache for this transformation */ - public NNFTransformation(final FormulaFactory f, final Map cache) { + public NnfTransformation(final FormulaFactory f, final Map cache) { super(f, cache); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(applyRec(formula, true)); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(applyRec(formula, true)); } private Formula applyRec(final Formula formula, final boolean polarity) { @@ -94,7 +94,7 @@ private Formula applyRec(final Formula formula, final boolean polarity) { } break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; if (polarity) { final List encoding = pbc.getEncoding(f); nnf = applyRec(f, encoding.iterator(), FType.AND, true); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/PureExpansionTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/PureExpansionTransformation.java index dadebc91..0be3fb5d 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/PureExpansionTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/PureExpansionTransformation.java @@ -11,10 +11,10 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.util.FormulaHelper; import java.util.ArrayList; @@ -36,8 +36,8 @@ public PureExpansionTransformation(final FormulaFactory f) { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(expand(formula)); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(expand(formula)); } private Formula expand(final Formula formula) { @@ -65,7 +65,7 @@ private Formula expand(final Formula formula) { final Formula newRight = apply(binary.getRight()); return f.binaryOperator(formula.getType(), newLeft, newRight); case PBC: - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; if (pbc.isAmo() || pbc.isExo()) { final EncodingResult encodingResult = EncodingResult.resultForFormula(f); final Variable[] vars = FormulaHelper.literalsAsVariables(pbc.getOperands()); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/Subsumption.java b/core/src/main/java/com/booleworks/logicng/transformations/Subsumption.java index 9f26a64d..de8639c3 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/Subsumption.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/Subsumption.java @@ -7,12 +7,12 @@ import static com.booleworks.logicng.handlers.events.SimpleEvent.SUBSUMPTION_ADDED_NEW_SET; import static com.booleworks.logicng.handlers.events.SimpleEvent.SUBSUMPTION_STARTING_UB_TREE_GENERATION; -import com.booleworks.logicng.datastructures.ubtrees.UBTree; +import com.booleworks.logicng.datastructures.ubtrees.UbTree; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import java.util.ArrayList; @@ -43,8 +43,8 @@ public Subsumption(final FormulaFactory f) { * @param formula the formula (must be an n-ary operator and CNF or DNF) * @return the UBTree with the operands and deleted subsumed operands */ - protected UBTree generateSubsumedUBTree(final Formula formula) { - return generateSubsumedUBTree(formula, NopHandler.get()).getResult(); + protected UbTree generateSubsumedUbTree(final Formula formula) { + return generateSubsumedUbTree(formula, NopHandler.get()).getResult(); } /** @@ -54,25 +54,25 @@ protected UBTree generateSubsumedUBTree(final Formula formula) { * @param handler the computation handler * @return the UBTree with the operands and deleted subsumed operands */ - protected LNGResult> generateSubsumedUBTree(final Formula formula, final ComputationHandler handler) { + protected LngResult> generateSubsumedUbTree(final Formula formula, final ComputationHandler handler) { final SortedMap>> mapping = new TreeMap<>(); for (final Formula term : formula) { mapping.computeIfAbsent(term.literals(f).size(), k -> new ArrayList<>()).add(term.literals(f)); } if (!handler.shouldResume(SUBSUMPTION_STARTING_UB_TREE_GENERATION)) { - return LNGResult.canceled(SUBSUMPTION_STARTING_UB_TREE_GENERATION); + return LngResult.canceled(SUBSUMPTION_STARTING_UB_TREE_GENERATION); } - final UBTree ubTree = new UBTree<>(); + final UbTree ubTree = new UbTree<>(); for (final Map.Entry>> entry : mapping.entrySet()) { for (final SortedSet set : entry.getValue()) { if (ubTree.firstSubset(set) == null) { ubTree.addSet(set); if (!handler.shouldResume(SUBSUMPTION_ADDED_NEW_SET)) { - return LNGResult.canceled(SUBSUMPTION_ADDED_NEW_SET); + return LngResult.canceled(SUBSUMPTION_ADDED_NEW_SET); } } } } - return LNGResult.of(ubTree); + return LngResult.of(ubTree); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/UnitPropagation.java b/core/src/main/java/com/booleworks/logicng/transformations/UnitPropagation.java index 20c597ab..9c37bfcc 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/UnitPropagation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/UnitPropagation.java @@ -10,10 +10,10 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import java.util.ArrayList; import java.util.List; @@ -47,28 +47,28 @@ public UnitPropagation(final FormulaFactory f, final Map cache } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Formula cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } final Propagator propagator = new Propagator(f); propagator.add(formula); final Formula result = propagator.propagatedFormula(f); setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } /** * An extension of the Core Solver to propagate units on formulas. */ - private static class Propagator extends LNGCoreSolver { + private static class Propagator extends LngCoreSolver { /** * Constructs a new Propagator. */ public Propagator(final FormulaFactory f) { - super(f, SATSolverConfig.builder().build()); + super(f, SatSolverConfig.builder().build()); } /** @@ -107,7 +107,7 @@ public Formula propagatedFormula(final FormulaFactory f) { return f.falsum(); } final List newClauses = new ArrayList<>(); - for (final LNGClause clause : clauses) { + for (final LngClause clause : clauses) { newClauses.add(clauseToFormula(f, clause)); } for (int i = 0; i < trail.size(); i++) { @@ -135,7 +135,7 @@ private Literal solverLiteralToFormula(final FormulaFactory f, final int lit) { * @param clause the solver clause to transform * @return the transformed clause */ - private Formula clauseToFormula(final FormulaFactory f, final LNGClause clause) { + private Formula clauseToFormula(final FormulaFactory f, final LngClause clause) { final List literals = new ArrayList<>(clause.size()); for (int i = 0; i < clause.size(); i++) { final int lit = clause.get(i); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/BDDCNFTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/BddCnfTransformation.java similarity index 79% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/BDDCNFTransformation.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/BddCnfTransformation.java index c553cd83..affd9b2a 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/BDDCNFTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/BddCnfTransformation.java @@ -7,9 +7,9 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.transformations.BDDNormalFormTransformation; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.transformations.BddNormalFormTransformation; import java.util.Map; @@ -18,7 +18,7 @@ * @version 2.3.0 * @since 1.4.0 */ -public final class BDDCNFTransformation extends BDDNormalFormTransformation { +public final class BddCnfTransformation extends BddNormalFormTransformation { /** * Constructs a new BDD-based CNF transformation with an optional BDD @@ -30,7 +30,7 @@ public final class BDDCNFTransformation extends BDDNormalFormTransformation { * @param f the formula factory to generate new formulas * @param kernel the optional BDD kernel */ - public BDDCNFTransformation(final FormulaFactory f, final BDDKernel kernel) { + public BddCnfTransformation(final FormulaFactory f, final BddKernel kernel) { super(f, true, kernel); } @@ -45,7 +45,7 @@ public BDDCNFTransformation(final FormulaFactory f, final BDDKernel kernel) { * @param kernel the optional BDD kernel * @param cache the cache to use for this transformation */ - public BDDCNFTransformation(final FormulaFactory f, final BDDKernel kernel, final Map cache) { + public BddCnfTransformation(final FormulaFactory f, final BddKernel kernel, final Map cache) { super(f, true, kernel, cache); } @@ -54,12 +54,12 @@ public BDDCNFTransformation(final FormulaFactory f, final BDDKernel kernel, fina * kernel for every formula application. * @param f the formula factory to generate new formulas */ - public BDDCNFTransformation(final FormulaFactory f) { + public BddCnfTransformation(final FormulaFactory f) { super(f, true, null); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { return compute(formula, handler); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumeration.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumeration.java similarity index 74% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumeration.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumeration.java index 4786041f..01c66ab1 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumeration.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumeration.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.CanonicalEnumeration; /** @@ -16,14 +16,14 @@ * @version 3.0.0 * @since 2.3.0 */ -public final class CanonicalCNFEnumeration extends CanonicalEnumeration { +public final class CanonicalCnfEnumeration extends CanonicalEnumeration { - public CanonicalCNFEnumeration(final FormulaFactory f) { + public CanonicalCnfEnumeration(final FormulaFactory f) { super(f); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { return compute(formula, handler, true); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFConfig.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfConfig.java similarity index 96% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFConfig.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfConfig.java index 3e389c09..7005b519 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFConfig.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfConfig.java @@ -12,7 +12,7 @@ * @version 1.2 * @since 1.1 */ -public final class CNFConfig extends Configuration { +public final class CnfConfig extends Configuration { /** * The algorithm for the CNF encoding. @@ -35,7 +35,7 @@ public enum Algorithm { * Constructs a new configuration with a given type. * @param builder the builder */ - private CNFConfig(final Builder builder) { + private CnfConfig(final Builder builder) { super(ConfigurationType.CNF); algorithm = builder.algorithm; fallbackAlgorithmForAdvancedEncoding = builder.fallbackAlgorithmForAdvancedEncoding; @@ -54,7 +54,7 @@ public static Builder builder() { @Override public String toString() { - final StringBuilder sb = new StringBuilder(String.format("CNFConfig{%n")); + final StringBuilder sb = new StringBuilder(String.format("CnfConfig{%n")); sb.append("algorithm=").append(algorithm).append(System.lineSeparator()); sb.append("fallbackAlgorithmForAdvancedEncoding=").append(fallbackAlgorithmForAdvancedEncoding) .append(System.lineSeparator()); @@ -153,8 +153,8 @@ public Builder atomBoundary(final int atomBoundary) { * Builds the configuration. * @return the configuration. */ - public CNFConfig build() { - return new CNFConfig(this); + public CnfConfig build() { + return new CnfConfig(this); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFEncoder.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfEncoder.java similarity index 87% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFEncoder.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfEncoder.java index 7cea4624..85d68bf7 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFEncoder.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfEncoder.java @@ -6,7 +6,7 @@ import static com.booleworks.logicng.handlers.events.ComputationStartedEvent.FACTORIZATION_STARTED; import static com.booleworks.logicng.handlers.events.SimpleEvent.DISTRIBUTION_PERFORMED; -import static com.booleworks.logicng.transformations.cnf.PlaistedGreenbaumTransformation.PGState; +import static com.booleworks.logicng.transformations.cnf.PlaistedGreenbaumTransformation.PgState; import com.booleworks.logicng.configurations.ConfigurationType; import com.booleworks.logicng.formulas.FType; @@ -15,9 +15,9 @@ import com.booleworks.logicng.formulas.FormulaTransformation; import com.booleworks.logicng.formulas.implementation.cached.CachingFormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.FactorizationCreatedClauseEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import java.util.ArrayList; import java.util.List; @@ -27,7 +27,7 @@ * @version 3.0.0 * @since 1.1 */ -public class CNFEncoder { +public class CnfEncoder { /** * Encodes a formula to CNF. @@ -46,18 +46,18 @@ public static Formula encode(final FormulaFactory f, final Formula formula) { * @param initConfig the configuration for the encoder * @return the CNF encoding of the formula */ - public static Formula encode(final FormulaFactory f, final Formula formula, final CNFConfig initConfig) { - final CNFConfig config = - initConfig != null ? initConfig : (CNFConfig) f.configurationFor(ConfigurationType.CNF); + public static Formula encode(final FormulaFactory f, final Formula formula, final CnfConfig initConfig) { + final CnfConfig config = + initConfig != null ? initConfig : (CnfConfig) f.configurationFor(ConfigurationType.CNF); switch (config.algorithm) { case FACTORIZATION: - return formula.transform(new CNFFactorization(f)); + return formula.transform(new CnfFactorization(f)); case TSEITIN: return formula.transform(getTseitinTransformation(f, config)); case PLAISTED_GREENBAUM: return formula.transform(getPgTransformation(f, config)); case BDD: - return formula.transform(new BDDCNFTransformation(f)); + return formula.transform(new BddCnfTransformation(f)); case ADVANCED: return advancedEncoding(f, formula, config); default: @@ -74,9 +74,9 @@ public static Formula encode(final FormulaFactory f, final Formula formula, fina * @param config the CNF configuration * @return the CNF encoding of the formula */ - protected static Formula advancedEncoding(final FormulaFactory f, final Formula formula, final CNFConfig config) { + protected static Formula advancedEncoding(final FormulaFactory f, final Formula formula, final CnfConfig config) { final var factorizationHandler = new AdvancedFactorizationHandler(config.distributionBoundary, config.createdClauseBoundary); - final var advancedFactorization = new CNFFactorization(f); + final var advancedFactorization = new CnfFactorization(f); final FormulaTransformation fallbackTransformation; switch (config.fallbackAlgorithmForAdvancedEncoding) { case TSEITIN: @@ -100,10 +100,10 @@ protected static Formula advancedEncoding(final FormulaFactory f, final Formula } protected static Formula singleAdvancedEncoding(final Formula formula, - final CNFFactorization advancedFactorization, + final CnfFactorization advancedFactorization, final AdvancedFactorizationHandler factorizationHandler, final FormulaTransformation fallback) { - final LNGResult result = formula.transform(advancedFactorization, factorizationHandler); + final LngResult result = formula.transform(advancedFactorization, factorizationHandler); if (result.isSuccess()) { return result.getResult(); } else { @@ -111,7 +111,7 @@ protected static Formula singleAdvancedEncoding(final Formula formula, } } - private static FormulaTransformation getTseitinTransformation(final FormulaFactory f, final CNFConfig config) { + private static FormulaTransformation getTseitinTransformation(final FormulaFactory f, final CnfConfig config) { if (f instanceof CachingFormulaFactory) { return new TseitinTransformation(f, config.atomBoundary); } else { @@ -119,11 +119,11 @@ private static FormulaTransformation getTseitinTransformation(final FormulaFacto } } - private static FormulaTransformation getPgTransformation(final FormulaFactory f, final CNFConfig config) { + private static FormulaTransformation getPgTransformation(final FormulaFactory f, final CnfConfig config) { if (f instanceof CachingFormulaFactory) { return new PlaistedGreenbaumTransformation(f, config.atomBoundary); } else { - return new PlaistedGreenbaumTransformation(f, config.atomBoundary, new PGState()); + return new PlaistedGreenbaumTransformation(f, config.atomBoundary, new PgState()); } } @@ -144,7 +144,7 @@ protected AdvancedFactorizationHandler(final int distributionBoundary, final int } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == FACTORIZATION_STARTED) { currentDistributions = 0; currentClauses = 0; diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFFactorization.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfFactorization.java similarity index 81% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFFactorization.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfFactorization.java index 8027fdda..170a3531 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFFactorization.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfFactorization.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.FactorizationCreatedClauseEvent; import com.booleworks.logicng.transformations.CacheableFormulaTransformation; @@ -25,13 +25,13 @@ * @version 3.0.0 * @since 1.0 */ -public final class CNFFactorization extends CacheableFormulaTransformation { +public final class CnfFactorization extends CacheableFormulaTransformation { /** * Constructor for a CNF Factorization. * @param f the formula factory to generate new formulas */ - public CNFFactorization(final FormulaFactory f) { + public CnfFactorization(final FormulaFactory f) { super(f, TransformationCacheEntry.FACTORIZED_CNF); } @@ -41,32 +41,32 @@ public CNFFactorization(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public CNFFactorization(final FormulaFactory f, final Map cache) { + public CnfFactorization(final FormulaFactory f, final Map cache) { super(f, cache); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { if (!handler.shouldResume(FACTORIZATION_STARTED)) { - return LNGResult.canceled(FACTORIZATION_STARTED); + return LngResult.canceled(FACTORIZATION_STARTED); } return applyRec(formula, handler); } - private LNGResult applyRec(final Formula formula, final ComputationHandler handler) { + private LngResult applyRec(final Formula formula, final ComputationHandler handler) { if (formula.getType().getPrecedence() >= FType.LITERAL.getPrecedence()) { - return LNGResult.of(formula); + return LngResult.of(formula); } final Formula cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } final Formula computed; switch (formula.getType()) { case NOT: case IMPL: case EQUIV: - final LNGResult rec = applyRec(formula.nnf(f), handler); + final LngResult rec = applyRec(formula.nnf(f), handler); if (rec.isSuccess()) { computed = rec.getResult(); } else { @@ -76,7 +76,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand case OR: LinkedHashSet nops = new LinkedHashSet<>(); for (final Formula op : formula) { - final LNGResult nop = applyRec(op, handler); + final LngResult nop = applyRec(op, handler); if (nop.isSuccess()) { nops.add(nop.getResult()); } else { @@ -86,7 +86,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand final Iterator it = nops.iterator(); Formula currentResult = it.next(); while (it.hasNext()) { - final LNGResult distributed = distribute(currentResult, it.next(), handler); + final LngResult distributed = distribute(currentResult, it.next(), handler); if (distributed.isSuccess()) { currentResult = distributed.getResult(); } else { @@ -98,7 +98,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand case AND: nops = new LinkedHashSet<>(); for (final Formula op : formula) { - final LNGResult nop = applyRec(op, handler); + final LngResult nop = applyRec(op, handler); if (nop.isSuccess()) { nops.add(nop.getResult()); } else { @@ -114,7 +114,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand throw new IllegalArgumentException("Could not process the formula type " + formula.getType()); } setCache(formula, computed); - return LNGResult.of(computed); + return LngResult.of(computed); } /** @@ -124,28 +124,28 @@ private LNGResult applyRec(final Formula formula, final ComputationHand * @param handler the computation handler * @return the distribution of the two formulas */ - private LNGResult distribute(final Formula f1, final Formula f2, final ComputationHandler handler) { + private LngResult distribute(final Formula f1, final Formula f2, final ComputationHandler handler) { if (!handler.shouldResume(DISTRIBUTION_PERFORMED)) { - return LNGResult.canceled(DISTRIBUTION_PERFORMED); + return LngResult.canceled(DISTRIBUTION_PERFORMED); } if (f1.getType() == FType.AND || f2.getType() == FType.AND) { final LinkedHashSet nops = new LinkedHashSet<>(); for (final Formula op : f1.getType() == FType.AND ? f1 : f2) { - final LNGResult distributed = distribute(op, f1.getType() == FType.AND ? f2 : f1, handler); + final LngResult distributed = distribute(op, f1.getType() == FType.AND ? f2 : f1, handler); if (distributed.isSuccess()) { nops.add(distributed.getResult()); } else { return distributed; } } - return LNGResult.of(f.and(nops)); + return LngResult.of(f.and(nops)); } final Formula clause = f.or(f1, f2); final FactorizationCreatedClauseEvent createdClauseEvent = new FactorizationCreatedClauseEvent(clause); if (handler.shouldResume(createdClauseEvent)) { - return LNGResult.of(clause); + return LngResult.of(clause); } else { - return LNGResult.canceled(createdClauseEvent); + return LngResult.canceled(createdClauseEvent); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFSubsumption.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfSubsumption.java similarity index 69% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFSubsumption.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfSubsumption.java index 84a7b275..ad352838 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/CNFSubsumption.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/CnfSubsumption.java @@ -4,13 +4,13 @@ package com.booleworks.logicng.transformations.cnf; -import com.booleworks.logicng.datastructures.ubtrees.UBTree; +import com.booleworks.logicng.datastructures.ubtrees.UbTree; import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.Subsumption; import java.util.ArrayList; @@ -25,35 +25,35 @@ * @version 3.0.0 * @since 1.5.0 */ -public final class CNFSubsumption extends Subsumption { +public final class CnfSubsumption extends Subsumption { - public CNFSubsumption(final FormulaFactory f) { + public CnfSubsumption(final FormulaFactory f) { super(f); } - public CNFSubsumption(final FormulaFactory f, final ComputationHandler handler) { + public CnfSubsumption(final FormulaFactory f, final ComputationHandler handler) { super(f); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - if (!formula.isCNF(f)) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { + if (!formula.isCnf(f)) { throw new IllegalArgumentException("CNF subsumption can only be applied to formulas in CNF"); } if (formula.getType().getPrecedence() >= FType.LITERAL.getPrecedence() || formula.getType() == FType.OR) { - return LNGResult.of(formula); + return LngResult.of(formula); } assert formula.getType() == FType.AND; - final LNGResult> ubTreeResult = generateSubsumedUBTree(formula, handler); + final LngResult> ubTreeResult = generateSubsumedUbTree(formula, handler); if (!ubTreeResult.isSuccess()) { - return LNGResult.canceled(ubTreeResult.getCancelCause()); + return LngResult.canceled(ubTreeResult.getCancelCause()); } else { - final UBTree ubTree = ubTreeResult.getResult(); + final UbTree ubTree = ubTreeResult.getResult(); final List clauses = new ArrayList<>(); for (final SortedSet literals : ubTree.allSets()) { clauses.add(f.clause(literals)); } - return LNGResult.of(f.cnf(clauses)); + return LngResult.of(f.cnf(clauses)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumCommon.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumCommon.java index d558d911..25a98896 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumCommon.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumCommon.java @@ -1,6 +1,6 @@ package com.booleworks.logicng.transformations.cnf; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Equivalence; import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Formula; @@ -9,8 +9,8 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.implementation.cached.CachingFormulaFactory; -import com.booleworks.logicng.predicates.ContainsPBCPredicate; -import com.booleworks.logicng.transformations.NNFTransformation; +import com.booleworks.logicng.predicates.ContainsPbcPredicate; +import com.booleworks.logicng.transformations.NnfTransformation; import com.booleworks.logicng.util.Pair; import java.util.HashMap; @@ -18,31 +18,31 @@ public abstract class PlaistedGreenbaumCommon { protected final FormulaFactory f; - protected final boolean performNNF; + protected final boolean performNnf; protected final Map variableCache; - protected final NNFTransformation nnfTransformation; + protected final NnfTransformation nnfTransformation; - protected PlaistedGreenbaumCommon(final FormulaFactory f, final boolean performNNF) { + protected PlaistedGreenbaumCommon(final FormulaFactory f, final boolean performNnf) { this.f = f; - this.performNNF = performNNF; + this.performNnf = performNnf; variableCache = new HashMap<>(); if (f instanceof CachingFormulaFactory) { - nnfTransformation = new NNFTransformation(f); + nnfTransformation = new NnfTransformation(f); } else { final Map nnfCache = new HashMap<>(); - nnfTransformation = new NNFTransformation(f, nnfCache); + nnfTransformation = new NnfTransformation(f, nnfCache); } } abstract int newSolverVariable(); - abstract void addToSolver(final LNGIntVector clause, T addendum); + abstract void addToSolver(final LngIntVector clause, T addendum); abstract int getLitFromSolver(final Literal lit); - abstract void addCNF(final Formula cnf, final T addendum); + abstract void addCnf(final Formula cnf, final T addendum); - private LNGIntVector computeTransformation(final Formula formula, final boolean polarity, + private LngIntVector computeTransformation(final Formula formula, final boolean polarity, final T addendum, final boolean topLevel) { switch (formula.getType()) { case LITERAL: @@ -69,13 +69,13 @@ private LNGIntVector computeTransformation(final Formula formula, final boolean * @param addendum the weight of the formula */ public void addCnfToSolver(final Formula formula, final T addendum) { - final Formula workingFormula = performNNF ? formula.transform(nnfTransformation) : formula; - final Formula withoutPBCs = !performNNF && workingFormula.holds(ContainsPBCPredicate.get()) + final Formula workingFormula = performNnf ? formula.transform(nnfTransformation) : formula; + final Formula withoutPbcs = !performNnf && workingFormula.holds(ContainsPbcPredicate.get()) ? workingFormula.nnf(f) : workingFormula; - if (withoutPBCs.isCNF(f)) { - addCNF(withoutPBCs, addendum); + if (withoutPbcs.isCnf(f)) { + addCnf(withoutPbcs, addendum); } else { - final LNGIntVector topLevelVars = computeTransformation(withoutPBCs, true, addendum, true); + final LngIntVector topLevelVars = computeTransformation(withoutPbcs, true, addendum, true); if (topLevelVars != null) { addToSolver(topLevelVars, addendum); } @@ -89,7 +89,7 @@ public void clearCache() { variableCache.clear(); } - private LNGIntVector handleImplication(final Implication formula, final boolean polarity, + private LngIntVector handleImplication(final Implication formula, final boolean polarity, final T addendum, final boolean topLevel) { final boolean skipPg = polarity || topLevel; final Pair pgVarResult = skipPg ? new Pair<>(false, null) : getPgVar(formula, polarity); @@ -100,15 +100,15 @@ private LNGIntVector handleImplication(final Implication formula, final boolean if (polarity) { // pg => (~left | right) ~~> ~pg | ~left | right // Speed-Up: Skip pg var - final LNGIntVector leftPgVarNeg = computeTransformation(formula.getLeft(), false, addendum, false); - final LNGIntVector rightPgVarPos = computeTransformation(formula.getRight(), true, addendum, false); + final LngIntVector leftPgVarNeg = computeTransformation(formula.getLeft(), false, addendum, false); + final LngIntVector rightPgVarPos = computeTransformation(formula.getRight(), true, addendum, false); return vector(leftPgVarNeg, rightPgVarPos); } else { // (~left | right) => pg // ~~> (left & ~right) | pg // ~~> (left | pg) & (~right | pg) - final LNGIntVector leftPgVarPos = computeTransformation(formula.getLeft(), true, addendum, topLevel); - final LNGIntVector rightPgVarNeg = computeTransformation(formula.getRight(), false, addendum, topLevel); + final LngIntVector leftPgVarPos = computeTransformation(formula.getLeft(), true, addendum, topLevel); + final LngIntVector rightPgVarNeg = computeTransformation(formula.getRight(), false, addendum, topLevel); if (topLevel) { if (leftPgVarPos != null) { addToSolver(leftPgVarPos, addendum); @@ -125,17 +125,17 @@ private LNGIntVector handleImplication(final Implication formula, final boolean } } - private LNGIntVector handleEquivalence(final Equivalence formula, final boolean polarity, + private LngIntVector handleEquivalence(final Equivalence formula, final boolean polarity, final T addendum, final boolean topLevel) { final Pair pgVarResult = topLevel ? new Pair<>(false, null) : getPgVar(formula, polarity); if (pgVarResult.getFirst()) { return polarity ? vector(pgVarResult.getSecond()) : vector(pgVarResult.getSecond() ^ 1); } final int pgVar = topLevel ? -1 : pgVarResult.getSecond(); - final LNGIntVector leftPgVarPos = computeTransformation(formula.getLeft(), true, addendum, false); - final LNGIntVector leftPgVarNeg = computeTransformation(formula.getLeft(), false, addendum, false); - final LNGIntVector rightPgVarPos = computeTransformation(formula.getRight(), true, addendum, false); - final LNGIntVector rightPgVarNeg = computeTransformation(formula.getRight(), false, addendum, false); + final LngIntVector leftPgVarPos = computeTransformation(formula.getLeft(), true, addendum, false); + final LngIntVector leftPgVarNeg = computeTransformation(formula.getLeft(), false, addendum, false); + final LngIntVector rightPgVarPos = computeTransformation(formula.getRight(), true, addendum, false); + final LngIntVector rightPgVarNeg = computeTransformation(formula.getRight(), false, addendum, false); if (polarity) { // pg => (left => right) & (right => left) // ~~> (pg & left => right) & (pg & right => left) @@ -165,7 +165,7 @@ private LNGIntVector handleEquivalence(final Equivalence formula, final boolean return polarity ? vector(pgVar) : vector(pgVar ^ 1); } - private LNGIntVector handleNary(final Formula formula, final boolean polarity, final T addendum, + private LngIntVector handleNary(final Formula formula, final boolean polarity, final T addendum, final boolean topLevel) { final boolean skipPg = topLevel || formula.getType() == FType.AND && !polarity || formula.getType() == FType.OR && polarity; @@ -179,7 +179,7 @@ private LNGIntVector handleNary(final Formula formula, final boolean polarity, f if (polarity) { // pg => (v1 & ... & vk) ~~> (~pg | v1) & ... & (~pg | vk) for (final Formula op : formula) { - final LNGIntVector opPgVars = computeTransformation(op, true, addendum, topLevel); + final LngIntVector opPgVars = computeTransformation(op, true, addendum, topLevel); if (topLevel) { if (opPgVars != null) { addToSolver(opPgVars, addendum); @@ -194,9 +194,9 @@ private LNGIntVector handleNary(final Formula formula, final boolean polarity, f } else { // (v1 & ... & vk) ~~> pg = ~v1 | ... | ~vk | pg // Speed-Up: Skip pg var - final LNGIntVector singleClause = new LNGIntVector(); + final LngIntVector singleClause = new LngIntVector(); for (final Formula op : formula) { - final LNGIntVector opPgVars = computeTransformation(op, false, addendum, false); + final LngIntVector opPgVars = computeTransformation(op, false, addendum, false); for (int i = 0; i < opPgVars.size(); i++) { singleClause.push(opPgVars.get(i)); } @@ -209,9 +209,9 @@ private LNGIntVector handleNary(final Formula formula, final boolean polarity, f if (polarity) { // pg => (v1 | ... | vk) ~~> ~pg | v1 | ... | vk // Speed-Up: Skip pg var - final LNGIntVector singleClause = new LNGIntVector(); + final LngIntVector singleClause = new LngIntVector(); for (final Formula op : formula) { - final LNGIntVector opPgVars = computeTransformation(op, true, addendum, false); + final LngIntVector opPgVars = computeTransformation(op, true, addendum, false); for (int i = 0; i < opPgVars.size(); i++) { singleClause.push(opPgVars.get(i)); } @@ -220,7 +220,7 @@ private LNGIntVector handleNary(final Formula formula, final boolean polarity, f } else { // (v1 | ... | vk) => pg ~~> (~v1 | pg) & ... & (~vk | pg) for (final Formula op : formula) { - final LNGIntVector opPgVars = computeTransformation(op, false, addendum, topLevel); + final LngIntVector opPgVars = computeTransformation(op, false, addendum, topLevel); if (topLevel) { if (opPgVars != null) { addToSolver(opPgVars, addendum); @@ -248,12 +248,12 @@ protected Pair getPgVar(final Formula formula, final boolean p return new Pair<>(wasCached, pgVar); } - protected static LNGIntVector vector(final int... elts) { - return LNGIntVector.of(elts); + protected static LngIntVector vector(final int... elts) { + return LngIntVector.of(elts); } - protected static LNGIntVector vector(final LNGIntVector a, final LNGIntVector b) { - final LNGIntVector result = new LNGIntVector(a.size() + b.size()); + protected static LngIntVector vector(final LngIntVector a, final LngIntVector b) { + final LngIntVector result = new LngIntVector(a.size() + b.size()); for (int i = 0; i < a.size(); i++) { result.unsafePush(a.get(i)); } @@ -263,8 +263,8 @@ protected static LNGIntVector vector(final LNGIntVector a, final LNGIntVector b) return result; } - protected static LNGIntVector vector(final int elt, final LNGIntVector a) { - final LNGIntVector result = new LNGIntVector(a.size() + 1); + protected static LngIntVector vector(final int elt, final LngIntVector a) { + final LngIntVector result = new LngIntVector(a.size() + 1); result.unsafePush(elt); for (int i = 0; i < a.size(); i++) { result.unsafePush(a.get(i)); @@ -272,8 +272,8 @@ protected static LNGIntVector vector(final int elt, final LNGIntVector a) { return result; } - protected static LNGIntVector vector(final int elt, final LNGIntVector a, final LNGIntVector b) { - final LNGIntVector result = new LNGIntVector(a.size() + b.size() + 1); + protected static LngIntVector vector(final int elt, final LngIntVector a, final LngIntVector b) { + final LngIntVector result = new LngIntVector(a.size() + b.size() + 1); result.unsafePush(elt); for (int i = 0; i < a.size(); i++) { result.unsafePush(a.get(i)); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformation.java index 480b30f7..e8151920 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformation.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatefulFormulaTransformation; import java.util.ArrayList; @@ -27,12 +27,12 @@ * @version 3.0.0 * @since 1.0 */ -public final class PlaistedGreenbaumTransformation extends StatefulFormulaTransformation { +public final class PlaistedGreenbaumTransformation extends StatefulFormulaTransformation { public static final int DEFAULT_BOUNDARY = 12; private final int boundaryForFactorization; - private final CNFFactorization factorization; + private final CnfFactorization factorization; /** * Constructor for a Plaisted & Greenbaum transformation with conversion @@ -53,7 +53,7 @@ public PlaistedGreenbaumTransformation(final FormulaFactory f) { public PlaistedGreenbaumTransformation(final FormulaFactory f, final int boundaryForFactorization) { super(f); this.boundaryForFactorization = boundaryForFactorization; - factorization = new CNFFactorization(f); + factorization = new CnfFactorization(f); } /** @@ -62,7 +62,7 @@ public PlaistedGreenbaumTransformation(final FormulaFactory f, final int boundar * @param f the formula factory to generate new formulas * @param state the mutable state for a PG transformation */ - public PlaistedGreenbaumTransformation(final FormulaFactory f, final PGState state) { + public PlaistedGreenbaumTransformation(final FormulaFactory f, final PgState state) { this(f, DEFAULT_BOUNDARY, state); } @@ -75,15 +75,15 @@ public PlaistedGreenbaumTransformation(final FormulaFactory f, final PGState sta * @param state the mutable state for a PG transformation */ public PlaistedGreenbaumTransformation(final FormulaFactory f, final int boundaryForFactorization, - final PGState state) { + final PgState state) { super(f, state); this.boundaryForFactorization = boundaryForFactorization; - factorization = new CNFFactorization(f); + factorization = new CnfFactorization(f); } @Override - protected PGState inititialState() { - return new PGState(); + protected PgState inititialState() { + return new PgState(); } /** @@ -99,17 +99,17 @@ private Literal pgVariable(final Formula formula) { } Literal var = state.literal(formula); if (var == null) { - var = f.newCNFVariable(); + var = f.newCnfVariable(); state.literalMap.put(formula, var); } return var; } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Formula nnf = formula.nnf(f); - if (nnf.isCNF(f)) { - return LNGResult.of(nnf); + if (nnf.isCnf(f)) { + return LngResult.of(nnf); } Formula pg; if (nnf.numberOfAtoms(f) < boundaryForFactorization) { @@ -120,7 +120,7 @@ public LNGResult apply(final Formula formula, final ComputationHandler pg = pg.restrict(f, topLevel); } state.literalMap.put(formula, state.literal(nnf)); - return LNGResult.of(pg); + return LngResult.of(pg); } private Formula computeTransformation(final Formula formula) { @@ -177,16 +177,16 @@ public String toString() { return String.format("PlaistedGreenbaumTransformation{boundary=%d}", boundaryForFactorization); } - public static final class PGState { + public static final class PgState { private final Map posMap; private final Map literalMap; - public PGState() { + public PgState() { posMap = new HashMap<>(); literalMap = new HashMap<>(); } - public PGState(final Map posMap, final Map literalMap) { + public PgState(final Map posMap, final Map literalMap) { this.posMap = posMap; this.literalMap = literalMap; } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSATSolver.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSatSolver.java similarity index 75% rename from core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSATSolver.java rename to core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSatSolver.java index 78f27682..91483b4a 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSATSolver.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationMaxSatSolver.java @@ -4,11 +4,11 @@ package com.booleworks.logicng.transformations.cnf; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; /** * A Plaisted-Greenbaum CNF conversion which is performed directly on the @@ -16,25 +16,25 @@ * @version 3.0.0 * @since 1.6.0 */ -public final class PlaistedGreenbaumTransformationMaxSATSolver extends PlaistedGreenbaumCommon { +public final class PlaistedGreenbaumTransformationMaxSatSolver extends PlaistedGreenbaumCommon { - private final MaxSAT solver; + private final MaxSat solver; /** * Constructs a new transformation for a given MaxSAT solver. * @param f the formula factory to generate new formulas - * @param performNNF flag whether an NNF transformation should be + * @param performNnf flag whether an NNF transformation should be * performed on the input formula * @param solver the solver */ - public PlaistedGreenbaumTransformationMaxSATSolver(final FormulaFactory f, final boolean performNNF, - final MaxSAT solver) { - super(f, performNNF); + public PlaistedGreenbaumTransformationMaxSatSolver(final FormulaFactory f, final boolean performNnf, + final MaxSat solver) { + super(f, performNnf); this.solver = solver; } @Override - void addCNF(final Formula cnf, final Integer weight) { + void addCnf(final Formula cnf, final Integer weight) { switch (cnf.getType()) { case TRUE: break; @@ -59,7 +59,7 @@ protected int newSolverVariable() { } @Override - void addToSolver(final LNGIntVector clause, final Integer addendum) { + void addToSolver(final LngIntVector clause, final Integer addendum) { solver.addClause(clause, addendum); } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolver.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolver.java index 05fa0844..26da0975 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolver.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolver.java @@ -4,16 +4,16 @@ package com.booleworks.logicng.transformations.cnf; -import static com.booleworks.logicng.solvers.sat.LNGCoreSolver.generateClauseVector; -import static com.booleworks.logicng.solvers.sat.LNGCoreSolver.solverLiteral; +import static com.booleworks.logicng.solvers.sat.LngCoreSolver.generateClauseVector; +import static com.booleworks.logicng.solvers.sat.LngCoreSolver.solverLiteral; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.InternalAuxVarType; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.propositions.Proposition; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; /** * A Plaisted-Greenbaum CNF conversion which is performed directly on the @@ -23,23 +23,23 @@ */ public final class PlaistedGreenbaumTransformationSolver extends PlaistedGreenbaumCommon { - private final LNGCoreSolver solver; + private final LngCoreSolver solver; /** * Constructs a new transformation for a given SAT solver. * @param f the formula factory to generate new formulas - * @param performNNF flag whether an NNF transformation should be + * @param performNnf flag whether an NNF transformation should be * performed on the input formula * @param solver the solver */ - public PlaistedGreenbaumTransformationSolver(final FormulaFactory f, final boolean performNNF, - final LNGCoreSolver solver) { - super(f, performNNF); + public PlaistedGreenbaumTransformationSolver(final FormulaFactory f, final boolean performNnf, + final LngCoreSolver solver) { + super(f, performNnf); this.solver = solver; } @Override - protected void addCNF(final Formula cnf, final Proposition proposition) { + protected void addCnf(final Formula cnf, final Proposition proposition) { switch (cnf.getType()) { case TRUE: break; @@ -67,7 +67,7 @@ protected int newSolverVariable() { } @Override - void addToSolver(final LNGIntVector clause, final Proposition addendum) { + void addToSolver(final LngIntVector clause, final Proposition addendum) { solver.addClause(clause, addendum); } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/cnf/TseitinTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/cnf/TseitinTransformation.java index c368711c..4596628f 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/cnf/TseitinTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/cnf/TseitinTransformation.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatefulFormulaTransformation; import java.util.ArrayList; @@ -33,7 +33,7 @@ public final class TseitinTransformation extends StatefulFormulaTransformation apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Formula nnf = formula.nnf(f); - if (nnf.isCNF(f)) { - return LNGResult.of(nnf); + if (nnf.isCnf(f)) { + return LngResult.of(nnf); } Formula tseitin = state.formula(nnf); if (tseitin != null) { final Assignment topLevel = new Assignment(state.literal(nnf)); - return LNGResult.of(state.formula(nnf).restrict(f, topLevel)); + return LngResult.of(state.formula(nnf).restrict(f, topLevel)); } if (nnf.numberOfAtoms(f) < boundaryForFactorization) { tseitin = nnf.transform(factorization); @@ -108,7 +108,7 @@ public LNGResult apply(final Formula formula, final ComputationHandler tseitin = state.formula(nnf).restrict(f, topLevel); } state.literalMap.put(formula, state.literal(nnf)); - return LNGResult.of(tseitin); + return LngResult.of(tseitin); } /** @@ -128,7 +128,7 @@ private void computeTseitin(final Formula formula) { case AND: case OR: final boolean isConjunction = formula instanceof And; - final Literal tsLiteral = f.newCNFVariable(); + final Literal tsLiteral = f.newCnfVariable(); final List nops = new ArrayList<>(); final List operands = new ArrayList<>(formula.numberOfOperands()); final List negOperands = new ArrayList<>(formula.numberOfOperands()); diff --git a/core/src/main/java/com/booleworks/logicng/transformations/dnf/BDDDNFTransformation.java b/core/src/main/java/com/booleworks/logicng/transformations/dnf/BddDnfTransformation.java similarity index 78% rename from core/src/main/java/com/booleworks/logicng/transformations/dnf/BDDDNFTransformation.java rename to core/src/main/java/com/booleworks/logicng/transformations/dnf/BddDnfTransformation.java index 3b247ef3..37069975 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/dnf/BDDDNFTransformation.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/dnf/BddDnfTransformation.java @@ -7,9 +7,9 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.transformations.BDDNormalFormTransformation; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.transformations.BddNormalFormTransformation; import java.util.Map; @@ -18,7 +18,7 @@ * @version 3.0.0 * @since 2.3.0 */ -public final class BDDDNFTransformation extends BDDNormalFormTransformation { +public final class BddDnfTransformation extends BddNormalFormTransformation { /** * Constructs a new BDD-based CNF transformation with an optional BDD @@ -30,7 +30,7 @@ public final class BDDDNFTransformation extends BDDNormalFormTransformation { * @param f the formula factory to generate new formulas * @param kernel the optional BDD kernel */ - public BDDDNFTransformation(final FormulaFactory f, final BDDKernel kernel) { + public BddDnfTransformation(final FormulaFactory f, final BddKernel kernel) { super(f, false, kernel); } @@ -45,7 +45,7 @@ public BDDDNFTransformation(final FormulaFactory f, final BDDKernel kernel) { * @param kernel the optional BDD kernel * @param cache the cache to use for this transformation */ - public BDDDNFTransformation(final FormulaFactory f, final BDDKernel kernel, final Map cache) { + public BddDnfTransformation(final FormulaFactory f, final BddKernel kernel, final Map cache) { super(f, false, kernel, cache); } @@ -54,12 +54,12 @@ public BDDDNFTransformation(final FormulaFactory f, final BDDKernel kernel, fina * kernel for every formula application. * @param f the formula factory to generate new formulas */ - public BDDDNFTransformation(final FormulaFactory f) { + public BddDnfTransformation(final FormulaFactory f) { super(f, false, null); } @Override - public LNGResult apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { return compute(formula, handler); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumeration.java b/core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumeration.java similarity index 70% rename from core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumeration.java rename to core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumeration.java index 0dede2a5..ed56afb1 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumeration.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumeration.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.CanonicalEnumeration; /** @@ -15,14 +15,14 @@ * @version 3.0.0 * @since 1.0 */ -public final class CanonicalDNFEnumeration extends CanonicalEnumeration { +public final class CanonicalDnfEnumeration extends CanonicalEnumeration { - public CanonicalDNFEnumeration(final FormulaFactory f) { + public CanonicalDnfEnumeration(final FormulaFactory f) { super(f); } @Override - public LNGResult apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { return compute(formula, handler, false); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFFactorization.java b/core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfFactorization.java similarity index 80% rename from core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFFactorization.java rename to core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfFactorization.java index 96b51bda..96196015 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFFactorization.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfFactorization.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.FactorizationCreatedClauseEvent; import com.booleworks.logicng.transformations.CacheableFormulaTransformation; @@ -25,13 +25,13 @@ * @version 3.0.0 * @since 1.0 */ -public final class DNFFactorization extends CacheableFormulaTransformation { +public final class DnfFactorization extends CacheableFormulaTransformation { /** * Constructor for a DNF Factorization. * @param f the formula factory to generate new formulas */ - public DNFFactorization(final FormulaFactory f) { + public DnfFactorization(final FormulaFactory f) { super(f, TransformationCacheEntry.FACTORIZED_DNF); } @@ -40,25 +40,25 @@ public DNFFactorization(final FormulaFactory f) { * @param f the formula factory to generate new formulas * @param cache the cache to use for the transformation */ - public DNFFactorization(final FormulaFactory f, final Map cache) { + public DnfFactorization(final FormulaFactory f, final Map cache) { super(f, cache); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { if (!handler.shouldResume(FACTORIZATION_STARTED)) { - return LNGResult.canceled(FACTORIZATION_STARTED); + return LngResult.canceled(FACTORIZATION_STARTED); } return applyRec(formula, handler); } - private LNGResult applyRec(final Formula formula, final ComputationHandler handler) { + private LngResult applyRec(final Formula formula, final ComputationHandler handler) { if (formula.getType().getPrecedence() >= FType.LITERAL.getPrecedence()) { - return LNGResult.of(formula); + return LngResult.of(formula); } final Formula cached = lookupCache(formula); if (cached != null) { - return LNGResult.of(cached); + return LngResult.of(cached); } final Formula computed; switch (formula.getType()) { @@ -66,7 +66,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand case IMPL: case EQUIV: case PBC: - final LNGResult rec = applyRec(formula.nnf(f), handler); + final LngResult rec = applyRec(formula.nnf(f), handler); if (rec.isSuccess()) { computed = rec.getResult(); } else { @@ -76,7 +76,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand case OR: LinkedHashSet nops = new LinkedHashSet<>(); for (final Formula op : formula) { - final LNGResult nop = applyRec(op, handler); + final LngResult nop = applyRec(op, handler); if (nop.isSuccess()) { nops.add(nop.getResult()); } else { @@ -88,7 +88,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand case AND: nops = new LinkedHashSet<>(); for (final Formula op : formula) { - final LNGResult nop = applyRec(op, handler); + final LngResult nop = applyRec(op, handler); if (nop.isSuccess()) { nops.add(nop.getResult()); } else { @@ -98,7 +98,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand final Iterator it = nops.iterator(); Formula currentResult = it.next(); while (it.hasNext()) { - final LNGResult distributed = distribute(currentResult, it.next(), handler); + final LngResult distributed = distribute(currentResult, it.next(), handler); if (distributed.isSuccess()) { currentResult = distributed.getResult(); } else { @@ -111,7 +111,7 @@ private LNGResult applyRec(final Formula formula, final ComputationHand throw new IllegalArgumentException("Could not process the formula type " + formula.getType()); } setCache(formula, computed); - return LNGResult.of(computed); + return LngResult.of(computed); } /** @@ -121,28 +121,28 @@ private LNGResult applyRec(final Formula formula, final ComputationHand * @param handler the computation handler * @return the distribution of the two formulas */ - private LNGResult distribute(final Formula f1, final Formula f2, final ComputationHandler handler) { + private LngResult distribute(final Formula f1, final Formula f2, final ComputationHandler handler) { if (!handler.shouldResume(DISTRIBUTION_PERFORMED)) { - return LNGResult.canceled(DISTRIBUTION_PERFORMED); + return LngResult.canceled(DISTRIBUTION_PERFORMED); } if (f1.getType() == FType.OR || f2.getType() == FType.OR) { final LinkedHashSet nops = new LinkedHashSet<>(); for (final Formula op : f1.getType() == FType.OR ? f1 : f2) { - final LNGResult distributed = distribute(op, f1.getType() == FType.OR ? f2 : f1, handler); + final LngResult distributed = distribute(op, f1.getType() == FType.OR ? f2 : f1, handler); if (distributed.isSuccess()) { nops.add(distributed.getResult()); } else { return distributed; } } - return LNGResult.of(f.or(nops)); + return LngResult.of(f.or(nops)); } final Formula clause = f.and(f1, f2); final FactorizationCreatedClauseEvent createdClauseEvent = new FactorizationCreatedClauseEvent(clause); if (handler.shouldResume(createdClauseEvent)) { - return LNGResult.of(clause); + return LngResult.of(clause); } else { - return LNGResult.canceled(createdClauseEvent); + return LngResult.canceled(createdClauseEvent); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFSubsumption.java b/core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfSubsumption.java similarity index 71% rename from core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFSubsumption.java rename to core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfSubsumption.java index 657015af..33e5b5e7 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/dnf/DNFSubsumption.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/dnf/DnfSubsumption.java @@ -4,13 +4,13 @@ package com.booleworks.logicng.transformations.dnf; -import com.booleworks.logicng.datastructures.ubtrees.UBTree; +import com.booleworks.logicng.datastructures.ubtrees.UbTree; import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.Subsumption; import java.util.ArrayList; @@ -25,31 +25,31 @@ * @version 3.0.0 * @since 1.5.0 */ -public final class DNFSubsumption extends Subsumption { +public final class DnfSubsumption extends Subsumption { - public DNFSubsumption(final FormulaFactory f) { + public DnfSubsumption(final FormulaFactory f) { super(f); } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - if (!formula.isDNF(f)) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { + if (!formula.isDnf(f)) { throw new IllegalArgumentException("DNF subsumption can only be applied to formulas in DNF"); } if (formula.getType().getPrecedence() >= FType.LITERAL.getPrecedence() || formula.getType() == FType.AND) { - return LNGResult.of(formula); + return LngResult.of(formula); } assert formula.getType() == FType.OR; - final LNGResult> ubTreeResult = generateSubsumedUBTree(formula, handler); + final LngResult> ubTreeResult = generateSubsumedUbTree(formula, handler); if (!ubTreeResult.isSuccess()) { - return LNGResult.canceled(ubTreeResult.getCancelCause()); + return LngResult.canceled(ubTreeResult.getCancelCause()); } else { - final UBTree ubTree = ubTreeResult.getResult(); + final UbTree ubTree = ubTreeResult.getResult(); final List minterms = new ArrayList<>(); for (final SortedSet literals : ubTree.allSets()) { minterms.add(f.and(literals)); } - return LNGResult.of(f.or(minterms)); + return LngResult.of(f.or(minterms)); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/qe/ExistentialQuantifierElimination.java b/core/src/main/java/com/booleworks/logicng/transformations/qe/ExistentialQuantifierElimination.java index e3e70b82..573f04f6 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/qe/ExistentialQuantifierElimination.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/qe/ExistentialQuantifierElimination.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; import java.util.Arrays; @@ -52,11 +52,11 @@ public ExistentialQuantifierElimination(final FormulaFactory f, final Collection } @Override - public LNGResult apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, ComputationHandler handler) { Formula result = formula; for (final Variable var : elimination) { result = f.or(result.restrict(f, new Assignment(var)), result.restrict(f, new Assignment(var.negate(f)))); } - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/qe/UniversalQuantifierElimination.java b/core/src/main/java/com/booleworks/logicng/transformations/qe/UniversalQuantifierElimination.java index 6bba3daf..338cac3e 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/qe/UniversalQuantifierElimination.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/qe/UniversalQuantifierElimination.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; import java.util.Arrays; @@ -52,11 +52,11 @@ public UniversalQuantifierElimination(final FormulaFactory f, final Collection apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, ComputationHandler handler) { Formula result = formula; for (final Variable var : elimination) { result = f.and(result.restrict(f, new Assignment(var)), result.restrict(f, new Assignment(var.negate(f)))); } - return LNGResult.of(result); + return LngResult.of(result); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifier.java index dcdb543c..87729db7 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifier.java @@ -16,7 +16,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.primecomputation.PrimeCompiler; import com.booleworks.logicng.primecomputation.PrimeResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; @@ -81,28 +81,28 @@ public AdvancedSimplifier(final FormulaFactory f, final AdvancedSimplifierConfig } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { if (!handler.shouldResume(ADVANCED_SIMPLIFICATION_STARTED)) { - return LNGResult.canceled(ADVANCED_SIMPLIFICATION_STARTED); + return LngResult.canceled(ADVANCED_SIMPLIFICATION_STARTED); } Formula simplified = formula; final SortedSet backboneLiterals = new TreeSet<>(); if (config.restrictBackbone) { - final LNGResult backboneResult = BackboneGeneration.compute(f, Collections.singletonList(formula), + final LngResult backboneResult = BackboneGeneration.compute(f, Collections.singletonList(formula), formula.variables(f), BackboneType.POSITIVE_AND_NEGATIVE, handler); if (!backboneResult.isSuccess()) { - return LNGResult.canceled(backboneResult.getCancelCause()); + return LngResult.canceled(backboneResult.getCancelCause()); } final Backbone backbone = backboneResult.getResult(); if (!backbone.isSat()) { - return LNGResult.of(f.falsum()); + return LngResult.of(f.falsum()); } backboneLiterals.addAll(backbone.getCompleteBackbone(f)); simplified = formula.restrict(f, new Assignment(backboneLiterals)); } - final LNGResult simplifyMinDnf = computeMinDnf(f, simplified, handler); + final LngResult simplifyMinDnf = computeMinDnf(f, simplified, handler); if (!simplifyMinDnf.isSuccess()) { - return LNGResult.canceled(simplifyMinDnf.getCancelCause()); + return LngResult.canceled(simplifyMinDnf.getCancelCause()); } simplified = simplifyWithRating(simplified, simplifyMinDnf.getResult(), config); if (config.factorOut) { @@ -116,25 +116,25 @@ public LNGResult apply(final Formula formula, final ComputationHandler final Formula negationSimplified = simplified.transform(new NegationSimplifier(f)); simplified = simplifyWithRating(simplified, negationSimplified, config); } - return LNGResult.of(simplified); + return LngResult.of(simplified); } - private LNGResult computeMinDnf(final FormulaFactory f, final Formula simplified, + private LngResult computeMinDnf(final FormulaFactory f, final Formula simplified, final ComputationHandler handler) { - final LNGResult primeResult = PrimeCompiler.getWithMinimization() + final LngResult primeResult = PrimeCompiler.getWithMinimization() .compute(f, simplified, PrimeResult.CoverageType.IMPLICANTS_COMPLETE, handler); if (!primeResult.isSuccess()) { - return LNGResult.canceled(primeResult.getCancelCause()); + return LngResult.canceled(primeResult.getCancelCause()); } final List> primeImplicants = primeResult.getResult().getPrimeImplicants(); - final LNGResult> minimizedPIsResult = + final LngResult> minimizedPisResult = SmusComputation.computeSmusForFormulas(f, negateAllLiterals(f, primeImplicants), Collections.singletonList(simplified), handler); - if (!minimizedPIsResult.isSuccess()) { - return LNGResult.canceled(minimizedPIsResult.getCancelCause()); + if (!minimizedPisResult.isSuccess()) { + return LngResult.canceled(minimizedPisResult.getCancelCause()); } else { - final List minimizedPIs = minimizedPIsResult.getResult(); - return LNGResult.of(f.or( + final List minimizedPIs = minimizedPisResult.getResult(); + return LngResult.of(f.or( negateAllLiteralsInFormulas(f, minimizedPIs).stream().map(f::and).collect(Collectors.toList()))); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/BackboneSimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/BackboneSimplifier.java index 7b3b278f..544a14da 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/BackboneSimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/BackboneSimplifier.java @@ -10,8 +10,8 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.BackboneFunction; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; @@ -30,27 +30,27 @@ public BackboneSimplifier(final FormulaFactory f) { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - final SATSolver solver = SATSolver.newSolver(f); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); - final LNGResult backboneResult = solver.execute(BackboneFunction.builder() + final LngResult backboneResult = solver.execute(BackboneFunction.builder() .variables(formula.variables(f)) .type(BackboneType.POSITIVE_AND_NEGATIVE) .build(), handler); if (!backboneResult.isSuccess()) { - return LNGResult.canceled(backboneResult.getCancelCause()); + return LngResult.canceled(backboneResult.getCancelCause()); } final Backbone backbone = backboneResult.getResult(); if (!backbone.isSat()) { - return LNGResult.of(f.falsum()); + return LngResult.of(f.falsum()); } if (!backbone.getNegativeBackbone().isEmpty() || !backbone.getPositiveBackbone().isEmpty()) { final Formula backboneFormula = backbone.toFormula(f); final Assignment assignment = new Assignment(backbone.getCompleteBackbone(f)); final Formula restrictedFormula = formula.restrict(f, assignment); - return LNGResult.of(f.and(backboneFormula, restrictedFormula)); + return LngResult.of(f.and(backboneFormula, restrictedFormula)); } else { - return LNGResult.of(formula); + return LngResult.of(formula); } } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/DefaultRatingFunction.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/DefaultRatingFunction.java index a90fc266..8be16c39 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/DefaultRatingFunction.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/DefaultRatingFunction.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.printer.DefaultStringRepresentation; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; /** * A rating function which rates a formula with the length of its representation @@ -33,7 +33,7 @@ public static DefaultRatingFunction get() { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { - return LNGResult.of(formatter.toString(formula).length()); + public LngResult apply(final Formula formula, final ComputationHandler handler) { + return LngResult.of(formatter.toString(formula).length()); } } diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/DistributiveSimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/DistributiveSimplifier.java index bd91dc9f..45a0852a 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/DistributiveSimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/DistributiveSimplifier.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.cache.TransformationCacheEntry; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.CacheableFormulaTransformation; import java.util.LinkedHashMap; @@ -37,10 +37,10 @@ public DistributiveSimplifier(final FormulaFactory f, final Map apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { Formula result = lookupCache(formula); if (result != null) { - return LNGResult.of(result); + return LngResult.of(result); } switch (formula.getType()) { case FALSE: @@ -70,7 +70,7 @@ public LNGResult apply(final Formula formula, final ComputationHandler throw new IllegalStateException("Unknown formula type: " + formula.getType()); } setCache(formula, result); - return LNGResult.of(result); + return LngResult.of(result); } private Formula distributeNAry(final Formula formula) { diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/FactorOutSimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/FactorOutSimplifier.java index 4ad6f492..b418d218 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/FactorOutSimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/FactorOutSimplifier.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; import com.booleworks.logicng.util.Pair; @@ -52,14 +52,14 @@ public FactorOutSimplifier(final FormulaFactory f, final RatingFunction apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { Formula last; Formula simplified = formula; do { last = simplified; simplified = applyRec(last); } while (!simplified.equals(last)); - return LNGResult.of(simplified); + return LngResult.of(simplified); } private Formula applyRec(final Formula formula) { diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/NegationSimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/NegationSimplifier.java index 5ede87e7..bc17bde1 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/NegationSimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/NegationSimplifier.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.NAryOperator; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; import java.util.ArrayList; @@ -33,13 +33,13 @@ public NegationSimplifier(final FormulaFactory f) { } @Override - public LNGResult apply(final Formula formula, final ComputationHandler handler) { + public LngResult apply(final Formula formula, final ComputationHandler handler) { final Formula nnf = formula.nnf(f); if (nnf.isAtomicFormula()) { - return LNGResult.of(getSmallestFormula(true, formula, nnf)); + return LngResult.of(getSmallestFormula(true, formula, nnf)); } final MinimizationResult result = minimize(nnf, true); - return LNGResult.of(getSmallestFormula(true, formula, nnf, result.positiveResult)); + return LngResult.of(getSmallestFormula(true, formula, nnf, result.positiveResult)); } private MinimizationResult minimize(final Formula formula, final boolean topLevel) { diff --git a/core/src/main/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeySimplifier.java b/core/src/main/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeySimplifier.java index 0d7aae7a..efc0e06a 100644 --- a/core/src/main/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeySimplifier.java +++ b/core/src/main/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeySimplifier.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.transformations.StatelessFormulaTransformation; /** @@ -30,7 +30,7 @@ protected QuineMcCluskeySimplifier(final FormulaFactory f) { } @Override - public LNGResult apply(final Formula formula, ComputationHandler handler) { + public LngResult apply(final Formula formula, ComputationHandler handler) { final var qmcConfig = AdvancedSimplifierConfig.builder() .factorOut(false) .restrictBackbone(false) diff --git a/core/src/test/java/com/booleworks/logicng/LogicNGTest.java b/core/src/test/java/com/booleworks/logicng/LogicNGTest.java index a44e2269..f2dd45f3 100644 --- a/core/src/test/java/com/booleworks/logicng/LogicNGTest.java +++ b/core/src/test/java/com/booleworks/logicng/LogicNGTest.java @@ -6,14 +6,14 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; public interface LogicNGTest { - default void assertSolverSat(final SATSolver solver) { + default void assertSolverSat(final SatSolver solver) { assertThat(solver.sat()).isTrue(); } - default void assertSolverUnsat(final SATSolver solver) { + default void assertSolverUnsat(final SatSolver solver) { assertThat(solver.sat()).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/LogicNGVersionTest.java b/core/src/test/java/com/booleworks/logicng/LogicNGVersionTest.java index 98ff378c..213bf5d0 100644 --- a/core/src/test/java/com/booleworks/logicng/LogicNGVersionTest.java +++ b/core/src/test/java/com/booleworks/logicng/LogicNGVersionTest.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.MockedStatic; @@ -22,7 +22,7 @@ public class LogicNGVersionTest { @Test public void test() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(A | ~B) & (B | C)")); solver.satCall().addFormulas(f.parse("~A"), f.parse("~C")).sat(); } diff --git a/core/src/test/java/com/booleworks/logicng/backbones/BackboneGenerationTest.java b/core/src/test/java/com/booleworks/logicng/backbones/BackboneGenerationTest.java index 0f4e9883..a80974de 100644 --- a/core/src/test/java/com/booleworks/logicng/backbones/BackboneGenerationTest.java +++ b/core/src/test/java/com/booleworks/logicng/backbones/BackboneGenerationTest.java @@ -14,11 +14,11 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.BoundedSatHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.DimacsReader; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.BackboneFunction; import com.booleworks.logicng.util.FormulaHelper; @@ -90,7 +90,7 @@ public void testBackboneGeneration() { @Test public void testSimpleBackbones() { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Literal x = f.literal("x", true); final Literal y = f.literal("y", true); @@ -194,7 +194,7 @@ public void testSmallFormulas() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/small_formulas.txt"); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final Backbone backbone = solver.execute(BackboneFunction.builder().variables(formula.variables(f)).build()); assertThat(verifyBackbone(backbone, formula, formula.variables(f))).isTrue(); @@ -205,7 +205,7 @@ public void testLargeFormula() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/large_formula.txt"); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final Backbone backbone = solver.execute(BackboneFunction.builder().variables(formula.variables(f)).build()); assertThat(verifyBackbone(backbone, formula, formula.variables(f))).isTrue(); @@ -213,7 +213,7 @@ public void testLargeFormula() throws IOException, ParserException { private boolean verifyBackbone(final Backbone backbone, final Formula formula, final Collection variables) { - final SATSolver solver = SATSolver.newSolver(formula.getFactory()); + final SatSolver solver = SatSolver.newSolver(formula.getFactory()); solver.add(formula); for (final Variable bbVar : backbone.getPositiveBackbone()) { if (solver.satCall().addFormulas(bbVar.negate(f)).sat().getResult()) { @@ -242,7 +242,7 @@ private boolean verifyBackbone(final Backbone backbone, final Formula formula, @Test public void testBackboneType() { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Literal x = f.literal("x", true); final Literal y = f.literal("y", true); @@ -323,7 +323,7 @@ public void testCancellationPoints() throws IOException { final List formulas = DimacsReader.readCNF(f, "../test_files/sat/term1_gr_rcs_w4.shuffled.cnf"); for (int numStarts = 0; numStarts < 10; numStarts++) { final ComputationHandler handler = new BoundedSatHandler(numStarts); - final LNGResult result = BackboneGeneration.compute(f, formulas, FormulaHelper.variables(f, formulas), + final LngResult result = BackboneGeneration.compute(f, formulas, FormulaHelper.variables(f, formulas), BackboneType.POSITIVE_AND_NEGATIVE, handler); assertThat(result.isSuccess()).isFalse(); } diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGBooleanVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngBooleanVectorTest.java similarity index 86% rename from core/src/test/java/com/booleworks/logicng/collections/LNGBooleanVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngBooleanVectorTest.java index 25f12787..e93e228a 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGBooleanVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngBooleanVectorTest.java @@ -9,29 +9,29 @@ import org.junit.jupiter.api.Test; -public class LNGBooleanVectorTest { +public class LngBooleanVectorTest { @Test public void testVectorCreation() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGBooleanVector v2 = new LNGBooleanVector(10); + final LngBooleanVector v2 = new LngBooleanVector(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGBooleanVector v3 = new LNGBooleanVector(10, true); + final LngBooleanVector v3 = new LngBooleanVector(10, true); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isTrue(); } assertThat(v3.isEmpty()).isFalse(); - final LNGBooleanVector v4 = new LNGBooleanVector(v3); + final LngBooleanVector v4 = new LngBooleanVector(v3); assertThat(v4.size()).isEqualTo(10); for (int i = 0; i < v4.size(); i++) { assertThat(v4.get(i)).isTrue(); } assertThat(v4.isEmpty()).isFalse(); - final LNGBooleanVector v5 = new LNGBooleanVector(true, true, true, false, false); + final LngBooleanVector v5 = new LngBooleanVector(true, true, true, false, false); assertThat(v5.size()).isEqualTo(5); for (int i = 0; i < 5; i++) { if (i < 3) { @@ -44,7 +44,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); @@ -59,7 +59,7 @@ public void testVectorAddElements() { @Test public void legalUnsafePush() { - final LNGBooleanVector v1 = new LNGBooleanVector(1000); + final LngBooleanVector v1 = new LngBooleanVector(1000); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.unsafePush(i % 2 == 0); @@ -74,7 +74,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGBooleanVector v1 = new LNGBooleanVector(100); + final LngBooleanVector v1 = new LngBooleanVector(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -85,7 +85,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); } @@ -101,7 +101,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); @@ -118,7 +118,7 @@ public void testVectorShrink() { @Test public void testGrowTo() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); @@ -147,7 +147,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); @@ -165,7 +165,7 @@ public void testRemoveElements() { @Test public void testReverseInplace() { - final LNGBooleanVector v1 = new LNGBooleanVector(true, true, false, true, false, false, true, true); + final LngBooleanVector v1 = new LngBooleanVector(true, true, false, true, false, false, true, true); v1.shrinkTo(7); v1.reverseInplace(); assertThat(v1.get(0)).isEqualTo(true); @@ -179,7 +179,7 @@ public void testReverseInplace() { @Test public void testToArray() { - final LNGBooleanVector v1 = new LNGBooleanVector(1000); + final LngBooleanVector v1 = new LngBooleanVector(1000); final boolean[] expected = new boolean[500]; for (int i = 0; i < 1000; i++) { v1.push(i % 2 == 0); @@ -193,7 +193,7 @@ public void testToArray() { @Test public void testToString() { - final LNGBooleanVector v1 = new LNGBooleanVector(); + final LngBooleanVector v1 = new LngBooleanVector(); assertThat(v1.toString()).isEqualTo("[]"); v1.push(true); assertThat(v1.toString()).isEqualTo("[true]"); diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGByteVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngByteVectorTest.java similarity index 84% rename from core/src/test/java/com/booleworks/logicng/collections/LNGByteVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngByteVectorTest.java index fd3826ac..705526d3 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGByteVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngByteVectorTest.java @@ -9,29 +9,29 @@ import org.junit.jupiter.api.Test; -public class LNGByteVectorTest { +public class LngByteVectorTest { @Test public void testVectorCreation() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGByteVector v2 = new LNGByteVector(10); + final LngByteVector v2 = new LngByteVector(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGByteVector v3 = new LNGByteVector(10, (byte) 42); + final LngByteVector v3 = new LngByteVector(10, (byte) 42); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isEqualTo((byte) 42); } assertThat(v3.isEmpty()).isFalse(); - final LNGByteVector v4 = new LNGByteVector(v3); + final LngByteVector v4 = new LngByteVector(v3); assertThat(v4.size()).isEqualTo(10); for (int i = 0; i < v4.size(); i++) { assertThat(v4.get(i)).isEqualTo((byte) 42); } assertThat(v4.isEmpty()).isFalse(); - final LNGByteVector v5 = new LNGByteVector((byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4); + final LngByteVector v5 = new LngByteVector((byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4); assertThat(v5.size()).isEqualTo(5); for (int i = 0; i < 5; i++) { assertThat(v5.get(i)).isEqualTo((byte) i); @@ -40,7 +40,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 100; i++) { v1.push((byte) i); @@ -55,7 +55,7 @@ public void testVectorAddElements() { @Test public void legalUnsafePush() { - final LNGByteVector v1 = new LNGByteVector(100); + final LngByteVector v1 = new LngByteVector(100); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 100; i++) { v1.unsafePush((byte) i); @@ -70,7 +70,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGByteVector v1 = new LNGByteVector(100); + final LngByteVector v1 = new LngByteVector(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -81,7 +81,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); for (int i = 0; i < 100; i++) { v1.push((byte) i); } @@ -97,7 +97,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 100; i++) { v1.push((byte) i); @@ -114,7 +114,7 @@ public void testVectorShrink() { @Test public void testGrowTo() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 50; i++) { v1.push((byte) i); @@ -143,7 +143,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 100; i++) { v1.push((byte) i); @@ -161,8 +161,8 @@ public void testRemoveElements() { @Test public void testSort() { - final LNGByteVector v1 = new LNGByteVector(100); - final LNGByteVector v2 = new LNGByteVector(100); + final LngByteVector v1 = new LngByteVector(100); + final LngByteVector v2 = new LngByteVector(100); for (int i = 99; i >= 0; i--) { v1.push((byte) i); } @@ -177,15 +177,15 @@ public void testSort() { assertThat(v1.get(i) < v1.get(i + 1)).isTrue(); } } - final LNGByteVector v3 = new LNGByteVector(100); + final LngByteVector v3 = new LngByteVector(100); v3.sort(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSortReverse() { - final LNGByteVector v1 = new LNGByteVector(100); - final LNGByteVector v2 = new LNGByteVector(100); + final LngByteVector v1 = new LngByteVector(100); + final LngByteVector v2 = new LngByteVector(100); for (int i = 99; i >= 0; i--) { v1.push((byte) i); } @@ -200,14 +200,14 @@ public void testSortReverse() { assertThat(v1.get(i) > v1.get(i + 1)).isTrue(); } } - final LNGByteVector v3 = new LNGByteVector(100); + final LngByteVector v3 = new LngByteVector(100); v3.sortReverse(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testToArray() { - final LNGByteVector v1 = new LNGByteVector(100); + final LngByteVector v1 = new LngByteVector(100); final byte[] expected = new byte[50]; for (int i = 0; i < 100; i++) { v1.push((byte) i); @@ -221,7 +221,7 @@ public void testToArray() { @Test public void testToString() { - final LNGByteVector v1 = new LNGByteVector(); + final LngByteVector v1 = new LngByteVector(); assertThat(v1.toString()).isEqualTo("[]"); v1.push((byte) 1); assertThat(v1.toString()).isEqualTo("[1]"); diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGDoubleVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngDoubleVectorTest.java similarity index 83% rename from core/src/test/java/com/booleworks/logicng/collections/LNGDoubleVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngDoubleVectorTest.java index 2c0fb4d4..daf5ad11 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGDoubleVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngDoubleVectorTest.java @@ -10,33 +10,33 @@ import org.junit.jupiter.api.Test; /** - * Unit tests for {@link LNGDoubleVector}. + * Unit tests for {@link LngDoubleVector}. * @version 2.0.0 * @since 1.0 */ -public class LNGDoubleVectorTest { +public class LngDoubleVectorTest { @Test public void testVectorCreation() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGDoubleVector v2 = new LNGDoubleVector(10); + final LngDoubleVector v2 = new LngDoubleVector(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGDoubleVector v3 = new LNGDoubleVector(10, 42.0); + final LngDoubleVector v3 = new LngDoubleVector(10, 42.0); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isEqualTo(42.0); } assertThat(v3.isEmpty()).isFalse(); - final LNGDoubleVector v4 = new LNGDoubleVector(v3); + final LngDoubleVector v4 = new LngDoubleVector(v3); assertThat(v4.size()).isEqualTo(10); for (int i = 0; i < v4.size(); i++) { assertThat(v4.get(i)).isEqualTo(42.0); } assertThat(v4.isEmpty()).isFalse(); - final LNGDoubleVector v5 = new LNGDoubleVector(0.0, 1.0, 2.0, 3.0, 4.0); + final LngDoubleVector v5 = new LngDoubleVector(0.0, 1.0, 2.0, 3.0, 4.0); assertThat(v5.size()).isEqualTo(5); for (int i = 0; i < 5; i++) { assertThat(v5.get(i)).isEqualTo(i); @@ -45,7 +45,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -60,7 +60,7 @@ public void testVectorAddElements() { @Test public void legalUnsafePush() { - final LNGDoubleVector v1 = new LNGDoubleVector(1000); + final LngDoubleVector v1 = new LngDoubleVector(1000); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.unsafePush(i); @@ -75,7 +75,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGDoubleVector v1 = new LNGDoubleVector(100); + final LngDoubleVector v1 = new LngDoubleVector(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -86,7 +86,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); for (int i = 0; i < 1000; i++) { v1.push(i); } @@ -102,7 +102,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -116,7 +116,7 @@ public void testVectorShrink() { @Test public void testGrowTo() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -145,7 +145,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -163,8 +163,8 @@ public void testRemoveElements() { @Test public void testSort() { - final LNGDoubleVector v1 = new LNGDoubleVector(1000); - final LNGDoubleVector v2 = new LNGDoubleVector(1000); + final LngDoubleVector v1 = new LngDoubleVector(1000); + final LngDoubleVector v2 = new LngDoubleVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -179,15 +179,15 @@ public void testSort() { assertThat(v1.get(i) < v1.get(i + 1)).isTrue(); } } - final LNGDoubleVector v3 = new LNGDoubleVector(1000); + final LngDoubleVector v3 = new LngDoubleVector(1000); v3.sort(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSortReverse() { - final LNGDoubleVector v1 = new LNGDoubleVector(1000); - final LNGDoubleVector v2 = new LNGDoubleVector(1000); + final LngDoubleVector v1 = new LngDoubleVector(1000); + final LngDoubleVector v2 = new LngDoubleVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -202,14 +202,14 @@ public void testSortReverse() { assertThat(v1.get(i) > v1.get(i + 1)).isTrue(); } } - final LNGDoubleVector v3 = new LNGDoubleVector(1000); + final LngDoubleVector v3 = new LngDoubleVector(1000); v3.sortReverse(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testToArray() { - final LNGDoubleVector v1 = new LNGDoubleVector(1000); + final LngDoubleVector v1 = new LngDoubleVector(1000); final double[] expected = new double[500]; for (int i = 0; i < 1000; i++) { v1.push(i); @@ -223,7 +223,7 @@ public void testToArray() { @Test public void testToString() { - final LNGDoubleVector v1 = new LNGDoubleVector(); + final LngDoubleVector v1 = new LngDoubleVector(); assertThat(v1.toString()).isEqualTo("[]"); v1.push(1); assertThat(v1.toString()).isEqualTo("[1.0]"); diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGIntVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngIntVectorTest.java similarity index 84% rename from core/src/test/java/com/booleworks/logicng/collections/LNGIntVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngIntVectorTest.java index 6343f25e..47aa050f 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGIntVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngIntVectorTest.java @@ -11,29 +11,29 @@ import java.util.stream.IntStream; -public class LNGIntVectorTest { +public class LngIntVectorTest { @Test public void testVectorCreation() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGIntVector v2 = new LNGIntVector(10); + final LngIntVector v2 = new LngIntVector(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGIntVector v3 = LNGIntVector.of(IntStream.generate(() -> 42).limit(10).toArray()); + final LngIntVector v3 = LngIntVector.of(IntStream.generate(() -> 42).limit(10).toArray()); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isEqualTo(42); } assertThat(v3.isEmpty()).isFalse(); - final LNGIntVector v4 = new LNGIntVector(v3); + final LngIntVector v4 = new LngIntVector(v3); assertThat(v4.size()).isEqualTo(10); for (int i = 0; i < v4.size(); i++) { assertThat(v4.get(i)).isEqualTo(42); } assertThat(v4.isEmpty()).isFalse(); - final LNGIntVector v5 = LNGIntVector.of(0, 1, 2, 3, 4); + final LngIntVector v5 = LngIntVector.of(0, 1, 2, 3, 4); assertThat(v5.size()).isEqualTo(5); for (int i = 0; i < 5; i++) { assertThat(v5.get(i)).isEqualTo(i); @@ -42,7 +42,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -57,7 +57,7 @@ public void testVectorAddElements() { @Test public void legalUnsafePush() { - final LNGIntVector v1 = new LNGIntVector(1000); + final LngIntVector v1 = new LngIntVector(1000); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.unsafePush(i); @@ -72,7 +72,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGIntVector v1 = new LNGIntVector(100); + final LngIntVector v1 = new LngIntVector(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -83,7 +83,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); for (int i = 0; i < 1000; i++) { v1.push(i); } @@ -99,7 +99,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -113,7 +113,7 @@ public void testVectorShrink() { @Test public void testGrowTo() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -142,7 +142,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -160,8 +160,8 @@ public void testRemoveElements() { @Test public void testSort() { - final LNGIntVector v1 = new LNGIntVector(1000); - final LNGIntVector v2 = new LNGIntVector(1000); + final LngIntVector v1 = new LngIntVector(1000); + final LngIntVector v2 = new LngIntVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -176,15 +176,15 @@ public void testSort() { assertThat(v1.get(i) < v1.get(i + 1)).isTrue(); } } - final LNGIntVector v3 = new LNGIntVector(1000); + final LngIntVector v3 = new LngIntVector(1000); v3.sort(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSortReverse() { - final LNGIntVector v1 = new LNGIntVector(1000); - final LNGIntVector v2 = new LNGIntVector(1000); + final LngIntVector v1 = new LngIntVector(1000); + final LngIntVector v2 = new LngIntVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -199,14 +199,14 @@ public void testSortReverse() { assertThat(v1.get(i) > v1.get(i + 1)).isTrue(); } } - final LNGIntVector v3 = new LNGIntVector(1000); + final LngIntVector v3 = new LngIntVector(1000); v3.sortReverse(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testToArray() { - final LNGIntVector v1 = new LNGIntVector(1000); + final LngIntVector v1 = new LngIntVector(1000); final int[] expected = new int[500]; for (int i = 0; i < 1000; i++) { v1.push(i); @@ -220,7 +220,7 @@ public void testToArray() { @Test public void testToString() { - final LNGIntVector v1 = new LNGIntVector(); + final LngIntVector v1 = new LngIntVector(); assertThat(v1.toString()).isEqualTo("[]"); v1.push(1); assertThat(v1.toString()).isEqualTo("[1]"); diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGLongVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngLongVectorTest.java similarity index 84% rename from core/src/test/java/com/booleworks/logicng/collections/LNGLongVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngLongVectorTest.java index 8e1967fd..0985d07f 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGLongVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngLongVectorTest.java @@ -9,29 +9,29 @@ import org.junit.jupiter.api.Test; -public class LNGLongVectorTest { +public class LngLongVectorTest { @Test public void testVectorCreation() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGLongVector v2 = new LNGLongVector(10); + final LngLongVector v2 = new LngLongVector(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGLongVector v3 = new LNGLongVector(10, 42); + final LngLongVector v3 = new LngLongVector(10, 42); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isEqualTo(42); } assertThat(v3.isEmpty()).isFalse(); - final LNGLongVector v4 = new LNGLongVector(v3); + final LngLongVector v4 = new LngLongVector(v3); assertThat(v4.size()).isEqualTo(10); for (int i = 0; i < v4.size(); i++) { assertThat(v4.get(i)).isEqualTo(42); } assertThat(v4.isEmpty()).isFalse(); - final LNGLongVector v5 = new LNGLongVector(0, 1, 2, 3, 4); + final LngLongVector v5 = new LngLongVector(0, 1, 2, 3, 4); assertThat(v5.size()).isEqualTo(5); for (int i = 0; i < 5; i++) { assertThat(v5.get(i)).isEqualTo(i); @@ -40,7 +40,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -55,7 +55,7 @@ public void testVectorAddElements() { @Test public void legalUnsafePush() { - final LNGLongVector v1 = new LNGLongVector(1000); + final LngLongVector v1 = new LngLongVector(1000); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.unsafePush(i); @@ -70,7 +70,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGLongVector v1 = new LNGLongVector(100); + final LngLongVector v1 = new LngLongVector(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -81,7 +81,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); for (int i = 0; i < 1000; i++) { v1.push(i); } @@ -97,7 +97,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -114,7 +114,7 @@ public void testVectorShrink() { @Test public void testGrowTo() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -143,7 +143,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push(i); @@ -161,8 +161,8 @@ public void testRemoveElements() { @Test public void testSort() { - final LNGLongVector v1 = new LNGLongVector(1000); - final LNGLongVector v2 = new LNGLongVector(1000); + final LngLongVector v1 = new LngLongVector(1000); + final LngLongVector v2 = new LngLongVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -177,15 +177,15 @@ public void testSort() { assertThat(v1.get(i) < v1.get(i + 1)).isTrue(); } } - final LNGLongVector v3 = new LNGLongVector(1000); + final LngLongVector v3 = new LngLongVector(1000); v3.sort(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSortReverse() { - final LNGLongVector v1 = new LNGLongVector(1000); - final LNGLongVector v2 = new LNGLongVector(1000); + final LngLongVector v1 = new LngLongVector(1000); + final LngLongVector v2 = new LngLongVector(1000); for (int i = 999; i >= 0; i--) { v1.push(i); } @@ -200,14 +200,14 @@ public void testSortReverse() { assertThat(v1.get(i) > v1.get(i + 1)).isTrue(); } } - final LNGLongVector v3 = new LNGLongVector(1000); + final LngLongVector v3 = new LngLongVector(1000); v3.sortReverse(); assertThat(v3.isEmpty()).isTrue(); } @Test public void testToArray() { - final LNGLongVector v1 = new LNGLongVector(1000); + final LngLongVector v1 = new LngLongVector(1000); final long[] expected = new long[500]; for (int i = 0; i < 1000; i++) { v1.push(i); @@ -221,7 +221,7 @@ public void testToArray() { @Test public void testToString() { - final LNGLongVector v1 = new LNGLongVector(); + final LngLongVector v1 = new LngLongVector(); assertThat(v1.toString()).isEqualTo("[]"); v1.push(1); assertThat(v1.toString()).isEqualTo("[1]"); diff --git a/core/src/test/java/com/booleworks/logicng/collections/LNGVectorTest.java b/core/src/test/java/com/booleworks/logicng/collections/LngVectorTest.java similarity index 85% rename from core/src/test/java/com/booleworks/logicng/collections/LNGVectorTest.java rename to core/src/test/java/com/booleworks/logicng/collections/LngVectorTest.java index 44408a82..ec43226f 100644 --- a/core/src/test/java/com/booleworks/logicng/collections/LNGVectorTest.java +++ b/core/src/test/java/com/booleworks/logicng/collections/LngVectorTest.java @@ -15,29 +15,29 @@ import java.util.List; import java.util.NoSuchElementException; -public class LNGVectorTest { +public class LngVectorTest { private final Comparator stringComparator; - public LNGVectorTest() { + public LngVectorTest() { stringComparator = String::compareTo; } @Test public void testVectorCreation() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.size()).isEqualTo(0); assertThat(v1.isEmpty()).isTrue(); - final LNGVector v2 = new LNGVector<>(10); + final LngVector v2 = new LngVector<>(10); assertThat(v2.size()).isEqualTo(0); assertThat(v2.isEmpty()).isTrue(); - final LNGVector v3 = new LNGVector<>(10, "string"); + final LngVector v3 = new LngVector<>(10, "string"); assertThat(v3.size()).isEqualTo(10); for (int i = 0; i < v3.size(); i++) { assertThat(v3.get(i)).isEqualTo("string"); } assertThat(v3.isEmpty()).isFalse(); - final LNGVector v4 = new LNGVector<>("s1", "s2", "s3", "s4", "s5"); + final LngVector v4 = new LngVector<>("s1", "s2", "s3", "s4", "s5"); assertThat(v4.size()).isEqualTo(5); int count = 1; for (final String s : v4) { @@ -47,7 +47,7 @@ public void testVectorCreation() { for (int i = 0; i < 1000; i++) { list.add("s" + i); } - final LNGVector v5 = new LNGVector<>(list); + final LngVector v5 = new LngVector<>(list); assertThat(v5.size()).isEqualTo(1000); for (int i = 0; i < 1000; i++) { assertThat(v5.get(i)).isEqualTo("s" + i); @@ -56,7 +56,7 @@ public void testVectorCreation() { @Test public void testVectorAddElements() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -71,7 +71,7 @@ public void testVectorAddElements() { @Test public void testRelease() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -86,7 +86,7 @@ public void testRelease() { @Test public void legalUnsafePush() { - final LNGVector v1 = new LNGVector<>(1000); + final LngVector v1 = new LngVector<>(1000); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.unsafePush("s" + i); @@ -101,7 +101,7 @@ public void legalUnsafePush() { @Test public void illegalUnsafePush() { - final LNGVector v1 = new LNGVector<>(100); + final LngVector v1 = new LngVector<>(100); assertThat(v1.isEmpty()).isTrue(); assertThatThrownBy(() -> { for (int i = 0; i < 1000; i++) { @@ -112,7 +112,7 @@ public void illegalUnsafePush() { @Test public void testGettingSettingAndPopping() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); } @@ -128,7 +128,7 @@ public void testGettingSettingAndPopping() { @Test public void testVectorShrink() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -145,7 +145,7 @@ public void testVectorShrink() { @Test public void testGrowToWithPad() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -174,7 +174,7 @@ public void testGrowToWithPad() { @Test public void testGrowTo() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 2000; i++) { v1.push("s" + i); @@ -204,7 +204,7 @@ public void testGrowTo() { @Test public void testRemoveElements() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -222,15 +222,15 @@ public void testRemoveElements() { @Test public void testInplaceReplace() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); } - final LNGVector v2 = new LNGVector<>(); + final LngVector v2 = new LngVector<>(); for (int i = 0; i < 500; i++) { v2.push("str" + i); } - final LNGVector v3 = new LNGVector<>(); + final LngVector v3 = new LngVector<>(); for (int i = 0; i < 2000; i++) { v3.push("string" + i); } @@ -248,7 +248,7 @@ public void testInplaceReplace() { @Test public void testIllegalInplaceReplace() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); } @@ -257,8 +257,8 @@ public void testIllegalInplaceReplace() { @Test public void testManualSort() { - final LNGVector v1 = new LNGVector<>(1000); - final LNGVector v2 = new LNGVector<>(1000); + final LngVector v1 = new LngVector<>(1000); + final LngVector v2 = new LngVector<>(1000); for (int i = 999; i >= 0; i--) { v1.push("s" + i); } @@ -273,15 +273,15 @@ public void testManualSort() { assertThat(v1.get(i).compareTo(v1.get(i + 1)) < 0).isTrue(); } } - final LNGVector v3 = new LNGVector<>(1000); + final LngVector v3 = new LngVector<>(1000); v3.manualSort(stringComparator); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSort() { - final LNGVector v1 = new LNGVector<>(1000); - final LNGVector v2 = new LNGVector<>(1000); + final LngVector v1 = new LngVector<>(1000); + final LngVector v2 = new LngVector<>(1000); for (int i = 999; i >= 0; i--) { v1.push("s" + i); } @@ -296,15 +296,15 @@ public void testSort() { assertThat(v1.get(i).compareTo(v1.get(i + 1)) < 0).isTrue(); } } - final LNGVector v3 = new LNGVector<>(1000); + final LngVector v3 = new LngVector<>(1000); v3.sort(stringComparator); assertThat(v3.isEmpty()).isTrue(); } @Test public void testSortReverse() { - final LNGVector v1 = new LNGVector<>(1000); - final LNGVector v2 = new LNGVector<>(1000); + final LngVector v1 = new LngVector<>(1000); + final LngVector v2 = new LngVector<>(1000); for (int i = 999; i >= 0; i--) { v1.push("s" + i); } @@ -319,14 +319,14 @@ public void testSortReverse() { assertThat(v1.get(i).compareTo(v1.get(i + 1)) > 0).isTrue(); } } - final LNGVector v3 = new LNGVector<>(1000); + final LngVector v3 = new LngVector<>(1000); v3.sortReverse(stringComparator); assertThat(v3.isEmpty()).isTrue(); } @Test public void testRemove() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -352,7 +352,7 @@ public void testRemove() { assertThat(v1.get(498)).isEqualTo("s499"); assertThat(v1.get(499)).isEqualTo("s501"); assertThat(v1.get(996)).isEqualTo("s998"); - final LNGVector v2 = new LNGVector<>("s1", "s1", "s2", "s5", "s8"); + final LngVector v2 = new LngVector<>("s1", "s1", "s2", "s5", "s8"); v2.remove("s1"); assertThat(v2.size()).isEqualTo(4); assertThat(v2.toString()).isEqualTo("[s1, s2, s5, s8]"); @@ -360,7 +360,7 @@ public void testRemove() { @Test public void testToArray() { - final LNGVector v1 = new LNGVector<>(1000); + final LngVector v1 = new LngVector<>(1000); final String[] expected = new String[500]; for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -376,7 +376,7 @@ public void testToArray() { @Test public void testIterator() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -389,7 +389,7 @@ public void testIterator() { @Test public void testIllegalIteratorRemoval() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -402,7 +402,7 @@ public void testIllegalIteratorRemoval() { @Test public void testIllegalIteratorTraversal() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.isEmpty()).isTrue(); for (int i = 0; i < 1000; i++) { v1.push("s" + i); @@ -418,7 +418,7 @@ public void testIllegalIteratorTraversal() { @Test public void testToString() { - final LNGVector v1 = new LNGVector<>(); + final LngVector v1 = new LngVector<>(); assertThat(v1.toString()).isEqualTo("[]"); v1.push("s1"); assertThat(v1.toString()).isEqualTo("[s1]"); diff --git a/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBNodeTest.java b/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbNodeTest.java similarity index 82% rename from core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBNodeTest.java rename to core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbNodeTest.java index 7b14767a..39029174 100644 --- a/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBNodeTest.java +++ b/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbNodeTest.java @@ -15,20 +15,20 @@ import java.util.SortedSet; import java.util.TreeSet; -public class UBNodeTest { +public class UbNodeTest { - private final UBNode node1; - private final UBNode node2; + private final UbNode node1; + private final UbNode node2; - public UBNodeTest() { - node1 = new UBNode<>(1); - node2 = new UBNode<>("String"); + public UbNodeTest() { + node1 = new UbNode<>(1); + node2 = new UbNode<>("String"); } @Test public void testHashCode() { assertThat(node1.hashCode()).isEqualTo(node1.hashCode()); - assertThat(node1.hashCode()).isEqualTo(new UBNode<>(1).hashCode()); + assertThat(node1.hashCode()).isEqualTo(new UbNode<>(1).hashCode()); } @Test @@ -41,7 +41,7 @@ public void testEquals() { final List> primeImplicates = new ArrayList<>(); primeImplicates.add(new TreeSet<>(List.of(f.variable("a"), f.literal("b", false)))); assertThat(node1.equals(node1)).isTrue(); - assertThat(node1.equals(new UBNode<>(1))).isTrue(); + assertThat(node1.equals(new UbNode<>(1))).isTrue(); assertThat(node1.equals(node2)).isFalse(); assertThat(node2.equals(node1)).isFalse(); assertThat(node1.equals(null)).isFalse(); @@ -50,7 +50,7 @@ public void testEquals() { @Test public void testToString() { assertThat(node1.toString()).isEqualTo( - "UBNode{" + + "UbNode{" + "element=1" + ", children={}" + ", set=null" + diff --git a/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBTreeTest.java b/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbTreeTest.java similarity index 93% rename from core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBTreeTest.java rename to core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbTreeTest.java index a3cf3e57..151a9569 100644 --- a/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UBTreeTest.java +++ b/core/src/test/java/com/booleworks/logicng/datastructures/ubtrees/UbTreeTest.java @@ -13,22 +13,22 @@ import java.util.TreeSet; /** - * Unit tests for {@link UBTree}. + * Unit tests for {@link UbTree}. * @version 2.0.0 * @since 1.5.0 */ -public class UBTreeTest { +public class UbTreeTest { @Test public void testEmptySet() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); tree.addSet(new TreeSet<>()); assertThat(tree.getRootNodes()).isEmpty(); } @Test public void testSingleSet() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); tree.addSet(set("A", "B", "C")); assertThat(tree.getRootNodes()).hasSize(1); assertThat(tree.getRootNodes().keySet()).containsExactly("A"); @@ -46,7 +46,7 @@ public void testSingleSet() { @Test public void testExampleFromPaper() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); tree.addSet(set("e0", "e1", "e2", "e3")); tree.addSet(set("e0", "e1", "e3")); tree.addSet(set("e0", "e1", "e2")); @@ -55,16 +55,16 @@ public void testExampleFromPaper() { assertThat(tree.getRootNodes().keySet()).containsExactly("e0", "e2"); // root nodes - final UBNode e0 = tree.getRootNodes().get("e0"); - final UBNode e2 = tree.getRootNodes().get("e2"); + final UbNode e0 = tree.getRootNodes().get("e0"); + final UbNode e2 = tree.getRootNodes().get("e2"); assertThat(e0.isEndOfPath()).isFalse(); assertThat(e0.getChildren().keySet()).containsExactly("e1"); assertThat(e2.isEndOfPath()).isFalse(); assertThat(e2.getChildren().keySet()).containsExactly("e3"); // first level - final UBNode e0e1 = e0.getChildren().get("e1"); - final UBNode e2e3 = e2.getChildren().get("e3"); + final UbNode e0e1 = e0.getChildren().get("e1"); + final UbNode e2e3 = e2.getChildren().get("e3"); assertThat(e0e1.isEndOfPath()).isFalse(); assertThat(e0e1.getChildren().keySet()).containsExactly("e2", "e3"); assertThat(e2e3.isEndOfPath()).isTrue(); @@ -72,17 +72,17 @@ public void testExampleFromPaper() { assertThat(e2e3.getChildren().keySet()).isEmpty(); // second level - final UBNode e0e1e2 = e0e1.getChildren().get("e2"); + final UbNode e0e1e2 = e0e1.getChildren().get("e2"); assertThat(e0e1e2.isEndOfPath()).isTrue(); assertThat(e0e1e2.getSet()).isEqualTo(set("e0", "e1", "e2")); assertThat(e0e1e2.getChildren().keySet()).containsExactly("e3"); - final UBNode e0e1e3 = e0e1.getChildren().get("e3"); + final UbNode e0e1e3 = e0e1.getChildren().get("e3"); assertThat(e0e1e3.isEndOfPath()).isTrue(); assertThat(e0e1e3.getSet()).isEqualTo(set("e0", "e1", "e3")); assertThat(e0e1e3.getChildren().keySet()).isEmpty(); // third level - final UBNode e0e1e2e3 = e0e1e2.getChildren().get("e3"); + final UbNode e0e1e2e3 = e0e1e2.getChildren().get("e3"); assertThat(e0e1e2e3.isEndOfPath()).isTrue(); assertThat(e0e1e2e3.getSet()).isEqualTo(set("e0", "e1", "e2", "e3")); assertThat(e0e1e2e3.getChildren().keySet()).isEmpty(); @@ -90,7 +90,7 @@ public void testExampleFromPaper() { @Test public void testContainsSubset() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); final SortedSet e0123 = set("e0", "e1", "e2", "e3"); final SortedSet e013 = set("e0", "e1", "e3"); final SortedSet e012 = set("e0", "e1", "e2"); @@ -133,7 +133,7 @@ public void testContainsSubset() { @Test public void testAllSubsets() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); final SortedSet e0123 = set("e0", "e1", "e2", "e3"); final SortedSet e013 = set("e0", "e1", "e3"); final SortedSet e012 = set("e0", "e1", "e2"); @@ -177,7 +177,7 @@ public void testAllSubsets() { @Test public void testAllSupersets() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); final SortedSet e0123 = set("e0", "e1", "e2", "e3"); final SortedSet e013 = set("e0", "e1", "e3"); final SortedSet e012 = set("e0", "e1", "e2"); @@ -219,7 +219,7 @@ public void testAllSupersets() { @Test public void testAllSets() { - final UBTree tree = new UBTree<>(); + final UbTree tree = new UbTree<>(); final SortedSet e0123 = set("e0", "e1", "e2", "e3"); final SortedSet e013 = set("e0", "e1", "e3"); final SortedSet e012 = set("e0", "e1", "e2"); diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcAlkTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcAlkTest.java index 19b36fce..8a8cd0cd 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcAlkTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcAlkTest.java @@ -13,7 +13,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.NumberOfModelsHandler; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; import org.junit.jupiter.api.Test; @@ -24,9 +24,9 @@ public class CcAlkTest implements LogicNGTest { public CcAlkTest() { configs = new EncoderConfig[3]; - configs[0] = EncoderConfig.builder().alkEncoding(EncoderConfig.ALK_ENCODER.TOTALIZER).build(); - configs[1] = EncoderConfig.builder().alkEncoding(EncoderConfig.ALK_ENCODER.MODULAR_TOTALIZER).build(); - configs[2] = EncoderConfig.builder().alkEncoding(EncoderConfig.ALK_ENCODER.CARDINALITY_NETWORK).build(); + configs[0] = EncoderConfig.builder().alkEncoding(EncoderConfig.AlkEncoder.TOTALIZER).build(); + configs[1] = EncoderConfig.builder().alkEncoding(EncoderConfig.AlkEncoder.MODULAR_TOTALIZER).build(); + configs[2] = EncoderConfig.builder().alkEncoding(EncoderConfig.AlkEncoder.CARDINALITY_NETWORK).build(); } @Test @@ -47,7 +47,7 @@ public void testALK() { testCC(f, 10, 9, 11); testCC(f, 10, 10, 1); testCC(f, 10, 12, 0); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } @@ -56,7 +56,7 @@ private void testCC(final FormulaFactory f, final int numLits, final int rhs, fi for (int i = 0; i < numLits; i++) { problemLits[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.cc(CType.GE, rhs, problemLits)); if (expected != 0) { assertSolverSat(solver); diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcAmkTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcAmkTest.java index 4eba4fe1..e708da11 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcAmkTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcAmkTest.java @@ -13,8 +13,8 @@ import com.booleworks.logicng.formulas.CardinalityConstraint; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; public class CcAmkTest implements LogicNGTest { @@ -23,9 +23,9 @@ public class CcAmkTest implements LogicNGTest { public CcAmkTest() { configs = new EncoderConfig[3]; - configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.TOTALIZER).build(); - configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.MODULAR_TOTALIZER).build(); - configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.CARDINALITY_NETWORK).build(); + configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.TOTALIZER).build(); + configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.MODULAR_TOTALIZER).build(); + configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.CARDINALITY_NETWORK).build(); } @Test @@ -46,7 +46,7 @@ public void testAMK() { testCC(f, 10, 9, 1023, false); testCC(f, 10, 10, 1024, false); testCC(f, 10, 15, 1024, false); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } @@ -65,7 +65,7 @@ public void testAMKMiniCard() { testCC(f, 10, 9, 1023, true); testCC(f, 10, 10, 1024, true); testCC(f, 10, 15, 1024, true); - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } @Test @@ -76,7 +76,7 @@ public void testLargeAMK() { for (final EncoderConfig config : configs) { f.putConfiguration(config); testCC(f, 150, 2, 1 + 150 + 11175, false); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } @@ -84,7 +84,7 @@ public void testLargeAMK() { public void testLargeAMKMiniCard() { final FormulaFactory f = FormulaFactory.caching(); testCC(f, 150, 2, 1 + 150 + 11175, true); - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } private void testCC(final FormulaFactory f, final int numLits, final int rhs, final int expected, @@ -93,7 +93,7 @@ private void testCC(final FormulaFactory f, final int numLits, final int rhs, fi for (int i = 0; i < numLits; i++) { problemLits[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(miniCard).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(miniCard).build()); solver.add(f.cc(CType.LE, rhs, problemLits)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcAmoTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcAmoTest.java index 54c6c80c..e2ad344f 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcAmoTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcAmoTest.java @@ -12,8 +12,8 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; public class CcAmoTest implements LogicNGTest { @@ -22,27 +22,27 @@ public class CcAmoTest implements LogicNGTest { public CcAmoTest() { configs = new EncoderConfig[14]; - configs[0] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build(); - configs[1] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.LADDER).build(); - configs[2] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PRODUCT).build(); - configs[3] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BINARY).build(); - configs[4] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.NESTED).build(); + configs[0] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build(); + configs[1] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.LADDER).build(); + configs[2] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PRODUCT).build(); + configs[3] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BINARY).build(); + configs[4] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.NESTED).build(); configs[5] = - EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.COMMANDER).commanderGroupSize(3).build(); + EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.COMMANDER).commanderGroupSize(3).build(); configs[6] = - EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.COMMANDER).commanderGroupSize(7).build(); - configs[7] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.FIXED).build(); - configs[8] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.HALF).build(); - configs[9] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.SQRT).build(); - configs[10] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.FIXED).bimanderFixedGroupSize(2).build(); - configs[11] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.NESTED).nestingGroupSize(5).build(); - configs[12] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PRODUCT).productRecursiveBound(10) + EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.COMMANDER).commanderGroupSize(7).build(); + configs[7] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.FIXED).build(); + configs[8] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.HALF).build(); + configs[9] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.SQRT).build(); + configs[10] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.FIXED).bimanderFixedGroupSize(2).build(); + configs[11] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.NESTED).nestingGroupSize(5).build(); + configs[12] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PRODUCT).productRecursiveBound(10) .build(); - configs[13] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BEST).build(); + configs[13] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BEST).build(); } @Test @@ -59,7 +59,7 @@ public void testAMO1() { for (final EncoderConfig config : configs) { assertThat(CcEncoder.encode(f, cc, config)).isEmpty(); } - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } @Test @@ -75,7 +75,7 @@ public void testAMOK() { testAMO(f, 100, false); testAMO(f, 250, false); testAMO(f, 500, false); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } } @@ -88,7 +88,7 @@ public void testAMOKMiniCard() { testAMO(f, 100, true); testAMO(f, 250, true); testAMO(f, 500, true); - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } private void testAMO(final FormulaFactory f, final int numLits, final boolean miniCard) { @@ -96,7 +96,7 @@ private void testAMO(final FormulaFactory f, final int numLits, final boolean mi for (int i = 0; i < numLits; i++) { problemLits[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(miniCard).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(miniCard).build()); solver.add(f.amo(problemLits)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcExkTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcExkTest.java index 33fcde80..6640cf46 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcExkTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcExkTest.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.CType; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; public class CcExkTest implements LogicNGTest { @@ -19,8 +19,8 @@ public class CcExkTest implements LogicNGTest { public CcExkTest() { configs = new EncoderConfig[2]; - configs[0] = EncoderConfig.builder().exkEncoding(EncoderConfig.EXK_ENCODER.TOTALIZER).build(); - configs[1] = EncoderConfig.builder().exkEncoding(EncoderConfig.EXK_ENCODER.CARDINALITY_NETWORK).build(); + configs[0] = EncoderConfig.builder().exkEncoding(EncoderConfig.ExkEncoder.TOTALIZER).build(); + configs[1] = EncoderConfig.builder().exkEncoding(EncoderConfig.ExkEncoder.CARDINALITY_NETWORK).build(); } @Test @@ -40,7 +40,7 @@ public void testEXK() { testCC(f, 10, 9, 10); testCC(f, 10, 10, 1); testCC(f, 10, 12, 0); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } @@ -49,7 +49,7 @@ private void testCC(final FormulaFactory f, final int numLits, final int rhs, fi for (int i = 0; i < numLits; i++) { problemLits[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.cc(CType.EQ, rhs, problemLits)); if (expected != 0) { assertSolverSat(solver); @@ -66,7 +66,7 @@ public void testToString() { assertThat(configs[0].exkEncoder.toString()).isEqualTo("TOTALIZER"); assertThat(configs[1].exkEncoder.toString()).isEqualTo("CARDINALITY_NETWORK"); - assertThat(EncoderConfig.EXK_ENCODER.values()) - .contains(EncoderConfig.EXK_ENCODER.valueOf("CARDINALITY_NETWORK")); + assertThat(EncoderConfig.ExkEncoder.values()) + .contains(EncoderConfig.ExkEncoder.valueOf("CARDINALITY_NETWORK")); } } diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcExoTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcExoTest.java index 98204e76..44ef6afb 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcExoTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcExoTest.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import java.util.stream.Collectors; @@ -23,22 +23,22 @@ public class CcExoTest implements LogicNGTest { public CcExoTest() { configs = new EncoderConfig[11]; - configs[0] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build(); - configs[1] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.LADDER).build(); - configs[2] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PRODUCT).build(); - configs[3] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BINARY).build(); - configs[4] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.NESTED).build(); + configs[0] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build(); + configs[1] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.LADDER).build(); + configs[2] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PRODUCT).build(); + configs[3] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BINARY).build(); + configs[4] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.NESTED).build(); configs[5] = - EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.COMMANDER).commanderGroupSize(3).build(); + EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.COMMANDER).commanderGroupSize(3).build(); configs[6] = - EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.COMMANDER).commanderGroupSize(7).build(); - configs[7] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.FIXED).build(); - configs[8] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.HALF).build(); - configs[9] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BIMANDER) - .bimanderGroupSize(EncoderConfig.BIMANDER_GROUP_SIZE.SQRT).build(); - configs[10] = EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.BEST).build(); + EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.COMMANDER).commanderGroupSize(7).build(); + configs[7] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.FIXED).build(); + configs[8] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.HALF).build(); + configs[9] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BIMANDER) + .bimanderGroupSize(EncoderConfig.BimanderGroupSize.SQRT).build(); + configs[10] = EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.BEST).build(); } @Test @@ -55,7 +55,7 @@ public void testEXO1() { for (final EncoderConfig config : configs) { assertThat(CcEncoder.encode(f, cc, config)).containsExactly(f.variable("v0")); } - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } @Test @@ -70,7 +70,7 @@ public void testEXOK() { testEXO(f, 100); testEXO(f, 250); testEXO(f, 500); - assertThat(f.newCCVariable().getName()).endsWith("_" + counter++); + assertThat(f.newCcVariable().getName()).endsWith("_" + counter++); } } } @@ -78,7 +78,7 @@ public void testEXOK() { @Test public void testEncodingSetting() { final FormulaFactory f = FormulaFactory.caching(); - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); final CardinalityConstraint exo = (CardinalityConstraint) f .exo(IntStream.range(0, 100).mapToObj(i -> f.variable("v" + i)).collect(Collectors.toList())); assertThat(exo.cnf(f).variables(f)).hasSize(100); @@ -101,7 +101,7 @@ private void testEXO(final FormulaFactory f, final int numLits) { for (int i = 0; i < numLits; i++) { problemLits[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.exo(problemLits)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalFormulaTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalFormulaTest.java index 7c09d350..0140ad65 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalFormulaTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalFormulaTest.java @@ -14,7 +14,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.sat.SolverTestSet; import com.booleworks.logicng.util.Pair; @@ -26,17 +26,17 @@ public class CcIncrementalFormulaTest implements LogicNGTest { private final FormulaFactory f = FormulaFactory.caching(); - private final List solvers; + private final List solvers; private final EncoderConfig[] configs; public CcIncrementalFormulaTest() { configs = new EncoderConfig[3]; - configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.TOTALIZER) - .alkEncoding(EncoderConfig.ALK_ENCODER.TOTALIZER).build(); - configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.CARDINALITY_NETWORK) - .alkEncoding(EncoderConfig.ALK_ENCODER.CARDINALITY_NETWORK).build(); - configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.MODULAR_TOTALIZER) - .alkEncoding(EncoderConfig.ALK_ENCODER.MODULAR_TOTALIZER).build(); + configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.TOTALIZER) + .alkEncoding(EncoderConfig.AlkEncoder.TOTALIZER).build(); + configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.CARDINALITY_NETWORK) + .alkEncoding(EncoderConfig.AlkEncoder.CARDINALITY_NETWORK).build(); + configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.MODULAR_TOTALIZER) + .alkEncoding(EncoderConfig.AlkEncoder.MODULAR_TOTALIZER).build(); solvers = SolverTestSet.solverTestSet(Set.of(USE_AT_MOST_CLAUSES), f); } @@ -52,7 +52,7 @@ public void testSimpleIncrementalAMK() { CcEncoder.encodeIncremental(f, (CardinalityConstraint) f.cc(CType.LE, 9, vars), config); final CcIncrementalData incData = cc.getSecond(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(CcEncoder.encode(f, (CardinalityConstraint) f.cc(CType.GE, 4, vars), config)); // >= // 4 solver.add(CcEncoder.encode(f, (CardinalityConstraint) f.cc(CType.LE, 7, vars), config)); // <= @@ -63,7 +63,7 @@ public void testSimpleIncrementalAMK() { assertSolverSat(solver); // <= 9 solver.add(incData.newUpperBound(8)); // <= 8 assertSolverSat(solver); - assertThat(incData.getCurrentRHS()).isEqualTo(8); + assertThat(incData.getCurrentRhs()).isEqualTo(8); solver.add(incData.newUpperBound(7)); // <= 7 assertSolverSat(solver); solver.add(incData.newUpperBound(6)); // <= 6 @@ -95,11 +95,11 @@ public void testIncrementalData() { Pair, CcIncrementalData> cc = CcEncoder.encodeIncremental(f, (CardinalityConstraint) f.cc(CType.LT, 10, vars), config); CcIncrementalData incData = cc.getSecond(); - assertThat(incData.toString()).contains("currentRHS=9"); + assertThat(incData.toString()).contains("currentRhs=9"); cc = CcEncoder.encodeIncremental(f, (CardinalityConstraint) f.cc(CType.GT, 1, vars), config); incData = cc.getSecond(); - assertThat(incData.toString()).contains("currentRHS=2"); + assertThat(incData.toString()).contains("currentRhs=2"); cc = CcEncoder.encodeIncremental(f, (CardinalityConstraint) f.cc(CType.LT, 1, vars), config); incData = cc.getSecond(); @@ -140,7 +140,7 @@ public void testSimpleIncrementalALK() { CcEncoder.encodeIncremental(f, (CardinalityConstraint) f.cc(CType.GE, 2, vars), config); final CcIncrementalData incData = cc.getSecond(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); // >= 4 solver.add(CcEncoder.encode(f, (CardinalityConstraint) f.cc(CType.GE, 4, vars), config)); // <= 7 @@ -171,7 +171,7 @@ public void testSimpleIncrementalALK() { @Test public void testLargeTotalizerUpperBoundAMK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final EncoderConfig config = configs[0]; final int numLits = 100; int currentBound = numLits - 1; @@ -198,7 +198,7 @@ public void testLargeTotalizerUpperBoundAMK() { @Test public void testLargeTotalizerLowerBoundALK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final EncoderConfig config = configs[0]; final int numLits = 100; int currentBound = 2; @@ -226,7 +226,7 @@ public void testLargeTotalizerLowerBoundALK() { @Test @LongRunningTag public void testLargeModularTotalizerAMK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final EncoderConfig config = configs[2]; final int numLits = 100; int currentBound = numLits - 1; @@ -255,7 +255,7 @@ public void testLargeModularTotalizerAMK() { @Test @LongRunningTag public void testVeryLargeModularTotalizerAMK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final EncoderConfig config = configs[2]; final int numLits = 300; int currentBound = numLits - 1; diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalSolverTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalSolverTest.java index 3f38e1ca..df073a5e 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalSolverTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcIncrementalSolverTest.java @@ -12,9 +12,9 @@ import com.booleworks.logicng.formulas.CardinalityConstraint; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.solvers.sat.SolverTestSet; import org.junit.jupiter.api.Test; @@ -24,17 +24,17 @@ public class CcIncrementalSolverTest implements LogicNGTest { private final FormulaFactory f = FormulaFactory.caching(); - private final List solvers; + private final List solvers; private final EncoderConfig[] configs; public CcIncrementalSolverTest() { configs = new EncoderConfig[]{ - EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.TOTALIZER) - .alkEncoding(EncoderConfig.ALK_ENCODER.TOTALIZER).build(), - EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.CARDINALITY_NETWORK) - .alkEncoding(EncoderConfig.ALK_ENCODER.CARDINALITY_NETWORK).build(), - EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.MODULAR_TOTALIZER) - .alkEncoding(EncoderConfig.ALK_ENCODER.MODULAR_TOTALIZER).build(), + EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.TOTALIZER) + .alkEncoding(EncoderConfig.AlkEncoder.TOTALIZER).build(), + EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.CARDINALITY_NETWORK) + .alkEncoding(EncoderConfig.AlkEncoder.CARDINALITY_NETWORK).build(), + EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.MODULAR_TOTALIZER) + .alkEncoding(EncoderConfig.AlkEncoder.MODULAR_TOTALIZER).build(), }; solvers = SolverTestSet.solverTestSet(Set.of(SolverTestSet.SATSolverConfigParam.USE_AT_MOST_CLAUSES), f); } @@ -48,7 +48,7 @@ public void testSimpleIncrementalAMK() { for (int i = 0; i < numLits; i++) { vars[i] = f.variable("v" + i); } - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(false).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(false).build()); solver.add(f.cc(CType.GE, 4, vars)); // >= 4 solver.add(f.cc(CType.LE, 7, vars)); // <= 7 @@ -80,7 +80,7 @@ public void testSimpleIncrementalAMK() { @Test public void testSimpleIncrementalALK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final SolverState initialState = solver.saveState(); for (final EncoderConfig config : configs) { solver.loadState(initialState); @@ -130,7 +130,7 @@ public void testLargeTotalizerUpperBoundAMK() { for (int i = 0; i < numLits; i++) { vars[i] = f.variable("v" + i); } - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.cc(CType.GE, 42, vars)); // >= 42 f.putConfiguration(configs[0]); final CcIncrementalData incData = @@ -147,7 +147,7 @@ public void testLargeTotalizerUpperBoundAMK() { @Test public void testLargeTotalizerLowerBoundALK() { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); f.putConfiguration(configs[2]); final int numLits = 100; int currentBound = 2; @@ -169,7 +169,7 @@ public void testLargeTotalizerLowerBoundALK() { @Test public void testLargeModularTotalizerAMK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { f.putConfiguration(configs[2]); final int numLits = 100; int currentBound = numLits - 1; @@ -193,7 +193,7 @@ public void testLargeModularTotalizerAMK() { @Test @LongRunningTag public void testVeryLargeModularTotalizerAMK() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { f.putConfiguration(configs[2]); final int numLits = 300; int currentBound = numLits - 1; diff --git a/core/src/test/java/com/booleworks/logicng/encodings/CcPerformanceTest.java b/core/src/test/java/com/booleworks/logicng/encodings/CcPerformanceTest.java index 790d4278..5e7aada2 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/CcPerformanceTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/CcPerformanceTest.java @@ -13,8 +13,8 @@ import com.booleworks.logicng.formulas.CardinalityConstraint; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; import java.util.Arrays; @@ -25,9 +25,9 @@ public class CcPerformanceTest implements LogicNGTest { public CcPerformanceTest() { configs = new EncoderConfig[3]; - configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.TOTALIZER).build(); - configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.MODULAR_TOTALIZER).build(); - configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AMK_ENCODER.CARDINALITY_NETWORK).build(); + configs[0] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.TOTALIZER).build(); + configs[1] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.MODULAR_TOTALIZER).build(); + configs[2] = EncoderConfig.builder().amkEncoding(EncoderConfig.AmkEncoder.CARDINALITY_NETWORK).build(); } @Test @@ -37,7 +37,7 @@ public void testAMKPerformance() { final FormulaFactory f = FormulaFactory.caching(); f.putConfiguration(config); buildAMK(f, 10_000, false); - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } } @@ -45,7 +45,7 @@ public void testAMKPerformance() { public void testAMKPerformanceMiniCard() { final FormulaFactory f = FormulaFactory.caching(); buildAMK(f, 10_000, true); - assertThat(f.newCCVariable().getName()).endsWith("_0"); + assertThat(f.newCcVariable().getName()).endsWith("_0"); } private void buildAMK(final FormulaFactory f, final int numLits, final boolean miniCard) { @@ -55,8 +55,8 @@ private void buildAMK(final FormulaFactory f, final int numLits, final boolean m } for (int i = 10; i < 100; i = i + 10) { final CardinalityConstraint cc = (CardinalityConstraint) f.cc(CType.LE, i, problemLits); - final SATSolver solver = - SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(miniCard).build()); + final SatSolver solver = + SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(miniCard).build()); solver.add(cc); assertSolverSat(solver); final Model model = solver.satCall().model(Arrays.asList(problemLits)); diff --git a/core/src/test/java/com/booleworks/logicng/encodings/PbEncoderTest.java b/core/src/test/java/com/booleworks/logicng/encodings/PbEncoderTest.java index 23c72caa..31a3fe15 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/PbEncoderTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/PbEncoderTest.java @@ -11,10 +11,10 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -28,11 +28,11 @@ public class PbEncoderTest implements LogicNGTest { public PbEncoderTest() { configs = Arrays.asList( - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.SWC).build(), + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.SWC).build(), EncoderConfig.builder() - .pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE) - .binaryMergeUseGAC(false) - .amoEncoding(EncoderConfig.AMO_ENCODER.NESTED) + .pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE) + .binaryMergeUseGac(false) + .amoEncoding(EncoderConfig.AmoEncoder.NESTED) .build(), null ); @@ -51,8 +51,8 @@ public void testCC0() { problemLits[i] = var; coeffs.add(1); } - final List clauses = PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, 0, lits, coeffs), config); - final SATSolver solver = SATSolver.newSolver(f); + final List clauses = com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, 0, lits, coeffs), config); + final SatSolver solver = SatSolver.newSolver(f); solver.add(clauses); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) @@ -75,9 +75,9 @@ public void testCC1() { problemLits[i] = var; coeffs.add(1); } - final List clauses = PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, rhs, lits, coeffs), + final List clauses = com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, rhs, lits, coeffs), config); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(clauses); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) @@ -109,9 +109,9 @@ private void testCC(final int numLits, final int rhs, final int expected, final problemLits[i] = f.variable("v" + i); coeffs[i] = 1; } - final List clauses = PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, rhs, problemLits, coeffs), + final List clauses = com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, rhs, problemLits, coeffs), config); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(clauses); assertSolverSat(solver); assertThat(solver.enumerateAllModels(problemLits)) @@ -127,9 +127,9 @@ public void testSpecialCases() { final List coeffs = new ArrayList<>(); coeffs.add(2); coeffs.add(1); - final PBConstraint truePBC = (PBConstraint) f.pbc(CType.GE, 0, lits, coeffs); + final PbConstraint truePBC = (PbConstraint) f.pbc(CType.GE, 0, lits, coeffs); for (final EncoderConfig config : configs) { - assertThat(PbEncoder.encode(f, truePBC, config)).isEmpty(); + assertThat(com.booleworks.logicng.encodings.PbEncoder.encode(f, truePBC, config)).isEmpty(); } } @@ -141,7 +141,7 @@ public void testCCNormalized() throws ParserException { final List coeffs2 = new ArrayList<>(); coeffs2.add(2); coeffs2.add(2); - final PBConstraint normCC = (PBConstraint) f.pbc(CType.LE, 2, lits, coeffs2); - assertThat(PbEncoder.encode(f, normCC, configs.get(0))).containsExactly(f.parse("~m | ~n")); + final PbConstraint normCC = (PbConstraint) f.pbc(CType.LE, 2, lits, coeffs2); + assertThat(com.booleworks.logicng.encodings.PbEncoder.encode(f, normCC, configs.get(0))).containsExactly(f.parse("~m | ~n")); } } diff --git a/core/src/test/java/com/booleworks/logicng/encodings/PbSolvingTest.java b/core/src/test/java/com/booleworks/logicng/encodings/PbSolvingTest.java index 5182b632..608045f3 100644 --- a/core/src/test/java/com/booleworks/logicng/encodings/PbSolvingTest.java +++ b/core/src/test/java/com/booleworks/logicng/encodings/PbSolvingTest.java @@ -12,9 +12,9 @@ import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.CType; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.sat.SolverTestSet; import org.junit.jupiter.api.Test; @@ -28,8 +28,8 @@ public class PbSolvingTest implements LogicNGTest { private final FormulaFactory f; private final Variable[] literals100; private final Variable[] literals10; - private final List solvers; - private final List> solverSuppliers; + private final List solvers; + private final List> solverSuppliers; private final EncoderConfig[] configs; @@ -46,30 +46,30 @@ public PbSolvingTest() { solvers = SolverTestSet.solverTestSet(Set.of(USE_AT_MOST_CLAUSES), f); solverSuppliers = SolverTestSet.solverSupplierTestSet(Set.of(USE_AT_MOST_CLAUSES)); configs = new EncoderConfig[]{ - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.SWC).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(true) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.SWC).build(), + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(true) .binaryMergeNoSupportForSingleBit(true).binaryMergeUseWatchDog(true).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(true) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(true) .binaryMergeNoSupportForSingleBit(true).binaryMergeUseWatchDog(false).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(true) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(true) .binaryMergeNoSupportForSingleBit(false).binaryMergeUseWatchDog(true).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(true) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(true) .binaryMergeNoSupportForSingleBit(false).binaryMergeUseWatchDog(false).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(false) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(false) .binaryMergeNoSupportForSingleBit(true).binaryMergeUseWatchDog(true).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(false) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(false) .binaryMergeNoSupportForSingleBit(true).binaryMergeUseWatchDog(false).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(false) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(false) .binaryMergeNoSupportForSingleBit(false).binaryMergeUseWatchDog(true).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.BINARY_MERGE).binaryMergeUseGAC(false) + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.BINARY_MERGE).binaryMergeUseGac(false) .binaryMergeNoSupportForSingleBit(false).binaryMergeUseWatchDog(false).build(), - EncoderConfig.builder().pbEncoding(EncoderConfig.PB_ENCODER.ADDER_NETWORKS).build(), + EncoderConfig.builder().pbEncoding(EncoderConfig.PbEncoder.ADDER_NETWORKS).build(), }; } @Test public void testCCAMO() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.amo(literals100)); final List models = solver.enumerateAllModels(literals100); assertThat(models.size()).isEqualTo(101); @@ -81,7 +81,7 @@ public void testCCAMO() { @Test public void testCCEXO() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.exo(literals100)); final List models = solver.enumerateAllModels(literals100); assertThat(models.size()).isEqualTo(100); @@ -93,7 +93,7 @@ public void testCCEXO() { @Test public void testCCAMK() { - for (final Function solver : solverSuppliers) { + for (final Function solver : solverSuppliers) { testCCAMK(solver.apply(f), 0, 1); testCCAMK(solver.apply(f), 1, 11); testCCAMK(solver.apply(f), 2, 56); @@ -109,7 +109,7 @@ public void testCCAMK() { @Test public void testCCLT() { - for (final Function solver : solverSuppliers) { + for (final Function solver : solverSuppliers) { testCCLT(solver.apply(f), 1, 1); testCCLT(solver.apply(f), 2, 11); testCCLT(solver.apply(f), 3, 56); @@ -125,7 +125,7 @@ public void testCCLT() { @Test public void testCCALK() { - for (final Function solver : solverSuppliers) { + for (final Function solver : solverSuppliers) { testCCALK(solver.apply(f), 1, 1023); testCCALK(solver.apply(f), 2, 1013); testCCALK(solver.apply(f), 3, 968); @@ -141,7 +141,7 @@ public void testCCALK() { @Test public void testCCGT() { - for (final Function solver : solverSuppliers) { + for (final Function solver : solverSuppliers) { testCCGT(solver.apply(f), 0, 1023); testCCGT(solver.apply(f), 1, 1013); testCCGT(solver.apply(f), 2, 968); @@ -157,7 +157,7 @@ public void testCCGT() { @Test public void testCCEQ() { - for (final Function solver : solverSuppliers) { + for (final Function solver : solverSuppliers) { testCCEQ(solver.apply(f), 0, 1); testCCEQ(solver.apply(f), 1, 10); testCCEQ(solver.apply(f), 2, 45); @@ -172,7 +172,7 @@ public void testCCEQ() { } } - private void testCCAMK(final SATSolver solver, final int rhs, final int expected) { + private void testCCAMK(final SatSolver solver, final int rhs, final int expected) { solver.add(f.cc(CType.LE, rhs, literals10)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -180,7 +180,7 @@ private void testCCAMK(final SATSolver solver, final int rhs, final int expected .allMatch(model -> model.positiveVariables().size() <= rhs); } - private void testCCLT(final SATSolver solver, final int rhs, final int expected) { + private void testCCLT(final SatSolver solver, final int rhs, final int expected) { solver.add(f.cc(CType.LT, rhs, literals10)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -188,7 +188,7 @@ private void testCCLT(final SATSolver solver, final int rhs, final int expected) .allMatch(model -> model.positiveVariables().size() < rhs); } - private void testCCALK(final SATSolver solver, final int rhs, final int expected) { + private void testCCALK(final SatSolver solver, final int rhs, final int expected) { solver.add(f.cc(CType.GE, rhs, literals10)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -196,7 +196,7 @@ private void testCCALK(final SATSolver solver, final int rhs, final int expected .allMatch(model -> model.positiveVariables().size() >= rhs); } - private void testCCGT(final SATSolver solver, final int rhs, final int expected) { + private void testCCGT(final SatSolver solver, final int rhs, final int expected) { solver.add(f.cc(CType.GT, rhs, literals10)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -204,7 +204,7 @@ private void testCCGT(final SATSolver solver, final int rhs, final int expected) .allMatch(model -> model.positiveVariables().size() > rhs); } - private void testCCEQ(final SATSolver solver, final int rhs, final int expected) { + private void testCCEQ(final SatSolver solver, final int rhs, final int expected) { solver.add(f.cc(CType.EQ, rhs, literals10)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -215,17 +215,17 @@ private void testCCEQ(final SATSolver solver, final int rhs, final int expected) @Test public void testPBEQ() { for (final EncoderConfig config : configs) { - for (final Function solverSupplier : solverSuppliers) { - SATSolver solver = solverSupplier.apply(f); + for (final Function solverSupplier : solverSuppliers) { + SatSolver solver = solverSupplier.apply(f); final int[] coeffs10 = new int[]{3, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.EQ, 5, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.EQ, 5, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) .hasSize(9) .allMatch(model -> model.positiveVariables().size() == 2) .allMatch(model -> model.positiveVariables().contains(f.variable("v" + 0))); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.EQ, 7, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.EQ, 7, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) @@ -233,14 +233,14 @@ public void testPBEQ() { .allMatch(model -> model.positiveVariables().size() == 3) .allMatch(model -> model.positiveVariables().contains(f.variable("v" + 0))); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.EQ, 0, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.EQ, 0, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.EQ, 1, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.EQ, 1, literals10, coeffs10), config)); assertSolverUnsat(solver); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.EQ, 22, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.EQ, 22, literals10, coeffs10), config)); assertSolverUnsat(solver); } } @@ -249,34 +249,34 @@ public void testPBEQ() { @Test public void testPBLess() { for (final EncoderConfig config : configs) { - for (final Function solverSupplier : solverSuppliers) { - SATSolver solver = solverSupplier.apply(f); + for (final Function solverSupplier : solverSuppliers) { + SatSolver solver = solverSupplier.apply(f); final int[] coeffs10 = new int[]{3, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, 6, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, 6, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) .hasSize(140) .allMatch(model -> model.positiveVariables().size() <= 3); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LT, 7, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LT, 7, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) .hasSize(140) .allMatch(model -> model.positiveVariables().size() <= 3); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, 0, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, 0, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LE, 1, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LE, 1, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LT, 2, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LT, 2, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.LT, 1, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.LT, 1, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); } @@ -286,30 +286,30 @@ public void testPBLess() { @Test public void testPBGreater() { for (final EncoderConfig config : configs) { - for (final Function solverSupplier : solverSuppliers) { - SATSolver solver = solverSupplier.apply(f); + for (final Function solverSupplier : solverSuppliers) { + SatSolver solver = solverSupplier.apply(f); final int[] coeffs10 = new int[]{3, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.GE, 17, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.GE, 17, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) .hasSize(47) .allMatch(model -> model.positiveVariables().size() >= 8); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.GT, 16, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.GT, 16, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)) .hasSize(47) .allMatch(model -> model.positiveVariables().size() >= 8); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.GE, 21, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.GE, 21, literals10, coeffs10), config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.GE, 22, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.GE, 22, literals10, coeffs10), config)); assertSolverUnsat(solver); solver = solverSupplier.apply(f); - solver.add(PbEncoder.encode(f, (PBConstraint) f.pbc(CType.GT, 42, literals10, coeffs10), config)); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, (PbConstraint) f.pbc(CType.GT, 42, literals10, coeffs10), config)); assertSolverUnsat(solver); } } @@ -318,43 +318,43 @@ public void testPBGreater() { @Test public void testPBNegative() { for (final EncoderConfig config : configs) { - for (final Function solverSupplier : solverSuppliers) { - SATSolver solver = solverSupplier.apply(f); + for (final Function solverSupplier : solverSuppliers) { + SatSolver solver = solverSupplier.apply(f); int[] coeffs10 = new int[]{2, 2, 2, 2, 2, 2, 2, 2, 2, -2}; - final PBConstraint pbc = (PBConstraint) f.pbc(CType.EQ, 2, literals10, coeffs10); - solver.add(PbEncoder.encode(f, pbc, config)); + final PbConstraint pbc = (PbConstraint) f.pbc(CType.EQ, 2, literals10, coeffs10); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc, config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(45) .allMatch(m -> pbc.evaluate(m.toAssignment())); solver = solverSupplier.apply(f); coeffs10 = new int[]{2, 2, 2, 2, 2, 2, 2, 2, 2, -2}; - final PBConstraint pbc2 = (PBConstraint) f.pbc(CType.EQ, 4, literals10, coeffs10); - solver.add(PbEncoder.encode(f, pbc2, config)); + final PbConstraint pbc2 = (PbConstraint) f.pbc(CType.EQ, 4, literals10, coeffs10); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc2, config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(120) .allMatch(m -> pbc2.evaluate(m.toAssignment())); solver = solverSupplier.apply(f); coeffs10 = new int[]{2, 2, -3, 2, -7, 2, 2, 2, 2, -2}; - final PBConstraint pbc3 = (PBConstraint) f.pbc(CType.EQ, 4, literals10, coeffs10); - solver.add(PbEncoder.encode(f, pbc3, config)); + final PbConstraint pbc3 = (PbConstraint) f.pbc(CType.EQ, 4, literals10, coeffs10); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc3, config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(57) .allMatch(m -> pbc3.evaluate(m.toAssignment())); solver = solverSupplier.apply(f); coeffs10 = new int[]{2, 2, -3, 2, -7, 2, 2, 2, 2, -2}; - final PBConstraint pbc4 = (PBConstraint) f.pbc(CType.EQ, -10, literals10, coeffs10); - solver.add(PbEncoder.encode(f, pbc4, config)); + final PbConstraint pbc4 = (PbConstraint) f.pbc(CType.EQ, -10, literals10, coeffs10); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc4, config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(8) .allMatch(m -> pbc4.evaluate(m.toAssignment())); solver = solverSupplier.apply(f); coeffs10 = new int[]{2, 2, -4, 2, -6, 2, 2, 2, 2, -2}; - final PBConstraint pbc5 = (PBConstraint) f.pbc(CType.EQ, -12, literals10, coeffs10); - solver.add(PbEncoder.encode(f, pbc5, config)); + final PbConstraint pbc5 = (PbConstraint) f.pbc(CType.EQ, -12, literals10, coeffs10); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc5, config)); assertSolverSat(solver); assertThat(solver.enumerateAllModels(literals10)).hasSize(1) .allMatch(m -> pbc5.evaluate(m.toAssignment())); @@ -366,8 +366,8 @@ public void testPBNegative() { @LongRunningTag public void testLargePBs() { for (final EncoderConfig config : configs) { - for (final Function solverSupplier : solverSuppliers) { - final SATSolver solver = solverSupplier.apply(f); + for (final Function solverSupplier : solverSuppliers) { + final SatSolver solver = solverSupplier.apply(f); final int numLits = 100; final Variable[] lits = new Variable[numLits]; final int[] coeffs = new int[numLits]; @@ -375,8 +375,8 @@ public void testLargePBs() { lits[i] = f.variable("v" + i); coeffs[i] = i + 1; } - final PBConstraint pbc = (PBConstraint) f.pbc(CType.GE, 5000, lits, coeffs); - solver.add(PbEncoder.encode(f, pbc, config)); + final PbConstraint pbc = (PbConstraint) f.pbc(CType.GE, 5000, lits, coeffs); + solver.add(com.booleworks.logicng.encodings.PbEncoder.encode(f, pbc, config)); assertSolverSat(solver); assertThat(pbc.evaluate(solver.satCall().model(Arrays.asList(lits)).toAssignment())).isTrue(); } diff --git a/core/src/test/java/com/booleworks/logicng/explanations/UNSATCoreTest.java b/core/src/test/java/com/booleworks/logicng/explanations/UnsatCoreTest.java similarity index 79% rename from core/src/test/java/com/booleworks/logicng/explanations/UNSATCoreTest.java rename to core/src/test/java/com/booleworks/logicng/explanations/UnsatCoreTest.java index a9f6dafe..6631c586 100644 --- a/core/src/test/java/com/booleworks/logicng/explanations/UNSATCoreTest.java +++ b/core/src/test/java/com/booleworks/logicng/explanations/UnsatCoreTest.java @@ -15,14 +15,14 @@ import java.util.ArrayList; import java.util.List; -public class UNSATCoreTest { +public class UnsatCoreTest { private final List props1; private final List props2; - private final UNSATCore core1; - private final UNSATCore core2; + private final UnsatCore core1; + private final UnsatCore core2; - public UNSATCoreTest() throws ParserException { + public UnsatCoreTest() throws ParserException { props1 = new ArrayList<>(); props2 = new ArrayList<>(); final FormulaFactory f = FormulaFactory.caching(); @@ -36,42 +36,42 @@ public UNSATCoreTest() throws ParserException { props2.add(new StandardProposition(parser.parse("a | ~b"))); props2.add(new StandardProposition(parser.parse("~a | ~b"))); props2.add(new StandardProposition(parser.parse("~a | ~b | c"))); - core1 = new UNSATCore<>(props1, true); - core2 = new UNSATCore<>(props2, false); + core1 = new UnsatCore<>(props1, true); + core2 = new UnsatCore<>(props2, false); } @Test public void testGetters() { assertThat(core1.getPropositions()).isEqualTo(props1); assertThat(core2.getPropositions()).isEqualTo(props2); - assertThat(core1.isMUS()).isTrue(); - assertThat(core2.isMUS()).isFalse(); + assertThat(core1.isMus()).isTrue(); + assertThat(core2.isMus()).isFalse(); } @Test public void testHashCode() { assertThat(core1.hashCode()).isEqualTo(core1.hashCode()); - assertThat(new UNSATCore<>(props2, false).hashCode()).isEqualTo(core2.hashCode()); + assertThat(new UnsatCore<>(props2, false).hashCode()).isEqualTo(core2.hashCode()); } @Test public void testEquals() { assertThat(core1).isEqualTo(core1); assertThat(core1.equals(core1)).isTrue(); - assertThat(new UNSATCore<>(props1, true)).isEqualTo(core1); + assertThat(new UnsatCore<>(props1, true)).isEqualTo(core1); assertThat(core2).isNotEqualTo(core1); - assertThat(new UNSATCore<>(props1, false)).isNotEqualTo(core1); - assertThat(new UNSATCore<>(props2, true)).isNotEqualTo(core1); + assertThat(new UnsatCore<>(props1, false)).isNotEqualTo(core1); + assertThat(new UnsatCore<>(props2, true)).isNotEqualTo(core1); assertThat("String").isNotEqualTo(core1); assertThat(core1).isNotEqualTo("String"); } @Test public void testToString() { - final String exp1 = "UNSATCore{isMUS=true, propositions=[StandardProposition{formula=a | b, description=}, " + + final String exp1 = "UnsatCore{isMus=true, propositions=[StandardProposition{formula=a | b, description=}, " + "StandardProposition{formula=~a | b, description=}, StandardProposition{formula=a | ~b, " + "description=}, StandardProposition{formula=~a | ~b, description=}]}"; - final String exp2 = "UNSATCore{isMUS=false, propositions=[StandardProposition{formula=a | b, description=}, " + + final String exp2 = "UnsatCore{isMus=false, propositions=[StandardProposition{formula=a | b, description=}, " + "StandardProposition{formula=~a | b, description=}, StandardProposition{formula=a | ~b, " + "description=}, StandardProposition{formula=~a | ~b, description=}, " + "StandardProposition{formula=~a | ~b | c, description=}]}"; diff --git a/core/src/test/java/com/booleworks/logicng/explanations/drup/DRUPTest.java b/core/src/test/java/com/booleworks/logicng/explanations/drup/DRUPTest.java index 831600b8..d5496ab0 100644 --- a/core/src/test/java/com/booleworks/logicng/explanations/drup/DRUPTest.java +++ b/core/src/test/java/com/booleworks/logicng/explanations/drup/DRUPTest.java @@ -8,7 +8,7 @@ import com.booleworks.logicng.LogicNGTest; import com.booleworks.logicng.LongRunningTag; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; @@ -17,10 +17,10 @@ import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.propositions.PropositionBackpack; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATCall; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatCall; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.Test; @@ -34,8 +34,8 @@ public class DRUPTest implements LogicNGTest { private final FormulaFactory f = FormulaFactory.caching(); - private final Supplier solverSupplier = - () -> SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + private final Supplier solverSupplier = + () -> SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); @Test @LongRunningTag @@ -46,10 +46,10 @@ public void testUnsatCoresFromDimacs() throws IOException { cnfs.add(DimacsReader.readCNF(f, "../test_files/drup/avg_input.cnf", "var")); for (final List cnf : cnfs) { - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.add(cnf); assertSolverUnsat(solver); - final UNSATCore unsatCore = solver.satCall().unsatCore(); + final UnsatCore unsatCore = solver.satCall().unsatCore(); verifyCore(unsatCore, cnf); } } @@ -65,10 +65,10 @@ public void testUnsatCoresFromLargeTestset() throws IOException { final String fileName = file.getName(); if (fileName.endsWith(".cnf")) { final List cnf = DimacsReader.readCNF(f, file); - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.add(cnf); if (!solver.sat()) { - final UNSATCore unsatCore = solver.satCall().unsatCore(); + final UnsatCore unsatCore = solver.satCall().unsatCore(); verifyCore(unsatCore, cnf); count++; } @@ -87,10 +87,10 @@ public void testUnsatCoresAimTestset() throws IOException { final String fileName = file.getName(); if (fileName.endsWith(".cnf")) { final List cnf = DimacsReader.readCNF(f, file); - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.add(cnf); assertSolverUnsat(solver); - final UNSATCore unsatCore = solver.satCall().unsatCore(); + final UnsatCore unsatCore = solver.satCall().unsatCore(); verifyCore(unsatCore, cnf); count++; } @@ -110,10 +110,10 @@ public void testPropositionHandling() throws ParserException { propositions.add(new StandardProposition("P7", f.parse("g | h"))); propositions.add(new StandardProposition("P8", f.parse("(x => ~y | z) & (z | w)"))); - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.addPropositions(propositions); assertThat(solver.sat()).isFalse(); - final UNSATCore unsatCore = solver.satCall().unsatCore(); + final UnsatCore unsatCore = solver.satCall().unsatCore(); assertThat(unsatCore.getPropositions()).containsExactlyInAnyOrder(propositions.get(0), propositions.get(1), propositions.get(2), propositions.get(3), propositions.get(4), propositions.get(5)); } @@ -132,7 +132,7 @@ public void testPropositionIncDec() throws ParserException { final StandardProposition p10 = new StandardProposition("P10", f.parse("(p => q) & p")); final StandardProposition p11 = new StandardProposition("P11", f.parse("a & ~q")); - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.addPropositions(p1, p2, p3, p4); final SolverState state1 = solver.saveState(); solver.addPropositions(p5, p6); @@ -140,7 +140,7 @@ public void testPropositionIncDec() throws ParserException { solver.addPropositions(p7, p8); assertThat(solver.sat()).isFalse(); - UNSATCore unsatCore = solver.satCall().unsatCore(); + UnsatCore unsatCore = solver.satCall().unsatCore(); assertThat(unsatCore.getPropositions()).containsExactlyInAnyOrder(p1, p2, p3, p4, p5, p6); solver.loadState(state2); @@ -171,15 +171,15 @@ public void testPropositionIncDec() throws ParserException { @Test public void testTrivialCasesPropositions() throws ParserException { - final SATSolver solver1 = solverSupplier.get(); + final SatSolver solver1 = solverSupplier.get(); assertSolverSat(solver1); final StandardProposition p1 = new StandardProposition("P1", f.parse("$false")); solver1.add(p1); assertSolverUnsat(solver1); - UNSATCore unsatCore = solver1.satCall().unsatCore(); + UnsatCore unsatCore = solver1.satCall().unsatCore(); assertThat(unsatCore.getPropositions()).containsExactlyInAnyOrder(p1); - final SATSolver solver2 = solverSupplier.get(); + final SatSolver solver2 = solverSupplier.get(); assertSolverSat(solver2); final StandardProposition p2 = new StandardProposition("P2", f.parse("a")); solver2.add(p2); @@ -193,7 +193,7 @@ public void testTrivialCasesPropositions() throws ParserException { @Test public void testCoreAndAssumptions() throws ParserException { - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); final FormulaFactory f = solver.getFactory(); final StandardProposition p1 = new StandardProposition(f.parse("A => B")); final StandardProposition p2 = new StandardProposition(f.parse("A & B => G")); @@ -212,13 +212,13 @@ public void testCoreAndAssumptions() throws ParserException { solver.add(p5); solver.add(p6); solver.sat(); - final UNSATCore unsatCore = solver.satCall().unsatCore(); + final UnsatCore unsatCore = solver.satCall().unsatCore(); assertThat(unsatCore.getPropositions()).containsExactlyInAnyOrder(p1, p2, p5, p6); } @Test public void testCoreAndAssumptions2() throws ParserException { - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); final FormulaFactory f = solver.getFactory(); solver.add(f.parse("~C => D")); solver.add(f.parse("C => D")); @@ -236,7 +236,7 @@ public void testCoreAndAssumptions2() throws ParserException { public void testCoreAndAssumptions3() throws ParserException { // Unit test for DRUP issue which led to // java.lang.ArrayIndexOutOfBoundsException: -1 - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); final FormulaFactory f = solver.getFactory(); solver.add(f.parse("X => Y")); solver.add(f.parse("X => Z")); @@ -260,7 +260,7 @@ public void testCoreAndAssumptions3() throws ParserException { @Test public void testCoreAndAssumptions4() throws ParserException { - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.add(f.parse("~X1")); solver.satCall().addFormulas(f.variable("X1")).sat(); // caused the bug solver.add(f.variable("A1")); @@ -276,10 +276,10 @@ public void testCoreAndAssumptions4() throws ParserException { @Test public void testWithAssumptionSolving() throws ParserException { - final SATSolver solver = solverSupplier.get(); + final SatSolver solver = solverSupplier.get(); solver.add(f.parse("A1 => A2")); solver.add(f.parse("A2 => ~A1 | ~A3")); - try (final SATCall satCall = solver.satCall().addFormulas(f.variable("A3"), f.variable("A1")).solve()) { + try (final SatCall satCall = solver.satCall().addFormulas(f.variable("A3"), f.variable("A1")).solve()) { assertThat(satCall.getSatResult().getResult()).isFalse(); } } @@ -287,8 +287,8 @@ public void testWithAssumptionSolving() throws ParserException { @Test public void testWithCcPropositions() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true) - .cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true) + .cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); final ExtendedProposition p1 = new ExtendedProposition<>(new StringBackpack("CC"), f.parse("A + B + C <= 1")); final StandardProposition p2 = new StandardProposition(f.parse("A")); @@ -305,7 +305,7 @@ public void testWithCcPropositions() throws ParserException { @Test public void testWithSpecialUnitCase() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); final StandardProposition p1 = new StandardProposition(f.parse("a => b")); final StandardProposition p2 = new StandardProposition(f.parse("a => c | d")); final StandardProposition p3 = new StandardProposition(f.parse("b => c | d")); @@ -331,14 +331,14 @@ public void testWithSpecialUnitCase() throws ParserException { * @param originalCore the original core * @param cnf the original problem */ - private void verifyCore(final UNSATCore originalCore, final List cnf) { + private void verifyCore(final UnsatCore originalCore, final List cnf) { final List core = new ArrayList<>(originalCore.getPropositions().size()); for (final Proposition prop : originalCore.getPropositions()) { core.add(prop.getFormula()); } final SoftAssertions softly = new SoftAssertions(); softly.assertThat(cnf).as("Core contains only original clauses").containsAll(core); - final SATSolver verifier = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + final SatSolver verifier = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); verifier.add(core); softly.assertThat(verifier.sat()).as("Core is unsatisfiable").isFalse(); softly.assertAll(); diff --git a/core/src/test/java/com/booleworks/logicng/explanations/mus/MUSConfigTest.java b/core/src/test/java/com/booleworks/logicng/explanations/mus/MusConfigTest.java similarity index 50% rename from core/src/test/java/com/booleworks/logicng/explanations/mus/MUSConfigTest.java rename to core/src/test/java/com/booleworks/logicng/explanations/mus/MusConfigTest.java index 7e56c9c6..dbf1b074 100644 --- a/core/src/test/java/com/booleworks/logicng/explanations/mus/MUSConfigTest.java +++ b/core/src/test/java/com/booleworks/logicng/explanations/mus/MusConfigTest.java @@ -6,19 +6,18 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.transformations.cnf.CNFConfig; -import org.assertj.core.api.Assertions; +import com.booleworks.logicng.transformations.cnf.CnfConfig; import org.junit.jupiter.api.Test; import java.util.Arrays; -public class MUSConfigTest { +public class MusConfigTest { @Test public void testMUSConfiguration() { - final MUSConfig config = MUSConfig.builder().algorithm(MUSConfig.Algorithm.valueOf("DELETION")).build(); - assertThat(config.toString()).isEqualTo(String.format("MUSConfig{%nalgorithm=DELETION%n}%n")); - assertThat(Arrays.asList(CNFConfig.Algorithm.values())) - .contains(CNFConfig.Algorithm.valueOf("TSEITIN")); + final MusConfig config = MusConfig.builder().algorithm(MusConfig.Algorithm.valueOf("DELETION")).build(); + assertThat(config.toString()).isEqualTo(String.format("MusConfig{%nalgorithm=DELETION%n}%n")); + assertThat(Arrays.asList(CnfConfig.Algorithm.values())) + .contains(CnfConfig.Algorithm.valueOf("TSEITIN")); } } diff --git a/core/src/test/java/com/booleworks/logicng/explanations/mus/MUSGenerationTest.java b/core/src/test/java/com/booleworks/logicng/explanations/mus/MusGenerationTest.java similarity index 67% rename from core/src/test/java/com/booleworks/logicng/explanations/mus/MUSGenerationTest.java rename to core/src/test/java/com/booleworks/logicng/explanations/mus/MusGenerationTest.java index 152abb4c..8a11f6fe 100644 --- a/core/src/test/java/com/booleworks/logicng/explanations/mus/MUSGenerationTest.java +++ b/core/src/test/java/com/booleworks/logicng/explanations/mus/MusGenerationTest.java @@ -8,16 +8,16 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.booleworks.logicng.LongRunningTag; -import com.booleworks.logicng.explanations.UNSATCore; +import com.booleworks.logicng.explanations.UnsatCore; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.handlers.BoundedSatHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.io.readers.DimacsReader; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.Test; @@ -30,7 +30,7 @@ import java.util.List; import java.util.stream.Collectors; -public class MUSGenerationTest { +public class MusGenerationTest { private final FormulaFactory f = FormulaFactory.caching(); private final PigeonHoleGenerator pg = new PigeonHoleGenerator(f); @@ -45,7 +45,7 @@ public class MUSGenerationTest { private final List file3; private final List file4; - public MUSGenerationTest() throws IOException { + public MusGenerationTest() throws IOException { pg3 = generatePGPropositions(3); pg4 = generatePGPropositions(4); pg5 = generatePGPropositions(5); @@ -59,33 +59,33 @@ public MUSGenerationTest() throws IOException { @Test public void testNoFormulas() { - final MUSGeneration mus = new MUSGeneration(); - assertThatThrownBy(() -> mus.computeMUS(f, Collections.emptyList(), MUSConfig.builder().build())) + final MusGeneration mus = new MusGeneration(); + assertThatThrownBy(() -> mus.computeMus(f, Collections.emptyList(), MusConfig.builder().build())) .isInstanceOf(IllegalArgumentException.class); } @Test public void testSATFormulaSetDeletionBasedMUS() { - final MUSGeneration mus = new MUSGeneration(); + final MusGeneration mus = new MusGeneration(); final StandardProposition proposition = new StandardProposition(f.variable("a")); - assertThatThrownBy(() -> mus.computeMUS(f, Collections.singletonList(proposition), - MUSConfig.builder().algorithm(MUSConfig.Algorithm.DELETION).build())) + assertThatThrownBy(() -> mus.computeMus(f, Collections.singletonList(proposition), + MusConfig.builder().algorithm(MusConfig.Algorithm.DELETION).build())) .isInstanceOf(IllegalArgumentException.class); } @Test @LongRunningTag public void testDeletionBasedMUS() { - final MUSGeneration mus = new MUSGeneration(); - final UNSATCore mus1 = mus.computeMUS(f, pg3); - final UNSATCore mus2 = mus.computeMUS(f, pg4); - final UNSATCore mus3 = mus.computeMUS(f, pg5); - final UNSATCore mus4 = mus.computeMUS(f, pg6); - final UNSATCore mus5 = mus.computeMUS(f, pg7); - final UNSATCore mus6 = mus.computeMUS(f, file1); - final UNSATCore mus7 = mus.computeMUS(f, file2); - final UNSATCore mus8 = mus.computeMUS(f, file3); - final UNSATCore mus9 = mus.computeMUS(f, file4); + final MusGeneration mus = new MusGeneration(); + final UnsatCore mus1 = mus.computeMus(f, pg3); + final UnsatCore mus2 = mus.computeMus(f, pg4); + final UnsatCore mus3 = mus.computeMus(f, pg5); + final UnsatCore mus4 = mus.computeMus(f, pg6); + final UnsatCore mus5 = mus.computeMus(f, pg7); + final UnsatCore mus6 = mus.computeMus(f, file1); + final UnsatCore mus7 = mus.computeMus(f, file2); + final UnsatCore mus8 = mus.computeMus(f, file3); + final UnsatCore mus9 = mus.computeMus(f, file4); testMUS(pg3, mus1); testMUS(pg4, mus2); testMUS(pg5, mus3); @@ -99,22 +99,22 @@ public void testDeletionBasedMUS() { @Test public void testSATFormulaSetPlainInsertionBasedMUS() { - final MUSGeneration mus = new MUSGeneration(); + final MusGeneration mus = new MusGeneration(); final StandardProposition proposition = new StandardProposition(f.variable("a")); - assertThatThrownBy(() -> mus.computeMUS(f, Collections.singletonList(proposition), - MUSConfig.builder().algorithm(MUSConfig.Algorithm.PLAIN_INSERTION).build())) + assertThatThrownBy(() -> mus.computeMus(f, Collections.singletonList(proposition), + MusConfig.builder().algorithm(MusConfig.Algorithm.PLAIN_INSERTION).build())) .isInstanceOf(IllegalArgumentException.class); } @Test public void testPlainInsertionBasedMUS() { - final MUSGeneration mus = new MUSGeneration(); - final MUSConfig config = MUSConfig.builder().algorithm(MUSConfig.Algorithm.PLAIN_INSERTION).build(); - final UNSATCore mus1 = mus.computeMUS(f, pg3, config); - final UNSATCore mus2 = mus.computeMUS(f, pg4, config); - final UNSATCore mus3 = mus.computeMUS(f, pg5, config); - final UNSATCore mus6 = mus.computeMUS(f, file1, config); - final UNSATCore mus7 = mus.computeMUS(f, file2, config); + final MusGeneration mus = new MusGeneration(); + final MusConfig config = MusConfig.builder().algorithm(MusConfig.Algorithm.PLAIN_INSERTION).build(); + final UnsatCore mus1 = mus.computeMus(f, pg3, config); + final UnsatCore mus2 = mus.computeMus(f, pg4, config); + final UnsatCore mus3 = mus.computeMus(f, pg5, config); + final UnsatCore mus6 = mus.computeMus(f, file1, config); + final UnsatCore mus7 = mus.computeMus(f, file2, config); testMUS(pg3, mus1); testMUS(pg4, mus2); testMUS(pg5, mus3); @@ -124,33 +124,33 @@ public void testPlainInsertionBasedMUS() { @Test public void testDeletionBasedCancellationPoints() throws IOException { - final MUSGeneration mus = new MUSGeneration(); + final MusGeneration mus = new MusGeneration(); final List propositions = DimacsReader.readCNF(f, "../test_files/sat/too_large_gr_rcs_w5.shuffled.cnf").stream() .map(StandardProposition::new) .collect(Collectors.toList()); for (int numStarts = 0; numStarts < 20; numStarts++) { final BoundedSatHandler handler = new BoundedSatHandler(numStarts); - final MUSConfig config = MUSConfig.builder().algorithm(MUSConfig.Algorithm.PLAIN_INSERTION).build(); - final LNGResult> result = mus.computeMUS(f, propositions, config, handler); + final MusConfig config = MusConfig.builder().algorithm(MusConfig.Algorithm.PLAIN_INSERTION).build(); + final LngResult> result = mus.computeMus(f, propositions, config, handler); assertThat(result.isSuccess()).isFalse(); } } @Test public void testCancellationPoints() throws IOException { - final MUSGeneration mus = new MUSGeneration(); + final MusGeneration mus = new MusGeneration(); final List propositions = DimacsReader.readCNF(f, "../test_files/sat/unsat/bf0432-007.cnf").stream() .map(StandardProposition::new) .collect(Collectors.toList()); - final List algorithms = - Arrays.asList(MUSConfig.Algorithm.DELETION, MUSConfig.Algorithm.PLAIN_INSERTION); - for (final MUSConfig.Algorithm algorithm : algorithms) { + final List algorithms = + Arrays.asList(MusConfig.Algorithm.DELETION, MusConfig.Algorithm.PLAIN_INSERTION); + for (final MusConfig.Algorithm algorithm : algorithms) { for (int numStarts = 0; numStarts < 10; numStarts++) { final ComputationHandler handler = new BoundedSatHandler(numStarts); - final MUSConfig config = MUSConfig.builder().algorithm(algorithm).build(); - final LNGResult> result = mus.computeMUS(f, propositions, config, handler); + final MusConfig config = MusConfig.builder().algorithm(algorithm).build(); + final LngResult> result = mus.computeMus(f, propositions, config, handler); assertThat(result.isSuccess()).isFalse(); } } @@ -183,10 +183,10 @@ private List readDimacs(final String fileName) throws IOExc return result; } - private void testMUS(final List original, final UNSATCore mus) { - assertThat(mus.isMUS()).isTrue(); + private void testMUS(final List original, final UnsatCore mus) { + assertThat(mus.isMus()).isTrue(); assertThat(mus.getPropositions().size() <= original.size()).isTrue(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); for (final StandardProposition p : mus.getPropositions()) { assertThat(original.contains(p)).isTrue(); assertThat(solver.sat()).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/explanations/smus/SmusComputationTest.java b/core/src/test/java/com/booleworks/logicng/explanations/smus/SmusComputationTest.java index 900c645d..751bd759 100644 --- a/core/src/test/java/com/booleworks/logicng/explanations/smus/SmusComputationTest.java +++ b/core/src/test/java/com/booleworks/logicng/explanations/smus/SmusComputationTest.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.handlers.BoundedOptimizationHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.DimacsReader; @@ -273,7 +273,7 @@ public void testHSolverCancelled() throws ParserException { private void testHandler(final ComputationHandler handler, final List formulas, final boolean expCanceled) { - final LNGResult> result = + final LngResult> result = SmusComputation.computeSmusForFormulas(f, formulas, Collections.emptyList(), handler); assertThat(!result.isSuccess()).isEqualTo(expCanceled); } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/AndTest.java b/core/src/test/java/com/booleworks/logicng/formulas/AndTest.java index b6a433c1..f8cb1b6a 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/AndTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/AndTest.java @@ -238,24 +238,24 @@ public void testContains(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.and1.isNNF(_c.f)).isTrue(); - assertThat(_c.and2.isNNF(_c.f)).isTrue(); - assertThat(_c.and3.isNNF(_c.f)).isTrue(); + assertThat(_c.and1.isNnf(_c.f)).isTrue(); + assertThat(_c.and2.isNnf(_c.f)).isTrue(); + assertThat(_c.and3.isNnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.and1.isDNF(_c.f)).isTrue(); - assertThat(_c.and2.isDNF(_c.f)).isTrue(); - assertThat(_c.and3.isDNF(_c.f)).isFalse(); + assertThat(_c.and1.isDnf(_c.f)).isTrue(); + assertThat(_c.and2.isDnf(_c.f)).isTrue(); + assertThat(_c.and3.isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.and1.isCNF(_c.f)).isTrue(); - assertThat(_c.and2.isCNF(_c.f)).isTrue(); - assertThat(_c.and3.isCNF(_c.f)).isTrue(); + assertThat(_c.and1.isCnf(_c.f)).isTrue(); + assertThat(_c.and2.isCnf(_c.f)).isTrue(); + assertThat(_c.and3.isCnf(_c.f)).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/CFalseTest.java b/core/src/test/java/com/booleworks/logicng/formulas/CFalseTest.java index a24cd9a3..318df7c9 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/CFalseTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/CFalseTest.java @@ -108,18 +108,18 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.falsum.isNNF(_c.f)).isTrue(); + assertThat(_c.falsum.isNnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.falsum.isDNF(_c.f)).isTrue(); + assertThat(_c.falsum.isDnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.falsum.isCNF(_c.f)).isTrue(); + assertThat(_c.falsum.isCnf(_c.f)).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/CTrueTest.java b/core/src/test/java/com/booleworks/logicng/formulas/CTrueTest.java index 77824dd6..1d16b540 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/CTrueTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/CTrueTest.java @@ -108,18 +108,18 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.verum.isNNF(_c.f)).isTrue(); + assertThat(_c.verum.isNnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.verum.isDNF(_c.f)).isTrue(); + assertThat(_c.verum.isDnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.verum.isCNF(_c.f)).isTrue(); + assertThat(_c.verum.isCnf(_c.f)).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/EquivalenceTest.java b/core/src/test/java/com/booleworks/logicng/formulas/EquivalenceTest.java index 080b8695..0805fb0d 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/EquivalenceTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/EquivalenceTest.java @@ -201,27 +201,27 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.eq1.isNNF(_c.f)).isFalse(); - assertThat(_c.eq2.isNNF(_c.f)).isFalse(); - assertThat(_c.eq3.isNNF(_c.f)).isFalse(); - assertThat(_c.eq4.isNNF(_c.f)).isFalse(); + assertThat(_c.eq1.isNnf(_c.f)).isFalse(); + assertThat(_c.eq2.isNnf(_c.f)).isFalse(); + assertThat(_c.eq3.isNnf(_c.f)).isFalse(); + assertThat(_c.eq4.isNnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.eq1.isDNF(_c.f)).isFalse(); - assertThat(_c.eq2.isDNF(_c.f)).isFalse(); - assertThat(_c.eq3.isDNF(_c.f)).isFalse(); - assertThat(_c.eq4.isDNF(_c.f)).isFalse(); + assertThat(_c.eq1.isDnf(_c.f)).isFalse(); + assertThat(_c.eq2.isDnf(_c.f)).isFalse(); + assertThat(_c.eq3.isDnf(_c.f)).isFalse(); + assertThat(_c.eq4.isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.eq1.isCNF(_c.f)).isFalse(); - assertThat(_c.eq2.isCNF(_c.f)).isFalse(); - assertThat(_c.eq3.isCNF(_c.f)).isFalse(); - assertThat(_c.eq4.isCNF(_c.f)).isFalse(); + assertThat(_c.eq1.isCnf(_c.f)).isFalse(); + assertThat(_c.eq2.isCnf(_c.f)).isFalse(); + assertThat(_c.eq3.isCnf(_c.f)).isFalse(); + assertThat(_c.eq4.isCnf(_c.f)).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/FormulaContext.java b/core/src/test/java/com/booleworks/logicng/formulas/FormulaContext.java index eb39e0e6..2fdea00d 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/FormulaContext.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/FormulaContext.java @@ -57,8 +57,8 @@ public class FormulaContext { public final Formula pbc4; public final Formula pbc5; - public final PBConstraint pb1; - public final PBConstraint pb2; + public final PbConstraint pb1; + public final PbConstraint pb2; public final CardinalityConstraint cc1; public final CardinalityConstraint cc2; public final CardinalityConstraint amo1; @@ -122,8 +122,8 @@ public FormulaContext(final FormulaFactory f) { final List litsCC2 = Arrays.asList(f.variable("a"), f.variable("b"), f.variable("c")); final int[] coeffs1 = new int[]{3}; final List coeffs2 = Arrays.asList(3, -2, 7); - pb1 = (PBConstraint) f.pbc(CType.LE, 2, lits1, coeffs1); - pb2 = (PBConstraint) f.pbc(CType.LE, 8, lits2, coeffs2); + pb1 = (PbConstraint) f.pbc(CType.LE, 2, lits1, coeffs1); + pb2 = (PbConstraint) f.pbc(CType.LE, 8, lits2, coeffs2); cc1 = (CardinalityConstraint) f.cc(CType.LT, 1, lits1); cc2 = (CardinalityConstraint) f.cc(CType.GE, 2, litsCC2); amo1 = (CardinalityConstraint) f.amo(lits1); diff --git a/core/src/test/java/com/booleworks/logicng/formulas/FormulaFactoryWithoutContradictionCheckTest.java b/core/src/test/java/com/booleworks/logicng/formulas/FormulaFactoryWithoutContradictionCheckTest.java index 699f2f5a..46fce03f 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/FormulaFactoryWithoutContradictionCheckTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/FormulaFactoryWithoutContradictionCheckTest.java @@ -9,13 +9,13 @@ import com.booleworks.logicng.datastructures.Assignment; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.predicates.NNFPredicate; +import com.booleworks.logicng.predicates.NnfPredicate; import com.booleworks.logicng.predicates.satisfiability.ContingencyPredicate; import com.booleworks.logicng.predicates.satisfiability.ContradictionPredicate; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.transformations.dnf.DNFFactorization; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.transformations.dnf.DnfFactorization; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -145,21 +145,21 @@ public void testNormalforms(final FormulaContext _c) { assertThat(_c.contradiction.nnf(_c.f)).isEqualTo(_c.contradiction); assertThat(_c.tautology.cnf(_c.f)).isEqualTo(_c.tautology); assertThat(_c.contradiction.cnf(_c.f)).isEqualTo(_c.contradiction); - assertThat(_c.tautology.transform(new DNFFactorization(_c.f))).isEqualTo(_c.tautology); - assertThat(_c.contradiction.transform(new DNFFactorization(_c.f))).isEqualTo(_c.contradiction); + assertThat(_c.tautology.transform(new DnfFactorization(_c.f))).isEqualTo(_c.tautology); + assertThat(_c.contradiction.transform(new DnfFactorization(_c.f))).isEqualTo(_c.contradiction); } @ParameterizedTest @MethodSource("contexts") public void testPredicates(final FormulaContext _c) { - assertThat(_c.tautology.isCNF(_c.f)).isTrue(); - assertThat(_c.contradiction.isCNF(_c.f)).isTrue(); - assertThat(_c.tautology.holds(new NNFPredicate(_c.f))).isTrue(); - assertThat(_c.contradiction.holds(new NNFPredicate(_c.f))).isTrue(); - assertThat(_c.tautology.isDNF(_c.f)).isTrue(); - assertThat(_c.contradiction.isDNF(_c.f)).isTrue(); - assertThat(_c.tautology.holds(new SATPredicate(_c.f))).isTrue(); - assertThat(_c.contradiction.holds(new SATPredicate(_c.f))).isFalse(); + assertThat(_c.tautology.isCnf(_c.f)).isTrue(); + assertThat(_c.contradiction.isCnf(_c.f)).isTrue(); + assertThat(_c.tautology.holds(new NnfPredicate(_c.f))).isTrue(); + assertThat(_c.contradiction.holds(new NnfPredicate(_c.f))).isTrue(); + assertThat(_c.tautology.isDnf(_c.f)).isTrue(); + assertThat(_c.contradiction.isDnf(_c.f)).isTrue(); + assertThat(_c.tautology.holds(new SatPredicate(_c.f))).isTrue(); + assertThat(_c.contradiction.holds(new SatPredicate(_c.f))).isFalse(); assertThat(_c.tautology.holds(new TautologyPredicate(_c.f))).isTrue(); assertThat(_c.contradiction.holds(new TautologyPredicate(_c.f))).isFalse(); assertThat(_c.tautology.holds(new ContradictionPredicate(_c.f))).isFalse(); @@ -171,7 +171,7 @@ public void testPredicates(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testSatSolverWithTautologies(final FormulaContext _c) throws ParserException { - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.f.parse("A")); solver.add(_c.f.parse("A => B")); solver.add(_c.f.parse("C | ~C")); @@ -190,7 +190,7 @@ public void testSatSolverWithTautologies(final FormulaContext _c) throws ParserE @ParameterizedTest @MethodSource("contexts") public void testSatSolverWithContradictions(final FormulaContext _c) throws ParserException { - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.f.parse("A")); solver.add(_c.f.parse("A => B")); solver.add(_c.f.parse("C | ~C")); diff --git a/core/src/test/java/com/booleworks/logicng/formulas/FormulaSatPredicatesTest.java b/core/src/test/java/com/booleworks/logicng/formulas/FormulaSatPredicatesTest.java index 9a0a4cf2..d9d86eec 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/FormulaSatPredicatesTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/FormulaSatPredicatesTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.transformations.cnf.BDDCNFTransformation; +import com.booleworks.logicng.transformations.cnf.BddCnfTransformation; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -83,6 +83,6 @@ public void testIsEquivalentTo(final FormulaContext _c) throws ParserException { assertThat(f1.isEquivalentTo(_c.f, f3)).isTrue(); assertThat(f3.isEquivalentTo(_c.f, f1)).isTrue(); assertThat(f2.isEquivalentTo(_c.f, f3)).isFalse(); - assertThat(f2.isEquivalentTo(_c.f, f2.transform(new BDDCNFTransformation(_c.f)))).isTrue(); + assertThat(f2.isEquivalentTo(_c.f, f2.transform(new BddCnfTransformation(_c.f)))).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/ImplicationTest.java b/core/src/test/java/com/booleworks/logicng/formulas/ImplicationTest.java index 2541d37d..46164d11 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/ImplicationTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/ImplicationTest.java @@ -207,27 +207,27 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.imp1.isNNF(_c.f)).isFalse(); - assertThat(_c.imp2.isNNF(_c.f)).isFalse(); - assertThat(_c.imp3.isNNF(_c.f)).isFalse(); - assertThat(_c.imp4.isNNF(_c.f)).isFalse(); + assertThat(_c.imp1.isNnf(_c.f)).isFalse(); + assertThat(_c.imp2.isNnf(_c.f)).isFalse(); + assertThat(_c.imp3.isNnf(_c.f)).isFalse(); + assertThat(_c.imp4.isNnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.imp1.isDNF(_c.f)).isFalse(); - assertThat(_c.imp2.isDNF(_c.f)).isFalse(); - assertThat(_c.imp3.isDNF(_c.f)).isFalse(); - assertThat(_c.imp4.isDNF(_c.f)).isFalse(); + assertThat(_c.imp1.isDnf(_c.f)).isFalse(); + assertThat(_c.imp2.isDnf(_c.f)).isFalse(); + assertThat(_c.imp3.isDnf(_c.f)).isFalse(); + assertThat(_c.imp4.isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.imp1.isCNF(_c.f)).isFalse(); - assertThat(_c.imp2.isCNF(_c.f)).isFalse(); - assertThat(_c.imp3.isCNF(_c.f)).isFalse(); - assertThat(_c.imp4.isCNF(_c.f)).isFalse(); + assertThat(_c.imp1.isCnf(_c.f)).isFalse(); + assertThat(_c.imp2.isCnf(_c.f)).isFalse(); + assertThat(_c.imp3.isCnf(_c.f)).isFalse(); + assertThat(_c.imp4.isCnf(_c.f)).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/LiteralTest.java b/core/src/test/java/com/booleworks/logicng/formulas/LiteralTest.java index 2130118c..62012fc4 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/LiteralTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/LiteralTest.java @@ -182,22 +182,22 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.a.isNNF(_c.f)).isTrue(); - assertThat(_c.na.isNNF(_c.f)).isTrue(); + assertThat(_c.a.isNnf(_c.f)).isTrue(); + assertThat(_c.na.isNnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.a.isDNF(_c.f)).isTrue(); - assertThat(_c.na.isDNF(_c.f)).isTrue(); + assertThat(_c.a.isDnf(_c.f)).isTrue(); + assertThat(_c.na.isDnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.a.isCNF(_c.f)).isTrue(); - assertThat(_c.na.isCNF(_c.f)).isTrue(); + assertThat(_c.a.isCnf(_c.f)).isTrue(); + assertThat(_c.na.isCnf(_c.f)).isTrue(); } @ParameterizedTest diff --git a/core/src/test/java/com/booleworks/logicng/formulas/NotTest.java b/core/src/test/java/com/booleworks/logicng/formulas/NotTest.java index d8ccbd2d..635a3913 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/NotTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/NotTest.java @@ -171,21 +171,21 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.not1.isNNF(_c.f)).isFalse(); - assertThat(_c.not2.isNNF(_c.f)).isFalse(); + assertThat(_c.not1.isNnf(_c.f)).isFalse(); + assertThat(_c.not2.isNnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.not1.isDNF(_c.f)).isFalse(); - assertThat(_c.not2.isDNF(_c.f)).isFalse(); + assertThat(_c.not1.isDnf(_c.f)).isFalse(); + assertThat(_c.not2.isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.not1.isCNF(_c.f)).isFalse(); - assertThat(_c.not2.isCNF(_c.f)).isFalse(); + assertThat(_c.not1.isCnf(_c.f)).isFalse(); + assertThat(_c.not2.isCnf(_c.f)).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/OrTest.java b/core/src/test/java/com/booleworks/logicng/formulas/OrTest.java index 542f27e2..5fc8385d 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/OrTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/OrTest.java @@ -221,24 +221,24 @@ public void testContains(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.or1.isNNF(_c.f)).isTrue(); - assertThat(_c.or2.isNNF(_c.f)).isTrue(); - assertThat(_c.or3.isNNF(_c.f)).isTrue(); + assertThat(_c.or1.isNnf(_c.f)).isTrue(); + assertThat(_c.or2.isNnf(_c.f)).isTrue(); + assertThat(_c.or3.isNnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.or1.isDNF(_c.f)).isTrue(); - assertThat(_c.or2.isDNF(_c.f)).isTrue(); - assertThat(_c.or3.isDNF(_c.f)).isTrue(); + assertThat(_c.or1.isDnf(_c.f)).isTrue(); + assertThat(_c.or2.isDnf(_c.f)).isTrue(); + assertThat(_c.or3.isDnf(_c.f)).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.or1.isCNF(_c.f)).isTrue(); - assertThat(_c.or2.isCNF(_c.f)).isTrue(); - assertThat(_c.or3.isCNF(_c.f)).isFalse(); + assertThat(_c.or1.isCnf(_c.f)).isTrue(); + assertThat(_c.or2.isCnf(_c.f)).isTrue(); + assertThat(_c.or3.isCnf(_c.f)).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/formulas/PBConstraintTest.java b/core/src/test/java/com/booleworks/logicng/formulas/PbConstraintTest.java similarity index 76% rename from core/src/test/java/com/booleworks/logicng/formulas/PBConstraintTest.java rename to core/src/test/java/com/booleworks/logicng/formulas/PbConstraintTest.java index 0fcbf373..9d68eed4 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/PBConstraintTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/PbConstraintTest.java @@ -21,7 +21,7 @@ import java.util.SortedSet; import java.util.TreeSet; -public class PBConstraintTest extends TestWithFormulaContext { +public class PbConstraintTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") @@ -60,7 +60,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.pb1.getCoefficients()).containsExactly(coeffs1); assertThat(_c.pb1.comparator()).isEqualTo(CType.LE); assertThat(_c.pb1.getRhs()).isEqualTo(2); - assertThat(_c.pb1.isCC()).isFalse(); + assertThat(_c.pb1.isCc()).isFalse(); assertThat(_c.pb1.isAmo()).isFalse(); assertThat(_c.pb1.isExo()).isFalse(); assertThat(_c.pb1.maxWeight()).isEqualTo(3); @@ -69,7 +69,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.pb2.getCoefficients()).containsExactly(coeffs2); assertThat(_c.pb2.comparator()).isEqualTo(CType.LE); assertThat(_c.pb2.getRhs()).isEqualTo(8); - assertThat(_c.pb2.isCC()).isFalse(); + assertThat(_c.pb2.isCc()).isFalse(); assertThat(_c.pb2.isAmo()).isFalse(); assertThat(_c.pb2.isExo()).isFalse(); assertThat(_c.pb2.maxWeight()).isEqualTo(7); @@ -78,7 +78,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.cc1.getCoefficients()).containsExactly(coeffsCC1); assertThat(_c.cc1.comparator()).isEqualTo(CType.LT); assertThat(_c.cc1.getRhs()).isEqualTo(1); - assertThat(_c.cc1.isCC()).isTrue(); + assertThat(_c.cc1.isCc()).isTrue(); assertThat(_c.cc1.isAmo()).isFalse(); assertThat(_c.cc1.isExo()).isFalse(); assertThat(_c.cc1.maxWeight()).isEqualTo(1); @@ -87,7 +87,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.cc2.getCoefficients()).containsExactly(coeffsCC2); assertThat(_c.cc2.comparator()).isEqualTo(CType.GE); assertThat(_c.cc2.getRhs()).isEqualTo(2); - assertThat(_c.cc2.isCC()).isTrue(); + assertThat(_c.cc2.isCc()).isTrue(); assertThat(_c.cc2.isAmo()).isFalse(); assertThat(_c.cc2.isExo()).isFalse(); assertThat(_c.cc2.maxWeight()).isEqualTo(1); @@ -96,7 +96,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.amo1.getCoefficients()).containsExactly(coeffsCC1); assertThat(_c.amo1.comparator()).isEqualTo(CType.LE); assertThat(_c.amo1.getRhs()).isEqualTo(1); - assertThat(_c.amo1.isCC()).isTrue(); + assertThat(_c.amo1.isCc()).isTrue(); assertThat(_c.amo1.isAmo()).isTrue(); assertThat(_c.amo1.isExo()).isFalse(); assertThat(_c.amo1.maxWeight()).isEqualTo(1); @@ -105,7 +105,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.amo2.getCoefficients()).containsExactly(coeffsCC2); assertThat(_c.amo2.comparator()).isEqualTo(CType.LE); assertThat(_c.amo2.getRhs()).isEqualTo(1); - assertThat(_c.amo2.isCC()).isTrue(); + assertThat(_c.amo2.isCc()).isTrue(); assertThat(_c.amo2.isAmo()).isTrue(); assertThat(_c.amo2.isExo()).isFalse(); assertThat(_c.amo2.maxWeight()).isEqualTo(1); @@ -114,7 +114,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.exo1.getCoefficients()).containsExactly(coeffsCC1); assertThat(_c.exo1.comparator()).isEqualTo(CType.EQ); assertThat(_c.exo1.getRhs()).isEqualTo(1); - assertThat(_c.exo1.isCC()).isTrue(); + assertThat(_c.exo1.isCc()).isTrue(); assertThat(_c.exo1.isAmo()).isFalse(); assertThat(_c.exo1.isExo()).isTrue(); assertThat(_c.exo1.maxWeight()).isEqualTo(1); @@ -123,7 +123,7 @@ public void testGetters(final FormulaContext _c) { assertThat(_c.exo2.getCoefficients()).containsExactly(coeffsCC2); assertThat(_c.exo2.comparator()).isEqualTo(CType.EQ); assertThat(_c.exo2.getRhs()).isEqualTo(1); - assertThat(_c.exo2.isCC()).isTrue(); + assertThat(_c.exo2.isCc()).isTrue(); assertThat(_c.exo2.isAmo()).isFalse(); assertThat(_c.exo2.isExo()).isTrue(); assertThat(_c.exo2.maxWeight()).isEqualTo(1); @@ -131,48 +131,48 @@ public void testGetters(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") - public void testIsCC(final FormulaContext _c) { + public void testIsCc(final FormulaContext _c) { final Literal[] lits1 = new Literal[]{_c.f.variable("a"), _c.f.variable("b")}; final Literal[] lits2 = new Literal[]{_c.f.variable("a"), _c.f.literal("b", false)}; final int[] coeffs1 = new int[]{1, 1}; final int[] coeffs2 = new int[]{-1, 1}; - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs1)).isCC()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs1)).isCc()).isTrue(); // Corner cases - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 0, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 0, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, -1, lits1, coeffs1)).isCC()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 0, lits1, coeffs1)).isCC()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 0, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 0, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, -1, lits1, coeffs1)).isCc()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 0, lits1, coeffs1)).isCc()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, -1, lits1, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 0, lits1, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, -1, lits1, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, -2, lits1, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, -1, lits1, coeffs1)).isCC()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, -1, lits1, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 0, lits1, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, -1, lits1, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, -2, lits1, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, -1, lits1, coeffs1)).isCc()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isCC()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isCc()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isCC()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isCc()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isCC()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isCC()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isCc()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isCc()).isFalse(); } @ParameterizedTest @@ -183,37 +183,37 @@ public void testIsAmo(final FormulaContext _c) { final int[] coeffs1 = new int[]{1, 1}; final int[] coeffs2 = new int[]{-1, 1}; - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 1, lits1, coeffs1)).isAmo()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 2, lits1, coeffs1)).isAmo()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 1, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 1, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 1, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 1, lits1, coeffs1)).isAmo()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 2, lits1, coeffs1)).isAmo()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 1, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 1, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 1, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 3, lits1, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 3, lits1, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isAmo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isAmo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isAmo()).isFalse(); } @ParameterizedTest @@ -224,37 +224,37 @@ public void testIsExo(final FormulaContext _c) { final int[] coeffs1 = new int[]{1, 1}; final int[] coeffs2 = new int[]{-1, 1}; - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 1, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 2, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 1, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 1, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 1, lits1, coeffs1)).isExo()).isTrue(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 1, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 2, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 1, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 1, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 1, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 1, lits1, coeffs1)).isExo()).isTrue(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 3, lits1, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 3, lits1, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits1, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits1, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits1, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits1, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits1, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs1)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs1)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isExo()).isFalse(); - assertThat(((PBConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LE, 4, lits2, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.LT, 4, lits2, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GE, 4, lits2, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.GT, 4, lits2, coeffs2)).isExo()).isFalse(); + assertThat(((PbConstraint) _c.f.pbc(CType.EQ, 4, lits2, coeffs2)).isExo()).isFalse(); } @ParameterizedTest @@ -333,22 +333,22 @@ public void testContains(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testIsNNF(final FormulaContext _c) { - assertThat(_c.pb1.isNNF(_c.f)).isFalse(); - assertThat(_c.pb2.isNNF(_c.f)).isFalse(); + assertThat(_c.pb1.isNnf(_c.f)).isFalse(); + assertThat(_c.pb2.isNnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsDNF(final FormulaContext _c) { - assertThat(_c.pb1.isDNF(_c.f)).isFalse(); - assertThat(_c.pb2.isDNF(_c.f)).isFalse(); + assertThat(_c.pb1.isDnf(_c.f)).isFalse(); + assertThat(_c.pb2.isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testIsCNF(final FormulaContext _c) { - assertThat(_c.pb1.isCNF(_c.f)).isFalse(); - assertThat(_c.pb2.isCNF(_c.f)).isFalse(); + assertThat(_c.pb1.isCnf(_c.f)).isFalse(); + assertThat(_c.pb2.isCnf(_c.f)).isFalse(); } @ParameterizedTest @@ -364,11 +364,11 @@ public void testEvaluate(final FormulaContext _c) { a2.addLiteral(_c.f.variable("a")); a2.addLiteral(_c.f.literal("b", false)); a2.addLiteral(_c.f.literal("c", false)); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); - final PBConstraint pb3 = (PBConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); - final PBConstraint pb4 = (PBConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); - final PBConstraint pb5 = (PBConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); - final PBConstraint pb6 = (PBConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); + final PbConstraint pb3 = (PbConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); + final PbConstraint pb4 = (PbConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); + final PbConstraint pb5 = (PbConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); + final PbConstraint pb6 = (PbConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); assertThat(pb1.evaluate(a1)).isTrue(); assertThat(pb1.evaluate(a2)).isFalse(); assertThat(pb3.evaluate(a1)).isTrue(); @@ -403,7 +403,7 @@ public void testRestrict(final FormulaContext _c) { a4.addLiteral(_c.f.literal("a", false)); a4.addLiteral(_c.f.variable("b")); a4.addLiteral(_c.f.literal("c", false)); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); assertThat(pb1.restrict(_c.f, a1)).isEqualTo(_c.f.pbc(CType.EQ, 0, litsA1, coeffA1)); assertThat(pb1.restrict(_c.f, a2)).isEqualTo(_c.f.pbc(CType.EQ, 2, litsA2, coeffA2)); assertThat(pb1.restrict(_c.f, a3)).isEqualTo(_c.f.falsum()); @@ -417,8 +417,8 @@ public void testRestrictInequality(final FormulaContext _c) { _c.f.variable("d"), _c.f.variable("e"), _c.f.literal("f", false)); final List coeffs = Arrays.asList(75, 50, 201, -3, -24, 1); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.GE, -24, lits, coeffs); - final PBConstraint pb2 = (PBConstraint) _c.f.pbc(CType.LE, 150, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.GE, -24, lits, coeffs); + final PbConstraint pb2 = (PbConstraint) _c.f.pbc(CType.LE, 150, lits, coeffs); final Assignment a1 = new Assignment(); a1.addLiteral(_c.f.literal("b", false)); a1.addLiteral(_c.f.variable("c")); @@ -482,7 +482,7 @@ public void testSubstitute(final FormulaContext _c) { final Substitution s6 = new Substitution(); s6.addMapping(_c.f.variable("a"), _c.f.variable("a2")); s6.addMapping(_c.f.variable("b"), _c.f.falsum()); - final PBConstraint pb = (PBConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); + final PbConstraint pb = (PbConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); assertThat(pb.substitute(_c.f, s1)).isEqualTo(_c.f.pbc(CType.EQ, 0, litsS1, coeffS1)); assertThat(pb.substitute(_c.f, s2)).isEqualTo(_c.f.pbc(CType.EQ, 2, litsS2, coeffS2)); assertThat(pb.substitute(_c.f, s3)).isEqualTo(_c.f.falsum()); @@ -498,12 +498,12 @@ public void testSubstitute(final FormulaContext _c) { public void testNegation(final FormulaContext _c) { final List lits = Arrays.asList(_c.f.variable("a"), _c.f.literal("b", false), _c.f.variable("c")); final List coeffs = Arrays.asList(2, -2, 3); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); - final PBConstraint pb3 = (PBConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); - final PBConstraint pb4 = (PBConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); - final PBConstraint pb5 = (PBConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); - final PBConstraint pb6 = (PBConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); - final PBConstraint pb7 = (PBConstraint) _c.f.pbc(CType.EQ, -2, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); + final PbConstraint pb3 = (PbConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); + final PbConstraint pb4 = (PbConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); + final PbConstraint pb5 = (PbConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); + final PbConstraint pb6 = (PbConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); + final PbConstraint pb7 = (PbConstraint) _c.f.pbc(CType.EQ, -2, lits, coeffs); assertThat(pb1.negate(_c.f)) .isEqualTo(_c.f.or(_c.f.pbc(CType.LT, 2, lits, coeffs), _c.f.pbc(CType.GT, 2, lits, coeffs))); assertThat(pb3.negate(_c.f)).isEqualTo(_c.f.pbc(CType.LT, 1, lits, coeffs)); @@ -530,11 +530,11 @@ public void testNormalization(final FormulaContext _c) { Arrays.asList(_c.f.variable("a"), _c.f.literal("b", false), _c.f.variable("c"), _c.f.variable("d"), _c.f.literal("b", false)); final List coeffs = Arrays.asList(2, -3, 3, 0, 1); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); - final PBConstraint pb2 = (PBConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); - final PBConstraint pb3 = (PBConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); - final PBConstraint pb4 = (PBConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); - final PBConstraint pb5 = (PBConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.EQ, 2, lits, coeffs); + final PbConstraint pb2 = (PbConstraint) _c.f.pbc(CType.GE, 1, lits, coeffs); + final PbConstraint pb3 = (PbConstraint) _c.f.pbc(CType.GT, 0, lits, coeffs); + final PbConstraint pb4 = (PbConstraint) _c.f.pbc(CType.LE, 1, lits, coeffs); + final PbConstraint pb5 = (PbConstraint) _c.f.pbc(CType.LT, 2, lits, coeffs); assertThat(pb1.normalize(_c.f).toString()).isEqualTo("(2*a + 2*b + 3*c <= 4) & (2*~a + 2*~b + 3*~c <= 3)"); assertThat(pb2.normalize(_c.f).toString()).isEqualTo("2*~a + 2*~b + 3*~c <= 4"); assertThat(pb3.normalize(_c.f).toString()).isEqualTo("2*~a + 2*~b + 3*~c <= 4"); @@ -548,11 +548,11 @@ public void testNormalizationTrivial(final FormulaContext _c) { final List lits = Arrays.asList(_c.f.variable("a"), _c.f.literal("b", false), _c.f.variable("c"), _c.f.variable("d")); final List coeffs = Arrays.asList(2, -2, 3, 0); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); - final PBConstraint pb2 = (PBConstraint) _c.f.pbc(CType.LE, 5, lits, coeffs); - final PBConstraint pb3 = (PBConstraint) _c.f.pbc(CType.LE, 7, lits, coeffs); - final PBConstraint pb4 = (PBConstraint) _c.f.pbc(CType.LE, 10, lits, coeffs); - final PBConstraint pb5 = (PBConstraint) _c.f.pbc(CType.LE, -3, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); + final PbConstraint pb2 = (PbConstraint) _c.f.pbc(CType.LE, 5, lits, coeffs); + final PbConstraint pb3 = (PbConstraint) _c.f.pbc(CType.LE, 7, lits, coeffs); + final PbConstraint pb4 = (PbConstraint) _c.f.pbc(CType.LE, 10, lits, coeffs); + final PbConstraint pb5 = (PbConstraint) _c.f.pbc(CType.LE, -3, lits, coeffs); assertThat(pb1.normalize(_c.f).toString()).isEqualTo("2*a + 2*b + 3*c <= 6"); assertThat(pb2.normalize(_c.f)).isEqualTo(_c.f.verum()); assertThat(pb3.normalize(_c.f)).isEqualTo(_c.f.verum()); @@ -566,11 +566,11 @@ public void testNormalizationSimplifications(final FormulaContext _c) { List lits = Arrays.asList(_c.f.variable("a"), _c.f.variable("a"), _c.f.variable("c"), _c.f.variable("d")); List coeffs = Arrays.asList(2, -2, 4, 4); - final PBConstraint pb1 = (PBConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); + final PbConstraint pb1 = (PbConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); assertThat(pb1.normalize(_c.f).toString()).isEqualTo("c + d <= 1"); lits = Arrays.asList(_c.f.variable("a"), _c.f.literal("a", false), _c.f.variable("c"), _c.f.variable("d")); coeffs = Arrays.asList(2, 2, 4, 2); - final PBConstraint pb2 = (PBConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); + final PbConstraint pb2 = (PbConstraint) _c.f.pbc(CType.LE, 4, lits, coeffs); assertThat(pb2.normalize(_c.f).toString()).isEqualTo("2*c + d <= 1"); } @@ -657,35 +657,35 @@ public void testAtomicFormula(final FormulaContext _c) { @Test public void testEvaluateCoeffs() { - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -3, CType.EQ)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 3, CType.EQ)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -2, CType.EQ)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 2, CType.EQ)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 0, CType.EQ)).isEqualTo(Tristate.UNDEF); - - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -3, CType.GE)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 3, CType.GE)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -2, CType.GE)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 2, CType.GE)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 0, CType.GE)).isEqualTo(Tristate.UNDEF); - - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -3, CType.GT)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 3, CType.GT)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -2, CType.GT)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 2, CType.GT)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 0, CType.GT)).isEqualTo(Tristate.UNDEF); - - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -3, CType.LE)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 3, CType.LE)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -2, CType.LE)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 2, CType.LE)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 0, CType.LE)).isEqualTo(Tristate.UNDEF); - - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -3, CType.LT)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 3, CType.LT)).isEqualTo(Tristate.TRUE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, -2, CType.LT)).isEqualTo(Tristate.FALSE); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 2, CType.LT)).isEqualTo(Tristate.UNDEF); - assertThat(PBConstraint.evaluateCoeffs(-2, 2, 0, CType.LT)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -3, CType.EQ)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 3, CType.EQ)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -2, CType.EQ)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 2, CType.EQ)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 0, CType.EQ)).isEqualTo(Tristate.UNDEF); + + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -3, CType.GE)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 3, CType.GE)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -2, CType.GE)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 2, CType.GE)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 0, CType.GE)).isEqualTo(Tristate.UNDEF); + + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -3, CType.GT)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 3, CType.GT)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -2, CType.GT)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 2, CType.GT)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 0, CType.GT)).isEqualTo(Tristate.UNDEF); + + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -3, CType.LE)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 3, CType.LE)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -2, CType.LE)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 2, CType.LE)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 0, CType.LE)).isEqualTo(Tristate.UNDEF); + + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -3, CType.LT)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 3, CType.LT)).isEqualTo(Tristate.TRUE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, -2, CType.LT)).isEqualTo(Tristate.FALSE); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 2, CType.LT)).isEqualTo(Tristate.UNDEF); + assertThat(PbConstraint.evaluateCoeffs(-2, 2, 0, CType.LT)).isEqualTo(Tristate.UNDEF); } @ParameterizedTest diff --git a/core/src/test/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactoryTest.java b/core/src/test/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactoryTest.java index 04264c73..12d97890 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactoryTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/implementation/cached/CachingFormulaFactoryTest.java @@ -18,8 +18,8 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -88,8 +88,8 @@ public void testRandomName() { @Test public void testConfigurations() { final FormulaFactory f = FormulaFactory.caching(); - final Configuration configMaxSat = MaxSATConfig.builder().build(); - final Configuration configSat = SATSolverConfig.builder().build(); + final Configuration configMaxSat = MaxSatConfig.builder().build(); + final Configuration configSat = SatSolverConfig.builder().build(); f.putConfiguration(configMaxSat); f.putConfiguration(configSat); assertThat(f.configurationFor(ConfigurationType.MAXSAT)).isEqualTo(configMaxSat); @@ -99,9 +99,9 @@ public void testConfigurations() { @Test public void testGeneratedVariables() { FormulaFactory f = FormulaFactory.caching(); - Variable ccVar = f.newCCVariable(); - Variable cnfVar = f.newCNFVariable(); - Variable pbVar = f.newPBVariable(); + Variable ccVar = f.newCcVariable(); + Variable cnfVar = f.newCnfVariable(); + Variable pbVar = f.newPbVariable(); Variable var = f.variable("x"); assertThat(ccVar.getName().startsWith("@AUX_")).isTrue(); assertThat(cnfVar.getName().startsWith("@AUX_")).isTrue(); @@ -112,9 +112,9 @@ public void testGeneratedVariables() { assertThat(cnfVar.getName()).isEqualTo("@AUX_" + f.getName() + "_CNF_0"); f = FormulaFactory.caching(FormulaFactoryConfig.builder().name("f").build()); - ccVar = f.newCCVariable(); - cnfVar = f.newCNFVariable(); - pbVar = f.newPBVariable(); + ccVar = f.newCcVariable(); + cnfVar = f.newCnfVariable(); + pbVar = f.newPbVariable(); var = f.variable("x"); assertThat(ccVar.getName().startsWith("@AUX_")).isTrue(); assertThat(cnfVar.getName().startsWith("@AUX_")).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentationTest.java b/core/src/test/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentationTest.java similarity index 96% rename from core/src/test/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentationTest.java rename to core/src/test/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentationTest.java index e2ec1da2..a11b4ddd 100644 --- a/core/src/test/java/com/booleworks/logicng/formulas/printer/UTF8StringRepresentationTest.java +++ b/core/src/test/java/com/booleworks/logicng/formulas/printer/Utf8StringRepresentationTest.java @@ -14,8 +14,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class UTF8StringRepresentationTest extends TestWithFormulaContext { - private final FormulaStringRepresentation sr = new UTF8StringRepresentation(); +public class Utf8StringRepresentationTest extends TestWithFormulaContext { + private final FormulaStringRepresentation sr = new Utf8StringRepresentation(); @ParameterizedTest @MethodSource("contexts") diff --git a/core/src/test/java/com/booleworks/logicng/functions/MinimumPrimeImplicantTest.java b/core/src/test/java/com/booleworks/logicng/functions/MinimumPrimeImplicantTest.java index 95c56444..da93f84f 100644 --- a/core/src/test/java/com/booleworks/logicng/functions/MinimumPrimeImplicantTest.java +++ b/core/src/test/java/com/booleworks/logicng/functions/MinimumPrimeImplicantTest.java @@ -24,7 +24,7 @@ public class MinimumPrimeImplicantTest { final FormulaFactory f = FormulaFactory.caching(); public MinimumPrimeImplicantTest() { - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); } @Test diff --git a/core/src/test/java/com/booleworks/logicng/graphs/algorithms/ConnectedComponentsComputerTest.java b/core/src/test/java/com/booleworks/logicng/graphs/algorithms/ConnectedComponentsComputerTest.java index dc132807..7f20c7bd 100644 --- a/core/src/test/java/com/booleworks/logicng/graphs/algorithms/ConnectedComponentsComputerTest.java +++ b/core/src/test/java/com/booleworks/logicng/graphs/algorithms/ConnectedComponentsComputerTest.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.encodings.EncoderConfig; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.graphs.datastructures.Graph; import com.booleworks.logicng.graphs.datastructures.GraphTest; @@ -17,7 +17,7 @@ import com.booleworks.logicng.graphs.generators.ConstraintGraphGenerator; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.transformations.cnf.CNFFactorization; +import com.booleworks.logicng.transformations.cnf.CnfFactorization; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -99,16 +99,16 @@ public void graph50Test() throws IOException { @Test public void testFormulaSplit() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); final Formula parsed = FormulaReader.readFormula(f, "../test_files/formulas/formula1.txt"); final List formulas = new ArrayList<>(); final List originalFormulas = new ArrayList<>(); for (final Formula formula : parsed) { originalFormulas.add(formula); - if (formula instanceof PBConstraint) { + if (formula instanceof PbConstraint) { formulas.add(formula); } else { - formulas.add(formula.transform(new CNFFactorization(f))); + formulas.add(formula.transform(new CnfFactorization(f))); } } final Graph constraintGraph = ConstraintGraphGenerator.generateFromFormulas(f, formulas); diff --git a/core/src/test/java/com/booleworks/logicng/graphs/datastructures/HypergraphEdgeTest.java b/core/src/test/java/com/booleworks/logicng/graphs/datastructures/HypergraphEdgeTest.java index fbd2538b..d77985e8 100644 --- a/core/src/test/java/com/booleworks/logicng/graphs/datastructures/HypergraphEdgeTest.java +++ b/core/src/test/java/com/booleworks/logicng/graphs/datastructures/HypergraphEdgeTest.java @@ -37,7 +37,7 @@ public void testCenterOfGravity() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser p = new PropositionalParser(f); final Hypergraph hypergraph = - HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("A | B | ~C | D"))); + HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("A | B | ~C | D"))); final HypergraphEdge edge = hypergraph.getEdges().iterator().next(); final Map, Integer> ordering = new HashMap<>(); ordering.put(new HypergraphNode<>(hypergraph, f.variable("A")), 1); @@ -57,7 +57,7 @@ public void testIllegalCenterOfGravity() throws ParserException { final FormulaFactory f = FormulaFactory.nonCaching(); final PropositionalParser p = new PropositionalParser(f); final Hypergraph hypergraph = - HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("A | B | ~C | D"))); + HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("A | B | ~C | D"))); final HypergraphEdge edge = hypergraph.getEdges().iterator().next(); assertThatThrownBy(() -> edge.centerOfGravity(new HashMap<>())).isInstanceOf(IllegalStateException.class); } diff --git a/core/src/test/java/com/booleworks/logicng/graphs/generators/ConstraintGraphGeneratorTest.java b/core/src/test/java/com/booleworks/logicng/graphs/generators/ConstraintGraphGeneratorTest.java index 0f79e3b1..0cee612e 100644 --- a/core/src/test/java/com/booleworks/logicng/graphs/generators/ConstraintGraphGeneratorTest.java +++ b/core/src/test/java/com/booleworks/logicng/graphs/generators/ConstraintGraphGeneratorTest.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.encodings.EncoderConfig; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.graphs.algorithms.ConnectedComponentsComputation; import com.booleworks.logicng.graphs.datastructures.Graph; @@ -17,7 +17,7 @@ import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.transformations.cnf.CNFFactorization; +import com.booleworks.logicng.transformations.cnf.CnfFactorization; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -96,14 +96,14 @@ public void testCnf() throws ParserException { @Test public void testRealExample() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); final Formula parsed = FormulaReader.readFormula(f, "../test_files/formulas/formula1.txt"); final List formulas = new ArrayList<>(); for (final Formula formula : parsed) { - if (formula instanceof PBConstraint) { + if (formula instanceof PbConstraint) { formulas.add(formula); } else { - formulas.add(formula.transform(new CNFFactorization(f))); + formulas.add(formula.transform(new CnfFactorization(f))); } } final Graph constraintGraph = ConstraintGraphGenerator.generateFromFormulas(f, formulas); diff --git a/core/src/test/java/com/booleworks/logicng/graphs/generators/HypergraphGeneratorTest.java b/core/src/test/java/com/booleworks/logicng/graphs/generators/HypergraphGeneratorTest.java index 179c4501..aa118b40 100644 --- a/core/src/test/java/com/booleworks/logicng/graphs/generators/HypergraphGeneratorTest.java +++ b/core/src/test/java/com/booleworks/logicng/graphs/generators/HypergraphGeneratorTest.java @@ -24,17 +24,17 @@ public class HypergraphGeneratorTest { public void testCNF() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser p = new PropositionalParser(f); - assertThat(HypergraphGenerator.fromCNF(f, p.parse("$false")).getNodes()).isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, p.parse("$false")).getEdges()).isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, p.parse("$true")).getNodes()).isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, p.parse("$true")).getEdges()).isEmpty(); + assertThat(HypergraphGenerator.fromCnf(f, p.parse("$false")).getNodes()).isEmpty(); + assertThat(HypergraphGenerator.fromCnf(f, p.parse("$false")).getEdges()).isEmpty(); + assertThat(HypergraphGenerator.fromCnf(f, p.parse("$true")).getNodes()).isEmpty(); + assertThat(HypergraphGenerator.fromCnf(f, p.parse("$true")).getEdges()).isEmpty(); - Hypergraph hypergraph = HypergraphGenerator.fromCNF(f, p.parse("A")); + Hypergraph hypergraph = HypergraphGenerator.fromCnf(f, p.parse("A")); HypergraphNode nodeA = new HypergraphNode<>(hypergraph, f.variable("A")); assertThat(hypergraph.getNodes()).containsExactly(nodeA); assertThat(hypergraph.getEdges()).containsExactly(new HypergraphEdge<>(Collections.singletonList(nodeA))); - hypergraph = HypergraphGenerator.fromCNF(f, p.parse("A | B | ~C")); + hypergraph = HypergraphGenerator.fromCnf(f, p.parse("A | B | ~C")); nodeA = new HypergraphNode<>(hypergraph, f.variable("A")); HypergraphNode nodeB = new HypergraphNode<>(hypergraph, f.variable("B")); HypergraphNode nodeC = new HypergraphNode<>(hypergraph, f.variable("C")); @@ -43,7 +43,7 @@ public void testCNF() throws ParserException { .containsExactlyInAnyOrder(new HypergraphEdge<>(Arrays.asList(nodeA, nodeB, nodeC))); hypergraph = - HypergraphGenerator.fromCNF(f, p.parse("(A | B | ~C) & (B | ~D) & (C | ~E) & (~B | ~D | E) & X & ~Y")); + HypergraphGenerator.fromCnf(f, p.parse("(A | B | ~C) & (B | ~D) & (C | ~E) & (~B | ~D | E) & X & ~Y")); nodeA = new HypergraphNode<>(hypergraph, f.variable("A")); nodeB = new HypergraphNode<>(hypergraph, f.variable("B")); nodeC = new HypergraphNode<>(hypergraph, f.variable("C")); @@ -66,21 +66,21 @@ public void testCNF() throws ParserException { public void testCNFFromList() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser p = new PropositionalParser(f); - assertThat(HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("$false"))).getNodes()) + assertThat(HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("$false"))).getNodes()) .isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("$false"))).getEdges()) + assertThat(HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("$false"))).getEdges()) .isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("$true"))).getNodes()) + assertThat(HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("$true"))).getNodes()) .isEmpty(); - assertThat(HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("$true"))).getEdges()) + assertThat(HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("$true"))).getEdges()) .isEmpty(); - Hypergraph hypergraph = HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("A"))); + Hypergraph hypergraph = HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("A"))); HypergraphNode nodeA = new HypergraphNode<>(hypergraph, f.variable("A")); assertThat(hypergraph.getNodes()).containsExactly(nodeA); assertThat(hypergraph.getEdges()).containsExactly(new HypergraphEdge<>(Collections.singletonList(nodeA))); - hypergraph = HypergraphGenerator.fromCNF(f, Collections.singletonList(p.parse("A | B | ~C"))); + hypergraph = HypergraphGenerator.fromCnf(f, Collections.singletonList(p.parse("A | B | ~C"))); nodeA = new HypergraphNode<>(hypergraph, f.variable("A")); HypergraphNode nodeB = new HypergraphNode<>(hypergraph, f.variable("B")); HypergraphNode nodeC = new HypergraphNode<>(hypergraph, f.variable("C")); @@ -88,7 +88,7 @@ public void testCNFFromList() throws ParserException { assertThat(hypergraph.getEdges()) .containsExactlyInAnyOrder(new HypergraphEdge<>(Arrays.asList(nodeA, nodeB, nodeC))); - hypergraph = HypergraphGenerator.fromCNF(f, Arrays.asList( + hypergraph = HypergraphGenerator.fromCnf(f, Arrays.asList( p.parse("(A | B | ~C)"), p.parse("(B | ~D)"), p.parse("(C | ~E)"), @@ -113,7 +113,7 @@ public void testCNFFromList() throws ParserException { new HypergraphEdge<>(Collections.singletonList(nodeY)) ); - hypergraph = HypergraphGenerator.fromCNF(f, + hypergraph = HypergraphGenerator.fromCnf(f, p.parse("(A | B | ~C)"), p.parse("(B | ~D)"), p.parse("(C | ~E)"), @@ -144,7 +144,7 @@ public void testNonCNF() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser p = new PropositionalParser(f); try { - HypergraphGenerator.fromCNF(f, p.parse("A => B")); + HypergraphGenerator.fromCnf(f, p.parse("A => B")); } catch (final IllegalArgumentException e) { assertThat(e).hasMessage("Cannot generate a hypergraph from a non-cnf formula"); } diff --git a/core/src/test/java/com/booleworks/logicng/handlers/BoundedOptimizationHandler.java b/core/src/test/java/com/booleworks/logicng/handlers/BoundedOptimizationHandler.java index 3e1ddfa4..2afa2bde 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/BoundedOptimizationHandler.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/BoundedOptimizationHandler.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.handlers; import com.booleworks.logicng.handlers.events.ComputationStartedEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * Bounded optimization handler for testing purposes. @@ -36,7 +36,7 @@ public BoundedOptimizationHandler(final int satStartsLimit, final int startsLimi } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event instanceof ComputationStartedEvent) { if (event == ComputationStartedEvent.SAT_CALL_STARTED) { canceled |= satStartsLimit != -1 && ++numSatStarts >= satStartsLimit; diff --git a/core/src/test/java/com/booleworks/logicng/handlers/BoundedSatHandler.java b/core/src/test/java/com/booleworks/logicng/handlers/BoundedSatHandler.java index 810e4bc9..a37c4315 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/BoundedSatHandler.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/BoundedSatHandler.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.handlers; import com.booleworks.logicng.handlers.events.ComputationStartedEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; /** * Bounded SAT handler for testing purposes. @@ -29,7 +29,7 @@ public BoundedSatHandler(final int startsLimit) { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == ComputationStartedEvent.SAT_CALL_STARTED) { canceled = startsLimit != -1 && ++numStarts >= startsLimit; } diff --git a/core/src/test/java/com/booleworks/logicng/handlers/ModelEnumerationHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/ModelEnumerationHandlerTest.java index 2a2c5590..d5a5a196 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/ModelEnumerationHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/ModelEnumerationHandlerTest.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.events.SimpleEvent; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelCountingFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -34,7 +34,7 @@ public void init() { @Test public void testTimeoutHandler() throws ParserException, InterruptedException { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A | B | C | D | E | F | G | H | I | J | K | L | N | M | O | P | Q | R | S | T | U | V | W"); solver.add(formula); @@ -46,7 +46,7 @@ public void testTimeoutHandler() throws ParserException, InterruptedException { assertThat(handler.shouldResume(SimpleEvent.NO_EVENT)).isTrue(); final long start = System.currentTimeMillis(); - final LNGResult result = solver.execute(enumeration, handler); + final LngResult result = solver.execute(enumeration, handler); final long finish = System.currentTimeMillis(); final long timeElapsed = finish - start; @@ -62,7 +62,7 @@ public void testNumberOfModelsHandler() throws ParserException { f.parse("A | B | C | D | E | F | G | H | I | J | K | L | N | M | O | P | Q | R | S | T | U | V | W"); final SortedSet vars = union(formula.variables(f), f.variables("X", "Y", "Z"), TreeSet::new); for (int i = 1; i <= 1000; i += 7) { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final NumberOfModelsHandler handler = new NumberOfModelsHandler(i); final ModelCountingFunction enumeration = ModelCountingFunction.builder(vars) @@ -70,7 +70,7 @@ public void testNumberOfModelsHandler() throws ParserException { .strategy(DefaultModelEnumerationStrategy.builder().maxNumberOfModels(200).build()) .build() ).build(); - final LNGResult numberOfModels = solver.execute(enumeration, handler); + final LngResult numberOfModels = solver.execute(enumeration, handler); assertThat(numberOfModels.isSuccess()).isFalse(); assertThat(numberOfModels.isPartial()).isTrue(); assertThat(numberOfModels.getPartialResult().longValueExact()).isLessThanOrEqualTo(i + 8); // because of 3 dont cares diff --git a/core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandlerTest.java similarity index 81% rename from core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandlerTest.java rename to core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandlerTest.java index da578fce..ab5a5074 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBDDHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/NumberOfNodesBddHandlerTest.java @@ -8,11 +8,11 @@ import org.junit.jupiter.api.Test; -public class NumberOfNodesBDDHandlerTest { +public class NumberOfNodesBddHandlerTest { @Test public void testInvalidBound() { - assertThatThrownBy(() -> new NumberOfNodesBDDHandler(-2)) + assertThatThrownBy(() -> new NumberOfNodesBddHandler(-2)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("The bound for added nodes must be equal or greater than 0."); } diff --git a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutBDDHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutBddHandlerTest.java similarity index 80% rename from core/src/test/java/com/booleworks/logicng/handlers/TimeoutBDDHandlerTest.java rename to core/src/test/java/com/booleworks/logicng/handlers/TimeoutBddHandlerTest.java index 7aa34081..04e0fd83 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutBDDHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutBddHandlerTest.java @@ -17,10 +17,10 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.orderings.BFSOrdering; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.orderings.BfsOrdering; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.VariableOrderingProvider; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.BeforeEach; @@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicInteger; @ExtendWith(MockitoExtension.class) -class TimeoutBDDHandlerTest { +class TimeoutBddHandlerTest { private FormulaFactory f; private PigeonHoleGenerator pg; @@ -55,12 +55,12 @@ public void testNewRefAdded() throws InterruptedException { @Test public void testThatMethodsAreCalled() throws ParserException { final Formula formula = f.parse("(A => ~B) & ((A & C) | (D & ~C)) & (A | Y | X)"); - final VariableOrderingProvider provider = new BFSOrdering(); - final BDDKernel kernel = new BDDKernel(f, provider.getOrder(f, formula), 100, 100); + final VariableOrderingProvider provider = new BfsOrdering(); + final BddKernel kernel = new BddKernel(f, provider.getOrder(f, formula), 100, 100); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); when(handler.shouldResume(any())).thenReturn(true); - BDDFactory.build(f, formula, kernel, handler); + BddFactory.build(f, formula, kernel, handler); verify(handler, times(1)).shouldResume(eq(BDD_COMPUTATION_STARTED)); verify(handler, atLeast(1)).shouldResume(eq(BDD_NEW_REF_ADDED)); } @@ -68,14 +68,14 @@ public void testThatMethodsAreCalled() throws ParserException { @Test public void testThatNewRefAddedHandledProperly() throws ParserException { final Formula formula = f.parse("(A => ~B) & ((A & C) | ~(D & ~C)) & (A | Y | X)"); - final VariableOrderingProvider provider = new BFSOrdering(); - final BDDKernel kernel = new BDDKernel(f, provider.getOrder(f, formula), 100, 100); + final VariableOrderingProvider provider = new BfsOrdering(); + final BddKernel kernel = new BddKernel(f, provider.getOrder(f, formula), 100, 100); final ComputationHandler handler = Mockito.mock(ComputationHandler.class); final AtomicInteger count = new AtomicInteger(0); when(handler.shouldResume(eq(BDD_COMPUTATION_STARTED))).thenReturn(true); when(handler.shouldResume(eq(BDD_NEW_REF_ADDED))).thenAnswer(invocationOnMock -> count.addAndGet(1) < 5); - final LNGResult result = BDDFactory.build(f, formula, kernel, handler); + final LngResult result = BddFactory.build(f, formula, kernel, handler); assertThat(result.isSuccess()).isFalse(); verify(handler, times(1)).shouldResume(eq(BDD_COMPUTATION_STARTED)); verify(handler, times(5)).shouldResume(eq(BDD_NEW_REF_ADDED)); @@ -84,23 +84,23 @@ public void testThatNewRefAddedHandledProperly() throws ParserException { @Test public void testTimeoutHandlerSingleTimeout() { final Formula formula = pg.generate(10); - final VariableOrderingProvider provider = new BFSOrdering(); - final BDDKernel kernel = new BDDKernel(f, provider.getOrder(f, formula), 100, 100); + final VariableOrderingProvider provider = new BfsOrdering(); + final BddKernel kernel = new BddKernel(f, provider.getOrder(f, formula), 100, 100); final TimeoutHandler handler = new TimeoutHandler(100L); - final LNGResult result = BDDFactory.build(f, formula, kernel, handler); + final LngResult result = BddFactory.build(f, formula, kernel, handler); assertThat(result.isSuccess()).isFalse(); } @Test public void testTimeoutHandlerFixedEnd() { final Formula formula = pg.generate(10); - final VariableOrderingProvider provider = new BFSOrdering(); - final BDDKernel kernel = new BDDKernel(f, provider.getOrder(f, formula), 100, 100); + final VariableOrderingProvider provider = new BfsOrdering(); + final BddKernel kernel = new BddKernel(f, provider.getOrder(f, formula), 100, 100); final TimeoutHandler handler = new TimeoutHandler(System.currentTimeMillis() + 100L, TimeoutHandler.TimerType.FIXED_END); - final LNGResult result = BDDFactory.build(f, formula, kernel, handler); + final LngResult result = BddFactory.build(f, formula, kernel, handler); assertThat(result.isSuccess()).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSATHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSatHandlerTest.java similarity index 84% rename from core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSATHandlerTest.java rename to core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSatHandlerTest.java index 48ab2045..dbfd791f 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSATHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutMaxSatHandlerTest.java @@ -21,8 +21,8 @@ import com.booleworks.logicng.handlers.events.MaxSatNewUpperBoundEvent; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.DimacsReader; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.MaxSatSolver; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -35,22 +35,22 @@ import java.util.List; @ExtendWith(MockitoExtension.class) -class TimeoutMaxSATHandlerTest { +class TimeoutMaxSatHandlerTest { private FormulaFactory f; - private List solvers; + private List solvers; @BeforeEach public void init() { f = FormulaFactory.caching(); solvers = Arrays.asList( - MaxSATSolver.incWBO(f), - MaxSATSolver.wbo(f), - MaxSATSolver.linearSU(f), - MaxSATSolver.linearUS(f), - MaxSATSolver.msu3(f), - MaxSATSolver.wmsu3(f), - MaxSATSolver.oll(f) + MaxSatSolver.incWbo(f), + MaxSatSolver.wbo(f), + MaxSatSolver.linearSu(f), + MaxSatSolver.linearUs(f), + MaxSatSolver.msu3(f), + MaxSatSolver.wmsu3(f), + MaxSatSolver.oll(f) ); } @@ -74,7 +74,7 @@ public void testTimeoutForUpperBound() throws InterruptedException { @Test public void testThatMethodsAreCalled() throws ParserException { - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { final int weight = solver.isWeighted() ? 2 : 1; solver.addHardFormula(f.parse("A&B")); solver.addSoftFormula(f.parse("~A"), weight); @@ -92,11 +92,11 @@ public void testThatMethodsAreCalled() throws ParserException { public void testTimeoutHandlerSingleTimeout() throws IOException { final List formulas = DimacsReader.readCNF(f, "../test_files/sat/too_large_gr_rcs_w5.shuffled.cnf"); - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { final int weight = solver.isWeighted() ? 2 : 1; formulas.forEach(c -> solver.addSoftFormula(c, weight)); final TimeoutHandler handler = new TimeoutHandler(10L); - final LNGResult solve = solver.solve(handler); + final LngResult solve = solver.solve(handler); assertThat(solve.isSuccess()).isFalse(); } } @@ -104,11 +104,11 @@ public void testTimeoutHandlerSingleTimeout() throws IOException { @Test public void testTimeoutHandlerFixedEnd() { final Formula ph = new PigeonHoleGenerator(f).generate(10); - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { final int weight = solver.isWeighted() ? 2 : 1; ph.forEach(c -> solver.addSoftFormula(c, weight)); final TimeoutHandler handler = new TimeoutHandler(System.currentTimeMillis() + 100L, FIXED_END); - final LNGResult solve = solver.solve(handler); + final LngResult solve = solver.solve(handler); assertThat(solve.isSuccess()).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutModelEnumerationHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutModelEnumerationHandlerTest.java index 01ffdd9c..09398ece 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutModelEnumerationHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutModelEnumerationHandlerTest.java @@ -22,7 +22,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import com.booleworks.logicng.solvers.sat.SolverTestSet; import com.booleworks.logicng.testutils.PigeonHoleGenerator; @@ -41,7 +41,7 @@ class TimeoutModelEnumerationHandlerTest { private FormulaFactory f; private PigeonHoleGenerator pg; - private List solvers; + private List solvers; @BeforeEach public void init() { @@ -62,7 +62,7 @@ public void testFoundModel() throws InterruptedException { @Test public void testThatMethodsAreCalled() throws ParserException { final Formula formula = f.parse("A & B | C"); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); when(handler.shouldResume(any())).thenReturn(true); @@ -76,7 +76,7 @@ public void testThatMethodsAreCalled() throws ParserException { @Test public void testThatSatHandlerIsHandledProperly() { final Formula formula = pg.generate(10).negate(f); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); final AtomicInteger count = new AtomicInteger(0); @@ -96,12 +96,12 @@ public void testThatSatHandlerIsHandledProperly() { @Test public void testTimeoutHandlerSingleTimeout() { final Formula formula = pg.generate(10).negate(f); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final TimeoutHandler handler = new TimeoutHandler(20L); final ModelEnumerationFunction me = ModelEnumerationFunction.builder(formula.variables(f)).build(); - final LNGResult> result = me.apply(solver, handler); + final LngResult> result = me.apply(solver, handler); assertThat(result.isSuccess()).isFalse(); assertThatThrownBy(result::getResult).isInstanceOf(IllegalStateException.class); @@ -111,12 +111,12 @@ public void testTimeoutHandlerSingleTimeout() { @Test public void testTimeoutHandlerFixedEnd() { final Formula formula = pg.generate(10).negate(f); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final TimeoutHandler handler = new TimeoutHandler(System.currentTimeMillis() + 100L, FIXED_END); final ModelEnumerationFunction me = ModelEnumerationFunction.builder(formula.variables(f)).build(); - final LNGResult> result = me.apply(solver, handler); + final LngResult> result = me.apply(solver, handler); assertThat(result.isSuccess()).isFalse(); assertThatThrownBy(result::getResult).isInstanceOf(IllegalStateException.class); diff --git a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutOptimizationHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutOptimizationHandlerTest.java index f725f55a..b2468d33 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutOptimizationHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutOptimizationHandlerTest.java @@ -25,7 +25,7 @@ import com.booleworks.logicng.handlers.events.OptimizationFoundBetterBoundEvent; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.DimacsReader; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.OptimizationFunction; import com.booleworks.logicng.solvers.sat.SolverTestSet; import com.booleworks.logicng.util.FormulaHelper; @@ -43,7 +43,7 @@ class TimeoutOptimizationHandlerTest { private FormulaFactory f; - private List solvers; + private List solvers; @BeforeEach public void init() { @@ -64,7 +64,7 @@ public void testTimeoutFoundBetterBound() throws InterruptedException { @Test public void testThatMethodsAreCalled() throws ParserException { final Formula formula = f.parse("a & b & (~a => b)"); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); when(handler.shouldResume(any())).thenReturn(true); @@ -78,11 +78,11 @@ public void testThatMethodsAreCalled() throws ParserException { public void testTimeoutHandlerSingleTimeout() throws IOException { final List formulas = DimacsReader.readCNF(f, "../test_files/sat/too_large_gr_rcs_w5.shuffled.cnf"); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formulas); final TimeoutHandler handler = new TimeoutHandler(10L); - final LNGResult result = solver.execute(OptimizationFunction.builder() + final LngResult result = solver.execute(OptimizationFunction.builder() .literals(FormulaHelper.variables(f, formulas)) .maximize().build(), handler); assertThat(result.isSuccess()).isFalse(); @@ -93,10 +93,10 @@ public void testTimeoutHandlerSingleTimeout() throws IOException { public void testTimeoutHandlerFixedEnd() throws IOException { final List formulas = DimacsReader.readCNF(f, "../test_files/sat/too_large_gr_rcs_w5.shuffled.cnf"); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formulas); final TimeoutHandler handler = new TimeoutHandler(100L, FIXED_END); - final LNGResult result = solver.execute(OptimizationFunction.builder() + final LngResult result = solver.execute(OptimizationFunction.builder() .literals(FormulaHelper.variables(f, formulas)) .maximize().build(), handler); assertThat(result.isSuccess()).isFalse(); diff --git a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutSATHandlerTest.java b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutSATHandlerTest.java index 20b0875f..59b72868 100644 --- a/core/src/test/java/com/booleworks/logicng/handlers/TimeoutSATHandlerTest.java +++ b/core/src/test/java/com/booleworks/logicng/handlers/TimeoutSATHandlerTest.java @@ -22,7 +22,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.sat.SolverTestSet; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.BeforeEach; @@ -40,7 +40,7 @@ class TimeoutSATHandlerTest { private FormulaFactory f; private PigeonHoleGenerator pg; - private List solvers; + private List solvers; @BeforeEach public void init() { @@ -60,7 +60,7 @@ public void testDetectedConflict() throws InterruptedException { @Test public void testThatMethodsAreCalled() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.parse("(x => y) & (~x => y) & (y => z) & (z => ~y)")); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); when(handler.shouldResume(any())).thenReturn(true); @@ -73,14 +73,14 @@ public void testThatMethodsAreCalled() throws ParserException { @Test public void testThatDetectedConflictIsHandledProperly() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(pg.generate(10)); final TimeoutHandler handler = Mockito.mock(TimeoutHandler.class); final AtomicInteger count = new AtomicInteger(0); when(handler.shouldResume(any())).thenReturn(true); when(handler.shouldResume(eq(SAT_CONFLICT_DETECTED))) .thenAnswer(invocationOnMock -> count.addAndGet(1) < 5); - final LNGResult result = solver.satCall().handler(handler).sat(); + final LngResult result = solver.satCall().handler(handler).sat(); assertThat(result.isSuccess()).isFalse(); verify(handler, times(1)).shouldResume(eq(SAT_CALL_STARTED)); verify(handler, times(5)).shouldResume(eq(SAT_CONFLICT_DETECTED)); @@ -90,20 +90,20 @@ public void testThatDetectedConflictIsHandledProperly() { @Test public void testTimeoutHandlerSingleTimeout() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(pg.generate(10)); final TimeoutHandler handler = new TimeoutHandler(100L); - final LNGResult result = solver.satCall().handler(handler).sat(); + final LngResult result = solver.satCall().handler(handler).sat(); assertThat(result.isSuccess()).isFalse(); } } @Test public void testTimeoutHandlerFixedEnd() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(pg.generate(10)); final TimeoutHandler handler = new TimeoutHandler(System.currentTimeMillis() + 100L, FIXED_END); - final LNGResult result = solver.satCall().handler(handler).sat(); + final LngResult result = solver.satCall().handler(handler).sat(); assertThat(result.isSuccess()).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/io/FormulaWriterReaderTest.java b/core/src/test/java/com/booleworks/logicng/io/FormulaWriterReaderTest.java index a42ae3ce..42428ce3 100644 --- a/core/src/test/java/com/booleworks/logicng/io/FormulaWriterReaderTest.java +++ b/core/src/test/java/com/booleworks/logicng/io/FormulaWriterReaderTest.java @@ -8,7 +8,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.printer.UTF8StringRepresentation; +import com.booleworks.logicng.formulas.printer.Utf8StringRepresentation; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.io.readers.FormulaReader; @@ -116,7 +116,7 @@ public void testSimpleFormulaOneLineFormatter() throws ParserException, IOExcept final File file = new File(fileName); final FormulaFactory f = FormulaFactory.caching(); final Formula p1 = new PropositionalParser(f).parse("A & B & ~(C | (D => ~E))"); - FormulaWriter.write(fileName, p1, false, new UTF8StringRepresentation()); + FormulaWriter.write(fileName, p1, false, new Utf8StringRepresentation()); try (final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), StandardCharsets.UTF_8))) { assertThat(reader.readLine()).isEqualTo("A ∧ B ∧ ¬(C ∨ (D ⇒ ¬E))"); @@ -130,7 +130,7 @@ public void testSimpleFormulaMultiLineFormatter() throws ParserException, IOExce final File file = new File(fileName); final FormulaFactory f = FormulaFactory.caching(); final Formula p1 = new PropositionalParser(f).parse("A & B & ~(C | (D => ~E))"); - FormulaWriter.write(fileName, p1, true, new UTF8StringRepresentation()); + FormulaWriter.write(fileName, p1, true, new Utf8StringRepresentation()); try (final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), StandardCharsets.UTF_8))) { assertThat(reader.readLine()).isEqualTo("A"); diff --git a/core/src/test/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGeneratorTest.java b/core/src/test/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGeneratorTest.java index 6cf4b353..34bbcaf2 100644 --- a/core/src/test/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGeneratorTest.java +++ b/core/src/test/java/com/booleworks/logicng/io/graphical/generators/BddGraphicalGeneratorTest.java @@ -17,9 +17,9 @@ import com.booleworks.logicng.io.graphical.GraphicalRepresentation; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import org.junit.jupiter.api.Test; import java.io.File; @@ -35,18 +35,18 @@ public void testFormulas() throws IOException, ParserException { final PropositionalParser p = new PropositionalParser(f); final List ordering = Arrays.asList(f.variable("A"), f.variable("B"), f.variable("C"), f.variable("D")); - final BDDKernel kernel = new BDDKernel(f, ordering, 1000, 1000); - testFiles("false", BDDFactory.build(f, p.parse("$false"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("true", BDDFactory.build(f, p.parse("$true"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("a", BDDFactory.build(f, p.parse("A"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("not_a", BDDFactory.build(f, p.parse("~A"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("impl", BDDFactory.build(f, p.parse("A => ~C"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("equiv", BDDFactory.build(f, p.parse("A <=> ~C"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("or", BDDFactory.build(f, p.parse("A | B | ~C"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("and", BDDFactory.build(f, p.parse("A & B & ~C"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("not", BDDFactory.build(f, p.parse("~(A & B & ~C)"), kernel), + final BddKernel kernel = new BddKernel(f, ordering, 1000, 1000); + testFiles("false", BddFactory.build(f, p.parse("$false"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("true", BddFactory.build(f, p.parse("$true"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("a", BddFactory.build(f, p.parse("A"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("not_a", BddFactory.build(f, p.parse("~A"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("impl", BddFactory.build(f, p.parse("A => ~C"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("equiv", BddFactory.build(f, p.parse("A <=> ~C"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("or", BddFactory.build(f, p.parse("A | B | ~C"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("and", BddFactory.build(f, p.parse("A & B & ~C"), kernel), BddGraphicalGenerator.builder().build()); + testFiles("not", BddFactory.build(f, p.parse("~(A & B & ~C)"), kernel), BddGraphicalGenerator.builder().build()); - testFiles("formula", BDDFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel), + testFiles("formula", BddFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel), BddGraphicalGenerator.builder().build()); } @@ -56,8 +56,8 @@ public void testFixedStyle() throws ParserException, IOException { final PropositionalParser p = new PropositionalParser(f); final List ordering = Arrays.asList(f.variable("A"), f.variable("B"), f.variable("C"), f.variable("D")); - final BDDKernel kernel = new BDDKernel(f, ordering, 1000, 1000); - final BDD bdd = BDDFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel); + final BddKernel kernel = new BddKernel(f, ordering, 1000, 1000); + final Bdd bdd = BddFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel); final BddGraphicalGenerator generator = BddGraphicalGenerator.builder() .falseNodeStyle(GraphicalNodeStyle.rectangle(GraphicalColor.PURPLE, GraphicalColor.WHITE, @@ -80,8 +80,8 @@ public void testDynamic() throws ParserException, IOException { final PropositionalParser p = new PropositionalParser(f); final List ordering = Arrays.asList(f.variable("A"), f.variable("B"), f.variable("C"), f.variable("D")); - final BDDKernel kernel = new BDDKernel(f, ordering, 1000, 1000); - final BDD bdd = BDDFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel); + final BddKernel kernel = new BddKernel(f, ordering, 1000, 1000); + final Bdd bdd = BddFactory.build(f, p.parse("(A => (B|~C)) & (B => C & D) & (D <=> A)"), kernel); final BddGraphicalGenerator generator = BddGraphicalGenerator.builder() .negativeEdgeMapper(new MyNegEdgeMapper(kernel)) @@ -92,7 +92,7 @@ public void testDynamic() throws ParserException, IOException { testFiles("formula-dynamic", bdd, generator); } - private void testFiles(final String fileName, final BDD bdd, final BddGraphicalGenerator generator) + private void testFiles(final String fileName, final Bdd bdd, final BddGraphicalGenerator generator) throws IOException { final GraphicalRepresentation representation = generator.translate(bdd); representation.write("../test_files/writers/temp/" + fileName + "_bdd.dot", GraphicalDotWriter.get()); @@ -113,7 +113,7 @@ private static class MyStyleMapper extends BddNodeStyleMapper { final GraphicalNodeStyle otherStyle = GraphicalNodeStyle.circle(GraphicalColor.CYAN, GraphicalColor.WHITE, GraphicalColor.CYAN); - public MyStyleMapper(final BDDKernel kernel) { + public MyStyleMapper(final BddKernel kernel) { super(kernel); } @@ -136,7 +136,7 @@ public GraphicalNodeStyle computeStyle(final Integer index) { private static class MyLabelMapper extends BddLabelMapper { - public MyLabelMapper(final BDDKernel kernel) { + public MyLabelMapper(final BddKernel kernel) { super(kernel); } @@ -162,7 +162,7 @@ private static class MyPosEdgeMapper extends BddEdgeStyleMapper { final GraphicalEdgeStyle style1 = GraphicalEdgeStyle.solid(GraphicalColor.GREEN); final GraphicalEdgeStyle style2 = GraphicalEdgeStyle.bold(GraphicalColor.GREEN); - public MyPosEdgeMapper(final BDDKernel kernel) { + public MyPosEdgeMapper(final BddKernel kernel) { super(kernel); } @@ -177,7 +177,7 @@ private static class MyNegEdgeMapper extends BddEdgeStyleMapper { final GraphicalEdgeStyle style1 = GraphicalEdgeStyle.dotted(GraphicalColor.RED); final GraphicalEdgeStyle style2 = GraphicalEdgeStyle.bold(GraphicalColor.RED); - public MyNegEdgeMapper(final BDDKernel kernel) { + public MyNegEdgeMapper(final BddKernel kernel) { super(kernel); } diff --git a/core/src/test/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriterTest.java b/core/src/test/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriterTest.java index 5fcb3e7e..b0458085 100644 --- a/core/src/test/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriterTest.java +++ b/core/src/test/java/com/booleworks/logicng/io/writers/FormulaDimacsFileWriterTest.java @@ -12,8 +12,8 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.transformations.cnf.CNFConfig; -import com.booleworks.logicng.transformations.cnf.CNFEncoder; +import com.booleworks.logicng.transformations.cnf.CnfConfig; +import com.booleworks.logicng.transformations.cnf.CnfEncoder; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.Test; @@ -25,7 +25,7 @@ public class FormulaDimacsFileWriterTest extends TestWithFormulaContext { private final FormulaFactory f = FormulaFactory.caching(FormulaFactoryConfig.builder().name("F").build()); - private final CNFConfig config = CNFConfig.builder().algorithm(CNFConfig.Algorithm.FACTORIZATION).build(); + private final CnfConfig config = CnfConfig.builder().algorithm(CnfConfig.Algorithm.FACTORIZATION).build(); private final PropositionalParser p = new PropositionalParser(f); private final PropositionalParser pp = new PropositionalParser(f); @@ -50,11 +50,11 @@ public void testLiterals() throws IOException { @Test public void testFormulas() throws IOException, ParserException { - final Formula f1 = CNFEncoder.encode(f, p.parse("(a & b) <=> (~c => (x | z))"), config); - final Formula f2 = CNFEncoder.encode(f, p.parse("a & b | b & ~c"), config); - final Formula f3 = CNFEncoder.encode(f, p.parse("(a & b) <=> (~c => (a | b))"), config); - final Formula f4 = CNFEncoder.encode(f, p.parse("~(a & b) | b & ~c"), config); - final Formula f5 = CNFEncoder.encode(f, pp.parse("a | ~b | (2*a + 3*~b + 4*c <= 4)"), config); + final Formula f1 = CnfEncoder.encode(f, p.parse("(a & b) <=> (~c => (x | z))"), config); + final Formula f2 = CnfEncoder.encode(f, p.parse("a & b | b & ~c"), config); + final Formula f3 = CnfEncoder.encode(f, p.parse("(a & b) <=> (~c => (a | b))"), config); + final Formula f4 = CnfEncoder.encode(f, p.parse("~(a & b) | b & ~c"), config); + final Formula f5 = CnfEncoder.encode(f, pp.parse("a | ~b | (2*a + 3*~b + 4*c <= 4)"), config); testFiles("f1", f1); testFiles("f2", f2); testFiles("f3", f3); @@ -64,9 +64,9 @@ public void testFormulas() throws IOException, ParserException { @Test public void testDuplicateFormulaParts() throws ParserException, IOException { - final Formula f6 = CNFEncoder.encode(f, p.parse("(a & b) | (c & ~(a & b))"), config); + final Formula f6 = CnfEncoder.encode(f, p.parse("(a & b) | (c & ~(a & b))"), config); testFiles("f6", f6); - final Formula f7 = CNFEncoder.encode(f, p.parse("(c & d) | (a & b) | ((c & d) <=> (a & b))"), config); + final Formula f7 = CnfEncoder.encode(f, p.parse("(c & d) | (a & b) | ((c & d) <=> (a & b))"), config); testFiles("f7", f7); } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDConstructionTests.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddConstructionTests.java similarity index 64% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDConstructionTests.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddConstructionTests.java index d85680a0..1095bc9f 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDConstructionTests.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddConstructionTests.java @@ -10,73 +10,73 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -public class BDDConstructionTests { +public class BddConstructionTests { FormulaFactory f; List variables; - BDDKernel kernel; + BddKernel kernel; Formula initFormula; Formula secondFormula; - BDD initBdd; - BDD secondBdd; + Bdd initBdd; + Bdd secondBdd; @BeforeEach public void init() throws ParserException { f = FormulaFactory.caching(); variables = new ArrayList<>(f.variables("a", "b", "c", "d", "e", "f", "g")); - kernel = new BDDKernel(f, variables, 1000, 10000); + kernel = new BddKernel(f, variables, 1000, 10000); initFormula = f.parse("(a & b) => (c | d & ~e)"); secondFormula = f.parse("(g & f) <=> (c | ~a | ~d)"); - initBdd = BDDFactory.build(f, initFormula, kernel); - secondBdd = BDDFactory.build(f, secondFormula, kernel); + initBdd = BddFactory.build(f, initFormula, kernel); + secondBdd = BddFactory.build(f, secondFormula, kernel); } @Test public void testNegation() { - final BDD negation = initBdd.negate(); - final BDD expected = BDDFactory.build(f, initFormula.negate(f), kernel); + final Bdd negation = initBdd.negate(); + final Bdd expected = BddFactory.build(f, initFormula.negate(f), kernel); assertThat(negation).isEqualTo(expected); } @Test public void testImplies() { - final BDD implication = initBdd.implies(secondBdd); - final BDD expected = BDDFactory.build(f, f.implication(initFormula, secondFormula), kernel); + final Bdd implication = initBdd.implies(secondBdd); + final Bdd expected = BddFactory.build(f, f.implication(initFormula, secondFormula), kernel); assertThat(implication).isEqualTo(expected); } @Test public void testIsImplied() { - final BDD implication = initBdd.impliedBy(secondBdd); - final BDD expected = BDDFactory.build(f, f.implication(secondFormula, initFormula), kernel); + final Bdd implication = initBdd.impliedBy(secondBdd); + final Bdd expected = BddFactory.build(f, f.implication(secondFormula, initFormula), kernel); assertThat(implication).isEqualTo(expected); } @Test public void testEquivalence() { - final BDD equivalence = initBdd.equivalence(secondBdd); - final BDD expected = BDDFactory.build(f, f.equivalence(secondFormula, initFormula), kernel); + final Bdd equivalence = initBdd.equivalence(secondBdd); + final Bdd expected = BddFactory.build(f, f.equivalence(secondFormula, initFormula), kernel); assertThat(equivalence).isEqualTo(expected); } @Test public void testAnd() { - final BDD and = initBdd.and(secondBdd); - final BDD expected = BDDFactory.build(f, f.and(secondFormula, initFormula), kernel); + final Bdd and = initBdd.and(secondBdd); + final Bdd expected = BddFactory.build(f, f.and(secondFormula, initFormula), kernel); assertThat(and).isEqualTo(expected); } @Test public void testOr() { - final BDD or = initBdd.or(secondBdd); - final BDD expected = BDDFactory.build(f, f.or(secondFormula, initFormula), kernel); + final Bdd or = initBdd.or(secondBdd); + final Bdd expected = BddFactory.build(f, f.or(secondFormula, initFormula), kernel); assertThat(or).isEqualTo(expected); } } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDLowLevelTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddLowLevelTest.java similarity index 71% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDLowLevelTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddLowLevelTest.java index 992ebd4c..36ff611e 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDLowLevelTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddLowLevelTest.java @@ -10,33 +10,33 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDConstruction; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddConstruction; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -public class BDDLowLevelTest { +public class BddLowLevelTest { - private BDD bdd; + private Bdd bdd; @BeforeEach public void init() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser parser = new PropositionalParser(f); - final BDDKernel kernel = new BDDKernel(f, 3, 1000, 1000); - BDDFactory.build(f, f.verum(), kernel); - BDDFactory.build(f, f.falsum(), kernel); - BDDFactory.build(f, f.literal("A", true), kernel); - BDDFactory.build(f, f.literal("A", false), kernel); - BDDFactory.build(f, parser.parse("A => ~B"), kernel); - BDDFactory.build(f, parser.parse("A <=> ~B"), kernel); - BDDFactory.build(f, parser.parse("A | B | ~C"), kernel); - bdd = BDDFactory.build(f, parser.parse("A & B & ~C"), kernel); + final BddKernel kernel = new BddKernel(f, 3, 1000, 1000); + BddFactory.build(f, f.verum(), kernel); + BddFactory.build(f, f.falsum(), kernel); + BddFactory.build(f, f.literal("A", true), kernel); + BddFactory.build(f, f.literal("A", false), kernel); + BddFactory.build(f, parser.parse("A => ~B"), kernel); + BddFactory.build(f, parser.parse("A <=> ~B"), kernel); + BddFactory.build(f, parser.parse("A | B | ~C"), kernel); + bdd = BddFactory.build(f, parser.parse("A & B & ~C"), kernel); } @Test public void testStatistics() { - final BDDKernel.BDDStatistics statistics = bdd.getUnderlyingKernel().statistics(); + final BddKernel.BddStatistics statistics = bdd.getUnderlyingKernel().statistics(); assertThat(statistics.cachesize()).isEqualTo(1000); assertThat(statistics.freenum()).isEqualTo(993); assertThat(statistics.gbcollectnum()).isEqualTo(0); @@ -49,7 +49,7 @@ public void testStatistics() { @Test public void kernelTests() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThat(kernel.ithVar(0)).isEqualTo(2); assertThat(kernel.nithVar(0)).isEqualTo(3); assertThat(kernel.bddVar(2)).isEqualTo(0); @@ -60,37 +60,37 @@ public void kernelTests() { @Test public void illegalKernel1() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThatThrownBy(() -> kernel.ithVar(-1)).isInstanceOf(IllegalArgumentException.class); } @Test public void illegalKernel2() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThatThrownBy(() -> kernel.nithVar(-1)).isInstanceOf(IllegalArgumentException.class); } @Test public void illegalKernel3() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThatThrownBy(() -> kernel.bddVar(1)).isInstanceOf(IllegalArgumentException.class); } @Test public void illegalKernel4() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThatThrownBy(() -> kernel.bddLow(1)).isInstanceOf(IllegalArgumentException.class); } @Test public void illegalKernel5() { - final BDDConstruction kernel = new BDDConstruction(bdd.getUnderlyingKernel()); + final BddConstruction kernel = new BddConstruction(bdd.getUnderlyingKernel()); assertThatThrownBy(() -> kernel.bddHigh(1)).isInstanceOf(IllegalArgumentException.class); } @Test public void testSetNegativeVarNum() { - assertThatThrownBy(() -> new BDDKernel(FormulaFactory.caching(), -4, 100, 100)) + assertThatThrownBy(() -> new BddKernel(FormulaFactory.caching(), -4, 100, 100)) .isInstanceOf(IllegalArgumentException.class); } } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDModelEnumerationTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddModelEnumerationTest.java similarity index 83% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDModelEnumerationTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddModelEnumerationTest.java index 8801f861..beb3c035 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDModelEnumerationTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddModelEnumerationTest.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.testutils.NQueensGenerator; import org.junit.jupiter.api.Test; @@ -22,7 +22,7 @@ import java.util.Set; import java.util.SortedSet; -public class BDDModelEnumerationTest { +public class BddModelEnumerationTest { private final FormulaFactory f; @@ -30,7 +30,7 @@ public class BDDModelEnumerationTest { private final List> variables; private final BigInteger[] expected; - public BDDModelEnumerationTest() { + public BddModelEnumerationTest() { final int[] problems = new int[]{3, 4, 5, 6, 7, 8, 9}; expected = new BigInteger[]{ BigInteger.valueOf(0), @@ -57,8 +57,8 @@ public BDDModelEnumerationTest() { @Test public void testModelCount() { for (int i = 0; i < formulas.size(); i++) { - final BDDKernel kernel = new BDDKernel(f, variables.get(i).size(), 10000, 10000); - final BDD bdd = BDDFactory.build(f, formulas.get(i), kernel); + final BddKernel kernel = new BddKernel(f, variables.get(i).size(), 10000, 10000); + final Bdd bdd = BddFactory.build(f, formulas.get(i), kernel); assertThat(bdd.modelCount()).isEqualTo(expected[i]); } } @@ -66,8 +66,8 @@ public void testModelCount() { @Test public void testModelEnumeration() { for (int i = 0; i < formulas.size(); i++) { - final BDDKernel kernel = new BDDKernel(f, variables.get(i).size(), 10000, 10000); - final BDD bdd = BDDFactory.build(f, formulas.get(i), kernel); + final BddKernel kernel = new BddKernel(f, variables.get(i).size(), 10000, 10000); + final Bdd bdd = BddFactory.build(f, formulas.get(i), kernel); final Set models = new HashSet<>(bdd.enumerateAllModels()); assertThat(models.size()).isEqualTo(expected[i].intValue()); for (final Model model : models) { @@ -80,8 +80,8 @@ public void testModelEnumeration() { public void testExo() { final FormulaFactory f = FormulaFactory.caching(); final Formula constraint = f.exo(generateVariables(f, 100)).cnf(f); - final BDDKernel kernel = new BDDKernel(f, constraint.variables(f).size(), 100000, 1000000); - final BDD bdd = BDDFactory.build(f, constraint, kernel); + final BddKernel kernel = new BddKernel(f, constraint.variables(f).size(), 100000, 1000000); + final Bdd bdd = BddFactory.build(f, constraint, kernel); assertThat(bdd.modelCount()).isEqualTo(BigInteger.valueOf(100)); assertThat(bdd.enumerateAllModels()).hasSize(100); } @@ -90,8 +90,8 @@ public void testExo() { public void testExk() { final FormulaFactory f = FormulaFactory.caching(); final Formula constraint = f.cc(CType.EQ, 8, generateVariables(f, 15)).cnf(f); - final BDDKernel kernel = new BDDKernel(f, constraint.variables(f).size(), 100000, 1000000); - final BDD bdd = BDDFactory.build(f, constraint, kernel); + final BddKernel kernel = new BddKernel(f, constraint.variables(f).size(), 100000, 1000000); + final Bdd bdd = BddFactory.build(f, constraint, kernel); assertThat(bdd.modelCount()).isEqualTo(BigInteger.valueOf(6435)); assertThat(bdd.enumerateAllModels()).hasSize(6435); } @@ -100,8 +100,8 @@ public void testExk() { public void testAmo() { final FormulaFactory f = FormulaFactory.caching(); final Formula constraint = f.amo(generateVariables(f, 100)).cnf(f); - final BDDKernel kernel = new BDDKernel(f, constraint.variables(f).size(), 100000, 1000000); - final BDD bdd = BDDFactory.build(f, constraint, kernel); + final BddKernel kernel = new BddKernel(f, constraint.variables(f).size(), 100000, 1000000); + final Bdd bdd = BddFactory.build(f, constraint, kernel); assertThat(bdd.modelCount()).isEqualTo(BigInteger.valueOf(221)); assertThat(bdd.enumerateAllModels(generateVariables(f, 100))).hasSize(101); } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDOperationsTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddOperationsTest.java similarity index 90% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDOperationsTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddOperationsTest.java index 2b846990..f974e6d5 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDOperationsTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddOperationsTest.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; import org.junit.jupiter.api.BeforeEach; @@ -29,33 +29,33 @@ import java.util.Map; import java.util.TreeSet; -public class BDDOperationsTest { +public class BddOperationsTest { private FormulaFactory f; private PropositionalParser parser; - private BDDKernel kernel; - private BDD bddVerum; - private BDD bddFalsum; - private BDD bddPosLit; - private BDD bddNegLit; - private BDD bddImpl; - private BDD bddEquiv; - private BDD bddOr; - private BDD bddAnd; + private BddKernel kernel; + private Bdd bddVerum; + private Bdd bddFalsum; + private Bdd bddPosLit; + private Bdd bddNegLit; + private Bdd bddImpl; + private Bdd bddEquiv; + private Bdd bddOr; + private Bdd bddAnd; @BeforeEach public void init() throws ParserException { f = FormulaFactory.caching(); parser = new PropositionalParser(f); - kernel = new BDDKernel(f, 3, 1000, 1000); - bddVerum = BDDFactory.build(f, f.verum(), kernel); - bddFalsum = BDDFactory.build(f, f.falsum(), kernel); - bddPosLit = BDDFactory.build(f, f.literal("A", true), kernel); - bddNegLit = BDDFactory.build(f, f.literal("A", false), kernel); - bddImpl = BDDFactory.build(f, parser.parse("A => ~B"), kernel); - bddEquiv = BDDFactory.build(f, parser.parse("A <=> ~B"), kernel); - bddOr = BDDFactory.build(f, parser.parse("A | B | ~C"), kernel); - bddAnd = BDDFactory.build(f, parser.parse("A & B & ~C"), kernel); + kernel = new BddKernel(f, 3, 1000, 1000); + bddVerum = BddFactory.build(f, f.verum(), kernel); + bddFalsum = BddFactory.build(f, f.falsum(), kernel); + bddPosLit = BddFactory.build(f, f.literal("A", true), kernel); + bddNegLit = BddFactory.build(f, f.literal("A", false), kernel); + bddImpl = BddFactory.build(f, parser.parse("A => ~B"), kernel); + bddEquiv = BddFactory.build(f, parser.parse("A <=> ~B"), kernel); + bddOr = BddFactory.build(f, parser.parse("A | B | ~C"), kernel); + bddAnd = BddFactory.build(f, parser.parse("A & B & ~C"), kernel); } @Test @@ -64,8 +64,8 @@ public void testToFormula() throws ParserException { assertThat(bddFalsum.toFormula()).isEqualTo(f.falsum()); assertThat(bddPosLit.toFormula()).isEqualTo(f.literal("A", true)); assertThat(bddNegLit.toFormula()).isEqualTo(f.literal("A", false)); - assertThat(BDDFactory.build(f, f.literal("C", true)).toFormula()).isEqualTo(f.literal("C", true)); - assertThat(BDDFactory.build(f, f.literal("C", false)).toFormula()).isEqualTo(f.literal("C", false)); + assertThat(BddFactory.build(f, f.literal("C", true)).toFormula()).isEqualTo(f.literal("C", true)); + assertThat(BddFactory.build(f, f.literal("C", false)).toFormula()).isEqualTo(f.literal("C", false)); compareFormula(bddImpl, "A => ~B"); compareFormula(bddEquiv, "A <=> ~B"); compareFormula(bddOr, "A | B | ~C"); @@ -74,7 +74,7 @@ public void testToFormula() throws ParserException { @Test public void testToFormulaStyles() throws ParserException { - final BDD bdd = BDDFactory.build(f, f.parse("~A | ~B | ~C"), kernel); + final Bdd bdd = BddFactory.build(f, f.parse("~A | ~B | ~C"), kernel); final Formula expFollowPathsToTrue = f.parse("~A | A & (~B | B & ~C)"); assertThat(bdd.toFormula()).isEqualTo(expFollowPathsToTrue); assertThat(bdd.toFormula(true)).isEqualTo(expFollowPathsToTrue); @@ -88,7 +88,7 @@ public void testToFormulaRandom() { for (int i = 0; i < 100; i++) { final Formula formula = new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(i).build()).formula(6); - final BDD bdd = BDDFactory.build(f, formula); + final Bdd bdd = BddFactory.build(f, formula); compareFormula(bdd, formula); } } @@ -112,18 +112,18 @@ public void testRestriction() throws ParserException { assertThat(bddNegLit.restrict(a)).isEqualTo(bddFalsum); assertThat(bddNegLit.restrict(resNotA)).isEqualTo(bddVerum); assertThat(bddNegLit.restrict(resAB)).isEqualTo(bddFalsum); - assertThat(bddImpl.restrict(a)).isEqualTo(BDDFactory.build(f, f.literal("B", false), kernel)); + assertThat(bddImpl.restrict(a)).isEqualTo(BddFactory.build(f, f.literal("B", false), kernel)); assertThat(bddImpl.restrict(resNotA)).isEqualTo(bddVerum); assertThat(bddImpl.restrict(resAB)).isEqualTo(bddFalsum); - assertThat(bddEquiv.restrict(a)).isEqualTo(BDDFactory.build(f, f.literal("B", false), kernel)); - assertThat(bddEquiv.restrict(resNotA)).isEqualTo(BDDFactory.build(f, f.literal("B", true), kernel)); + assertThat(bddEquiv.restrict(a)).isEqualTo(BddFactory.build(f, f.literal("B", false), kernel)); + assertThat(bddEquiv.restrict(resNotA)).isEqualTo(BddFactory.build(f, f.literal("B", true), kernel)); assertThat(bddEquiv.restrict(resAB)).isEqualTo(bddFalsum); assertThat(bddOr.restrict(a)).isEqualTo(bddVerum); - assertThat(bddOr.restrict(resNotA)).isEqualTo(BDDFactory.build(f, parser.parse("B | ~C"), kernel)); + assertThat(bddOr.restrict(resNotA)).isEqualTo(BddFactory.build(f, parser.parse("B | ~C"), kernel)); assertThat(bddOr.restrict(resAB)).isEqualTo(bddVerum); - assertThat(bddAnd.restrict(a)).isEqualTo(BDDFactory.build(f, parser.parse("B & ~C"), kernel)); + assertThat(bddAnd.restrict(a)).isEqualTo(BddFactory.build(f, parser.parse("B & ~C"), kernel)); assertThat(bddAnd.restrict(resNotA)).isEqualTo(bddFalsum); - assertThat(bddAnd.restrict(resAB)).isEqualTo(BDDFactory.build(f, f.literal("C", false), kernel)); + assertThat(bddAnd.restrict(resAB)).isEqualTo(BddFactory.build(f, f.literal("C", false), kernel)); } @Test @@ -146,8 +146,8 @@ public void testExistentialQuantification() throws ParserException { assertThat(bddEquiv.exists(resAB)).isEqualTo(bddVerum); assertThat(bddOr.exists(a)).isEqualTo(bddVerum); assertThat(bddOr.exists(resAB)).isEqualTo(bddVerum); - assertThat(bddAnd.exists(a)).isEqualTo(BDDFactory.build(f, parser.parse("B & ~C"), kernel)); - assertThat(bddAnd.exists(resAB)).isEqualTo(BDDFactory.build(f, parser.parse("~C"), kernel)); + assertThat(bddAnd.exists(a)).isEqualTo(BddFactory.build(f, parser.parse("B & ~C"), kernel)); + assertThat(bddAnd.exists(resAB)).isEqualTo(BddFactory.build(f, parser.parse("~C"), kernel)); } @Test @@ -164,12 +164,12 @@ public void testUniversalQuantification() throws ParserException { assertThat(bddPosLit.forall(resAB)).isEqualTo(bddFalsum); assertThat(bddNegLit.forall(a)).isEqualTo(bddFalsum); assertThat(bddNegLit.forall(resAB)).isEqualTo(bddFalsum); - assertThat(bddImpl.forall(a)).isEqualTo(BDDFactory.build(f, parser.parse("~B"), kernel)); + assertThat(bddImpl.forall(a)).isEqualTo(BddFactory.build(f, parser.parse("~B"), kernel)); assertThat(bddImpl.forall(resAB)).isEqualTo(bddFalsum); assertThat(bddEquiv.forall(a)).isEqualTo(bddFalsum); assertThat(bddEquiv.forall(resAB)).isEqualTo(bddFalsum); - assertThat(bddOr.forall(a)).isEqualTo(BDDFactory.build(f, parser.parse("B | ~C"), kernel)); - assertThat(bddOr.forall(resAB)).isEqualTo(BDDFactory.build(f, parser.parse("~C"), kernel)); + assertThat(bddOr.forall(a)).isEqualTo(BddFactory.build(f, parser.parse("B | ~C"), kernel)); + assertThat(bddOr.forall(resAB)).isEqualTo(BddFactory.build(f, parser.parse("~C"), kernel)); assertThat(bddAnd.forall(a)).isEqualTo(bddFalsum); assertThat(bddAnd.forall(resAB)).isEqualTo(bddFalsum); } @@ -339,11 +339,11 @@ public void testVariableProfile() { assertThat(bddAnd.variableProfile()).containsExactly(a1, b1, c1); } - private void compareFormula(final BDD bdd, final String formula) throws ParserException { + private void compareFormula(final Bdd bdd, final String formula) throws ParserException { compareFormula(bdd, bdd.kernel.factory().parse(formula)); } - private void compareFormula(final BDD bdd, final Formula compareFormula) { + private void compareFormula(final Bdd bdd, final Formula compareFormula) { final Formula bddFormulaFollowPathsToTrue = bdd.toFormula(true); final Formula bddFormulaFollowPathsToFalse = bdd.toFormula(false); assertThat(bddFormulaFollowPathsToTrue.isEquivalentTo(compareFormula.getFactory(), compareFormula)).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDReorderingTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddReorderingTest.java similarity index 80% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDReorderingTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddReorderingTest.java index 13955c41..8145591f 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BDDReorderingTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/BddReorderingTest.java @@ -15,15 +15,15 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDConstant; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDInnerNode; -import com.booleworks.logicng.knowledgecompilation.bdds.functions.LngBDDFunction; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDOperations; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDReordering; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDReorderingMethod; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddConstant; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddInnerNode; +import com.booleworks.logicng.knowledgecompilation.bdds.functions.LngBddFunction; import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDVerification; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddOperations; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddReordering; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddReorderingMethod; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -40,31 +40,31 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -public class BDDReorderingTest extends TestWithFormulaContext { +public class BddReorderingTest extends TestWithFormulaContext { private final SwapStats stats = new SwapStats(); - private static final List REORDER_METHODS = - List.of(BDDReorderingMethod.BDD_REORDER_WIN2, BDDReorderingMethod.BDD_REORDER_WIN2ITE, - BDDReorderingMethod.BDD_REORDER_WIN3, BDDReorderingMethod.BDD_REORDER_WIN3ITE, - BDDReorderingMethod.BDD_REORDER_SIFT, - BDDReorderingMethod.BDD_REORDER_SIFTITE, BDDReorderingMethod.BDD_REORDER_RANDOM); + private static final List REORDER_METHODS = + List.of(BddReorderingMethod.BDD_REORDER_WIN2, BddReorderingMethod.BDD_REORDER_WIN2ITE, + BddReorderingMethod.BDD_REORDER_WIN3, BddReorderingMethod.BDD_REORDER_WIN3ITE, + BddReorderingMethod.BDD_REORDER_SIFT, + BddReorderingMethod.BDD_REORDER_SIFTITE, BddReorderingMethod.BDD_REORDER_RANDOM); @ParameterizedTest @MethodSource("contexts") public void testExceptionalBehavior(final FormulaContext _c) { assertThatThrownBy(() -> { - final BDDKernel kernel = new BDDKernel(_c.f, List.of(_c.a, _c.b), 100, 100); - final BDDReordering reordering = new BDDReordering(kernel); + final BddKernel kernel = new BddKernel(_c.f, List.of(_c.a, _c.b), 100, 100); + final BddReordering reordering = new BddReordering(kernel); final Formula formula = _c.f.parse("a | b"); - BDDFactory.build(_c.f, formula, kernel); + BddFactory.build(_c.f, formula, kernel); reordering.swapVariables(0, 2); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Unknown variable number: " + 2); assertThatThrownBy(() -> { - final BDDKernel kernel = new BDDKernel(_c.f, List.of(_c.a, _c.b), 100, 100); - final BDDReordering reordering = new BDDReordering(kernel); + final BddKernel kernel = new BddKernel(_c.f, List.of(_c.a, _c.b), 100, 100); + final BddReordering reordering = new BddReordering(kernel); final Formula formula = _c.f.parse("a | b"); - BDDFactory.build(_c.f, formula, kernel); + BddFactory.build(_c.f, formula, kernel); reordering.swapVariables(3, 0); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Unknown variable number: " + 3); @@ -73,9 +73,9 @@ public void testExceptionalBehavior(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testSwapping(final FormulaContext _c) throws ParserException { - final BDDKernel kernel = new BDDKernel(_c.f, List.of(_c.a, _c.b, _c.c), 100, 100); + final BddKernel kernel = new BddKernel(_c.f, List.of(_c.a, _c.b, _c.c), 100, 100); final Formula formula = _c.f.parse("a | b | c"); - final BDD bdd = BDDFactory.build(_c.f, formula, kernel); + final Bdd bdd = BddFactory.build(_c.f, formula, kernel); assertThat(bdd.getVariableOrder()).containsExactly(_c.a, _c.b, _c.c); bdd.swapVariables(_c.a, _c.b); assertThat(bdd.getVariableOrder()).containsExactly(_c.b, _c.a, _c.c); @@ -88,34 +88,34 @@ public void testSwapping(final FormulaContext _c) throws ParserException { bdd.swapVariables(_c.b, _c.c); assertThat(bdd.getVariableOrder()).containsExactly(_c.b, _c.c, _c.a); assertThat(_c.f.equivalence(formula, bdd.cnf()).holds(new TautologyPredicate(_c.f))).isTrue(); - assertThat(bdd.apply(new LngBDDFunction(_c.f))).isEqualTo( - new BDDInnerNode(_c.b, - new BDDInnerNode(_c.c, - new BDDInnerNode(_c.a, BDDConstant.getFalsumNode(_c.f), BDDConstant.getVerumNode(_c.f)), - BDDConstant.getVerumNode(_c.f)), - BDDConstant.getVerumNode(_c.f))); + assertThat(bdd.apply(new LngBddFunction(_c.f))).isEqualTo( + new BddInnerNode(_c.b, + new BddInnerNode(_c.c, + new BddInnerNode(_c.a, BddConstant.getFalsumNode(_c.f), BddConstant.getVerumNode(_c.f)), + BddConstant.getVerumNode(_c.f)), + BddConstant.getVerumNode(_c.f))); assertThatThrownBy(() -> bdd.swapVariables(_c.b, _c.x)).isInstanceOf(IllegalArgumentException.class); } @ParameterizedTest @MethodSource("contexts") public void testSwappingMultipleBdds(final FormulaContext _c) throws ParserException { - final BDDKernel kernel = new BDDKernel(_c.f, List.of(_c.a, _c.b, _c.c), 100, 100); + final BddKernel kernel = new BddKernel(_c.f, List.of(_c.a, _c.b, _c.c), 100, 100); final Formula formula1 = _c.f.parse("a | b | c"); final Formula formula2 = _c.f.parse("a & b"); - final BDD bdd1 = BDDFactory.build(_c.f, formula1, kernel); - final BDD bdd2 = BDDFactory.build(_c.f, formula2, kernel); + final Bdd bdd1 = BddFactory.build(_c.f, formula1, kernel); + final Bdd bdd2 = BddFactory.build(_c.f, formula2, kernel); assertThat(bdd1.getVariableOrder()).containsExactly(_c.a, _c.b, _c.c); assertThat(bdd2.getVariableOrder()).containsExactly(_c.a, _c.b, _c.c); - assertThat(bdd2.apply(new LngBDDFunction(_c.f))).isEqualTo( - new BDDInnerNode(_c.a, BDDConstant.getFalsumNode(_c.f), - new BDDInnerNode(_c.b, BDDConstant.getFalsumNode(_c.f), BDDConstant.getVerumNode(_c.f)))); + assertThat(bdd2.apply(new LngBddFunction(_c.f))).isEqualTo( + new BddInnerNode(_c.a, BddConstant.getFalsumNode(_c.f), + new BddInnerNode(_c.b, BddConstant.getFalsumNode(_c.f), BddConstant.getVerumNode(_c.f)))); bdd1.swapVariables(_c.a, _c.b); assertThat(bdd1.getVariableOrder()).containsExactly(_c.b, _c.a, _c.c); assertThat(bdd2.getVariableOrder()).containsExactly(_c.b, _c.a, _c.c); - assertThat(bdd2.apply(new LngBDDFunction(_c.f))).isEqualTo( - new BDDInnerNode(_c.b, BDDConstant.getFalsumNode(_c.f), - new BDDInnerNode(_c.a, BDDConstant.getFalsumNode(_c.f), BDDConstant.getVerumNode(_c.f)))); + assertThat(bdd2.apply(new LngBddFunction(_c.f))).isEqualTo( + new BddInnerNode(_c.b, BddConstant.getFalsumNode(_c.f), + new BddInnerNode(_c.a, BddConstant.getFalsumNode(_c.f), BddConstant.getVerumNode(_c.f)))); } @Test @@ -149,10 +149,10 @@ private void testRandomReordering(final int minVars, final int maxVars, final bo if (verbose) { System.out.printf("vars = %2d, depth = %2d, nodes = %5d%n", vars, depth, formula.numberOfNodes(f)); } - for (final BDDReorderingMethod method : REORDER_METHODS) { + for (final BddReorderingMethod method : REORDER_METHODS) { performReorder(f, formula, method, true, verbose); } - for (final BDDReorderingMethod method : REORDER_METHODS) { + for (final BddReorderingMethod method : REORDER_METHODS) { performReorder(f, formula, method, false, verbose); } } @@ -164,24 +164,24 @@ private Formula randomFormula(final FormulaFactory f, final int vars, final int .numVars(vars).seed(vars * depth * 42) .weightEquiv(0).weightImpl(0).weightNot(0).build()); return Stream.generate(() -> randomizer.and(depth)) - .filter(fm -> fm.variables(f).size() == vars && fm.holds(new SATPredicate(f))) + .filter(fm -> fm.variables(f).size() == vars && fm.holds(new SatPredicate(f))) .findAny().get(); } - private void performReorder(final FormulaFactory f, final Formula formula, final BDDReorderingMethod reorderMethod, + private void performReorder(final FormulaFactory f, final Formula formula, final BddReorderingMethod reorderMethod, final boolean withBlocks, final boolean verbose) { - final BDDKernel kernel = new BDDKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); - final BDD bdd = BDDFactory.build(f, formula, kernel); + final BddKernel kernel = new BddKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); + final Bdd bdd = BddFactory.build(f, formula, kernel); final BigInteger count = bdd.modelCount(); - final int usedBefore = new BDDOperations(kernel).nodeCount(bdd.getIndex()); + final int usedBefore = new BddOperations(kernel).nodeCount(bdd.getIndex()); final long start = System.currentTimeMillis(); addVariableBlocks(formula.variables(f).size(), withBlocks, kernel); kernel.getReordering().reorder(reorderMethod); final long duration = System.currentTimeMillis() - start; - final int usedAfter = new BDDOperations(kernel).nodeCount(bdd.getIndex()); + final int usedAfter = new BddOperations(kernel).nodeCount(bdd.getIndex()); assertThat(verifyBddConsistency(f, formula, bdd, count)).isTrue(); verifyVariableBlocks(f, formula, withBlocks, bdd); - if (reorderMethod != BDDReorderingMethod.BDD_REORDER_RANDOM) { + if (reorderMethod != BddReorderingMethod.BDD_REORDER_RANDOM) { assertThat(usedAfter).isLessThanOrEqualTo(usedBefore); } final double reduction = (usedBefore - usedAfter) / (double) usedBefore * 100; @@ -191,8 +191,8 @@ private void performReorder(final FormulaFactory f, final Formula formula, final } } - private void addVariableBlocks(final int numVars, final boolean withBlocks, final BDDKernel kernel) { - final BDDReordering reordering = kernel.getReordering(); + private void addVariableBlocks(final int numVars, final boolean withBlocks, final BddKernel kernel) { + final BddReordering reordering = kernel.getReordering(); if (withBlocks) { reordering.addVariableBlockAll(); reordering.addVariableBlock(0, 20, true); @@ -219,30 +219,30 @@ private void testReorderOnBuild(final int minVars, final int maxVars, final bool System.out.println(String.format("vars = %2d, depth = %2d, nodes = %5d", vars, depth, formula.numberOfNodes(f))); } - final BDDKernel kernel = new BDDKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); - final BDD bdd = BDDFactory.build(f, formula, kernel); - final int nodeCount = new BDDOperations(kernel).nodeCount(bdd.getIndex()); + final BddKernel kernel = new BddKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); + final Bdd bdd = BddFactory.build(f, formula, kernel); + final int nodeCount = new BddOperations(kernel).nodeCount(bdd.getIndex()); final BigInteger modelCount = bdd.modelCount(); - for (final BDDReorderingMethod method : REORDER_METHODS) { + for (final BddReorderingMethod method : REORDER_METHODS) { reorderOnBuild(f, formula, method, modelCount, nodeCount, true, verbose); } - for (final BDDReorderingMethod method : REORDER_METHODS) { + for (final BddReorderingMethod method : REORDER_METHODS) { reorderOnBuild(f, formula, method, modelCount, nodeCount, false, verbose); } } } } - private void reorderOnBuild(final FormulaFactory f, final Formula formula, final BDDReorderingMethod method, + private void reorderOnBuild(final FormulaFactory f, final Formula formula, final BddReorderingMethod method, final BigInteger originalCount, final int originalUsedNodes, final boolean withBlocks, final boolean verbose) { - final BDDKernel kernel = new BDDKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); + final BddKernel kernel = new BddKernel(f, new ArrayList<>(formula.variables(f)), 1000, 10000); addVariableBlocks(formula.variables(f).size(), withBlocks, kernel); kernel.getReordering().setReorderDuringConstruction(method, 10000); final long start = System.currentTimeMillis(); - final BDD bdd = BDDFactory.build(f, formula, kernel); + final Bdd bdd = BddFactory.build(f, formula, kernel); final long duration = System.currentTimeMillis() - start; - final int usedAfter = new BDDOperations(kernel).nodeCount(bdd.getIndex()); + final int usedAfter = new BddOperations(kernel).nodeCount(bdd.getIndex()); verifyVariableBlocks(f, formula, withBlocks, bdd); verifyBddConsistency(f, formula, bdd, originalCount); final double reduction = (originalUsedNodes - usedAfter) / (double) originalUsedNodes * 100; @@ -252,7 +252,7 @@ private void reorderOnBuild(final FormulaFactory f, final Formula formula, final } } - private boolean verifyBddConsistency(final FormulaFactory f, final Formula f1, final BDD bdd, + private boolean verifyBddConsistency(final FormulaFactory f, final Formula f1, final Bdd bdd, final BigInteger modelCount) { final BDDVerification verification = new BDDVerification(bdd.getUnderlyingKernel()); if (!verification.verify(bdd.getIndex())) { @@ -275,7 +275,7 @@ private boolean verifyBddConsistency(final FormulaFactory f, final Formula f1, f } private void verifyVariableBlocks(final FormulaFactory f, final Formula formula, final boolean withBlocks, - final BDD bdd) { + final Bdd bdd) { if (withBlocks) { assertThat(findSequence(bdd, IntStream.range(0, 21).mapToObj(i -> String.format("v%02d", i)).collect(Collectors.toSet()))) @@ -309,7 +309,7 @@ private void verifyVariableBlocks(final FormulaFactory f, final Formula formula, } } - private boolean findSequence(final BDD bdd, final Set vars) { + private boolean findSequence(final Bdd bdd, final Set vars) { final Iterator it = bdd.getVariableOrder().iterator(); while (it.hasNext()) { if (vars.contains(it.next().getName())) { @@ -338,7 +338,7 @@ public void newFormula(final Formula formula) { maxFormulaSize = Math.max(maxFormulaSize, formula.numberOfNodes(formula.getFactory())); } - public void newBdd(final BDD bdd) { + public void newBdd(final Bdd bdd) { maxBddNodes = Math.max(maxBddNodes, bdd.nodeCount()); } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBDDTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBddTest.java similarity index 88% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBDDTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBddTest.java index 7d387934..64d0ccf0 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBDDTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/FormulaBddTest.java @@ -11,20 +11,19 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.orderings.BFSOrdering; -import com.booleworks.logicng.knowledgecompilation.bdds.orderings.DFSOrdering; +import com.booleworks.logicng.knowledgecompilation.bdds.orderings.BfsOrdering; +import com.booleworks.logicng.knowledgecompilation.bdds.orderings.DfsOrdering; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.MaxToMinOrdering; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.MinToMaxOrdering; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -public class FormulaBDDTest { +public class FormulaBddTest { @Test public void testSimpleCases() { final FormulaFactory f = FormulaFactory.caching(); - BDD bdd = f.verum().bdd(f); + Bdd bdd = f.verum().bdd(f); assertThat(bdd.isTautology()).isTrue(); bdd = f.falsum().bdd(f); assertThat(bdd.isContradiction()).isTrue(); @@ -38,11 +37,11 @@ public void testBDDGeneration() throws ParserException { final PropositionalParser p = new PropositionalParser(f); final Formula formula = p.parse("(A => ~B) & ((A & C) | (D & ~C)) & (A | Y | X) & (Y <=> (X | (W + A + F < 1)))"); - final BDD bddNoOrder = formula.bdd(f); - final BDD bddBfs = formula.bdd(f, new BFSOrdering()); - final BDD bddDfs = formula.bdd(f, new DFSOrdering()); - final BDD bddMin2Max = formula.bdd(f, new MinToMaxOrdering()); - final BDD bddMax2Min = formula.bdd(f, new MaxToMinOrdering()); + final Bdd bddNoOrder = formula.bdd(f); + final Bdd bddBfs = formula.bdd(f, new BfsOrdering()); + final Bdd bddDfs = formula.bdd(f, new DfsOrdering()); + final Bdd bddMin2Max = formula.bdd(f, new MinToMaxOrdering()); + final Bdd bddMax2Min = formula.bdd(f, new MaxToMinOrdering()); assertThat(bddNoOrder.nodeCount()).isEqualTo(13); assertThat(bddBfs.nodeCount()).isEqualTo(14); diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBDDTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBddTest.java similarity index 72% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBDDTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBddTest.java index 41fef843..a5bfdcaf 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBDDTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/LargeBddTest.java @@ -9,18 +9,18 @@ import com.booleworks.logicng.LongRunningTag; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.NumberOfNodesBDDHandler; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.NumberOfNodesBddHandler; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.testutils.NQueensGenerator; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.Test; import java.math.BigInteger; -public class LargeBDDTest { +public class LargeBddTest { @Test public void testPigeonHole() { @@ -38,8 +38,8 @@ public void testPigeonHole() { private void testPigeonHole(final FormulaFactory f, final PigeonHoleGenerator generator, final int size) { final Formula pigeon = generator.generate(size); - final BDDKernel kernel = new BDDKernel(f, pigeon.variables(f).size(), 10000, 10000); - final BDD bdd = BDDFactory.build(f, pigeon, kernel); + final BddKernel kernel = new BddKernel(f, pigeon.variables(f).size(), 10000, 10000); + final Bdd bdd = BddFactory.build(f, pigeon, kernel); assertThat(bdd.isContradiction()).isTrue(); } @@ -57,12 +57,12 @@ public void testQueens() { private void testQueens(final FormulaFactory f, final NQueensGenerator generator, final int size, final int models) { final Formula queens = generator.generate(size); - final BDDKernel kernel = new BDDKernel(f, queens.variables(f).size(), 10000, 10000); - final BDD bdd = BDDFactory.build(f, queens, kernel); + final BddKernel kernel = new BddKernel(f, queens.variables(f).size(), 10000, 10000); + final Bdd bdd = BddFactory.build(f, queens, kernel); final Formula cnf = bdd.cnf(); - assertThat(cnf.isCNF(f)).isTrue(); - final BDD cnfBDD = BDDFactory.build(f, cnf, kernel); - assertThat(cnfBDD).isEqualTo(bdd); + assertThat(cnf.isCnf(f)).isTrue(); + final Bdd cnfBdd = BddFactory.build(f, cnf, kernel); + assertThat(cnfBdd).isEqualTo(bdd); assertThat(bdd.support()).isEqualTo(queens.variables(f)); assertThat(bdd.modelCount()).isEqualTo(BigInteger.valueOf(models)); } @@ -72,11 +72,11 @@ public void testTimeoutHandlerNgSmall() { final FormulaFactory f = FormulaFactory.caching(); final NQueensGenerator generator = new NQueensGenerator(f); final Formula queens = generator.generate(4); - final BDDKernel kernel = new BDDKernel(f, queens.variables(f).size(), 10000, 10000); + final BddKernel kernel = new BddKernel(f, queens.variables(f).size(), 10000, 10000); final TimeoutHandler handler = new TimeoutHandler(2000L); - final LNGResult bdd = BDDFactory.build(f, queens, kernel, handler); + final LngResult bdd = BddFactory.build(f, queens, kernel, handler); assertThat(bdd.isSuccess()).isTrue(); - assertThat(bdd.getResult().getIndex()).isNotEqualTo(BDDKernel.BDD_ABORT); + assertThat(bdd.getResult().getIndex()).isNotEqualTo(BddKernel.BDD_ABORT); } @Test @@ -85,9 +85,9 @@ public void testTimeoutHandlerNgLarge() { final FormulaFactory f = FormulaFactory.caching(); final NQueensGenerator generator = new NQueensGenerator(f); final Formula queens = generator.generate(10); - final BDDKernel kernel = new BDDKernel(f, queens.variables(f).size(), 10000, 10000); + final BddKernel kernel = new BddKernel(f, queens.variables(f).size(), 10000, 10000); final TimeoutHandler handler = new TimeoutHandler(1000L); - final LNGResult bdd = BDDFactory.build(f, queens, kernel, handler); + final LngResult bdd = BddFactory.build(f, queens, kernel, handler); assertThat(bdd.isSuccess()).isFalse(); } @@ -96,11 +96,11 @@ public void testNumberOfNodesHandlerSmall() { final FormulaFactory f = FormulaFactory.caching(); final NQueensGenerator generator = new NQueensGenerator(f); final Formula queens = generator.generate(4); - final BDDKernel kernel = new BDDKernel(f, queens.variables(f).size(), 10000, 10000); - final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(1000); - final LNGResult bdd = BDDFactory.build(f, queens, kernel, handler); + final BddKernel kernel = new BddKernel(f, queens.variables(f).size(), 10000, 10000); + final NumberOfNodesBddHandler handler = new NumberOfNodesBddHandler(1000); + final LngResult bdd = BddFactory.build(f, queens, kernel, handler); assertThat(bdd.isSuccess()).isTrue(); - assertThat(bdd.getResult().getIndex()).isNotEqualTo(BDDKernel.BDD_ABORT); + assertThat(bdd.getResult().getIndex()).isNotEqualTo(BddKernel.BDD_ABORT); } @Test @@ -108,9 +108,9 @@ public void testNumberOfNodesHandlerLarge() { final FormulaFactory f = FormulaFactory.caching(); final NQueensGenerator generator = new NQueensGenerator(f); final Formula queens = generator.generate(10); - final BDDKernel kernel = new BDDKernel(f, queens.variables(f).size(), 10000, 10000); - final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(5); - final LNGResult bdd = BDDFactory.build(f, queens, kernel, handler); + final BddKernel kernel = new BddKernel(f, queens.variables(f).size(), 10000, 10000); + final NumberOfNodesBddHandler handler = new NumberOfNodesBddHandler(5); + final LngResult bdd = BddFactory.build(f, queens, kernel, handler); assertThat(bdd.isSuccess()).isFalse(); } @@ -118,9 +118,9 @@ public void testNumberOfNodesHandlerLarge() { public void testNumberOfNodesHandler() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final Formula formula = f.parse("A <=> ~(B => C & F & G & ~H | A & D & ~E)"); - final BDDKernel kernel = new BDDKernel(f, formula.variables(f).size(), 10000, 10000); - final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(5); - final LNGResult bdd = BDDFactory.build(f, formula, kernel, handler); + final BddKernel kernel = new BddKernel(f, formula.variables(f).size(), 10000, 10000); + final NumberOfNodesBddHandler handler = new NumberOfNodesBddHandler(5); + final LngResult bdd = BddFactory.build(f, formula, kernel, handler); assertThat(bdd.isSuccess()).isFalse(); } } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBDDTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBddTest.java similarity index 85% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBDDTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBddTest.java index 6f86df67..6bc5fe2b 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBDDTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/SimpleBddTest.java @@ -13,8 +13,8 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BDDConstant; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.datastructures.BddConstant; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -22,12 +22,12 @@ import java.util.Arrays; import java.util.List; -public class SimpleBDDTest extends TestWithFormulaContext { +public class SimpleBddTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testTrue(final FormulaContext _c) { - final BDD bdd = BDDFactory.build(_c.f, _c.f.verum()); + final Bdd bdd = BddFactory.build(_c.f, _c.f.verum()); assertThat(bdd.isTautology()).isTrue(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.f.verum()); @@ -35,15 +35,15 @@ public void testTrue(final FormulaContext _c) { assertThat(bdd.modelCount()).isEqualTo(BigInteger.ONE); assertThat(bdd.getUnderlyingKernel().factory()).isSameAs(_c.f); assertThat(bdd.enumerateAllModels()).containsExactly(new Model()); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ZERO); - assertThat(bdd.toLngBdd()).isEqualTo(BDDConstant.getVerumNode(_c.f)); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ZERO); + assertThat(bdd.toLngBdd()).isEqualTo(BddConstant.getVerumNode(_c.f)); } @ParameterizedTest @MethodSource("contexts") public void testFalse(final FormulaContext _c) { - final BDDKernel kernel = new BDDKernel(_c.f, 0, 100, 100); - final BDD bdd = BDDFactory.build(_c.f, _c.f.falsum(), kernel); + final BddKernel kernel = new BddKernel(_c.f, 0, 100, 100); + final Bdd bdd = BddFactory.build(_c.f, _c.f.falsum(), kernel); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isTrue(); assertThat(bdd.cnf()).isEqualTo(_c.f.falsum()); @@ -52,14 +52,14 @@ public void testFalse(final FormulaContext _c) { assertThat(bdd.getUnderlyingKernel()).isSameAs(kernel); assertThat(bdd.getUnderlyingKernel().factory()).isSameAs(_c.f); assertThat(bdd.enumerateAllModels()).isEmpty(); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ONE); - assertThat(bdd.toLngBdd()).isEqualTo(BDDConstant.getFalsumNode(_c.f)); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ONE); + assertThat(bdd.toLngBdd()).isEqualTo(BddConstant.getFalsumNode(_c.f)); } @ParameterizedTest @MethodSource("contexts") public void testPositiveLiteral(final FormulaContext _c) { - final BDD bdd = BDDFactory.build(_c.f, _c.f.literal("A", true)); + final Bdd bdd = BddFactory.build(_c.f, _c.f.literal("A", true)); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.f.literal("A", true)); @@ -67,14 +67,14 @@ public void testPositiveLiteral(final FormulaContext _c) { assertThat(bdd.modelCount()).isEqualTo(BigInteger.ONE); assertThat(bdd.getUnderlyingKernel().factory()).isSameAs(_c.f); assertThat(bdd.enumerateAllModels()).containsExactly(new Model(_c.f.literal("A", true))); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ONE); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ONE); assertThat(bdd.toLngBdd().toString()).isEqualTo(" high=<$true>>"); } @ParameterizedTest @MethodSource("contexts") public void testNegativeLiteral(final FormulaContext _c) { - final BDD bdd = BDDFactory.build(_c.f, _c.f.literal("A", false)); + final Bdd bdd = BddFactory.build(_c.f, _c.f.literal("A", false)); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.f.literal("A", false)); @@ -82,14 +82,14 @@ public void testNegativeLiteral(final FormulaContext _c) { assertThat(bdd.modelCount()).isEqualTo(BigInteger.ONE); assertThat(bdd.getUnderlyingKernel().factory()).isSameAs(_c.f); assertThat(bdd.enumerateAllModels()).containsExactly(new Model(_c.f.literal("A", false))); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ONE); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ONE); assertThat(bdd.toLngBdd().toString()).isEqualTo(" high=<$false>>"); } @ParameterizedTest @MethodSource("contexts") public void testImplication(final FormulaContext _c) throws ParserException { - final BDD bdd = BDDFactory.build(_c.f, _c.p.parse("A => ~B")); + final Bdd bdd = BddFactory.build(_c.f, _c.p.parse("A => ~B")); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.p.parse("~A | ~B")); @@ -101,7 +101,7 @@ public void testImplication(final FormulaContext _c) throws ParserException { new Model(_c.f.literal("A", true), _c.f.literal("B", false)), new Model(_c.f.literal("A", false), _c.f.literal("B", true)) ); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ONE); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ONE); assertThat(bdd.toLngBdd().toString()) .isEqualTo(" high= high=<$false>>>"); } @@ -109,7 +109,7 @@ public void testImplication(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testEquivalence(final FormulaContext _c) throws ParserException { - final BDD bdd = BDDFactory.build(_c.f, _c.p.parse("A <=> ~B")); + final Bdd bdd = BddFactory.build(_c.f, _c.p.parse("A <=> ~B")); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.p.parse("(A | B) & (~A | ~B)")); @@ -120,7 +120,7 @@ public void testEquivalence(final FormulaContext _c) throws ParserException { new Model(_c.f.literal("A", true), _c.f.literal("B", false)), new Model(_c.f.literal("A", false), _c.f.literal("B", true)) ); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.valueOf(2)); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.valueOf(2)); assertThat(bdd.toLngBdd().toString()) .isEqualTo(" high=<$true>> high= high=<$false>>>"); } @@ -128,7 +128,7 @@ public void testEquivalence(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testOr(final FormulaContext _c) throws ParserException { - final BDD bdd = BDDFactory.build(_c.f, _c.p.parse("A | B | ~C")); + final Bdd bdd = BddFactory.build(_c.f, _c.p.parse("A | B | ~C")); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(_c.p.parse("A | B | ~C")); @@ -144,7 +144,7 @@ public void testOr(final FormulaContext _c) throws ParserException { new Model(_c.f.literal("A", true), _c.f.literal("B", true), _c.f.literal("C", false)), new Model(_c.f.literal("A", true), _c.f.literal("B", true), _c.f.literal("C", true)) ); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.ONE); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.ONE); assertThat(bdd.toLngBdd().toString()) .isEqualTo(" high=<$false>> high=<$true>> high=<$true>>"); } @@ -155,8 +155,8 @@ public void testAnd(final FormulaContext _c) throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser parser = new PropositionalParser(f); final List ordering = Arrays.asList(f.variable("A"), f.variable("B"), f.variable("C")); - final BDDKernel kernel = new BDDKernel(f, ordering, 1000, 1000); - final BDD bdd = BDDFactory.build(f, parser.parse("A & B & ~C"), kernel); + final BddKernel kernel = new BddKernel(f, ordering, 1000, 1000); + final Bdd bdd = BddFactory.build(f, parser.parse("A & B & ~C"), kernel); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(parser.parse("A & (~A | B) & (~A | ~B | ~C)")); @@ -166,7 +166,7 @@ public void testAnd(final FormulaContext _c) throws ParserException { assertThat(bdd.enumerateAllModels()).containsExactlyInAnyOrder( new Model(f.literal("A", true), f.literal("B", true), f.literal("C", false)) ); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.valueOf(3)); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.valueOf(3)); assertThat(bdd.toLngBdd().toString()) .isEqualTo(" high= high= high=<$false>>>>"); } @@ -177,8 +177,8 @@ public void testFormula(final FormulaContext _c) throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser parser = new PropositionalParser(f); final List ordering = Arrays.asList(f.variable("A"), f.variable("B"), f.variable("C")); - final BDDKernel kernel = new BDDKernel(f, ordering, 1000, 1000); - final BDD bdd = BDDFactory.build(f, parser.parse("(A => ~C) | (B & ~C)"), kernel); + final BddKernel kernel = new BddKernel(f, ordering, 1000, 1000); + final Bdd bdd = BddFactory.build(f, parser.parse("(A => ~C) | (B & ~C)"), kernel); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.modelCount()).isEqualTo(BigInteger.valueOf(6)); @@ -186,7 +186,7 @@ public void testFormula(final FormulaContext _c) throws ParserException { assertThat(bdd.enumerateAllModels()).hasSize(6); assertThat(bdd.enumerateAllModels(f.variable("A"))).hasSize(2); assertThat(bdd.hashCode()) - .isEqualTo(BDDFactory.build(f, parser.parse("(A => ~C) | (B & ~C)"), kernel).hashCode()); + .isEqualTo(BddFactory.build(f, parser.parse("(A => ~C) | (B & ~C)"), kernel).hashCode()); assertThat(bdd.toString()).isEqualTo("BDD{8}"); } @@ -195,8 +195,8 @@ public void testFormula(final FormulaContext _c) throws ParserException { public void testCC(final FormulaContext _c) throws ParserException { final FormulaFactory f = FormulaFactory.caching(); final PropositionalParser parser = new PropositionalParser(f); - final BDDKernel kernel = new BDDKernel(f, 3, 1000, 1000); - final BDD bdd = BDDFactory.build(f, parser.parse("A + B + C = 1"), kernel); + final BddKernel kernel = new BddKernel(f, 3, 1000, 1000); + final Bdd bdd = BddFactory.build(f, parser.parse("A + B + C = 1"), kernel); assertThat(bdd.isTautology()).isFalse(); assertThat(bdd.isContradiction()).isFalse(); assertThat(bdd.cnf()).isEqualTo(parser.parse("(A | B | C) & (A | ~B | ~C) & (~A | B | ~C) & (~A | ~B)")); @@ -208,6 +208,6 @@ public void testCC(final FormulaContext _c) throws ParserException { new Model(f.literal("A", false), f.literal("B", true), f.literal("C", false)), new Model(f.literal("A", false), f.literal("B", false), f.literal("C", true)) ); - assertThat(bdd.numberOfClausesCNF()).isEqualTo(BigInteger.valueOf(4)); + assertThat(bdd.numberOfClausesCnf()).isEqualTo(BigInteger.valueOf(4)); } } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNodeTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNodeTest.java similarity index 73% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNodeTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNodeTest.java index d8eb1c32..36330912 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BDDNodeTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/datastructures/BddNodeTest.java @@ -9,14 +9,14 @@ import com.booleworks.logicng.formulas.FormulaFactory; import org.junit.jupiter.api.Test; -public class BDDNodeTest { +public class BddNodeTest { @Test public void testSimpleMethods() { final FormulaFactory f = FormulaFactory.caching(); - final BDDNode verumNode = BDDConstant.getVerumNode(f); - final BDDNode falsumNode = BDDConstant.getFalsumNode(f); - final BDDNode innerNode = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode verumNode = BddConstant.getVerumNode(f); + final BddNode falsumNode = BddConstant.getFalsumNode(f); + final BddNode innerNode = new BddInnerNode(f.variable("A"), verumNode, falsumNode); assertThat(verumNode.isInnerNode()).isFalse(); assertThat(falsumNode.isInnerNode()).isFalse(); assertThat(innerNode.isInnerNode()).isTrue(); @@ -34,9 +34,9 @@ public void testSimpleMethods() { @Test public void testNodes() { final FormulaFactory f = FormulaFactory.caching(); - final BDDNode verumNode = BDDConstant.getVerumNode(f); - final BDDNode falsumNode = BDDConstant.getFalsumNode(f); - final BDDNode innerNode = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode verumNode = BddConstant.getVerumNode(f); + final BddNode falsumNode = BddConstant.getFalsumNode(f); + final BddNode innerNode = new BddInnerNode(f.variable("A"), verumNode, falsumNode); assertThat(verumNode.nodes()).containsExactly(verumNode); assertThat(falsumNode.nodes()).containsExactly(falsumNode); assertThat(innerNode.nodes()).containsExactlyInAnyOrder(verumNode, falsumNode, innerNode); @@ -45,10 +45,10 @@ public void testNodes() { @Test public void testHashCode() { final FormulaFactory f = FormulaFactory.caching(); - final BDDNode verumNode = BDDConstant.getVerumNode(f); - final BDDNode falsumNode = BDDConstant.getFalsumNode(f); - final BDDNode innerNode1 = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); - final BDDNode innerNode2 = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode verumNode = BddConstant.getVerumNode(f); + final BddNode falsumNode = BddConstant.getFalsumNode(f); + final BddNode innerNode1 = new BddInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode innerNode2 = new BddInnerNode(f.variable("A"), verumNode, falsumNode); assertThat(verumNode.hashCode()).isEqualTo(verumNode.hashCode()); assertThat(falsumNode.hashCode()).isEqualTo(falsumNode.hashCode()); assertThat(innerNode1.hashCode()).isEqualTo(innerNode2.hashCode()); @@ -57,12 +57,12 @@ public void testHashCode() { @Test public void testEquals() { final FormulaFactory f = FormulaFactory.caching(); - final BDDNode verumNode = BDDConstant.getVerumNode(f); - final BDDNode falsumNode = BDDConstant.getFalsumNode(f); - final BDDNode innerNode1 = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); - final BDDNode innerNode1a = new BDDInnerNode(f.variable("A"), verumNode, falsumNode); - final BDDNode innerNode2 = new BDDInnerNode(f.variable("A"), falsumNode, verumNode); - final BDDNode innerNode3 = new BDDInnerNode(f.variable("B"), verumNode, falsumNode); + final BddNode verumNode = BddConstant.getVerumNode(f); + final BddNode falsumNode = BddConstant.getFalsumNode(f); + final BddNode innerNode1 = new BddInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode innerNode1a = new BddInnerNode(f.variable("A"), verumNode, falsumNode); + final BddNode innerNode2 = new BddInnerNode(f.variable("A"), falsumNode, verumNode); + final BddNode innerNode3 = new BddInnerNode(f.variable("B"), verumNode, falsumNode); assertThat(verumNode).isEqualTo(verumNode); assertThat(falsumNode).isEqualTo(falsumNode); assertThat(innerNode1).isEqualTo(innerNode1); diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDVerification.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDVerification.java index f9c2b108..70c4c32a 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDVerification.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDVerification.java @@ -5,9 +5,9 @@ package com.booleworks.logicng.knowledgecompilation.bdds.jbuddy; public class BDDVerification { - private final BDDKernel k; + private final BddKernel k; - public BDDVerification(final BDDKernel k) { + public BDDVerification(final BddKernel k) { this.k = k; } @@ -22,7 +22,7 @@ public BDDVerification(final BDDKernel k) { public boolean verify(final int root) { final int varnum = k.level2var.length - 1; for (int i = 0; i < varnum * 2 + 2; i++) { - if (k.refcou(i) != BDDKernel.MAXREF) { + if (k.refcou(i) != BddKernel.MAXREF) { System.out.println("Constant or Variable without MAXREF count: " + i); return false; } @@ -53,7 +53,7 @@ public boolean verify(final int root) { } } if (i > 1 && k.level(i) >= varnum) { // this.level2var[node.level] - // != i / 2 - 1) { + // != i / 2 - 1) { System.out.println("VAR Level wrong"); return false; } @@ -118,7 +118,7 @@ protected long verifyTreeRec(final int root, final long[] cache) { protected boolean verifyLevelData() { for (int level = 0; level < k.reordering.levels.length; level++) { - final BDDReordering.LevelData data = k.reordering.levels[level]; + final BddReordering.LevelData data = k.reordering.levels[level]; for (int i = data.start; i < data.start + data.size; i++) { int r = k.hash(i); while (r != 0) { diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrimeTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrimeTest.java similarity index 71% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrimeTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrimeTest.java index 52a9cef7..da8b6bf2 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BDDPrimeTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/jbuddy/BddPrimeTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Test; -public class BDDPrimeTest { +public class BddPrimeTest { @Test public void testNumberOfBits() { - assertThat(BDDPrime.numberOfBits(0)).isEqualTo(0); - assertThat(BDDPrime.numberOfBits(1)).isEqualTo(1); + assertThat(BddPrime.numberOfBits(0)).isEqualTo(0); + assertThat(BddPrime.numberOfBits(1)).isEqualTo(1); } } diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrderingTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrderingTest.java similarity index 96% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrderingTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrderingTest.java index a606ad19..47ec23bc 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BFSOrderingTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/BfsOrderingTest.java @@ -12,9 +12,9 @@ import com.booleworks.logicng.io.parsers.PropositionalParser; import org.junit.jupiter.api.Test; -public class BFSOrderingTest { +public class BfsOrderingTest { - private final BFSOrdering ordering = new BFSOrdering(); + private final BfsOrdering ordering = new BfsOrdering(); @Test public void testSimpleCases() throws ParserException { diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrderingTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrderingTest.java similarity index 95% rename from core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrderingTest.java rename to core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrderingTest.java index 1db896c1..7f0358ab 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DFSOrderingTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/bdds/orderings/DfsOrderingTest.java @@ -10,12 +10,11 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -public class DFSOrderingTest { +public class DfsOrderingTest { - private final DFSOrdering ordering = new DFSOrdering(); + private final DfsOrdering ordering = new DfsOrdering(); @Test public void testSimpleCases() throws ParserException { diff --git a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompilerTest.java b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompilerTest.java index 6e5eec02..9c73ee2c 100644 --- a/core/src/test/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompilerTest.java +++ b/core/src/test/java/com/booleworks/logicng/knowledgecompilation/dnnf/DnnfCompilerTest.java @@ -23,28 +23,28 @@ import com.booleworks.logicng.formulas.FType; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.graphs.algorithms.ConnectedComponentsComputation; import com.booleworks.logicng.graphs.datastructures.Graph; import com.booleworks.logicng.graphs.datastructures.Node; import com.booleworks.logicng.graphs.generators.ConstraintGraphGenerator; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.LngResult; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.io.parsers.FormulaParser; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.io.readers.DimacsReader; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.knowledgecompilation.bdds.BDDFactory; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.knowledgecompilation.bdds.BddFactory; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.ForceOrdering; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.Dnnf; import com.booleworks.logicng.knowledgecompilation.dnnf.functions.DnnfModelCountFunction; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import com.booleworks.logicng.transformations.cnf.CNFFactorization; +import com.booleworks.logicng.transformations.cnf.CnfFactorization; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -107,10 +107,10 @@ public void testDnnfProperties() throws ParserException { @Test public void testDnnfEvents() throws ParserException, IOException { final FormulaFactory f = FormulaFactory.caching(); - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); final Formula parsed = FormulaReader.readFormula(f, "../test_files/formulas/formula1.txt"); final DnnfComputationHandler handler = new DnnfComputationHandler(); - final LNGResult dnnf = DnnfCompiler.compile(f, parsed, handler); + final LngResult dnnf = DnnfCompiler.compile(f, parsed, handler); assertThat(dnnf.isSuccess()).isTrue(); assertThat(handler.eventCounter).containsExactly( entry(BACKBONE_COMPUTATION_STARTED, 1), @@ -131,7 +131,7 @@ public void testDnnfEvents() throws ParserException, IOException { @LongRunningTag public void testLargeFormula() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); - f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); final Formula parsed = FormulaReader.readFormula(f, "../test_files/formulas/formula1.txt"); Dnnf dnnf = DnnfCompiler.compile(f, parsed); final BigInteger dnnfCount = dnnf.execute(new DnnfModelCountFunction(f)); @@ -139,10 +139,10 @@ public void testLargeFormula() throws IOException, ParserException { final List originalFormulas = new ArrayList<>(); for (final Formula formula : parsed) { originalFormulas.add(formula); - if (formula instanceof PBConstraint) { + if (formula instanceof PbConstraint) { formulas.add(formula); } else { - formulas.add(formula.transform(new CNFFactorization(f))); + formulas.add(formula.transform(new CnfFactorization(f))); } } final Graph constraintGraph = ConstraintGraphGenerator.generateFromFormulas(f, formulas); @@ -172,17 +172,17 @@ private BigInteger countWithBdd(final Formula formula) { } else if (formula.getType() == FType.FALSE) { return BigInteger.ZERO; } - final BDDKernel kernel = new BDDKernel(formula.getFactory(), + final BddKernel kernel = new BddKernel(formula.getFactory(), new ForceOrdering().getOrder(formula.getFactory(), formula), 100000, 1000000); - final BDD bdd = BDDFactory.build(formula.getFactory(), formula, kernel); + final Bdd bdd = BddFactory.build(formula.getFactory(), formula, kernel); return bdd.modelCount(); } private static class DnnfComputationHandler implements ComputationHandler { - private final Map eventCounter = new LinkedHashMap<>(); + private final Map eventCounter = new LinkedHashMap<>(); @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { eventCounter.put(event, eventCounter.getOrDefault(event, 0) + 1); return true; } diff --git a/core/src/test/java/com/booleworks/logicng/modelcounting/ModelCounterTest.java b/core/src/test/java/com/booleworks/logicng/modelcounting/ModelCounterTest.java index c4176846..bf9929f5 100644 --- a/core/src/test/java/com/booleworks/logicng/modelcounting/ModelCounterTest.java +++ b/core/src/test/java/com/booleworks/logicng/modelcounting/ModelCounterTest.java @@ -15,14 +15,14 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.knowledgecompilation.bdds.orderings.ForceOrdering; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.testutils.NQueensGenerator; -import com.booleworks.logicng.transformations.cnf.CNFConfig; +import com.booleworks.logicng.transformations.cnf.CnfConfig; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaHelper; import com.booleworks.logicng.util.FormulaRandomizer; @@ -129,7 +129,7 @@ public void testCornerCases(final FormulaContext _c) { final FormulaCornerCases cornerCases = new FormulaCornerCases(_c.f); for (final Formula formula : cornerCases.cornerCases()) { if (formula.getType() == FType.PBC) { - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; if (!pbc.isAmo() && !pbc.isExo()) { assertThatThrownBy( () -> ModelCounter.count(_c.f, Collections.singletonList(formula), formula.variables(_c.f))) @@ -148,7 +148,7 @@ public void testCornerCases(final FormulaContext _c) { @RandomTag public void testRandom(final FormulaContext _c) { for (int i = 0; i < 500; i++) { - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); final FormulaRandomizerConfig config = FormulaRandomizerConfig.builder() .numVars(5) .weightAmo(5) @@ -168,7 +168,7 @@ public void testRandom(final FormulaContext _c) { @RandomTag public void testRandomWithFormulaList(final FormulaContext _c) { for (int i = 0; i < 500; i++) { - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); final FormulaRandomizerConfig config = FormulaRandomizerConfig.builder() .numVars(5) .weightAmo(5) @@ -189,7 +189,7 @@ public void testRandomWithFormulaList(final FormulaContext _c) { @RandomTag public void testRandomWithFormulaListWithoutPBC(final FormulaContext _c) { for (int i = 0; i < 500; i++) { - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); final FormulaRandomizerConfig config = FormulaRandomizerConfig.builder() .numVars(5) .weightPbc(0) @@ -218,7 +218,7 @@ private void testQueens(final FormulaFactory f, final NQueensGenerator generator } private static BigInteger enumerationBasedModelCount(final FormulaFactory f, final List formulas) { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formulas); final SortedSet variables = FormulaHelper.variables(f, formulas); final List models = solver.enumerateAllModels(variables); diff --git a/core/src/test/java/com/booleworks/logicng/predicates/CNFPredicateTest.java b/core/src/test/java/com/booleworks/logicng/predicates/CnfPredicateTest.java similarity index 91% rename from core/src/test/java/com/booleworks/logicng/predicates/CNFPredicateTest.java rename to core/src/test/java/com/booleworks/logicng/predicates/CnfPredicateTest.java index 03b983ba..e914d2e4 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/CNFPredicateTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/CnfPredicateTest.java @@ -20,12 +20,12 @@ import java.util.HashMap; import java.util.Map; -public class CNFPredicateTest extends TestWithFormulaContext { +public class CnfPredicateTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void test(final FormulaContext _c) { - final CNFPredicate cnfPredicate = new CNFPredicate(_c.f); + final CnfPredicate cnfPredicate = new CnfPredicate(_c.f); assertThat(_c.f.verum().holds(cnfPredicate)).isTrue(); assertThat(_c.f.falsum().holds(cnfPredicate)).isTrue(); @@ -47,7 +47,7 @@ public void test(final FormulaContext _c) { @Test public void testWithCachingFF() throws ParserException { final CachingFormulaFactory f = FormulaFactory.caching(); - final CNFPredicate cnfPredicate = new CNFPredicate(f); + final CnfPredicate cnfPredicate = new CnfPredicate(f); final Formula formula = f.parse("(a => b) & b & ~c"); assertThat(formula.holds(cnfPredicate)).isFalse(); assertThat(f.getPredicateCacheForType(PredicateCacheEntry.IS_CNF).get(formula)).isEqualTo(false); @@ -57,7 +57,7 @@ public void testWithCachingFF() throws ParserException { public void testWithNonCaching() throws ParserException { final FormulaFactory f = FormulaFactory.nonCaching(); final Map cache = new HashMap<>(); - final CNFPredicate cnfPredicate = new CNFPredicate(f, cache); + final CnfPredicate cnfPredicate = new CnfPredicate(f, cache); final Formula formula = f.parse("(a => b) & b & ~c"); assertThat(formula.holds(cnfPredicate)).isFalse(); assertThat(cache.get(formula)).isEqualTo(false); diff --git a/core/src/test/java/com/booleworks/logicng/predicates/ContainsPBCPredicateTest.java b/core/src/test/java/com/booleworks/logicng/predicates/ContainsPbcPredicateTest.java similarity index 95% rename from core/src/test/java/com/booleworks/logicng/predicates/ContainsPBCPredicateTest.java rename to core/src/test/java/com/booleworks/logicng/predicates/ContainsPbcPredicateTest.java index 8572857d..8fe1efc0 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/ContainsPBCPredicateTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/ContainsPbcPredicateTest.java @@ -16,9 +16,9 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class ContainsPBCPredicateTest extends TestWithFormulaContext { +public class ContainsPbcPredicateTest extends TestWithFormulaContext { - private final ContainsPBCPredicate predicate = ContainsPBCPredicate.get(); + private final ContainsPbcPredicate predicate = ContainsPbcPredicate.get(); @ParameterizedTest @MethodSource("contexts") diff --git a/core/src/test/java/com/booleworks/logicng/predicates/DNFPredicateTest.java b/core/src/test/java/com/booleworks/logicng/predicates/DnfPredicateTest.java similarity index 92% rename from core/src/test/java/com/booleworks/logicng/predicates/DNFPredicateTest.java rename to core/src/test/java/com/booleworks/logicng/predicates/DnfPredicateTest.java index 77e6bb53..a8d76489 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/DNFPredicateTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/DnfPredicateTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class DNFPredicateTest extends TestWithFormulaContext { +public class DnfPredicateTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void test(final FormulaContext _c) { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); assertThat(_c.f.verum().holds(dnfPredicate)).isTrue(); assertThat(_c.f.falsum().holds(dnfPredicate)).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicateTest.java b/core/src/test/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicateTest.java index 903b5259..a8dc6e0d 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicateTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/EvaluatesToConstantPredicateTest.java @@ -14,7 +14,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; @@ -262,12 +262,12 @@ public void testEquivalenceToFalse(final FormulaContext _c) throws ParserExcepti public void testPBCToFalse(final FormulaContext _c) { final var e = new Preds(_c); - final PBConstraint pbc01 = (PBConstraint) _c.f.pbc(CType.EQ, 2, new Literal[]{_c.a, _c.b}, new int[]{2, -4}); + final PbConstraint pbc01 = (PbConstraint) _c.f.pbc(CType.EQ, 2, new Literal[]{_c.a, _c.b}, new int[]{2, -4}); assertThat(pbc01.holds(e.emptyToFalse)).isFalse(); assertThat(pbc01.holds(e.aToFalse)).isFalse(); assertThat(pbc01.holds(e.aNotBToFalse)).isFalse(); - final PBConstraint pbc02 = (PBConstraint) _c.f.pbc(CType.GT, 2, new Literal[]{_c.b, _c.c}, new int[]{2, 1}); + final PbConstraint pbc02 = (PbConstraint) _c.f.pbc(CType.GT, 2, new Literal[]{_c.b, _c.c}, new int[]{2, 1}); assertThat(pbc02.holds(e.emptyToFalse)).isFalse(); assertThat(pbc02.holds(e.aToFalse)).isFalse(); assertThat(pbc02.holds(e.aNotBToFalse)).isTrue(); @@ -550,12 +550,12 @@ public void testEquivalenceToTrue(final FormulaContext _c) throws ParserExceptio public void testPBCToTrue(final FormulaContext _c) { final var e = new Preds(_c); - final PBConstraint pbc01 = (PBConstraint) _c.f.pbc(CType.EQ, 2, new Literal[]{_c.a, _c.b}, new int[]{2, -4}); + final PbConstraint pbc01 = (PbConstraint) _c.f.pbc(CType.EQ, 2, new Literal[]{_c.a, _c.b}, new int[]{2, -4}); assertThat(pbc01.holds(e.emptyToTrue)).isFalse(); assertThat(pbc01.holds(e.aToTrue)).isFalse(); assertThat(pbc01.holds(e.aNotBToTrue)).isTrue(); - final PBConstraint pbc02 = (PBConstraint) _c.f.pbc(CType.GT, 2, new Literal[]{_c.b, _c.c}, new int[]{2, 1}); + final PbConstraint pbc02 = (PbConstraint) _c.f.pbc(CType.GT, 2, new Literal[]{_c.b, _c.c}, new int[]{2, 1}); assertThat(pbc02.holds(e.emptyToTrue)).isFalse(); assertThat(pbc02.holds(e.aToTrue)).isFalse(); assertThat(pbc02.holds(e.aNotBToTrue)).isFalse(); diff --git a/core/src/test/java/com/booleworks/logicng/predicates/NNFPredicateTest.java b/core/src/test/java/com/booleworks/logicng/predicates/NnfPredicateTest.java similarity index 93% rename from core/src/test/java/com/booleworks/logicng/predicates/NNFPredicateTest.java rename to core/src/test/java/com/booleworks/logicng/predicates/NnfPredicateTest.java index 876010d6..5d7f915a 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/NNFPredicateTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/NnfPredicateTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class NNFPredicateTest extends TestWithFormulaContext { +public class NnfPredicateTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void test(final FormulaContext _c) { - final NNFPredicate nnfPredicate = new NNFPredicate(_c.f); + final NnfPredicate nnfPredicate = new NnfPredicate(_c.f); assertThat(_c.f.verum().holds(nnfPredicate)).isTrue(); assertThat(_c.f.falsum().holds(nnfPredicate)).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/predicates/satisfiability/PredicatesTest.java b/core/src/test/java/com/booleworks/logicng/predicates/satisfiability/PredicatesTest.java index c686aa65..ff2dcab8 100644 --- a/core/src/test/java/com/booleworks/logicng/predicates/satisfiability/PredicatesTest.java +++ b/core/src/test/java/com/booleworks/logicng/predicates/satisfiability/PredicatesTest.java @@ -10,7 +10,6 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.testutils.PigeonHoleGenerator; -import org.assertj.core.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -19,7 +18,7 @@ public class PredicatesTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testTrue(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -33,7 +32,7 @@ public void testTrue(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testFalse(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -47,7 +46,7 @@ public void testFalse(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -65,7 +64,7 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testOther(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -83,7 +82,7 @@ public void testOther(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testTaut(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -98,7 +97,7 @@ public void testTaut(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testCont(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); final var ctr = new ContradictionPredicate(_c.f); final var tau = new TautologyPredicate(_c.f); final var con = new ContingencyPredicate(_c.f); @@ -113,7 +112,7 @@ public void testCont(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testSat(final FormulaContext _c) { - final var sat = new SATPredicate(_c.f); + final var sat = new SatPredicate(_c.f); assertThat(_c.and1.holds(sat)).isTrue(); assertThat(_c.and2.holds(sat)).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeCompilerTest.java b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeCompilerTest.java index 4324d052..62b106bf 100644 --- a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeCompilerTest.java +++ b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeCompilerTest.java @@ -20,7 +20,7 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.BoundedOptimizationHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; @@ -233,7 +233,7 @@ private void verifyImplicates(final List> implicateSets, fina private void testHandler(final ComputationHandler handler, final Formula formula, final PrimeCompiler compiler, final PrimeResult.CoverageType coverageType, final boolean expCanceled) { - final LNGResult result = compiler.compute(formula.getFactory(), formula, coverageType, handler); + final LngResult result = compiler.compute(formula.getFactory(), formula, coverageType, handler); assertThat(!result.isSuccess()).isEqualTo(expCanceled); if (expCanceled) { assertThatThrownBy(result::getResult).isInstanceOf(IllegalStateException.class); diff --git a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicantReductionTest.java b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicantReductionTest.java index aea134b0..d8d4f138 100644 --- a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicantReductionTest.java +++ b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicantReductionTest.java @@ -15,12 +15,12 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.BoundedSatHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATCall; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatCall; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -133,15 +133,15 @@ private void testFormula(final Formula formula) { private void testFormula(final Formula formula, final ComputationHandler handler, final boolean expCanceled) { final FormulaFactory f = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); - try (final SATCall call = solver.satCall().solve()) { + try (final SatCall call = solver.satCall().solve()) { if (!call.getSatResult().getResult()) { return; } final List model = call.model(formula.variables(f)).getLiterals(); final NaivePrimeReduction naive = new NaivePrimeReduction(f, formula); - final LNGResult> primeImplicant = naive.reduceImplicant(model, handler); + final LngResult> primeImplicant = naive.reduceImplicant(model, handler); if (expCanceled) { assertThat(primeImplicant.isSuccess()).isFalse(); } else { @@ -153,7 +153,7 @@ private void testFormula(final Formula formula, final ComputationHandler handler public static void testPrimeImplicantProperty(final Formula formula, final SortedSet primeImplicant) { final FormulaFactory f = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula.negate(f)); assertThat(solver.satCall().addFormulas(primeImplicant).sat().getResult()).isFalse(); for (final Literal lit : primeImplicant) { diff --git a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicateReductionTest.java b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicateReductionTest.java index f634e172..1805d370 100644 --- a/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicateReductionTest.java +++ b/core/src/test/java/com/booleworks/logicng/primecomputation/PrimeImplicateReductionTest.java @@ -14,12 +14,12 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.BoundedSatHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATCall; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatCall; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaHelper; import com.booleworks.logicng.util.FormulaRandomizer; @@ -122,16 +122,16 @@ private void testFormula(final Formula formula) { private void testFormula(final Formula formula, final ComputationHandler handler, final boolean expCanceled) { final FormulaFactory f = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula.negate(f)); - try (final SATCall call = solver.satCall().solve()) { + try (final SatCall call = solver.satCall().solve()) { if (!call.getSatResult().getResult()) { return; } final SortedSet falsifyingAssignment = FormulaHelper.negateLiterals(f, call.model(formula.variables(f)).getLiterals(), TreeSet::new); final NaivePrimeReduction naive = new NaivePrimeReduction(f, formula); - final LNGResult> primeImplicate = naive.reduceImplicate(f, falsifyingAssignment, handler); + final LngResult> primeImplicate = naive.reduceImplicate(f, falsifyingAssignment, handler); if (expCanceled) { assertThat(primeImplicate.isSuccess()).isFalse(); } else { @@ -143,7 +143,7 @@ private void testFormula(final Formula formula, final ComputationHandler handler public static void testPrimeImplicateProperty(final Formula formula, final SortedSet primeImplicate) { final FormulaFactory f = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final SortedSet negatedLiterals = FormulaHelper.negateLiterals(f, primeImplicate, TreeSet::new); assertThat(solver.satCall().addFormulas(negatedLiterals).sat().getResult()).isFalse(); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/datastructures/LNGHeapTest.java b/core/src/test/java/com/booleworks/logicng/solvers/datastructures/LngHeapTest.java similarity index 67% rename from core/src/test/java/com/booleworks/logicng/solvers/datastructures/LNGHeapTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/datastructures/LngHeapTest.java index 7deb55da..c8530b73 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/datastructures/LNGHeapTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/datastructures/LngHeapTest.java @@ -7,25 +7,25 @@ import static org.assertj.core.api.Assertions.assertThat; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; -public class LNGHeapTest { +public class LngHeapTest { @Test public void test() { - final LNGCoreSolver solver = new LNGCoreSolver(FormulaFactory.caching(), SATSolverConfig.builder().build()); + final LngCoreSolver solver = new LngCoreSolver(FormulaFactory.caching(), SatSolverConfig.builder().build()); solver.newVar(true, true); solver.newVar(true, true); solver.newVar(true, true); - final LNGHeap heap = new LNGHeap(solver); + final LngHeap heap = new LngHeap(solver); assertThat(heap.empty()).isTrue(); heap.insert(1); heap.insert(2); heap.insert(0); assertThat(heap.get(0)).isEqualTo(1); - assertThat(heap.toString()).isEqualTo("LNGHeap{[1, 2], [2, 0], [0, 1]}"); + assertThat(heap.toString()).isEqualTo("LngHeap{[1, 2], [2, 0], [0, 1]}"); assertThat(heap.size()).isEqualTo(3); heap.clear(); assertThat(heap.empty()).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/datastructures/SolversDatastructuresTest.java b/core/src/test/java/com/booleworks/logicng/solvers/datastructures/SolversDatastructuresTest.java index d32be265..167f5ec7 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/datastructures/SolversDatastructuresTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/datastructures/SolversDatastructuresTest.java @@ -6,50 +6,51 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Tristate; import org.junit.jupiter.api.Test; public class SolversDatastructuresTest { @Test - public void testLNGBoundedIntQueue() { - final LNGBoundedIntQueue queue = new LNGBoundedIntQueue(); + public void testLngBoundedIntQueue() { + final LngBoundedIntQueue queue = new LngBoundedIntQueue(); queue.initSize(2); queue.push(64); queue.push(32); queue.push(8); queue.push(16); final String expected = - "LNGBoundedIntQueue{first=0, last=0, sumOfQueue=24, maxSize=2, queueSize=2, elems=[8, 16]}"; + "LngBoundedIntQueue{first=0, last=0, sumOfQueue=24, maxSize=2, queueSize=2, elems=[8, 16]}"; assertThat(queue.toString()).isEqualTo(expected); } @Test - public void testLNGBoundedLongQueue() { - final LNGBoundedLongQueue queue = new LNGBoundedLongQueue(); + public void testLngBoundedLongQueue() { + final LngBoundedLongQueue queue = new LngBoundedLongQueue(); queue.initSize(2); queue.push(64L); queue.push(32L); queue.push(8L); queue.push(17L); final String expected = - "LNGBoundedLongQueue{first=0, last=0, sumOfQueue=25, maxSize=2, queueSize=2, elems=[8, 17]}"; + "LngBoundedLongQueue{first=0, last=0, sumOfQueue=25, maxSize=2, queueSize=2, elems=[8, 17]}"; assertThat(queue.toString()).isEqualTo(expected); } @Test - public void testMSClause() { - final LNGIntVector vec = new LNGIntVector(); + public void testLngClause() { + final LngIntVector vec = new LngIntVector(); vec.push(2); vec.push(4); vec.push(6); - final LNGClause clause = new LNGClause(vec, 0); + final LngClause clause = new LngClause(vec, 0); clause.setCanBeDel(true); - clause.setLBD(42); + clause.setLbd(42); clause.setSeen(true); final String expected = - "MSClause{activity=0.0, learntOnState=0, seen=true, lbd=42, canBeDel=true, oneWatched=false, isAtMost=false, atMostWatchers=-1, lits=[1, 2, 3]}"; + "LngClause{activity=0.0, learntOnState=0, seen=true, lbd=42, canBeDel=true, oneWatched=false, isAtMost=false, atMostWatchers=-1, lits=[1, 2, " + + "3]}"; assertThat(clause.toString()).isEqualTo(expected); assertThat(clause.equals(clause)).isTrue(); assertThat(clause.hashCode()).isEqualTo(clause.hashCode()); @@ -57,49 +58,50 @@ public void testMSClause() { } @Test - public void testMSHardClause() { - final LNGIntVector vec = new LNGIntVector(); + public void testLngHardClause() { + final LngIntVector vec = new LngIntVector(); vec.push(2); vec.push(4); vec.push(6); - final LNGHardClause clause = new LNGHardClause(vec); - final String expected = "MSHardClause{lits=[1, 2, 3]}"; + final LngHardClause clause = new LngHardClause(vec); + final String expected = "LngHardClause{lits=[1, 2, 3]}"; assertThat(clause.toString()).isEqualTo(expected); } @Test - public void testMSSoftClause() { - final LNGIntVector vec = new LNGIntVector(); + public void testLngSoftClause() { + final LngIntVector vec = new LngIntVector(); vec.push(2); vec.push(4); vec.push(6); - final LNGSoftClause clause = new LNGSoftClause(vec, 2, 4, vec); - final String expected = "MSSoftClause{weight=2, assumption=4 lits=[1, 2, 3] relax[1, 2, 3]}"; + final LngSoftClause clause = new LngSoftClause(vec, 2, 4, vec); + final String expected = "LngSoftClause{weight=2, assumption=4 lits=[1, 2, 3] relax[1, 2, 3]}"; assertThat(clause.toString()).isEqualTo(expected); } @Test - public void testMSVariable() { - final LNGVariable var = new LNGVariable(true); + public void testLngVariable() { + final LngVariable var = new LngVariable(true); var.setDecision(true); var.setLevel(12); var.setReason(null); var.assign(Tristate.TRUE); final String expected = - "MSVariable{assignment=TRUE, level=12, reason=null, activity=0.000000, polarity=true, decision=true}"; + "LngVariable{assignment=TRUE, level=12, reason=null, activity=0.000000, polarity=true, decision=true}"; assertThat(var.toString()).isEqualTo(expected); } @Test - public void testMSWatcher() { - final LNGIntVector vec = new LNGIntVector(); + public void testLngWatcher() { + final LngIntVector vec = new LngIntVector(); vec.push(2); vec.push(4); vec.push(6); - final LNGClause clause = new LNGClause(vec, 1); - final LNGWatcher watcher = new LNGWatcher(clause, 2); + final LngClause clause = new LngClause(vec, 1); + final LngWatcher watcher = new LngWatcher(clause, 2); final String expected = - "MSWatcher{clause=MSClause{activity=0.0, learntOnState=1, seen=false, lbd=0, canBeDel=true, oneWatched=false, isAtMost=false, atMostWatchers=-1, lits=[1, 2, 3]}, blocker=2}"; + "LngWatcher{clause=LngClause{activity=0.0, learntOnState=1, seen=false, lbd=0, canBeDel=true, oneWatched=false, isAtMost=false, " + + "atMostWatchers=-1, lits=[1, 2, 3]}, blocker=2}"; assertThat(watcher.toString()).isEqualTo(expected); assertThat(watcher.hashCode()).isEqualTo(watcher.hashCode()); } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/AbstractModelEnumerationFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/AbstractModelEnumerationFunctionTest.java index d72daa80..68f68a21 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/AbstractModelEnumerationFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/AbstractModelEnumerationFunctionTest.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; import com.booleworks.logicng.solvers.functions.modelenumeration.TestVariableProvider; @@ -34,7 +34,7 @@ public void init() { public void testEmptySplitVariables() throws ParserException { final Formula formula = f.parse("A | B | C | D | E"); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final ModelEnumerationConfig config = ModelEnumerationConfig.builder() @@ -53,7 +53,7 @@ public void testEmptySplitVariables() throws ParserException { public void testNullSplitVariables() throws ParserException { final Formula formula = f.parse("A | B | C | D | E"); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); final ModelEnumerationConfig config = ModelEnumerationConfig.builder() diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/BackboneFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/BackboneFunctionTest.java index b154e656..3918c3ee 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/BackboneFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/BackboneFunctionTest.java @@ -16,9 +16,9 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.solvers.sat.SolverTestSet; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -45,7 +45,7 @@ public static List solvers() { @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testConstants(final SATSolver solver, final String solverDescription) { + public void testConstants(final SatSolver solver, final String solverDescription) { final FormulaFactory f = solver.getFactory(); final SolverState state = solver.saveState(); solver.add(f.falsum()); @@ -61,7 +61,7 @@ public void testConstants(final SATSolver solver, final String solverDescription @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testSimpleBackbones(final SATSolver solver, final String solverDescription) throws ParserException { + public void testSimpleBackbones(final SatSolver solver, final String solverDescription) throws ParserException { final FormulaFactory f = solver.getFactory(); final SolverState state = solver.saveState(); solver.add(f.parse("a & b & ~c")); @@ -78,7 +78,7 @@ public void testSimpleBackbones(final SATSolver solver, final String solverDescr @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testSimpleFormulas(final SATSolver solver, final String solverDescription) throws ParserException { + public void testSimpleFormulas(final SatSolver solver, final String solverDescription) throws ParserException { final FormulaFactory f = solver.getFactory(); solver.add(f.parse("(a => c | d) & (b => d | ~e) & (a | b)")); Backbone backbone = solver.backbone(v("a b c d e f", f)); @@ -96,7 +96,7 @@ public void testSimpleFormulas(final SATSolver solver, final String solverDescri @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testSimpleFormulasWithBuilderUsage(final SATSolver solver, final String solverDescription) + public void testSimpleFormulasWithBuilderUsage(final SatSolver solver, final String solverDescription) throws ParserException { final FormulaFactory f = solver.getFactory(); solver.add(f.parse("(a => c | d) & (b => d | ~e) & (a | b)")); @@ -118,7 +118,7 @@ public void testSimpleFormulasWithBuilderUsage(final SATSolver solver, final Str @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") @LongRunningTag - public void testRealFormulaIncremental1(final SATSolver solver, final String solverDescription) + public void testRealFormulaIncremental1(final SatSolver solver, final String solverDescription) throws IOException, ParserException { final FormulaFactory f = solver.getFactory(); final Formula formula = @@ -162,7 +162,7 @@ public void testRealFormulaIncremental1(final SATSolver solver, final String sol @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") @LongRunningTag - public void testRealFormulaIncremental2(final SATSolver solver, final String solverDescription) + public void testRealFormulaIncremental2(final SatSolver solver, final String solverDescription) throws IOException, ParserException { final FormulaFactory f = solver.getFactory(); final Formula formula = @@ -206,7 +206,7 @@ public void testRealFormulaIncremental2(final SATSolver solver, final String sol @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") @LongRunningTag - public void testRealFormulaIncrementalDecremental1(final SATSolver solver, final String solverDescription) + public void testRealFormulaIncrementalDecremental1(final SatSolver solver, final String solverDescription) throws IOException, ParserException { final FormulaFactory f = solver.getFactory(); final Formula formula = @@ -261,7 +261,7 @@ public void testRealFormulaIncrementalDecremental1(final SATSolver solver, final @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") @LongRunningTag - public void testRealFormulaIncrementalDecremental2(final SATSolver solver, final String solverDescription) + public void testRealFormulaIncrementalDecremental2(final SatSolver solver, final String solverDescription) throws IOException, ParserException { final FormulaFactory f = solver.getFactory(); final Formula formula = @@ -316,7 +316,7 @@ public void testRealFormulaIncrementalDecremental2(final SATSolver solver, final @Test public void testMiniCardSpecialCase() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver miniCard = SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(true).build()); + final SatSolver miniCard = SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(true).build()); miniCard.add(f.parse("v1 + v2 + v3 + v4 + v5 + v6 = 1")); miniCard.add(f.parse("v1234 + v50 + v60 = 1")); miniCard.add( diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelCountingFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelCountingFunctionTest.java index ff32d60d..4a2e0005 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelCountingFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelCountingFunctionTest.java @@ -7,19 +7,19 @@ import static org.assertj.core.api.Assertions.assertThat; import com.booleworks.logicng.RandomTag; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NumberOfModelsHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.modelcounting.ModelCounter; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollectorTestHandler; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -67,7 +67,7 @@ public void testTautology(final SplitVariableProvider splitProvider) { : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final BigInteger numberOfModels = solver.execute(ModelCountingFunction.builder(f.variables()).configuration(config).build()); assertThat(numberOfModels).isEqualTo(1); @@ -82,7 +82,7 @@ public void testEmptyEnumerationVariables(final SplitVariableProvider splitProvi : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A & (B | C)"); solver.add(formula); final BigInteger numberOfModels = @@ -99,7 +99,7 @@ public void testSimple1(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final BigInteger numberOfModels = solver.execute(ModelCountingFunction.builder(f.variables("A", "B", "C")).configuration(config).build()); @@ -115,7 +115,7 @@ public void testSimple2(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); final BigInteger numberOfModels = solver.execute(ModelCountingFunction.builder(f.variables("A", "B", "C")).configuration(config).build()); @@ -131,7 +131,7 @@ public void testMultipleModelEnumeration(final SplitVariableProvider splitProvid : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); solver.add(formula); final ModelCountingFunction meFunction = @@ -151,7 +151,7 @@ public void testDontCareVariables1(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); final SortedSet variables = f.variables("A", "B", "C", "D"); solver.add(formula); @@ -170,7 +170,7 @@ public void testDontCareVariables2(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); final SortedSet variables = f.variables("A", "C", "D", "E"); solver.add(formula); @@ -186,7 +186,7 @@ public void testDontCareVariables3() throws ParserException { final ModelEnumerationConfig config = ModelEnumerationConfig.builder().strategy(DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()).build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A | B | (X & ~X)"); // X will be // simplified out // and become a @@ -210,10 +210,10 @@ public void testHandlerWithNumModelsLimit(final SplitVariableProvider splitProvi .strategy(splitProvider == null ? null : DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); solver.add(formula); - final LNGResult numberOfModels = solver.execute( + final LngResult numberOfModels = solver.execute( ModelCountingFunction.builder(formula.variables(f)).configuration(config).build(), handler); assertThat(numberOfModels.isSuccess()).isFalse(); assertThat(numberOfModels.isPartial()).isTrue(); @@ -228,7 +228,7 @@ public void testRandomFormulas() { new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(i).numVars(15).build()); final Formula formula = randomizer.formula(3); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); // no split @@ -258,7 +258,7 @@ public void testRandomFormulas() { @ParameterizedTest @MethodSource("contexts") public void testCollector(final FormulaContext _c) { - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.eq1); final EnumerationCollectorTestHandler handler = new EnumerationCollectorTestHandler(); @@ -268,9 +268,9 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getCommitCalls()).isZero(); assertThat(handler.getRollbackCalls()).isZero(); - final LNGBooleanVector modelFromSolver1 = new LNGBooleanVector(true, true); - final LNGBooleanVector modelFromSolver2 = new LNGBooleanVector(false, false); - final LNGIntVector relevantIndices = LNGIntVector.of(0, 1); + final LngBooleanVector modelFromSolver1 = new LngBooleanVector(true, true); + final LngBooleanVector modelFromSolver2 = new LngBooleanVector(false, false); + final LngIntVector relevantIndices = LngIntVector.of(0, 1); final Model expectedModel2 = new Model(_c.na, _c.nb); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunctionTest.java index cb0b44e2..fb62b497 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationFunctionTest.java @@ -13,8 +13,8 @@ import com.booleworks.logicng.LongRunningTag; import com.booleworks.logicng.RandomTag; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaContext; @@ -23,11 +23,11 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NumberOfModelsHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.modelcounting.ModelCounter; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollectorTestHandler; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; @@ -36,7 +36,7 @@ import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.LeastCommonVariablesProvider; import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.MostCommonVariablesProvider; import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.SplitVariableProvider; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.util.FormulaHelper; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -81,7 +81,7 @@ public void testContradiction(final SplitVariableProvider splitProvider) { : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.literal("A", true)); solver.add(f.literal("A", false)); final List models = @@ -98,7 +98,7 @@ public void testTautology(final SplitVariableProvider splitProvider) { : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); List models = solver.execute(ModelEnumerationFunction.builder(List.of()).configuration(config).build()); assertThat(models).containsExactly(new Model()); final SortedSet additionalVars = f.variables("A", "B"); @@ -117,7 +117,7 @@ public void testEmptyEnumerationVariables(final SplitVariableProvider splitProvi : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A & (B | C)"); solver.add(formula); List models = solver.execute(ModelEnumerationFunction.builder(List.of()).configuration(config).build()); @@ -137,7 +137,7 @@ public void testSimple1(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final List models = solver .execute(ModelEnumerationFunction.builder(f.variables("A", "B", "C")).configuration(config).build()); @@ -157,7 +157,7 @@ public void testSimple2(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); final List models = solver .execute(ModelEnumerationFunction.builder(f.variables("A", "B", "C")).configuration(config).build()); @@ -174,7 +174,7 @@ public void testResultLiteralOrderIndependentFromInputOrder(final SplitVariableP : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final List models = solver .execute(ModelEnumerationFunction.builder(f.variables("A", "B", "C")).configuration(config).build()); @@ -201,7 +201,7 @@ public void testDuplicateEnumerationVariables(final SplitVariableProvider splitP : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final List models = solver.execute(ModelEnumerationFunction.builder(f.variables("A", "A", "B")) .configuration(config).build()); @@ -221,7 +221,7 @@ public void testMultipleModelEnumeration(final SplitVariableProvider splitProvid : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); solver.add(formula); final ModelEnumerationFunction meFunction = @@ -241,7 +241,7 @@ public void testAdditionalVariablesSimple(final SplitVariableProvider splitProvi : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & C | B & ~C")); final Variable a = f.variable("A"); final Variable b = f.variable("B"); @@ -265,7 +265,7 @@ public void testDuplicateAdditionalVariables(final SplitVariableProvider splitPr : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final List models = solver.execute(ModelEnumerationFunction.builder(f.variables("A")) .additionalVariables(f.variables("B", "B")) @@ -284,7 +284,7 @@ public void testDontCareVariables1(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); final List models = solver.execute(ModelEnumerationFunction.builder(f.variables("A", "B", "C", "D")) .configuration(config) @@ -314,7 +314,7 @@ public void testDontCareVariables2(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); final List models = solver.execute(ModelEnumerationFunction.builder(f.variables("A", "C", "D", "E")) .configuration(config) @@ -345,7 +345,7 @@ public void testDontCareVariables3() throws ParserException { final ModelEnumerationConfig config = ModelEnumerationConfig.builder().strategy(DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()).build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A | B | (X & ~X)"); // X will be // simplified out // and become a @@ -369,9 +369,9 @@ public void testHandlerWithNumModelsLimit(final SplitVariableProvider splitProvi .strategy(splitProvider == null ? null : DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); - final LNGResult> models = solver.execute( + final LngResult> models = solver.execute( ModelEnumerationFunction.builder(f.variables("A", "B", "C")).configuration(config).build(), handler); assertThat(models.isSuccess()).isFalse(); assertThat(models.isPartial()).isTrue(); @@ -388,7 +388,7 @@ public void testAdditionalVariables() { for (int i = 1; i <= 1000; i++) { // given - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final FormulaRandomizer randomizer = new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(i).numVars(20).build()); final Formula formula = randomizer.formula(4); @@ -425,7 +425,7 @@ public void testRandomFormulas() { new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(i).numVars(15).build()); final Formula formula = randomizer.formula(3); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); // no split @@ -463,7 +463,7 @@ public void testRandomFormulas() { @ParameterizedTest @MethodSource("contexts") public void testCollector(final FormulaContext _c) { - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.eq1); final EnumerationCollectorTestHandler handler = new EnumerationCollectorTestHandler(); @@ -474,12 +474,12 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getCommitCalls()).isZero(); assertThat(handler.getRollbackCalls()).isZero(); - final LNGBooleanVector modelFromSolver1 = new LNGBooleanVector(true, true); - final LNGBooleanVector modelFromSolver2 = new LNGBooleanVector(false, false); + final LngBooleanVector modelFromSolver1 = new LngBooleanVector(true, true); + final LngBooleanVector modelFromSolver2 = new LngBooleanVector(false, false); final Model expectedModel1 = new Model(_c.a, _c.b); final Model expectedModel2 = new Model(_c.na, _c.nb); - final LNGIntVector relevantIndices = LNGIntVector.of(0, 1); + final LngIntVector relevantIndices = LngIntVector.of(0, 1); collector.addModel(modelFromSolver1, solver, relevantIndices, handler); assertThat(collector.getResult()).isEmpty(); @@ -552,7 +552,7 @@ public void testGetCartesianProduct(final FormulaContext _c) { @Test public void testModelEnumerationSimple() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & (B | C)")); final List models = solver.enumerateAllModels(f.variables("A", "B", "C")); assertThat(models).containsExactlyInAnyOrder( @@ -566,8 +566,8 @@ public void testModelEnumerationSimple() throws ParserException { public void testVariableRemovedBySimplificationOccursInModels() throws ParserException { final FormulaFactory f = FormulaFactory.caching(FormulaFactoryConfig.builder().simplifyComplementaryOperands(true).build()); - final SATSolver solver = SATSolver.newSolver(this.f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(this.f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); final Variable a = f.variable("A"); final Variable b = f.variable("B"); final Formula formula = this.f.parse("A & B => A"); @@ -583,7 +583,7 @@ public void testVariableRemovedBySimplificationOccursInModels() throws ParserExc @Test public void testUnknownVariableNotOccurringInModel() { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Variable a = f.variable("A"); solver.add(a); final List models = solver.enumerateAllModels(f.variables("A", "X")); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunctionTest.java index 9f38d3c7..1a4d5733 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/ModelEnumerationToBddFunctionTest.java @@ -8,19 +8,19 @@ import static org.assertj.core.api.Assertions.assertThat; import com.booleworks.logicng.RandomTag; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NumberOfModelsHandler; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.BDD; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.knowledgecompilation.bdds.Bdd; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationToBddFunction.BddModelEnumerationCollector; import com.booleworks.logicng.solvers.functions.modelenumeration.DefaultModelEnumerationStrategy; import com.booleworks.logicng.solvers.functions.modelenumeration.EnumerationCollectorTestHandler; @@ -68,10 +68,10 @@ public void testContradiction(final SplitVariableProvider splitProvider) { : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.literal("A", true)); solver.add(f.literal("A", false)); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); assertThat(bdd.isContradiction()).isTrue(); } @@ -84,8 +84,8 @@ public void testTautology(final SplitVariableProvider splitProvider) { : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); + final SatSolver solver = SatSolver.newSolver(f); + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); assertThat(bdd.isTautology()).isTrue(); } @@ -98,10 +98,10 @@ public void testEmptyEnumerationVariables(final SplitVariableProvider splitProvi : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A & (B | C)"); solver.add(formula); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(List.of()).configuration(config).build()); assertThat(bdd.isTautology()).isTrue(); } @@ -114,10 +114,10 @@ public void testSimple1(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("A & (B | C)"); solver.add(formula); - final BDD bdd = solver + final Bdd bdd = solver .execute(ModelEnumerationToBddFunction.builder(formula.variables(f)).configuration(config).build()); compareModels(formula, formula.variables(f), bdd); } @@ -131,10 +131,10 @@ public void testSimple2(final SplitVariableProvider splitProvider) throws Parser : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); solver.add(formula); - final BDD bdd = solver + final Bdd bdd = solver .execute(ModelEnumerationToBddFunction.builder(formula.variables(f)).configuration(config).build()); assertThat(bdd.modelCount()).isEqualTo(5); compareModels(formula, formula.variables(f), bdd); @@ -149,13 +149,13 @@ public void testMultipleModelEnumeration(final SplitVariableProvider splitProvid : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); solver.add(formula); final ModelEnumerationToBddFunction meFunction = ModelEnumerationToBddFunction.builder(formula.variables(f)).configuration(config).build(); - final BDD firstRun = solver.execute(meFunction); - final BDD secondRun = solver.execute(meFunction); + final Bdd firstRun = solver.execute(meFunction); + final Bdd secondRun = solver.execute(meFunction); assertThat(firstRun.modelCount()).isEqualTo(5); assertThat(secondRun.modelCount()).isEqualTo(5); compareModels(formula, formula.variables(f), firstRun); @@ -171,11 +171,11 @@ public void testDontCareVariables1(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); final SortedSet variables = f.variables("A", "B", "C", "D"); solver.add(formula); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) .configuration(config) .build()); assertThat(bdd.modelCount()).isEqualTo(10); @@ -191,11 +191,11 @@ public void testDontCareVariables2(final SplitVariableProvider splitProvider) th : DefaultModelEnumerationStrategy.builder().splitVariableProvider(splitProvider) .maxNumberOfModels(2).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Formula formula = f.parse("(~A | C) & (~B | C)"); final SortedSet variables = f.variables("A", "C", "D", "E"); solver.add(formula); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) .configuration(config) .build()); assertThat(bdd.modelCount()).isEqualTo(12); @@ -208,13 +208,13 @@ public void testDontCareVariables3() throws ParserException { final ModelEnumerationConfig config = ModelEnumerationConfig.builder().strategy(DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()).build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); // X will be simplified out and become a don't care variable unknown // by the solver final Formula formula = f.parse("A | B | (X & ~X)"); solver.add(formula); final SortedSet variables = new TreeSet<>(f.variables("A", "B", "X")); - final BDD bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) + final Bdd bdd = solver.execute(ModelEnumerationToBddFunction.builder(variables) .configuration(config) .build()); assertThat(bdd.modelCount()).isEqualTo(6); @@ -230,9 +230,9 @@ public void testHandlerWithNumModelsLimit(final SplitVariableProvider splitProvi .strategy(splitProvider == null ? null : DefaultModelEnumerationStrategy.builder() .splitVariableProvider(splitProvider).maxNumberOfModels(3).build()) .build(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(~A | C) & (~B | C)")); - final LNGResult bdd = solver.execute( + final LngResult bdd = solver.execute( ModelEnumerationToBddFunction.builder(f.variables("A", "B", "C")).configuration(config).build(), handler); assertThat(bdd.isSuccess()).isFalse(); @@ -248,7 +248,7 @@ public void testRandomFormulas() { new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(i).numVars(15).build()); final Formula formula = randomizer.formula(3); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(formula); // recursive call: least common vars @@ -256,7 +256,7 @@ public void testRandomFormulas() { ModelEnumerationConfig.builder().strategy(DefaultModelEnumerationStrategy.builder() .splitVariableProvider(new LeastCommonVariablesProvider()).maxNumberOfModels(500).build()) .build(); - final BDD bdd1 = solver.execute( + final Bdd bdd1 = solver.execute( ModelEnumerationToBddFunction.builder(formula.variables(f)).configuration(configLcv).build()); // recursive call: most common vars @@ -264,7 +264,7 @@ public void testRandomFormulas() { ModelEnumerationConfig.builder().strategy(DefaultModelEnumerationStrategy.builder() .splitVariableProvider(new MostCommonVariablesProvider()).maxNumberOfModels(500).build()) .build(); - final BDD bdd2 = solver.execute( + final Bdd bdd2 = solver.execute( ModelEnumerationToBddFunction.builder(formula.variables(f)).configuration(configMcv).build()); compareModels(formula, formula.variables(f), bdd1); @@ -275,7 +275,7 @@ public void testRandomFormulas() { @ParameterizedTest @MethodSource("contexts") public void testCollector(final FormulaContext _c) { - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.eq1); final EnumerationCollectorTestHandler handler = new EnumerationCollectorTestHandler(); @@ -286,9 +286,9 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getCommitCalls()).isZero(); assertThat(handler.getRollbackCalls()).isZero(); - final LNGBooleanVector modelFromSolver1 = new LNGBooleanVector(true, true); - final LNGBooleanVector modelFromSolver2 = new LNGBooleanVector(false, false); - final LNGIntVector relevantIndices = LNGIntVector.of(0, 1); + final LngBooleanVector modelFromSolver1 = new LngBooleanVector(true, true); + final LngBooleanVector modelFromSolver2 = new LngBooleanVector(false, false); + final LngIntVector relevantIndices = LngIntVector.of(0, 1); final Model expectedModel1 = new Model(_c.a, _c.b); final Model expectedModel2 = new Model(_c.na, _c.nb); @@ -304,7 +304,7 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getFoundModels()).isEqualTo(1); assertThat(handler.getCommitCalls()).isEqualTo(1); assertThat(handler.getRollbackCalls()).isZero(); - final BDD result1 = collector.getResult(); + final Bdd result1 = collector.getResult(); collector.addModel(modelFromSolver2, solver, relevantIndices, handler); assertThat(collector.getResult()).isEqualTo(result1); @@ -333,7 +333,7 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getFoundModels()).isEqualTo(4); assertThat(handler.getCommitCalls()).isEqualTo(2); assertThat(handler.getRollbackCalls()).isEqualTo(2); - final BDD result2 = collector.getResult(); + final Bdd result2 = collector.getResult(); collector.rollback(handler); assertThat(collector.getResult()).isEqualTo(result2); @@ -343,9 +343,9 @@ public void testCollector(final FormulaContext _c) { assertThat(handler.getRollbackCalls()).isEqualTo(4); } - private void compareModels(final Formula formula, final Collection variables, final BDD bdd) { + private void compareModels(final Formula formula, final Collection variables, final Bdd bdd) { final FormulaFactory factory = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(factory); + final SatSolver solver = SatSolver.newSolver(factory); solver.add(formula); final Variable taut = factory.variable("@TAUT"); for (final Variable variable : variables) { diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/OptimizationFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/OptimizationFunctionTest.java index 5f8e6012..bc29533d 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/OptimizationFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/OptimizationFunctionTest.java @@ -25,19 +25,19 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.handlers.BoundedOptimizationHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.handlers.TimeoutHandler; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.OptimizationFoundBetterBoundEvent; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.io.readers.DimacsReader; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.solvers.sat.SolverTestSet; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaRandomizer; @@ -83,58 +83,58 @@ public static List solverSuppliers() { @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") - public void testUnsatFormula(final Function solver, final FormulaFactory f, + public void testUnsatFormula(final Function solver, final FormulaFactory f, final String solverDescription) throws ParserException { final Formula formula = f.parse("a & b & (a => ~b)"); - final LNGResult minimumModel = optimize(Collections.singleton(formula), + final LngResult minimumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), false, solver.apply(f), NopHandler.get()); assertThat(minimumModel).isNull(); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), true, solver.apply(f), NopHandler.get()); assertThat(maximumModel).isNull(); } @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") - public void testSingleModel(final Function solver, final FormulaFactory f, + public void testSingleModel(final Function solver, final FormulaFactory f, final String solverDescription) throws ParserException { final Formula formula = f.parse("~a & ~b & ~c"); - final LNGResult minimumModel = optimize(Collections.singleton(formula), + final LngResult minimumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), false, solver.apply(f), NopHandler.get()); testMinimumModel(formula, minimumModel, formula.variables(f)); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), true, solver.apply(f), NopHandler.get()); testMaximumModel(formula, maximumModel, formula.variables(f)); } @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") - public void testExoModel(final Function solver, final FormulaFactory f, + public void testExoModel(final Function solver, final FormulaFactory f, final String solverDescription) { final CardinalityConstraint exo = (CardinalityConstraint) f.exo(f.variable("a"), f.variable("b"), f.variable("c")); - final LNGResult minimumModel = optimize(Collections.singleton(exo), exo.variables(f), + final LngResult minimumModel = optimize(Collections.singleton(exo), exo.variables(f), Collections.emptyList(), false, solver.apply(f), NopHandler.get()); testMinimumModel(exo, minimumModel, exo.variables(f)); - final LNGResult maximumModel = optimize(Collections.singleton(exo), exo.variables(f), + final LngResult maximumModel = optimize(Collections.singleton(exo), exo.variables(f), Collections.emptyList(), true, solver.apply(f), NopHandler.get()); testMaximumModel(exo, maximumModel, exo.variables(f)); } @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") - public void testCornerCases(final Function solver, final FormulaFactory f, + public void testCornerCases(final Function solver, final FormulaFactory f, final String solverDescription) { final FormulaCornerCases cornerCases = new FormulaCornerCases(f); for (final Formula formula : cornerCases.cornerCases()) { - if (formula.holds(new SATPredicate(f))) { + if (formula.holds(new SatPredicate(f))) { final Set targetLiterals = cornerCases.getVariables(); - final LNGResult minimumModel = optimize(Collections.singleton(formula), + final LngResult minimumModel = optimize(Collections.singleton(formula), targetLiterals, Collections.emptySet(), false, solver.apply(f), NopHandler.get()); testMinimumModel(formula, minimumModel, targetLiterals); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), targetLiterals, Collections.emptySet(), true, solver.apply(f), NopHandler.get()); testMaximumModel(formula, maximumModel, targetLiterals); } @@ -146,12 +146,12 @@ public void testCornerCases(final Function solver, fi @RandomTag @Execution(ExecutionMode.SAME_THREAD) - public void testRandomSmall(final Function solver, final FormulaFactory f0, + public void testRandomSmall(final Function solver, final FormulaFactory f0, final String solverDescription) { final FormulaFactory f = FormulaFactory.nonCaching(FormulaFactoryConfig.builder() // caching factory goes out of heap .formulaMergeStrategy(FormulaFactoryConfig.FormulaMergeStrategy.IMPORT).build()); - final SATPredicate satPredicate = new SATPredicate(f); + final SatPredicate satPredicate = new SatPredicate(f); final Random random = new Random(42); final FormulaRandomizer randomizer = new FormulaRandomizer(f, FormulaRandomizerConfig.builder().numVars(6).weightPbc(2).seed(42).build()); @@ -164,11 +164,11 @@ public void testRandomSmall(final Function solver, fi randomTargetLiterals(f, random, randomSubset(random, variables, Math.min(variables.size(), 5))); final Set additionalVariables = randomSubset(random, variables, Math.min(variables.size(), 3)); - final LNGResult minimumModel = optimize(Collections.singleton(formula), + final LngResult minimumModel = optimize(Collections.singleton(formula), targetLiterals, additionalVariables, false, solver.apply(f), NopHandler.get()); testMinimumModel(formula, minimumModel, targetLiterals); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), targetLiterals, additionalVariables, true, solver.apply(f), NopHandler.get()); testMaximumModel(formula, maximumModel, targetLiterals); } @@ -193,10 +193,10 @@ private static SortedSet randomTargetLiterals(final FormulaFactory f, f @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") - public void testIncrementalityMinimizeAndMaximize(final Function solverSupplier, final FormulaFactory f) + public void testIncrementalityMinimizeAndMaximize(final Function solverSupplier, final FormulaFactory f) throws ParserException { Formula formula = f.parse("(a|b|c|d|e) & (p|q) & (x|y|z)"); - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final SortedSet vars = new TreeSet<>(formula.variables(f)); solver.add(formula); @@ -247,7 +247,7 @@ public void testIncrementalityMinimizeAndMaximize(final Function solver, final FormulaFactory f, + public void testAdditionalVariables(final Function solver, final FormulaFactory f, final String solverDescription) throws ParserException { final Variable a = f.variable("a"); @@ -262,10 +262,10 @@ public void testAdditionalVariables(final Function so final Formula formula = f.parse("(a|b) & (~a => c) & (x|y)"); final List literalsANBX = Arrays.asList(a, nb, x); - final LNGResult minimumModel = optimize(Collections.singleton(formula), literalsANBX, + final LngResult minimumModel = optimize(Collections.singleton(formula), literalsANBX, Collections.emptyList(), false, solver.apply(f), NopHandler.get()); assertThat(minimumModel.getResult().getLiterals()).containsExactlyInAnyOrder(na, b, nx); - final LNGResult minimumModelWithY = optimize(Collections.singleton(formula), + final LngResult minimumModelWithY = optimize(Collections.singleton(formula), literalsANBX, Collections.singleton(y), false, solver.apply(f), NopHandler.get()); assertThat(minimumModelWithY.getResult().getLiterals()) .containsExactlyInAnyOrder(na, b, nx, y); @@ -288,13 +288,13 @@ public void testAdditionalVariables(final Function so @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") @LongRunningTag - public void testLargeFormulaMinimize(final Function solver, final FormulaFactory f, + public void testLargeFormulaMinimize(final Function solver, final FormulaFactory f, final String solverDescription) throws IOException, ParserException { final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/large_formula.txt"); final List variables = randomSubset(formula.variables(f), 300); - final LNGResult minimumModel = optimize(Collections.singleton(formula), variables, + final LngResult minimumModel = optimize(Collections.singleton(formula), variables, Collections.emptyList(), false, solver.apply(f), NopHandler.get()); testMinimumModel(formula, minimumModel, variables); } @@ -302,12 +302,12 @@ public void testLargeFormulaMinimize(final Function s @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") @LongRunningTag - public void testLargeFormulaMaximize(final Function solver, final FormulaFactory f, + public void testLargeFormulaMaximize(final Function solver, final FormulaFactory f, final String solverDescription) throws IOException, ParserException { final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/large_formula.txt"); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), true, solver.apply(f), NopHandler.get()); testMaximumModel(formula, maximumModel, formula.variables(f)); } @@ -315,12 +315,12 @@ public void testLargeFormulaMaximize(final Function s @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") @LongRunningTag - public void testLargerFormulaMinimize(final Function solver, final FormulaFactory f, + public void testLargerFormulaMinimize(final Function solver, final FormulaFactory f, final String solverDescription) throws IOException, ParserException { final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/small_formulas.txt"); - final LNGResult minimumModel = optimize(Collections.singleton(formula), + final LngResult minimumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), false, solver.apply(f), NopHandler.get()); testMinimumModel(formula, minimumModel, formula.variables(f)); } @@ -328,13 +328,13 @@ public void testLargerFormulaMinimize(final Function @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") @LongRunningTag - public void testLargerFormulaMaximize(final Function solver, final FormulaFactory f, + public void testLargerFormulaMaximize(final Function solver, final FormulaFactory f, final String solverDescription) throws IOException, ParserException { final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/small_formulas.txt"); final List variables = randomSubset(formula.variables(f), 300); - final LNGResult maximumModel = optimize(Collections.singleton(formula), variables, + final LngResult maximumModel = optimize(Collections.singleton(formula), variables, Collections.emptyList(), true, solver.apply(f), NopHandler.get()); testMaximumModel(formula, maximumModel, variables); } @@ -353,17 +353,17 @@ public void compareWithMaxSat() throws IOException, ParserException { variables.addAll(parsed.variables(f)); } final int expected = 25; - assertThat(solveMaxSat(formulas, variables, MaxSATSolver.incWBO(f))).isEqualTo(expected); - assertThat(solveMaxSat(formulas, variables, MaxSATSolver.linearSU(f))).isEqualTo(expected); - assertThat(solveMaxSat(formulas, variables, MaxSATSolver.linearUS(f))).isEqualTo(expected); - assertThat(solveMaxSat(formulas, variables, MaxSATSolver.msu3(f))).isEqualTo(expected); - assertThat(solveMaxSat(formulas, variables, MaxSATSolver.wbo(f))).isEqualTo(expected); + assertThat(solveMaxSat(formulas, variables, MaxSatSolver.incWbo(f))).isEqualTo(expected); + assertThat(solveMaxSat(formulas, variables, MaxSatSolver.linearSu(f))).isEqualTo(expected); + assertThat(solveMaxSat(formulas, variables, MaxSatSolver.linearUs(f))).isEqualTo(expected); + assertThat(solveMaxSat(formulas, variables, MaxSatSolver.msu3(f))).isEqualTo(expected); + assertThat(solveMaxSat(formulas, variables, MaxSatSolver.wbo(f))).isEqualTo(expected); assertThat(satisfiedLiterals(optimize(formulas, variables, Collections.emptyList(), false, - SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(false).build()), + SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(false).build()), NopHandler.get()), variables).size()) .isEqualTo(expected); assertThat(satisfiedLiterals(optimize(formulas, variables, Collections.emptyList(), false, - SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(true).build()), + SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(true).build()), NopHandler.get()), variables).size()) .isEqualTo(expected); } @@ -371,26 +371,26 @@ public void compareWithMaxSat() throws IOException, ParserException { @ParameterizedTest(name = "{index} {2}") @MethodSource("solverSuppliers") @LongRunningTag - public void testTimeoutOptimizationHandler(final Function solver, final FormulaFactory f, + public void testTimeoutOptimizationHandler(final Function solver, final FormulaFactory f, final String solverDescription) throws IOException, ParserException { final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/large_formula.txt"); final TimeoutHandler handlerMax = new TimeoutHandler(1L); - final LNGResult maximumModel = optimize(Collections.singleton(formula), + final LngResult maximumModel = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), true, solver.apply(f), handlerMax); assertThat(maximumModel.isSuccess()).isFalse(); assertThat(maximumModel.isPartial()).isFalse(); assertThat(maximumModel.getPartialResult()).isNull(); final TimeoutHandler handlerTooShort = new TimeoutHandler(0L); - final LNGResult model = optimize(Collections.singleton(formula), formula.variables(f), + final LngResult model = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), false, solver.apply(f), handlerTooShort); assertThat(model.isSuccess()).isFalse(); assertThat(model.isPartial()).isFalse(); assertThat(model.getPartialResult()).isNull(); final CustomOptimizationHandler customHandler = new CustomOptimizationHandler(); - final LNGResult modelCustom = optimize(Collections.singleton(formula), + final LngResult modelCustom = optimize(Collections.singleton(formula), formula.variables(f), Collections.emptyList(), true, solver.apply(f), customHandler); assertThat(modelCustom.isSuccess()).isFalse(); assertThat(modelCustom.isPartial()).isTrue(); @@ -401,7 +401,7 @@ public void testTimeoutOptimizationHandler(final Function solverSupplier, final FormulaFactory f0, + public void testCancellationPoints(final Function solverSupplier, final FormulaFactory f0, final String solverDescription) throws IOException { final FormulaFactory f = FormulaFactory.caching(); final SortedSet selVars = new TreeSet<>(); @@ -412,33 +412,33 @@ public void testCancellationPoints(final Function sol selVars.add(selVar); formulas.add(f.equivalence(selVar, clause)); } - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); for (int numSatHandlerStarts = 1; numSatHandlerStarts < 4; numSatHandlerStarts++) { solver.add(formulas); final ComputationHandler handler = new BoundedOptimizationHandler(numSatHandlerStarts, -1); final OptimizationFunction optimizationFunction = builder().literals(selVars).maximize().build(); - final LNGResult result = solver.execute(optimizationFunction, handler); + final LngResult result = solver.execute(optimizationFunction, handler); assertThat(result.isSuccess()).isFalse(); } } private int solveMaxSat(final List formulas, final SortedSet variables, - final MaxSATSolver solver) { + final MaxSatSolver solver) { formulas.forEach(solver::addHardFormula); variables.forEach(v -> solver.addSoftFormula(v.negate(formulas.iterator().next().getFactory()), 1)); return solver.solve().getOptimum(); } - private List satisfiedLiterals(final LNGResult model, + private List satisfiedLiterals(final LngResult model, final Collection literals) { final Set modelLiterals = new HashSet<>(model.getResult().getLiterals()); return literals.stream().filter(modelLiterals::contains).collect(Collectors.toList()); } - private static LNGResult optimize( + private static LngResult optimize( final Collection formulas, final Collection literals, final Collection additionalVariables, final boolean maximize, - final SATSolver solver, final ComputationHandler handler) { + final SatSolver solver, final ComputationHandler handler) { formulas.forEach(solver::add); if (!solver.sat()) { return null; @@ -452,17 +452,17 @@ private static LNGResult optimize( } } - private void testMinimumModel(final Formula formula, final LNGResult resultModel, + private void testMinimumModel(final Formula formula, final LngResult resultModel, final Collection literals) { testOptimumModel(formula, resultModel, literals, false); } - private void testMaximumModel(final Formula formula, final LNGResult resultModel, + private void testMaximumModel(final Formula formula, final LngResult resultModel, final Collection literals) { testOptimumModel(formula, resultModel, literals, true); } - private void testOptimumModel(final Formula formula, final LNGResult optimumModel, + private void testOptimumModel(final Formula formula, final LngResult optimumModel, final Collection literals, final boolean maximize) { assertThat(optimumModel.isSuccess()).isTrue(); final FormulaFactory f = formula.getFactory(); @@ -471,10 +471,10 @@ private void testOptimumModel(final Formula formula, final LNGResult opti assertThat(optimumLiterals).isEmpty(); } else { final int actualNumSatisfied = satisfiedLiterals(optimumModel, literals).size(); - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); solver.addHardFormula(formula); literals.forEach(l -> solver.addSoftFormula(maximize ? l : l.negate(f), 1)); - final int numSatisfiedOll = satisfiedLiterals(LNGResult.of(solver.solve().getModel()), literals).size(); + final int numSatisfiedOll = satisfiedLiterals(LngResult.of(solver.solve().getModel()), literals).size(); assertThat(actualNumSatisfied).isEqualTo(numSatisfiedOll); } } @@ -490,7 +490,7 @@ private static class CustomOptimizationHandler implements ComputationHandler { private boolean canceled; @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event instanceof OptimizationFoundBetterBoundEvent) { currentResult = ((OptimizationFoundBetterBoundEvent) event).getModel().get(); canceled = currentResult.positiveVariables().size() >= 161; diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunctionTest.java index 8f565173..29493c7d 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/UnsatCoreFunctionTest.java @@ -8,8 +8,8 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import com.booleworks.logicng.TestWithExampleFormulas; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; public class UnsatCoreFunctionTest extends TestWithExampleFormulas { @@ -17,13 +17,13 @@ public class UnsatCoreFunctionTest extends TestWithExampleFormulas { @Test public void testExceptionalBehavior() { assertThatThrownBy(() -> { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(false).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(false).build()); solver.satCall().unsatCore(); }).isInstanceOf(IllegalStateException.class) .hasMessage("Cannot generate an unsat core if proof generation is not turned on"); assertThat( - SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()).satCall().unsatCore()) - .isNull(); + SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()).satCall().unsatCore()) + .isNull(); } } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunctionTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunctionTest.java index e0cbb354..32a37aec 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunctionTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/VariableOccurrencesOnSolverFunctionTest.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import java.util.Arrays; @@ -33,7 +33,7 @@ public class VariableOccurrencesOnSolverFunctionTest { @Test public void testWithEmptySolver() { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); assertThat(solver.execute(new VariableOccurrencesOnSolverFunction())).isEmpty(); final Map countWithRelevantVariables = solver.execute( new VariableOccurrencesOnSolverFunction(new HashSet<>(Arrays.asList(A, B, C)))); @@ -44,7 +44,7 @@ public void testWithEmptySolver() { @Test public void testWithAllVariables() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(a | b | c) & (~b | c) & (d | ~e) & x & (~a | e) & (a | d | b | g | h) & (~h | i) & y")); final Map counts = solver.execute(new VariableOccurrencesOnSolverFunction()); assertThat(counts).hasSize(10); @@ -62,7 +62,7 @@ public void testWithAllVariables() throws ParserException { @Test public void testWithRelevantVariables() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("(a | b | c) & (~b | c) & (d | ~e) & x & (~a | e) & (a | d | b | g | h) & (~h | i) & y")); final Map counts = solver.execute( new VariableOccurrencesOnSolverFunction(new HashSet<>(Arrays.asList(A, C, X, J)))); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollectorTestHandler.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollectorTestHandler.java index 8197eea2..ae28bb9c 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollectorTestHandler.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/EnumerationCollectorTestHandler.java @@ -7,7 +7,7 @@ import com.booleworks.logicng.handlers.ComputationHandler; import com.booleworks.logicng.handlers.events.ComputationStartedEvent; import com.booleworks.logicng.handlers.events.EnumerationFoundModelsEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.SimpleEvent; public final class EnumerationCollectorTestHandler implements ComputationHandler { @@ -17,7 +17,7 @@ public final class EnumerationCollectorTestHandler implements ComputationHandler private int rollbackCalls; @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == ComputationStartedEvent.MODEL_ENUMERATION_STARTED) { foundModels = 0; } else if (event instanceof EnumerationFoundModelsEvent) { diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/TestVariableProvider.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/TestVariableProvider.java index 613a09e0..e4bf069a 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/TestVariableProvider.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/TestVariableProvider.java @@ -7,7 +7,7 @@ import static java.util.Collections.emptySortedSet; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.modelenumeration.splitprovider.SplitVariableProvider; import java.util.Collection; @@ -16,14 +16,14 @@ public class TestVariableProvider { public static class EmptyVariableProvider implements SplitVariableProvider { @Override - public SortedSet getSplitVars(final SATSolver solver, final Collection variables) { + public SortedSet getSplitVars(final SatSolver solver, final Collection variables) { return emptySortedSet(); } } public static class NullVariableProvider implements SplitVariableProvider { @Override - public SortedSet getSplitVars(final SATSolver solver, final Collection variables) { + public SortedSet getSplitVars(final SatSolver solver, final Collection variables) { return null; } } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderTest.java b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderTest.java index 6e4efd72..737faaa5 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/functions/modelenumeration/splitprovider/SplitVariableProviderTest.java @@ -11,7 +11,7 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -31,7 +31,7 @@ public void testFixedVariableProvider(final FormulaContext _c) { .containsExactlyElementsOf(varSet(_c.f, "A B C D E F")); assertThat(new FixedVariableProvider(varSet(_c.f, "A B C D E F")).getSplitVars(null, varSet(_c.f, "A B X U"))) .containsExactlyElementsOf(varSet(_c.f, "A B C D E F")); - assertThat(new FixedVariableProvider(varSet(_c.f, "A B C D E F")).getSplitVars(SATSolver.newSolver(_c.f), + assertThat(new FixedVariableProvider(varSet(_c.f, "A B C D E F")).getSplitVars(SatSolver.newSolver(_c.f), varSet(_c.f, "A B X U"))).containsExactlyElementsOf(varSet(_c.f, "A B C D E F")); } @@ -39,7 +39,7 @@ public void testFixedVariableProvider(final FormulaContext _c) { @MethodSource("contexts") public void testLeastCommonVariablesProvider(final FormulaContext _c) throws ParserException { final SortedSet varSet = varSet(_c.f, "a b c d e f g h i j"); - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.f.parse( "(a | b | c) & (~b | c) & (d | ~e) & (~a | e) & (a | d | b | g | h) & (~h | i) & (f | g | j) & (f | b | j | ~g) & (g | c)")); assertThat(new LeastCommonVariablesProvider(.1, 100).getSplitVars(solver, null)) @@ -72,7 +72,7 @@ public void testLeastCommonVariablesProvider(final FormulaContext _c) throws Par @MethodSource("contexts") public void testMostCommonVariablesProvider(final FormulaContext _c) throws ParserException { final SortedSet varSet = varSet(_c.f, "a b c d e f g h i j"); - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(_c.f.parse( "(a | b | c) & (~b | c) & (d | ~e) & (~a | e) & (a | d | b | g | h) & (~h | i) & (f | g | j) & (f | b | j | ~g) & (g | c)")); assertThat(new MostCommonVariablesProvider(.2, 100).getSplitVars(solver, null)) diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATClassTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATClassTest.java deleted file mode 100644 index 87082012..00000000 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATClassTest.java +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 and MIT -// Copyright 2015-2023 Christoph Zengler -// Copyright 2023-20xx BooleWorks GmbH - -package com.booleworks.logicng.solvers.maxsat; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -public class MaxSATClassTest { - - @Test - public void testMaxSATConfig() { - assertThat(Arrays.asList(MaxSATConfig.IncrementalStrategy.values()) - .contains(MaxSATConfig.IncrementalStrategy.valueOf("ITERATIVE"))).isTrue(); - assertThat( - Arrays.asList(MaxSATConfig.AMOEncoding.values()).contains(MaxSATConfig.AMOEncoding.valueOf("LADDER"))) - .isTrue(); - assertThat(Arrays.asList(MaxSATConfig.PBEncoding.values()).contains(MaxSATConfig.PBEncoding.valueOf("SWC"))) - .isTrue(); - assertThat(Arrays.asList(MaxSATConfig.CardinalityEncoding.values()) - .contains(MaxSATConfig.CardinalityEncoding.valueOf("TOTALIZER"))).isTrue(); - assertThat(Arrays.asList(MaxSATConfig.WeightStrategy.values()) - .contains(MaxSATConfig.WeightStrategy.valueOf("DIVERSIFY"))).isTrue(); - assertThat(Arrays.asList(MaxSATConfig.Verbosity.values()).contains(MaxSATConfig.Verbosity.valueOf("SOME"))) - .isTrue(); - } -} diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATReader.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATReader.java index bbfc2665..37b1c7c7 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATReader.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATReader.java @@ -6,7 +6,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Literal; -import com.booleworks.logicng.solvers.MaxSATSolver; +import com.booleworks.logicng.solvers.MaxSatSolver; import java.io.BufferedReader; import java.io.FileReader; @@ -22,7 +22,7 @@ public class MaxSATReader { * @param fileName the file name to read * @throws IOException if something goes wrong */ - static void readCnfToSolver(final MaxSATSolver solver, final String fileName) throws IOException { + static void readCnfToSolver(final MaxSatSolver solver, final String fileName) throws IOException { final FormulaFactory f = solver.getFactory(); final BufferedReader reader = new BufferedReader(new FileReader(fileName)); boolean pureMaxSat = false; diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatClassTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatClassTest.java new file mode 100644 index 00000000..2ad66e91 --- /dev/null +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatClassTest.java @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 and MIT +// Copyright 2015-2023 Christoph Zengler +// Copyright 2023-20xx BooleWorks GmbH + +package com.booleworks.logicng.solvers.maxsat; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; + +public class MaxSatClassTest { + + @Test + public void testMaxSATConfig() { + assertThat(Arrays.asList(MaxSatConfig.IncrementalStrategy.values()) + .contains(MaxSatConfig.IncrementalStrategy.valueOf("ITERATIVE"))).isTrue(); + assertThat( + Arrays.asList(MaxSatConfig.AmoEncoding.values()).contains(MaxSatConfig.AmoEncoding.valueOf("LADDER"))) + .isTrue(); + assertThat(Arrays.asList(MaxSatConfig.PbEncoding.values()).contains(MaxSatConfig.PbEncoding.valueOf("SWC"))) + .isTrue(); + assertThat(Arrays.asList(MaxSatConfig.CardinalityEncoding.values()) + .contains(MaxSatConfig.CardinalityEncoding.valueOf("TOTALIZER"))).isTrue(); + assertThat(Arrays.asList(MaxSatConfig.WeightStrategy.values()) + .contains(MaxSatConfig.WeightStrategy.valueOf("DIVERSIFY"))).isTrue(); + assertThat(Arrays.asList(MaxSatConfig.Verbosity.values()).contains(MaxSatConfig.Verbosity.valueOf("SOME"))) + .isTrue(); + } +} diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATDecrementalTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatDecrementalTest.java similarity index 61% rename from core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATDecrementalTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatDecrementalTest.java index 25687c6a..406449ec 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATDecrementalTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatDecrementalTest.java @@ -5,48 +5,48 @@ import com.booleworks.logicng.TestWithExampleFormulas; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.CardinalityEncoding; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.IncrementalStrategy; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.WeightStrategy; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATState; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.CardinalityEncoding; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.IncrementalStrategy; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.WeightStrategy; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatState; import org.junit.jupiter.api.Test; -public class MaxSATDecrementalTest extends TestWithExampleFormulas { +public class MaxSatDecrementalTest extends TestWithExampleFormulas { @Test public void testDecrementalityPartial() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[]{ - MaxSATSolver.wbo(f), - MaxSATSolver.incWBO(f), - MaxSATSolver.oll(f), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()) + final MaxSatSolver[] solvers = new MaxSatSolver[]{ + MaxSatSolver.wbo(f), + MaxSatSolver.incWbo(f), + MaxSatSolver.oll(f), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()) }; - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { assertThat(solver.solve().getOptimum()).isEqualTo(0); - final MaxSATState state0 = solver.saveState(); - assertThat(state0).isEqualTo(new MaxSATState(1, 0, 0, 0, 0, 1, new int[0])); + final MaxSatState state0 = solver.saveState(); + assertThat(state0).isEqualTo(new MaxSatState(1, 0, 0, 0, 0, 1, new int[0])); solver.addHardFormula(f.parse("(~a | ~b) & (~b | ~c) & ~d")); assertThat(solver.solve().getOptimum()).isEqualTo(0); - final MaxSATState state1 = solver.saveState(); - assertThat(state1).isEqualTo(new MaxSATState(3, 4, 3, 0, 0, 1, new int[0])); + final MaxSatState state1 = solver.saveState(); + assertThat(state1).isEqualTo(new MaxSatState(3, 4, 3, 0, 0, 1, new int[0])); solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 1); assertThat(solver.solve().getOptimum()).isEqualTo(1); - final MaxSATState state2 = solver.saveState(); - assertThat(state2).isEqualTo(new MaxSATState(5, 6, 7, 2, 2, 1, new int[]{1, 1})); + final MaxSatState state2 = solver.saveState(); + assertThat(state2).isEqualTo(new MaxSatState(5, 6, 7, 2, 2, 1, new int[]{1, 1})); solver.loadState(state1); assertThat(solver.solve().getOptimum()).isEqualTo(0); @@ -54,11 +54,11 @@ public void testDecrementalityPartial() throws ParserException { solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 1); assertThat(solver.solve().getOptimum()).isEqualTo(1); - final MaxSATState state3 = solver.saveState(); + final MaxSatState state3 = solver.saveState(); solver.addSoftFormula(C, 1); solver.addSoftFormula(D, 1); assertThat(solver.solve().getOptimum()).isEqualTo(2); - final MaxSATState state4 = solver.saveState(); + final MaxSatState state4 = solver.saveState(); solver.addSoftFormula(NA, 1); assertThat(solver.solve().getOptimum()).isEqualTo(3); @@ -83,43 +83,43 @@ public void testDecrementalityPartial() throws ParserException { @Test public void testDecrementalityWeighted() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[]{ - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.NONE).build()), - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.NORMAL).build()), - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.NONE).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.NORMAL).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), - MaxSATSolver.wmsu3(f, - MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, - MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, - MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, - MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.oll(f) + final MaxSatSolver[] solvers = new MaxSatSolver[]{ + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.NONE).build()), + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.NORMAL).build()), + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.NONE).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.NORMAL).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.oll(f) }; - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { solver.addSoftFormula(X, 2); assertThat(solver.solve().getOptimum()).isEqualTo(0); - final MaxSATState state0 = solver.saveState(); - assertThat(state0).isEqualTo(new MaxSATState(1, 2, 2, 1, 2, 2, new int[]{2})); + final MaxSatState state0 = solver.saveState(); + assertThat(state0).isEqualTo(new MaxSatState(1, 2, 2, 1, 2, 2, new int[]{2})); solver.addHardFormula(f.parse("(~a | ~b) & (~b | ~c) & ~d")); assertThat(solver.solve().getOptimum()).isEqualTo(0); - final MaxSATState state1 = solver.saveState(); - assertThat(state1).isEqualTo(new MaxSATState(3, 6, 5, 1, 2, 2, new int[]{2})); + final MaxSatState state1 = solver.saveState(); + assertThat(state1).isEqualTo(new MaxSatState(3, 6, 5, 1, 2, 2, new int[]{2})); solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 2); assertThat(solver.solve().getOptimum()).isEqualTo(1); - final MaxSATState state2 = solver.saveState(); - assertThat(state2).isEqualTo(new MaxSATState(5, 8, 9, 3, 5, 2, new int[]{2, 1, 2})); + final MaxSatState state2 = solver.saveState(); + assertThat(state2).isEqualTo(new MaxSatState(5, 8, 9, 3, 5, 2, new int[]{2, 1, 2})); solver.loadState(state1); assertThat(solver.solve().getOptimum()).isEqualTo(0); @@ -127,11 +127,11 @@ public void testDecrementalityWeighted() throws ParserException { solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 2); assertThat(solver.solve().getOptimum()).isEqualTo(1); - final MaxSATState state3 = solver.saveState(); + final MaxSatState state3 = solver.saveState(); solver.addSoftFormula(C, 1); solver.addSoftFormula(D, 2); assertThat(solver.solve().getOptimum()).isEqualTo(4); - final MaxSATState state4 = solver.saveState(); + final MaxSatState state4 = solver.saveState(); solver.addSoftFormula(NA, 4); assertThat(solver.solve().getOptimum()).isEqualTo(4); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATIncrementalTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatIncrementalTest.java similarity index 50% rename from core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATIncrementalTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatIncrementalTest.java index d8b62b50..0a3de318 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSATIncrementalTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatIncrementalTest.java @@ -4,33 +4,33 @@ import com.booleworks.logicng.TestWithExampleFormulas; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.CardinalityEncoding; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.IncrementalStrategy; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.WeightStrategy; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.CardinalityEncoding; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.IncrementalStrategy; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.WeightStrategy; import org.junit.jupiter.api.Test; -public class MaxSATIncrementalTest extends TestWithExampleFormulas { +public class MaxSatIncrementalTest extends TestWithExampleFormulas { @Test public void testIncrementalityPartial() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[]{ - MaxSATSolver.wbo(f), - MaxSATSolver.incWBO(f), - MaxSATSolver.oll(f), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), - MaxSATSolver.linearUS(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), - MaxSATSolver.msu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()) + final MaxSatSolver[] solvers = new MaxSatSolver[]{ + MaxSatSolver.wbo(f), + MaxSatSolver.incWbo(f), + MaxSatSolver.oll(f), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), + MaxSatSolver.linearUs(f, MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).build()), + MaxSatSolver.msu3(f, MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).build()) }; - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("(~a | ~b) & (~b | ~c) & ~d")); solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 1); @@ -45,24 +45,28 @@ public void testIncrementalityPartial() throws ParserException { @Test public void testIncrementalityWeighted() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[]{ - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.NONE).build()), - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.NORMAL).build()), - MaxSATSolver.wbo(f, MaxSATConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.NONE).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.NORMAL).build()), - MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.linearSU(f, MaxSATConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), - MaxSATSolver.wmsu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), - MaxSATSolver.wmsu3(f, MaxSATConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), - MaxSATSolver.oll(f) + final MaxSatSolver[] solvers = new MaxSatSolver[]{ + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.NONE).build()), + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.NORMAL).build()), + MaxSatSolver.wbo(f, MaxSatConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.NONE).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.NORMAL).build()), + MaxSatSolver.incWbo(f, MaxSatConfig.builder().weight(WeightStrategy.DIVERSIFY).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.linearSu(f, MaxSatConfig.builder().cardinality(CardinalityEncoding.MTOTALIZER).bmo(true).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.NONE).cardinality(CardinalityEncoding.MTOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(false).build()), + MaxSatSolver.wmsu3(f, + MaxSatConfig.builder().incremental(IncrementalStrategy.ITERATIVE).cardinality(CardinalityEncoding.TOTALIZER).bmo(true).build()), + MaxSatSolver.oll(f) }; - for (final MaxSATSolver solver : solvers) { + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("(~a | ~b) & (~b | ~c) & ~d")); solver.addSoftFormula(A, 1); solver.addSoftFormula(B, 2); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatLongRunningTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatLongRunningTest.java index 43cd6ab7..828f8ab2 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatLongRunningTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/MaxSatLongRunningTest.java @@ -9,9 +9,9 @@ import com.booleworks.logicng.LongRunningTag; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; import java.io.File; @@ -32,17 +32,17 @@ public void testWeightedMaxSat() throws IOException { final FormulaFactory f = FormulaFactory.caching(); final File folder = new File("../test_files/longrunning/wms"); final Map result = readResult(new File("../test_files/longrunning/wms/result.txt")); - final List> solvers = Arrays.asList( - () -> MaxSATSolver.oll(f), - () -> MaxSATSolver.incWBO(f, MaxSATConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF) - .weight(MaxSATConfig.WeightStrategy.DIVERSIFY).build()), - () -> MaxSATSolver.incWBO(f, MaxSATConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF) + final List> solvers = Arrays.asList( + () -> MaxSatSolver.oll(f), + () -> MaxSatSolver.incWbo(f, MaxSatConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF) + .weight(MaxSatConfig.WeightStrategy.DIVERSIFY).build()), + () -> MaxSatSolver.incWbo(f, MaxSatConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF) .build()) ); - for (final Supplier solverGenerator : solvers) { + for (final Supplier solverGenerator : solvers) { for (final File file : Objects.requireNonNull(folder.listFiles())) { if (file.getName().endsWith("wcnf")) { - final MaxSATSolver solver = solverGenerator.get(); + final MaxSatSolver solver = solverGenerator.get(); readCnfToSolver(solver, file.getAbsolutePath()); assertThat(solver.solve().getOptimum()).isEqualTo(result.get(file.getName())); } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSATTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSatTest.java similarity index 59% rename from core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSATTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSatTest.java index 2f878c35..62003a89 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSATTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialMaxSatTest.java @@ -12,16 +12,16 @@ import com.booleworks.logicng.TestWithExampleFormulas; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.handlers.events.ComputationStartedEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.MaxSatNewLowerBoundEvent; import com.booleworks.logicng.handlers.events.MaxSatNewUpperBoundEvent; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.Test; @@ -30,7 +30,7 @@ import java.io.PrintStream; import java.util.function.Supplier; -public class PartialMaxSATTest extends TestWithExampleFormulas { +public class PartialMaxSatTest extends TestWithExampleFormulas { private static final String[] files = new String[]{ "c1355_F176gat-1278gat@1.wcnf", @@ -47,23 +47,23 @@ public class PartialMaxSATTest extends TestWithExampleFormulas { }; private final PrintStream logStream; - public PartialMaxSATTest() throws FileNotFoundException { + public PartialMaxSatTest() throws FileNotFoundException { logStream = new PrintStream("../test_files/partialmaxsat/log.txt"); } @Test public void testExceptionalBehaviorForMSU3() { assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.msu3(f); + final MaxSatSolver solver = MaxSatSolver.msu3(f); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 2); solver.solve(); }).isInstanceOf(IllegalStateException.class) .hasMessage("Error: Currently algorithm MSU3 does not support weighted MaxSAT instances."); assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.msu3(f, MaxSATConfig.builder() - .incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER) + final MaxSatSolver solver = MaxSatSolver.msu3(f, MaxSatConfig.builder() + .incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER) .build()); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 1); @@ -75,13 +75,13 @@ public void testExceptionalBehaviorForMSU3() { @Test @LongRunningTag public void testWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -91,9 +91,9 @@ public void testWBO() throws IOException { @Test public void testOLL() throws IOException { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -102,13 +102,13 @@ public void testOLL() throws IOException { @Test @LongRunningTag public void testIncWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.incWBO(f, config); + final MaxSatSolver solver = MaxSatSolver.incWbo(f, config); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -117,20 +117,20 @@ public void testIncWBO() throws IOException { @Test public void testLinearSU() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[4]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[3] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[4]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[3] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.linearSU(f, config); + final MaxSatSolver solver = MaxSatSolver.linearSu(f, config); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -140,21 +140,21 @@ public void testLinearSU() throws IOException { @Test @LongRunningTag public void testLinearUS() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.linearUS(f, config); + final MaxSatSolver solver = MaxSatSolver.linearUs(f, config); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -163,21 +163,21 @@ public void testLinearUS() throws IOException { @Test public void testMSU3() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.msu3(f, config); + final MaxSatSolver solver = MaxSatSolver.msu3(f, config); readCnfToSolver(solver, "../test_files/partialmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -186,84 +186,84 @@ public void testMSU3() throws IOException { @Test public void testTimeoutHandlerWBO() { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test public void testTimeoutHandlerIncWBO() { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerLinearSU() { - final MaxSATConfig[] configs = new MaxSATConfig[4]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[3] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[4]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[3] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerLinearUS() { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerMSU3() { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSATConfig.Verbosity.SOME) + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(MaxSatConfig.Verbosity.SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } - private void testTimeoutHandler(final Supplier solverGenerator) { + private void testTimeoutHandler(final Supplier solverGenerator) { final TimeoutHandler handler = new TimeoutHandler(1000L); final PigeonHoleGenerator pg = new PigeonHoleGenerator(f); final Formula formula = pg.generate(10); - MaxSATSolver solver = solverGenerator.get(); + MaxSatSolver solver = solverGenerator.get(); solver.addHardFormula(formula); solver.addSoftFormula(f.or(formula.variables(f)), 1); - LNGResult result = solver.solve(handler); + LngResult result = solver.solve(handler); assertThat(result.isSuccess()).isFalse(); final TimeoutHandler handler2 = new TimeoutHandler(1000L); @@ -277,16 +277,16 @@ private void testTimeoutHandler(final Supplier solverGenerator) { @Test public void testTimeoutHandlerSimple() throws IOException { - MaxSATSolver solver = MaxSATSolver.wbo(f, - MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build()); + MaxSatSolver solver = MaxSatSolver.wbo(f, + MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build()); readCnfToSolver(solver, "../test_files/partialmaxsat/c1355_F176gat-1278gat@1.wcnf"); MaxSatTimeoutHandlerWithApproximation handler = new MaxSatTimeoutHandlerWithApproximation(1000L); - LNGResult result = solver.solve(handler); + LngResult result = solver.solve(handler); assertThat(result.isSuccess()).isFalse(); assertThat(handler.lowerBoundApproximation).isLessThan(13); - solver = MaxSATSolver.wbo(f, - MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build()); + solver = MaxSatSolver.wbo(f, + MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build()); readCnfToSolver(solver, "../test_files/partialmaxsat/c1355_F1229gat@1.wcnf"); handler = new MaxSatTimeoutHandlerWithApproximation(5000L); result = solver.solve(handler); @@ -296,11 +296,11 @@ public void testTimeoutHandlerSimple() throws IOException { @Test public void testTimeoutHandlerUB() throws IOException { - final MaxSATSolver solver = MaxSATSolver.linearSU(f, - MaxSATConfig.builder().verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build()); + final MaxSatSolver solver = MaxSatSolver.linearSu(f, + MaxSatConfig.builder().verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build()); readCnfToSolver(solver, "../test_files/partialmaxsat/c1355_F1229gat@1.wcnf"); final MaxSatTimeoutHandlerWithApproximation handler = new MaxSatTimeoutHandlerWithApproximation(5000L); - final LNGResult result = solver.solve(handler); + final LngResult result = solver.solve(handler); assertThat(result.isSuccess()).isTrue(); assertThat(result.getResult().isSatisfiable()).isTrue(); assertThat(result.getResult().getOptimum()).isEqualTo(handler.upperBoundApproximation); @@ -308,13 +308,13 @@ public void testTimeoutHandlerUB() throws IOException { @Test public void testNonClauselSoftConstraints() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[2]; - solvers[0] = MaxSATSolver.msu3(f); - solvers[1] = MaxSATSolver.linearUS(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[2]; + solvers[0] = MaxSatSolver.msu3(f); + solvers[1] = MaxSatSolver.linearUs(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 1); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -325,14 +325,14 @@ public void testNonClauselSoftConstraints() throws ParserException { @Test public void testSoftConstraintsCornerCaseVerum() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[2]; - solvers[0] = MaxSATSolver.msu3(f); - solvers[1] = MaxSATSolver.linearUS(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[2]; + solvers[0] = MaxSatSolver.msu3(f); + solvers[1] = MaxSatSolver.linearUs(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("$true"), 1); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 1); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -343,14 +343,14 @@ public void testSoftConstraintsCornerCaseVerum() throws ParserException { @Test public void testSoftConstraintsCornerCaseFalsum() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[2]; - solvers[0] = MaxSATSolver.msu3(f); - solvers[1] = MaxSATSolver.linearUS(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[2]; + solvers[0] = MaxSatSolver.msu3(f); + solvers[1] = MaxSatSolver.linearUs(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("$false"), 1); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 1); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -372,7 +372,7 @@ static class MaxSatTimeoutHandlerWithApproximation implements ComputationHandler } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event instanceof ComputationStartedEvent) { if (designatedEnd == 0) { designatedEnd = System.currentTimeMillis() + timeout; diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSATTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSatTest.java similarity index 54% rename from core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSATTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSatTest.java index 903b440a..c084a542 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSATTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PartialWeightedMaxSatTest.java @@ -11,13 +11,13 @@ import com.booleworks.logicng.LongRunningTag; import com.booleworks.logicng.TestWithExampleFormulas; import com.booleworks.logicng.formulas.Formula; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ import java.io.PrintStream; import java.util.function.Supplier; -public class PartialWeightedMaxSATTest extends TestWithExampleFormulas { +public class PartialWeightedMaxSatTest extends TestWithExampleFormulas { private static final String[] files = new String[]{ "8.wcsp.log.wcnf", @@ -50,24 +50,24 @@ public class PartialWeightedMaxSATTest extends TestWithExampleFormulas { }; private final PrintStream logStream; - public PartialWeightedMaxSATTest() throws FileNotFoundException { + public PartialWeightedMaxSatTest() throws FileNotFoundException { logStream = new PrintStream("../test_files/partialweightedmaxsat/log.txt"); } @Test public void testExceptionalBehaviorForWMSU3() { assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.wmsu3(f); + final MaxSatSolver solver = MaxSatSolver.wmsu3(f); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 1); solver.solve(); }).isInstanceOf(IllegalStateException.class) .hasMessage("Error: Currently algorithm WMSU3 does not support unweighted MaxSAT instances."); assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.wmsu3(f, MaxSATConfig.builder() + final MaxSatSolver solver = MaxSatSolver.wmsu3(f, MaxSatConfig.builder() .bmo(true) - .incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER) + .incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER) .build()); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 2); @@ -78,18 +78,18 @@ public void testExceptionalBehaviorForWMSU3() { @Test public void testWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NORMAL) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.DIVERSIFY) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NORMAL) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.DIVERSIFY) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -99,18 +99,18 @@ public void testWBO() throws IOException { @Test @LongRunningTag public void testIncWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NORMAL) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.DIVERSIFY) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NORMAL) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.DIVERSIFY) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.incWBO(f, config); + final MaxSatSolver solver = MaxSatSolver.incWbo(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -120,20 +120,20 @@ public void testIncWBO() throws IOException { @Test @LongRunningTag public void testLinearSU() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder() - .cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder() - .cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder() + .cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder() + .cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.linearSU(f, config); + final MaxSatSolver solver = MaxSatSolver.linearSu(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -143,21 +143,21 @@ public void testLinearSU() throws IOException { @Test @LongRunningTag public void testWMSU3() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.wmsu3(f, config); + final MaxSatSolver solver = MaxSatSolver.wmsu3(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -166,15 +166,15 @@ public void testWMSU3() throws IOException { @Test public void testWMSU3BMO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < bmoFiles.length; i++) { - final MaxSATSolver solver = MaxSATSolver.wmsu3(f, config); + final MaxSatSolver solver = MaxSatSolver.wmsu3(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/bmo/" + bmoFiles[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(bmoResults[i]); } @@ -183,16 +183,16 @@ public void testWMSU3BMO() throws IOException { @Test public void testLinearSUBMO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { for (int i = 0; i < bmoFiles.length; i++) { - final MaxSATSolver solver = MaxSATSolver.linearSU(f, config); + final MaxSatSolver solver = MaxSatSolver.linearSu(f, config); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/bmo/" + bmoFiles[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(bmoResults[i]); } @@ -202,16 +202,16 @@ public void testLinearSUBMO() throws IOException { @Test public void testOLL() throws IOException { for (int i = 0; i < bmoFiles.length; i++) { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/bmo/" + bmoFiles[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(bmoResults[i]); } for (int i = 0; i < files.length; i++) { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/" + files[i]); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(results[i]); } @@ -220,9 +220,9 @@ public void testOLL() throws IOException { @Test @LongRunningTag public void testLargeOLL1() throws IOException { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/large/large_industrial.wcnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(68974); } @@ -230,9 +230,9 @@ public void testLargeOLL1() throws IOException { @Test @LongRunningTag public void testLargeOLL2() throws IOException { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/large/t3g3-5555.spn.wcnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1100610); } @@ -240,9 +240,9 @@ public void testLargeOLL2() throws IOException { @Test @LongRunningTag public void testOLLWithLargeWeights() throws IOException { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); readCnfToSolver(solver, "../test_files/partialweightedmaxsat/large/large_weights.wcnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(90912); } @@ -250,98 +250,98 @@ public void testOLLWithLargeWeights() throws IOException { @Test @LongRunningTag public void testTimeoutHandlerWBO() { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NORMAL) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.DIVERSIFY) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NORMAL) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.DIVERSIFY) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerIncWBO() { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NORMAL) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.DIVERSIFY) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NORMAL) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.DIVERSIFY) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test public void testTimeoutHandlerLinearSU() { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerWMSU3() { - final MaxSATConfig[] configs = new MaxSATConfig[3]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[2] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(false) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[3]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[2] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(false) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test @LongRunningTag public void testTimeoutHandlerWMSU3BMO() { - final MaxSATConfig[] configs = new MaxSATConfig[1]; - configs[0] = MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[1]; + configs[0] = MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test public void testTimeoutHandlerLinearSUBMO() { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).bmo(true) - .verbosity(MaxSATConfig.Verbosity.SOME).output(logStream).build(); - for (final MaxSATConfig config : configs) { - testTimeoutHandler(() -> MaxSATSolver.wbo(f, config)); + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).bmo(true) + .verbosity(MaxSatConfig.Verbosity.SOME).output(logStream).build(); + for (final MaxSatConfig config : configs) { + testTimeoutHandler(() -> MaxSatSolver.wbo(f, config)); } } @Test public void testWeightedNonClauseSoftConstraints() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[4]; - solvers[0] = MaxSATSolver.incWBO(f); - solvers[1] = MaxSATSolver.linearSU(f); - solvers[2] = MaxSATSolver.wbo(f); - solvers[3] = MaxSATSolver.wmsu3(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[4]; + solvers[0] = MaxSatSolver.incWbo(f); + solvers[1] = MaxSatSolver.linearSu(f); + solvers[2] = MaxSatSolver.wbo(f); + solvers[3] = MaxSatSolver.wmsu3(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 2); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -353,16 +353,16 @@ public void testWeightedNonClauseSoftConstraints() throws ParserException { @Test public void testWeightedSoftConstraintsCornerCaseVerum() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[4]; - solvers[0] = MaxSATSolver.incWBO(f); - solvers[1] = MaxSATSolver.linearSU(f); - solvers[2] = MaxSATSolver.wbo(f); - solvers[3] = MaxSATSolver.wmsu3(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[4]; + solvers[0] = MaxSatSolver.incWbo(f); + solvers[1] = MaxSatSolver.linearSu(f); + solvers[2] = MaxSatSolver.wbo(f); + solvers[3] = MaxSatSolver.wmsu3(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("$true"), 2); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 3); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -373,16 +373,16 @@ public void testWeightedSoftConstraintsCornerCaseVerum() throws ParserException @Test public void testWeightedSoftConstraintsCornerCaseFalsum() throws ParserException { - final MaxSATSolver[] solvers = new MaxSATSolver[4]; - solvers[0] = MaxSATSolver.incWBO(f); - solvers[1] = MaxSATSolver.linearSU(f); - solvers[2] = MaxSATSolver.wbo(f); - solvers[3] = MaxSATSolver.wmsu3(f); - for (final MaxSATSolver solver : solvers) { + final MaxSatSolver[] solvers = new MaxSatSolver[4]; + solvers[0] = MaxSatSolver.incWbo(f); + solvers[1] = MaxSatSolver.linearSu(f); + solvers[2] = MaxSatSolver.wbo(f); + solvers[3] = MaxSatSolver.wmsu3(f); + for (final MaxSatSolver solver : solvers) { solver.addHardFormula(f.parse("a & b & c")); solver.addSoftFormula(f.parse("$false"), 2); solver.addSoftFormula(f.parse("~a & ~b & ~c"), 3); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getModel().getLiterals()).containsExactlyInAnyOrder( f.variable("a"), f.variable("b"), f.variable("c") @@ -391,14 +391,14 @@ public void testWeightedSoftConstraintsCornerCaseFalsum() throws ParserException } } - private void testTimeoutHandler(final Supplier solverGenerator) { + private void testTimeoutHandler(final Supplier solverGenerator) { final TimeoutHandler handler = new TimeoutHandler(1000L); final PigeonHoleGenerator pg = new PigeonHoleGenerator(f); final Formula formula = pg.generate(10); - MaxSATSolver solver = solverGenerator.get(); + MaxSatSolver solver = solverGenerator.get(); solver.addHardFormula(formula); solver.addSoftFormula(f.or(formula.variables(f)), 10); - LNGResult result = solver.solve(handler); + LngResult result = solver.solve(handler); assertThat(result.isSuccess()).isFalse(); final TimeoutHandler handler2 = new TimeoutHandler(1000L); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSATTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSatTest.java similarity index 67% rename from core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSATTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSatTest.java index 20c346cf..3d058d92 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSATTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/PureMaxSatTest.java @@ -5,7 +5,7 @@ package com.booleworks.logicng.solvers.maxsat; import static com.booleworks.logicng.solvers.maxsat.MaxSATReader.readCnfToSolver; -import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig.Verbosity.SOME; +import static com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig.Verbosity.SOME; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -15,10 +15,10 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.solvers.MaxSATResult; -import com.booleworks.logicng.solvers.MaxSATSolver; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSAT; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; +import com.booleworks.logicng.solvers.MaxSatResult; +import com.booleworks.logicng.solvers.MaxSatSolver; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSat; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; import org.assertj.core.data.Offset; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ import java.io.IOException; import java.io.PrintStream; -public class PureMaxSATTest extends TestWithExampleFormulas { +public class PureMaxSatTest extends TestWithExampleFormulas { private static final String[] files = new String[]{ "c5315-bug-gate-0.dimacs.seq.filtered.cnf", @@ -39,14 +39,14 @@ public class PureMaxSATTest extends TestWithExampleFormulas { }; private final PrintStream logStream; - public PureMaxSATTest() throws FileNotFoundException { + public PureMaxSatTest() throws FileNotFoundException { logStream = new PrintStream("../test_files/maxsat/log.txt"); } @Test public void testExceptionalBehavior() { assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.incWBO(f); + final MaxSatSolver solver = MaxSatSolver.incWbo(f); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, -1); }).isInstanceOf(IllegalArgumentException.class) @@ -56,16 +56,16 @@ public void testExceptionalBehavior() { @Test public void testExceptionalBehaviorForLinearUS() { assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.linearUS(f); + final MaxSatSolver solver = MaxSatSolver.linearUs(f); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 3); solver.solve(); }).isInstanceOf(IllegalStateException.class) .hasMessage("Error: Currently LinearUS does not support weighted MaxSAT instances."); assertThatThrownBy(() -> { - final MaxSATSolver solver = MaxSATSolver.linearUS(f, MaxSATConfig.builder() - .incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER) + final MaxSatSolver solver = MaxSatSolver.linearUs(f, MaxSatConfig.builder() + .incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER) .build()); solver.addHardFormula(f.parse("a | b")); solver.addSoftFormula(A, 1); @@ -76,11 +76,11 @@ public void testExceptionalBehaviorForLinearUS() { @Test public void testCornerCase() throws ParserException { - final MaxSATSolver solver = MaxSATSolver.incWBO(f); + final MaxSatSolver solver = MaxSatSolver.incWbo(f); solver.addHardFormula(f.parse("a | b")); solver.addHardFormula(f.verum()); solver.addSoftFormula(A, 1); - MaxSATResult result = solver.solve(); + MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); @@ -89,22 +89,22 @@ public void testCornerCase() throws ParserException { @Test @LongRunningTag public void testWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE).symmetry(true).verbosity(SOME) + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE).symmetry(true).verbosity(SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE).symmetry(false).verbosity(SOME) + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE).symmetry(false).verbosity(SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @@ -113,22 +113,22 @@ public void testWBO() throws IOException { @Test @LongRunningTag public void testIncWBO() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE).symmetry(true).verbosity(SOME) + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE).symmetry(true).verbosity(SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.NONE).symmetry(false).verbosity(SOME) + configs[1] = MaxSatConfig.builder().weight(MaxSatConfig.WeightStrategy.NONE).symmetry(false).verbosity(SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.incWBO(f, config); + final MaxSatSolver solver = MaxSatSolver.incWbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @@ -137,22 +137,22 @@ public void testIncWBO() throws IOException { @Test @LongRunningTag public void testLinearSU() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[2]; - configs[0] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME) + final MaxSatConfig[] configs = new MaxSatConfig[2]; + configs[0] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME) .output(logStream).build(); - configs[1] = MaxSATConfig.builder().cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME) + configs[1] = MaxSatConfig.builder().cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME) .output(logStream).build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.linearSU(f, config); + final MaxSatSolver solver = MaxSatSolver.linearSu(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @@ -161,30 +161,30 @@ public void testLinearSU() throws IOException { @Test @LongRunningTag public void testLinearUS() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; + final MaxSatConfig[] configs = new MaxSatConfig[3]; configs[0] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) .build(); configs[1] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream) .build(); configs[2] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) .build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.linearUS(f, config); + final MaxSatSolver solver = MaxSatSolver.linearUs(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @@ -193,30 +193,30 @@ public void testLinearUS() throws IOException { @Test @LongRunningTag public void testMSU3() throws IOException { - final MaxSATConfig[] configs = new MaxSATConfig[3]; + final MaxSatConfig[] configs = new MaxSatConfig[3]; configs[0] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) .build(); configs[1] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.NONE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.NONE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream) .build(); configs[2] = - MaxSATConfig.builder().incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) + MaxSatConfig.builder().incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.TOTALIZER).verbosity(SOME).output(logStream) .build(); - for (final MaxSATConfig config : configs) { + for (final MaxSatConfig config : configs) { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.msu3(f, config); + final MaxSatSolver solver = MaxSatSolver.msu3(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.wbo(f, config); + final MaxSatSolver solver = MaxSatSolver.wbo(f, config); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @@ -226,41 +226,41 @@ public void testMSU3() throws IOException { @LongRunningTag public void testOLL() throws IOException { for (final String file : files) { - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); MaxSATReader.readCnfToSolver(solver, "../test_files/maxsat/" + file); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(1); } - final MaxSATSolver solver = MaxSATSolver.oll(f); + final MaxSatSolver solver = MaxSatSolver.oll(f); MaxSATReader.readCnfToSolver(solver, "../test_files/sat/9symml_gr_rcs_w6.shuffled.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(0); } @Test public void testSingle() throws IOException { - final MaxSATSolver solver = MaxSATSolver.incWBO(f, MaxSATConfig.builder() - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream).build()); + final MaxSatSolver solver = MaxSatSolver.incWbo(f, MaxSatConfig.builder() + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream).build()); readCnfToSolver(solver, "../test_files/maxsat/c-fat200-2.clq.cnf"); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(26); - final MaxSAT.Stats stats = solver.getStats(); + final MaxSat.Stats stats = solver.getStats(); assertThat(stats.bestSolution()).isEqualTo(26); assertThat(stats.unsatCalls()).isEqualTo(26); assertThat(stats.satCalls()).isEqualTo(2); assertThat(stats.averageCoreSize()).isEqualTo(35.27, Offset.offset(0.01)); assertThat(stats.symmetryClauses()).isEqualTo(45314); assertThat(stats.toString()).isEqualTo( - "MaxSAT.Stats{best solution=26, #sat calls=2, #unsat calls=26, average core size=35.27, #symmetry clauses=45314}"); + "MaxSat.Stats{best solution=26, #sat calls=2, #unsat calls=26, average core size=35.27, #symmetry clauses=45314}"); } @Test public void testAssignment() throws ParserException { - final MaxSATSolver solver = MaxSATSolver.incWBO(f, MaxSATConfig.builder() - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream).build()); + final MaxSatSolver solver = MaxSatSolver.incWbo(f, MaxSatConfig.builder() + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER).verbosity(SOME).output(logStream).build()); final PropositionalParser p = new PropositionalParser(f); solver.addHardFormula(p.parse("y")); solver.addHardFormula(p.parse("~z")); @@ -274,7 +274,7 @@ public void testAssignment() throws ParserException { solver.addSoftFormula(p.parse("a"), 1); solver.addSoftFormula(p.parse("~y"), 1); solver.addSoftFormula(p.parse("z"), 1); - final MaxSATResult result = solver.solve(); + final MaxSatResult result = solver.solve(); assertThat(result.isSatisfiable()).isTrue(); assertThat(result.getOptimum()).isEqualTo(3); final Model model = result.getModel(); @@ -288,20 +288,20 @@ public void testAssignment() throws ParserException { @Test public void testToString() { - final MaxSATSolver[] solvers = new MaxSATSolver[6]; - solvers[0] = MaxSATSolver.incWBO(f); - solvers[1] = MaxSATSolver.linearSU(f); - solvers[2] = MaxSATSolver.linearUS(f); - solvers[3] = MaxSATSolver.msu3(f); - solvers[4] = MaxSATSolver.wbo(f); - solvers[5] = MaxSATSolver.wmsu3(f); + final MaxSatSolver[] solvers = new MaxSatSolver[6]; + solvers[0] = MaxSatSolver.incWbo(f); + solvers[1] = MaxSatSolver.linearSu(f); + solvers[2] = MaxSatSolver.linearUs(f); + solvers[3] = MaxSatSolver.msu3(f); + solvers[4] = MaxSatSolver.wbo(f); + solvers[5] = MaxSatSolver.wmsu3(f); - final String expected = "MaxSATSolver{result=ComputationResult{" + - "result=MaxSATResult{satisfiable=true, optimum=1, model=Model{literals=[~a, ~b]}}, " + + final String expected = "MaxSatSolver{result=ComputationResult{" + + "result=MaxSatResult{satisfiable=true, optimum=1, model=Model{literals=[~a, ~b]}}, " + "cancelCause=null}}"; for (int i = 0; i < solvers.length; i++) { - final MaxSATSolver solver = solvers[i]; + final MaxSatSolver solver = solvers[i]; solver.addHardFormula(OR3); solver.addSoftFormula(A, 1); if (i == 2 || i == 3) { diff --git a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/encodings/EncodingsTest.java b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/encodings/EncodingsTest.java index 23861fe5..51bf1dcb 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/maxsat/encodings/EncodingsTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/maxsat/encodings/EncodingsTest.java @@ -7,20 +7,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; -import org.assertj.core.api.Assertions; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; public class EncodingsTest { @Test public void testTotalizer() { - final Totalizer totalizer = new Totalizer(MaxSATConfig.IncrementalStrategy.ITERATIVE); - assertThat(totalizer.incremental()).isEqualTo(MaxSATConfig.IncrementalStrategy.ITERATIVE); + final Totalizer totalizer = new Totalizer(MaxSatConfig.IncrementalStrategy.ITERATIVE); + assertThat(totalizer.incremental()).isEqualTo(MaxSatConfig.IncrementalStrategy.ITERATIVE); } @Test @@ -33,14 +32,14 @@ public void testModularTotalizer() { public void testSequentialWeightCounterExceptionalBehavior() { assertThatThrownBy(() -> { final SequentialWeightCounter swc = new SequentialWeightCounter(); - swc.encode(new LNGCoreSolver(FormulaFactory.caching(), SATSolverConfig.builder().build()), - new LNGIntVector(), new LNGIntVector(), Integer.MAX_VALUE); + swc.encode(new LngCoreSolver(FormulaFactory.caching(), SatSolverConfig.builder().build()), + new LngIntVector(), new LngIntVector(), Integer.MAX_VALUE); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Overflow in the encoding."); assertThatThrownBy(() -> { final SequentialWeightCounter swc = new SequentialWeightCounter(); - swc.encode(new LNGCoreSolver(FormulaFactory.caching(), SATSolverConfig.builder().build()), - new LNGIntVector(), new LNGIntVector(), Integer.MAX_VALUE, new LNGIntVector(), 1); + swc.encode(new LngCoreSolver(FormulaFactory.caching(), SatSolverConfig.builder().build()), + new LngIntVector(), new LngIntVector(), Integer.MAX_VALUE, new LngIntVector(), 1); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Overflow in the encoding."); } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/AssumeTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/AssumeTest.java index 4fc5da8a..69748054 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/AssumeTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/AssumeTest.java @@ -13,7 +13,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import java.util.Arrays; @@ -23,7 +23,7 @@ public class AssumeTest implements LogicNGTest { private final FormulaFactory f; - private final List solvers; + private final List solvers; private final PropositionalParser parser; public AssumeTest() { @@ -43,7 +43,7 @@ public void testAssume() throws ParserException { final List assumptions4 = Arrays.asList(f.literal("c", false), f.literal("d", true)); final List assumptions5 = Arrays.asList(f.literal("x", true), f.literal("x", false)); final List assumptions6 = Arrays.asList(f.literal("a", true), f.literal("a", false)); - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(parser.parse("~a")); s.add(parser.parse("b")); s.add(parser.parse("b => c")); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/ConfigurationsTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/ConfigurationsTest.java index 074603c0..8c1dcbb1 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/ConfigurationsTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/ConfigurationsTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSATConfig; +import com.booleworks.logicng.solvers.maxsat.algorithms.MaxSatConfig; import com.booleworks.logicng.util.FormulaRandomizerConfig; import org.junit.jupiter.api.Test; @@ -15,41 +15,41 @@ public class ConfigurationsTest { @Test public void testSolverConfigToString() { - final SATSolverLowLevelConfig config = SATSolverLowLevelConfig.builder() + final SatSolverLowLevelConfig config = SatSolverLowLevelConfig.builder() .varDecay(1.2) .varInc(1.3) .restartFirst(200) .restartInc(0.8) .clauseDecay(0.92) - .lbLBDMinimizingClause(3) - .lbLBDFrozenClause(25) + .lbLbdMinimizingClause(3) + .lbLbdFrozenClause(25) .lbSizeMinimizingClause(24) - .firstReduceDB(1999) - .specialIncReduceDB(999) - .incReduceDB(299) + .firstReduceDb(1999) + .specialIncReduceDb(999) + .incReduceDb(299) .factorK(0.7) .factorR(1.3) - .sizeLBDQueue(45) + .sizeLbdQueue(45) .sizeTrailQueue(4999) .reduceOnSize(true) .reduceOnSizeSize(10) .maxVarDecay(0.99) .build(); - final String expected = String.format("SATSolverLowLevelConfig{%n" + + final String expected = String.format("SatSolverLowLevelConfig{%n" + "varDecay=1.2%n" + "varInc=1.3%n" + "restartFirst=200%n" + "restartInc=0.8%n" + "clauseDecay=0.92%n" + - "lbLBDMinimizingClause=3%n" + - "lbLBDFrozenClause=25%n" + + "lbLbdMinimizingClause=3%n" + + "lbLbdFrozenClause=25%n" + "lbSizeMinimizingClause=24%n" + - "firstReduceDB=1999%n" + - "specialIncReduceDB=999%n" + - "incReduceDB=299%n" + + "firstReduceDb=1999%n" + + "specialIncReduceDb=999%n" + + "incReduceDb=299%n" + "factorK=0.7%n" + "factorR=1.3%n" + - "sizeLBDQueue=45%n" + + "sizeLbdQueue=45%n" + "sizeTrailQueue=4999%n" + "reduceOnSize=true%n" + "reduceOnSizeSize=10%n" + @@ -60,18 +60,18 @@ public void testSolverConfigToString() { @Test public void testMaxSATConfigToString() { - final MaxSATConfig config = MaxSATConfig.builder() - .cnfMethod(SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER) - .incremental(MaxSATConfig.IncrementalStrategy.ITERATIVE) - .cardinality(MaxSATConfig.CardinalityEncoding.MTOTALIZER) - .weight(MaxSATConfig.WeightStrategy.DIVERSIFY) - .verbosity(MaxSATConfig.Verbosity.SOME) + final MaxSatConfig config = MaxSatConfig.builder() + .cnfMethod(SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER) + .incremental(MaxSatConfig.IncrementalStrategy.ITERATIVE) + .cardinality(MaxSatConfig.CardinalityEncoding.MTOTALIZER) + .weight(MaxSatConfig.WeightStrategy.DIVERSIFY) + .verbosity(MaxSatConfig.Verbosity.SOME) .output(System.out) .symmetry(false) .limit(1000) .bmo(false) .build(); - final String expected = String.format("MaxSATConfig{%n" + + final String expected = String.format("MaxSatConfig{%n" + "cnfMethod=FULL_PG_ON_SOLVER%n" + "incrementalStrategy=ITERATIVE%n" + "pbEncoding=LADDER%n" + diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/IncDecTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/IncDecTest.java index 587727b4..fc2f2f69 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/IncDecTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/IncDecTest.java @@ -9,7 +9,7 @@ import com.booleworks.logicng.LogicNGTest; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.testutils.PigeonHoleGenerator; import org.junit.jupiter.params.ParameterizedTest; @@ -29,7 +29,7 @@ public static List solvers() { @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testIncDec(final SATSolver s, final String solverDescription) { + public void testIncDec(final SatSolver s, final String solverDescription) { final var f = s.getFactory(); final PigeonHoleGenerator pg = new PigeonHoleGenerator(f); s.add(f.variable("a")); @@ -57,7 +57,7 @@ public void testIncDec(final SATSolver s, final String solverDescription) { @ParameterizedTest(name = "{index} {1}") @MethodSource("solvers") - public void testIncDecDeep(final SATSolver s, final String solverDescription) { + public void testIncDecDeep(final SatSolver s, final String solverDescription) { final var f = s.getFactory(); s.add(f.variable("a")); final SolverState state1 = s.saveState(); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/LNGCoreSolverTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/LngCoreSolverTest.java similarity index 78% rename from core/src/test/java/com/booleworks/logicng/solvers/sat/LNGCoreSolverTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/sat/LngCoreSolverTest.java index 28d2acc6..42e779ce 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/LNGCoreSolverTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/LngCoreSolverTest.java @@ -6,20 +6,20 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.handlers.NopHandler; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.api.Test; import java.util.Arrays; -public class LNGCoreSolverTest { +public class LngCoreSolverTest { @Test public void testAnalyzeAssumptionConflict() { - final LNGCoreSolver solver = new LNGCoreSolver(FormulaFactory.caching(), SATSolverConfig.builder().build()); + final LngCoreSolver solver = new LngCoreSolver(FormulaFactory.caching(), SatSolverConfig.builder().build()); solver.newVar(true, true); solver.newVar(true, true); solver.newVar(true, true); @@ -34,15 +34,15 @@ public void testAnalyzeAssumptionConflict() { @Test public void testConfig() { - assertThat(SATSolverConfig.builder().build().getType().toString()).isEqualTo("SAT"); - assertThat(Arrays.asList(SATSolverConfig.ClauseMinimization.values()) - .contains(SATSolverConfig.ClauseMinimization.valueOf("DEEP"))).isTrue(); + assertThat(SatSolverConfig.builder().build().getType().toString()).isEqualTo("SAT"); + assertThat(Arrays.asList(SatSolverConfig.ClauseMinimization.values()) + .contains(SatSolverConfig.ClauseMinimization.valueOf("DEEP"))).isTrue(); } @Test public void testAssumptionChecking() throws ParserException { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A & B")); assertThat(solver.sat()).isTrue(); assertThat(solver.satCall().addFormulas(f.literal("A", true)).sat().getResult()).isTrue(); @@ -55,8 +55,8 @@ public void testAssumptionChecking() throws ParserException { assertThat(solver.sat()).isTrue(); } - private LNGIntVector clause(final int... lits) { - final LNGIntVector c = new LNGIntVector(lits.length); + private LngIntVector clause(final int... lits) { + final LngIntVector c = new LngIntVector(lits.length); for (final int l : lits) { c.push(literal(l)); } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/ModelTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/ModelTest.java index 45ecf29e..64a17ca0 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/ModelTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/ModelTest.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; import com.booleworks.logicng.solvers.functions.modelenumeration.ModelEnumerationConfig; import com.booleworks.logicng.transformations.cnf.TseitinTransformation; @@ -42,9 +42,9 @@ public static Collection solverSuppliers() { @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testNoModel(final Function solverSupplier, final String solverDescription) + public void testNoModel(final Function solverSupplier, final String solverDescription) throws ParserException { - SATSolver solver = solverSupplier.apply(f); + SatSolver solver = solverSupplier.apply(f); solver.add(f.falsum()); assertThat(solver.satCall().model(f.variables())).isNull(); solver = solverSupplier.apply(f); @@ -57,9 +57,9 @@ public void testNoModel(final Function solverSupplier @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testEmptyModel(final Function solverSupplier, + public void testEmptyModel(final Function solverSupplier, final String solverDescription) { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); solver.add(f.verum()); final Model model = solver.satCall().model(f.variables()); assertThat(model.getLiterals()).isEmpty(); @@ -69,9 +69,9 @@ public void testEmptyModel(final Function solverSuppl @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testSimpleModel(final Function solverSupplier, + public void testSimpleModel(final Function solverSupplier, final String solverDescription) { - SATSolver solver = solverSupplier.apply(f); + SatSolver solver = solverSupplier.apply(f); solver.add(f.literal("A", true)); Model model = solver.satCall().model(f.variables("A")); assertThat(model.getLiterals()).containsExactly(f.literal("A", true)); @@ -85,9 +85,9 @@ public void testSimpleModel(final Function solverSupp @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testCNFFormula(final Function solverSupplier, + public void testCNFFormula(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final Formula formula = f.parse("(A|B|C) & (~A|~B|~C) & (A|~B|~C) & (~A|~B|C)"); solver.add(formula); final Model model = solver.satCall().model(f.variables("A", "B", "C")); @@ -100,10 +100,10 @@ public void testCNFFormula(final Function solverSuppl @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testCNFWithAuxiliaryVarsRestrictedToOriginal(final Function solverSupplier, + public void testCNFWithAuxiliaryVarsRestrictedToOriginal(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final Formula formula = f.parse("(A => B & C) & (~A => C & ~D) & (C => (D & E | ~E & B)) & ~F"); final Formula cnf = formula.transform(new TseitinTransformation(solver.getFactory(), 0)); solver.add(cnf); @@ -120,10 +120,10 @@ public void testCNFWithAuxiliaryVarsRestrictedToOriginal(final Function solverSupplier, + public void testNonCNFAllVars(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final Formula formula = f.parse("(A => B & C) & (~A => C & ~D) & (C => (D & E | ~E & B)) & ~F"); solver.add(formula); final Model model = solver.satCall().model(formula.variables(f)); @@ -138,10 +138,10 @@ public void testNonCNFAllVars(final Function solverSu @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testNonCNFOnlyFormulaVars(final Function solverSupplier, + public void testNonCNFOnlyFormulaVars(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final Formula formula = f.parse("(A => B & C) & (~A => C & ~D) & (C => (D & E | ~E & B)) & ~F"); solver.add(formula); final Model model = solver.satCall().model(formula.variables(f)); @@ -157,12 +157,12 @@ public void testNonCNFOnlyFormulaVars(final Function @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testNonCNFRestrictedVars(final Function solverSupplier, + public void testNonCNFRestrictedVars(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solverForMe = solverSupplier.apply(f); + final SatSolver solverForMe = solverSupplier.apply(f); final Formula formula = f.parse("(A => B & C) & (~A => C & ~D) & (C => (D & E | ~E & B)) & ~F"); - final SATSolver verificationSolver = SATSolver.newSolver(f); + final SatSolver verificationSolver = SatSolver.newSolver(f); verificationSolver.add(formula); solverForMe.add(formula); final SortedSet relevantVariables = @@ -180,11 +180,11 @@ public void testNonCNFRestrictedVars(final Function s @ParameterizedTest(name = "{index} {1}") @MethodSource("solverSuppliers") - public void testNonCNFRestrictedAndAdditionalVars(final Function solverSupplier, + public void testNonCNFRestrictedAndAdditionalVars(final Function solverSupplier, final String solverDescription) throws ParserException { - final SATSolver solverForMe = solverSupplier.apply(f); - final SATSolver verificationSolver = SATSolver.newSolver(f); + final SatSolver solverForMe = solverSupplier.apply(f); + final SatSolver verificationSolver = SatSolver.newSolver(f); final Formula formula = f.parse("(A => B & C) & (~A => C & ~D) & (C => (D & E | ~E & B)) & ~F"); solverForMe.add(formula); verificationSolver.add(formula); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/SATTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/SATTest.java index 51458877..ab6fd5aa 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/SATTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/SATTest.java @@ -4,9 +4,9 @@ package com.booleworks.logicng.solvers.sat; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.BASIC; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.DEEP; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.NONE; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.BASIC; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.DEEP; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.NONE; import static com.booleworks.logicng.solvers.sat.SolverTestSet.SATSolverConfigParam.CLAUSE_MINIMIZATION; import static com.booleworks.logicng.solvers.sat.SolverTestSet.SATSolverConfigParam.CNF_METHOD; import static com.booleworks.logicng.solvers.sat.SolverTestSet.SATSolverConfigParam.INITIAL_PHASE; @@ -25,13 +25,13 @@ import com.booleworks.logicng.formulas.FormulaFactoryConfig; import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.NumberOfModelsHandler; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.FormulaOnSolverFunction; import com.booleworks.logicng.solvers.functions.ModelEnumerationFunction; @@ -62,8 +62,8 @@ public class SATTest extends TestWithExampleFormulas implements LogicNGTest { - private final List solvers; - private final List> solverSuppliers; + private final List solvers; + private final List> solverSuppliers; private final PigeonHoleGenerator pg; private final PropositionalParser parser; @@ -78,7 +78,7 @@ public SATTest() { @Test public void testTrue() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(TRUE); assertThat(s.satCall().model(f.variables()).size()).isEqualTo(0); } @@ -86,7 +86,7 @@ public void testTrue() { @Test public void testFalse() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(FALSE); assertThat(s.satCall().model(f.variables())).isNull(); } @@ -94,7 +94,7 @@ public void testFalse() { @Test public void testLiterals1() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(A); assertThat(s.satCall().model(List.of(A)).size()).isEqualTo(1); assertThat(s.satCall().model(List.of(A)).toAssignment().evaluateLit(A)).isTrue(); @@ -105,7 +105,7 @@ public void testLiterals1() { @Test public void testLiterals2() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(NA); assertThat(s.satCall().model(List.of(A)).size()).isEqualTo(1); assertThat(s.satCall().model(List.of(A)).toAssignment().evaluateLit(NA)).isTrue(); @@ -114,7 +114,7 @@ public void testLiterals2() { @Test public void testAnd1() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(AND1); assertThat(s.satCall().model(AND1.variables(f)).size()).isEqualTo(2); assertThat(s.satCall().model(AND1.variables(f)).toAssignment().evaluateLit(A)).isTrue(); @@ -127,7 +127,7 @@ public void testAnd1() { @Test public void testAnd2() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final StandardProposition prop = new StandardProposition( f.and(f.literal("a", true), f.literal("b", false), f.literal("c", true), f.literal("d", false))); s.add(prop); @@ -141,7 +141,7 @@ public void testAnd2() { @Test public void testAnd3() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final List formulas = new ArrayList<>(3); formulas.add(f.literal("a", true)); formulas.add(f.literal("b", false)); @@ -154,7 +154,7 @@ public void testAnd3() { @Test public void testFormula1() throws ParserException { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = parser.parse("(x => y) & (~x => y) & (y => z) & (z => ~x)"); s.add(formula); assertThat(s.satCall().model(formula.variables(f)).size()).isEqualTo(3); @@ -168,7 +168,7 @@ public void testFormula1() throws ParserException { @Test public void testFormula2() throws ParserException { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(parser.parse("(x => y) & (~x => y) & (y => z) & (z => ~x)")); final List models = s.enumerateAllModels(f.variables("x", "y", "z")); assertThat(models.size()).isEqualTo(1); @@ -183,7 +183,7 @@ public void testFormula2() throws ParserException { @Test public void testFormula3() throws ParserException { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(parser.parse("a | b")); final List models = s.execute(ModelEnumerationFunction.builder(f.variables("a", "b")) .additionalVariables(f.variable("c")) @@ -199,7 +199,7 @@ public void testFormula3() throws ParserException { @Test public void testCC1() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Variable[] lits = new Variable[100]; for (int j = 0; j < lits.length; j++) { lits[j] = f.variable("x" + j); @@ -215,7 +215,7 @@ public void testCC1() { @Test public void testPBC() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final List lits = new ArrayList<>(); final List coeffs = new ArrayList<>(); for (int i = 0; i < 5; i++) { @@ -229,7 +229,7 @@ public void testPBC() { @Test public void testPartialModel() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(A); s.add(B); s.add(C); @@ -247,8 +247,8 @@ public void testPartialModel() { public void testVariableRemovedBySimplificationOccursInModel() throws ParserException { final FormulaFactory f = FormulaFactory.caching(FormulaFactoryConfig.builder().simplifyComplementaryOperands(true).build()); - final SATSolver solver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build()); final Variable a = f.variable("A"); final Variable b = f.variable("B"); final Formula formula = f.parse("A & B => A"); @@ -262,7 +262,7 @@ public void testVariableRemovedBySimplificationOccursInModel() throws ParserExce @Test public void testUnknownVariableNotOccurringInModel() { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); final Variable a = f.variable("A"); solver.add(a); assertThat(solver.satCall().model(f.variables("A", "X")).getLiterals()).containsExactlyInAnyOrder(a, @@ -271,7 +271,7 @@ public void testUnknownVariableNotOccurringInModel() { @Test public void testRelaxationFormulas() throws ParserException { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = f.parse("a & (b | c)"); s.add(formula); assertSolverSat(s); @@ -286,7 +286,7 @@ public void testRelaxationFormulas() throws ParserException { @Test public void testPigeonHole1() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(1); s.add(formula); assertSolverUnsat(s); @@ -296,7 +296,7 @@ public void testPigeonHole1() { @Test public void testPigeonHole2() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(2); s.add(formula); assertSolverUnsat(s); @@ -307,7 +307,7 @@ public void testPigeonHole2() { @Test public void testPigeonHole3() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(3); s.add(formula); assertSolverUnsat(s); @@ -317,7 +317,7 @@ public void testPigeonHole3() { @Test public void testPigeonHole4() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(4); s.add(formula); assertSolverUnsat(s); @@ -327,7 +327,7 @@ public void testPigeonHole4() { @Test public void testPigeonHole5() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(5); s.add(formula); assertSolverUnsat(s); @@ -337,7 +337,7 @@ public void testPigeonHole5() { @Test public void testPigeonHole6() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(6); s.add(formula); assertSolverUnsat(s); @@ -348,7 +348,7 @@ public void testPigeonHole6() { @Test @LongRunningTag public void testPigeonHole7() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final Formula formula = pg.generate(7); s.add(formula); assertSolverUnsat(s); @@ -358,20 +358,20 @@ public void testPigeonHole7() { @Test public void testDifferentClauseMinimizations() { - final SATSolver[] moreSolvers = new SATSolver[6]; - moreSolvers[0] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(NONE).useAtMostClauses(false).build()); - moreSolvers[1] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(BASIC).useAtMostClauses(false).build()); - moreSolvers[2] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(DEEP).useAtMostClauses(false).build()); - moreSolvers[3] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(NONE).useAtMostClauses(true).build()); - moreSolvers[4] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(BASIC).useAtMostClauses(true).build()); - moreSolvers[5] = SATSolver.newSolver(f, - SATSolverConfig.builder().clauseMinimization(DEEP).useAtMostClauses(true).build()); - for (final SATSolver s : moreSolvers) { + final SatSolver[] moreSolvers = new SatSolver[6]; + moreSolvers[0] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(NONE).useAtMostClauses(false).build()); + moreSolvers[1] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(BASIC).useAtMostClauses(false).build()); + moreSolvers[2] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(DEEP).useAtMostClauses(false).build()); + moreSolvers[3] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(NONE).useAtMostClauses(true).build()); + moreSolvers[4] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(BASIC).useAtMostClauses(true).build()); + moreSolvers[5] = SatSolver.newSolver(f, + SatSolverConfig.builder().clauseMinimization(DEEP).useAtMostClauses(true).build()); + for (final SatSolver s : moreSolvers) { final Formula formula = pg.generate(7); s.add(formula); assertSolverUnsat(s); @@ -381,10 +381,10 @@ public void testDifferentClauseMinimizations() { @Test public void testTimeoutSATHandlerSmall() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(IMP1); final TimeoutHandler handler = new TimeoutHandler(1000L); - final LNGResult result = s.satCall().handler(handler).sat(); + final LngResult result = s.satCall().handler(handler).sat(); assertThat(result.isSuccess()).isTrue(); assertThat(result.getResult()).isTrue(); } @@ -393,10 +393,10 @@ public void testTimeoutSATHandlerSmall() { @Test @LongRunningTag public void testTimeoutSATHandlerLarge() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(pg.generate(10)); final TimeoutHandler handler = new TimeoutHandler(1000L); - final LNGResult result = s.satCall().handler(handler).sat(); + final LngResult result = s.satCall().handler(handler).sat(); assertThat(result.isSuccess()).isFalse(); } } @@ -413,9 +413,9 @@ public void testDimacsFiles() throws IOException { final File testFolder = new File("../test_files/sat"); final File[] files = testFolder.listFiles(); assert files != null; - for (final Function solverSupplier : solverSuppliers) { + for (final Function solverSupplier : solverSuppliers) { for (final File file : files) { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); final String fileName = file.getName(); if (fileName.endsWith(".cnf")) { readCNF(solver, file); @@ -426,7 +426,7 @@ public void testDimacsFiles() throws IOException { } } - private void readCNF(final SATSolver solver, final File file) throws IOException { + private void readCNF(final SatSolver solver, final File file) throws IOException { final BufferedReader reader = new BufferedReader(new FileReader(file)); while (reader.ready()) { final String line = reader.readLine(); @@ -458,12 +458,12 @@ private void readCNF(final SATSolver solver, final File file) throws IOException @Test @LongRunningTag public void testTimeoutModelEnumerationHandlerWithUNSATInstance() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final Formula formula = pg.generate(10); solver.add(formula); final var handler = new TimeoutHandler(1000L); final var me = meWithHandler(formula.variables(f)); - final LNGResult> models = solver.execute(me, handler); + final LngResult> models = solver.execute(me, handler); assertThat(models.isSuccess()).isFalse(); } } @@ -471,7 +471,7 @@ public void testTimeoutModelEnumerationHandlerWithUNSATInstance() { @Test @LongRunningTag public void testTimeoutModelEnumerationHandlerWithSATInstance1() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final List variables = new ArrayList<>(); for (int i = 0; i < 1000; i++) { variables.add(f.variable("x" + i)); @@ -480,14 +480,14 @@ public void testTimeoutModelEnumerationHandlerWithSATInstance1() { solver.add(f.exo(variables)); final var handler = new TimeoutHandler(50L); final var me = meWithHandler(variables); - final LNGResult> result = solver.execute(me, handler); + final LngResult> result = solver.execute(me, handler); assertThat(result.isSuccess()).isFalse(); } } @Test public void testTimeoutModelEnumerationHandlerWithSATInstance2() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final List variables = new ArrayList<>(); for (int i = 0; i < 1000; i++) { variables.add(f.variable("x" + i)); @@ -496,7 +496,7 @@ public void testTimeoutModelEnumerationHandlerWithSATInstance2() { solver.add(f.exo(variables.subList(0, 5))); final var handler = new TimeoutHandler(50L); final var me = meWithHandler(variables.subList(0, 5)); - final LNGResult> models = solver.execute(me, handler); + final LngResult> models = solver.execute(me, handler); assertThat(models.isSuccess()).isTrue(); assertThat(models.getResult()).hasSize(5); } @@ -504,7 +504,7 @@ public void testTimeoutModelEnumerationHandlerWithSATInstance2() { @Test public void testModelEnumeration() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final SortedSet lits = new TreeSet<>(); final SortedSet firstFive = new TreeSet<>(); for (int j = 0; j < 20; j++) { @@ -533,7 +533,7 @@ public void testModelEnumeration() { @Test public void testModelEnumerationWithHandler01() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final SortedSet lits = new TreeSet<>(); final SortedSet firstFive = new TreeSet<>(); for (int j = 0; j < 20; j++) { @@ -550,7 +550,7 @@ public void testModelEnumerationWithHandler01() { .additionalVariables(lits) .configuration(ModelEnumerationConfig.builder().strategy(defaultMeStrategy).build()) .build(); - final LNGResult> modelsWithHandler = s.execute(me, handler); + final LngResult> modelsWithHandler = s.execute(me, handler); assertThat(modelsWithHandler.isSuccess()).isFalse(); assertThat(modelsWithHandler.isPartial()).isTrue(); final List partialResult = modelsWithHandler.getPartialResult(); @@ -566,7 +566,7 @@ public void testModelEnumerationWithHandler01() { @Test public void testModelEnumerationWithHandler02() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { final SortedSet lits = new TreeSet<>(); final SortedSet firstFive = new TreeSet<>(); for (int j = 0; j < 20; j++) { @@ -583,7 +583,7 @@ public void testModelEnumerationWithHandler02() { .additionalVariables(firstFive) .configuration(ModelEnumerationConfig.builder().strategy(defaultMeStrategy).build()) .build(); - final LNGResult> modelsWithHandler = s.execute(me, handler); + final LngResult> modelsWithHandler = s.execute(me, handler); assertThat(modelsWithHandler.isSuccess()).isFalse(); assertThat(modelsWithHandler.isPartial()).isTrue(); assertThat(modelsWithHandler.getPartialResult()).hasSize(29); @@ -598,7 +598,7 @@ public void testModelEnumerationWithHandler02() { @Test public void testEmptyEnumeration() { - for (final SATSolver s : solvers) { + for (final SatSolver s : solvers) { s.add(f.falsum()); final List models = s.enumerateAllModels(List.of()); assertThat(models.isEmpty()).isTrue(); @@ -607,19 +607,19 @@ public void testEmptyEnumeration() { @Test public void testNumberOfModelHandler() { - for (final Function solverSupplier : solverSuppliers) { + for (final Function solverSupplier : solverSuppliers) { final Variable[] lits = new Variable[100]; for (int j = 0; j < lits.length; j++) { lits[j] = f.variable("x" + j); } - SATSolver s = solverSupplier.apply(f); + SatSolver s = solverSupplier.apply(f); s.add(f.exo(lits)); var handler = new NumberOfModelsHandler(101); var me = ModelEnumerationFunction.builder(lits) .configuration(ModelEnumerationConfig.builder().strategy(defaultMeStrategy).build()) .build(); - LNGResult> models = s.execute(me, handler); + LngResult> models = s.execute(me, handler); assertThat(models.isSuccess()).isTrue(); assertThat(models.getResult().size()).isEqualTo(100); for (final Model m : models.getResult()) { @@ -673,10 +673,10 @@ public void testNumberOfModelHandler() { public void testKnownVariables() throws ParserException { final PropositionalParser parser = new PropositionalParser(f); final Formula phi = parser.parse("x1 & x2 & x3 & (x4 | ~x5)"); - final SATSolver solverWithoutAtMost = - SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(false).build()); - final SATSolver solverWithAtMost = - SATSolver.newSolver(f, SATSolverConfig.builder().useAtMostClauses(true).build()); + final SatSolver solverWithoutAtMost = + SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(false).build()); + final SatSolver solverWithAtMost = + SatSolver.newSolver(f, SatSolverConfig.builder().useAtMostClauses(true).build()); solverWithoutAtMost.add(phi); solverWithAtMost.add(phi); final SortedSet expected = new TreeSet<>(Arrays.asList( @@ -712,7 +712,7 @@ public void testKnownVariables() throws ParserException { @Test public void testUPZeroLiteralsUNSAT() throws ParserException { final Formula formula = parser.parse("a & (a => b) & (b => c) & (c => ~a)"); - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(formula); final SortedSet upLiterals = solver.execute(UpZeroLiteralsFunction.get()); assertThat(upLiterals).isEmpty(); @@ -735,9 +735,9 @@ public void testUPZeroLiterals() throws ParserException { new TreeSet<>(Collections.singletonList(f.literal("b", false)))); expectedSubsets.put(parser.parse("(b | c) & ~b & (~c | d)"), new TreeSet<>(Arrays.asList( f.literal("b", false), f.literal("c", true), f.literal("d", true)))); - for (final Function solverSupplier : solverSuppliers) { + for (final Function solverSupplier : solverSuppliers) { for (final Formula formula : expectedSubsets.keySet()) { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); solver.add(formula); final boolean res = solver.sat(); assertThat(res).isTrue(); @@ -753,11 +753,11 @@ public void testUPZeroLiteralsDimacsFiles() throws IOException { final File testFolder = new File("../test_files/sat"); final File[] files = testFolder.listFiles(); assert files != null; - for (final Function solverSupplier : solverSuppliers) { + for (final Function solverSupplier : solverSuppliers) { for (final File file : files) { final String fileName = file.getName(); if (fileName.endsWith(".cnf")) { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); readCNF(solver, file); if (solver.sat()) { final SortedSet upZeroLiterals = solver.execute(UpZeroLiteralsFunction.get()); @@ -778,7 +778,7 @@ public void testUPZeroLiteralsDimacsFiles() throws IOException { @Test public void testFormulaOnSolver1() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final PropositionalParser p = new PropositionalParser(f); final Set formulas = new LinkedHashSet<>(); formulas.add(p.parse("A | B | C")); @@ -793,7 +793,7 @@ public void testFormulaOnSolver1() throws ParserException { @Test public void testFormulaOnSolver2() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final PropositionalParser p = new PropositionalParser(f); final Set formulas = new LinkedHashSet<>(); formulas.add(p.parse("A | B | C")); @@ -811,7 +811,7 @@ public void testFormulaOnSolver2() throws ParserException { @Test public void testFormulaOnSolverWithContradiction1() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.variable("A")); solver.add(f.variable("B")); solver.add(f.parse("C & (~A | ~B)")); @@ -822,7 +822,7 @@ public void testFormulaOnSolverWithContradiction1() throws ParserException { @Test public void testFormulaOnSolverWithContradiction2() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { solver.add(f.parse("A <=> B")); solver.add(f.parse("B <=> ~A")); assertThat(solver.execute(FormulaOnSolverFunction.get())) @@ -840,7 +840,7 @@ public void testFormulaOnSolverWithContradiction2() throws ParserException { @Test public void testSelectionOrderSimple01() throws ParserException { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final Formula formula = parser.parse("~(x <=> y)"); solver.add(formula); @@ -872,7 +872,7 @@ public void testSelectionOrderSimple01() throws ParserException { @Test public void testSelectionOrderSimple02() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final List literals = new ArrayList<>(); for (int i = 0; i < 5; i++) { final Variable lit = f.variable("x" + i); @@ -892,7 +892,7 @@ public void testSelectionOrderSimple02() { @Test public void testSelectionOrderSimple03() { - for (final SATSolver solver : solvers) { + for (final SatSolver solver : solvers) { final List literals = new ArrayList<>(); for (int i = 0; i < 5; i++) { final Variable lit = f.variable("x" + i); @@ -926,11 +926,11 @@ public void testDimacsFilesWithSelectionOrder() throws IOException { final File testFolder = new File("../test_files/sat"); final File[] files = testFolder.listFiles(); assert files != null; - for (final Function solverSupplier : solverSuppliers) { + for (final Function solverSupplier : solverSuppliers) { for (final File file : files) { final String fileName = file.getName(); if (fileName.endsWith(".cnf")) { - final SATSolver solver = solverSupplier.apply(f); + final SatSolver solver = solverSupplier.apply(f); readCNF(solver, file); final List selectionOrder = new ArrayList<>(); for (final Variable var : variables(f, solver.execute(FormulaOnSolverFunction.get()))) { @@ -953,7 +953,7 @@ public void testDimacsFilesWithSelectionOrder() throws IOException { @Test public void testModelEnumerationWithAdditionalVariables() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); solver.add(f.parse("A | B | C | D | E")); final List models = solver.execute(ModelEnumerationFunction.builder(f.variables("A", "B")) .additionalVariables(f.variables("C", "D")).build()); @@ -981,16 +981,16 @@ private void compareFormulas(final Collection original, final Collectio for (final Formula formula : original) { vars.addAll(formula.variables(f)); } - final SATSolver solver1 = SATSolver.newSolver(f); + final SatSolver solver1 = SatSolver.newSolver(f); solver1.add(original); final List models1 = solver1.enumerateAllModels(vars); - final SATSolver solver2 = SATSolver.newSolver(f); + final SatSolver solver2 = SatSolver.newSolver(f); solver2.add(fromSolver); final List models2 = solver2.enumerateAllModels(vars); assertThat(models1).hasSameElementsAs(models2); } - private void testLocalMinimum(final SATSolver solver, final Model model, + private void testLocalMinimum(final SatSolver solver, final Model model, final Collection relevantLiterals) { final Set literals = new HashSet<>(model.getLiterals()); for (final Literal lit : relevantLiterals) { @@ -1010,7 +1010,7 @@ private void testLocalMinimum(final SATSolver solver, final Model model, * @param model the satisfying model * @param order the literals order */ - private void testHighestLexicographicalModel(final SATSolver solver, final Model model, + private void testHighestLexicographicalModel(final SatSolver solver, final Model model, final List order) { final Set literals = new HashSet<>(model.getLiterals()); final List orderSublist = new ArrayList<>(); diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/SATCallTest.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/SatCallTest.java similarity index 92% rename from core/src/test/java/com/booleworks/logicng/solvers/sat/SATCallTest.java rename to core/src/test/java/com/booleworks/logicng/solvers/sat/SatCallTest.java index c33ba23e..cd479240 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/SATCallTest.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/SatCallTest.java @@ -10,12 +10,12 @@ import com.booleworks.logicng.formulas.implementation.cached.CachingFormulaFactory; import com.booleworks.logicng.handlers.ComputationHandler; import com.booleworks.logicng.handlers.TimeoutHandler; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.handlers.events.SimpleEvent; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; import com.booleworks.logicng.solvers.functions.FormulaOnSolverFunction; import org.junit.jupiter.api.Test; @@ -24,16 +24,16 @@ import java.util.List; import java.util.Set; -public class SATCallTest { +public class SatCallTest { final CachingFormulaFactory f = FormulaFactory.caching(); @Test public void testIllegalOperationsOnOpenSatCall() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); - final SATCall openCall = solver.satCall().solve(); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); + final SatCall openCall = solver.satCall().solve(); - final SATCallBuilder newCallBuilder = solver.satCall().handler(new TimeoutHandler(1000)) + final SatCallBuilder newCallBuilder = solver.satCall().handler(new TimeoutHandler(1000)) .addFormulas(f.variable("a")).selectionOrder(List.of(f.variable("a"))); assertThat(newCallBuilder).isNotNull(); @@ -67,7 +67,7 @@ public void testIllegalOperationsOnOpenSatCall() throws ParserException { @Test public void testDirectSatMethod() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().build()); solver.add(f.parse("a | b")); solver.add(f.parse("c & (~c | ~a)")); assertThat(solver.satCall().sat().getResult()).isTrue(); @@ -77,7 +77,7 @@ public void testDirectSatMethod() throws ParserException { @Test public void testDirectModelMethod() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().build()); solver.add(f.parse("a | b")); solver.add(f.parse("c & (~c | ~a)")); final Set abc = Set.of(f.variable("a"), f.variable("b"), f.variable("c")); @@ -94,7 +94,7 @@ public void testDirectModelMethod() throws ParserException { @Test public void testDirectUnsatCoreMethod() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); solver.add(f.parse("a | b")); solver.add(f.parse("c & (~c | ~a)")); assertThat(solver.satCall().addFormulas(f.literal("b", false)).unsatCore().getPropositions()) @@ -123,17 +123,17 @@ public void testDirectUnsatCoreMethod() throws ParserException { @Test public void testDisallowNullVariablesInModel() { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().build()); assertThatThrownBy(() -> solver.satCall().model(null)).isInstanceOf(IllegalArgumentException.class) .hasMessage("The given variables must not be null."); } @Test public void testHandler() throws IOException, ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); solver.add(FormulaReader.readFormula(f, "../test_files/formulas/small_formulas.txt")); - try (final SATCall satCall = solver.satCall().handler(new MaxConflictsHandler(0)).solve()) { + try (final SatCall satCall = solver.satCall().handler(new MaxConflictsHandler(0)).solve()) { assertThat(satCall.getSatResult().isSuccess()).isFalse(); assertThat(satCall.model(solver.getUnderlyingSolver().knownVariables())).isNull(); assertThat(satCall.unsatCore()).isNull(); @@ -145,7 +145,7 @@ public void testHandler() throws IOException, ParserException { .isNull(); assertThat(solver.satCall().handler(new MaxConflictsHandler(0)).unsatCore()).isNull(); - try (final SATCall satCall = solver.satCall().handler(new MaxConflictsHandler(100)).solve()) { + try (final SatCall satCall = solver.satCall().handler(new MaxConflictsHandler(100)).solve()) { assertThat(satCall.getSatResult().getResult()).isTrue(); assertThat(satCall.model(solver.getUnderlyingSolver().knownVariables())).isNotNull(); assertThat(satCall.unsatCore()).isNull(); @@ -154,7 +154,7 @@ public void testHandler() throws IOException, ParserException { @Test public void testSelectionOrder() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().proofGeneration(true).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().proofGeneration(true).build()); solver.add(f.parse("a | b | c | d")); solver.add(f.parse("~a | ~b")); solver.add(f.parse("~c | ~d")); @@ -177,8 +177,8 @@ public void testSelectionOrder() throws ParserException { @Test public void testAdditionalFormulasAndPropositions() throws ParserException { - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder() - .cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF).proofGeneration(true).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder() + .cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF).proofGeneration(true).build()); solver.add(f.parse("a | b | c | d")); solver.add(new StandardProposition(f.parse("a => b"))); solver.add(new StandardProposition(f.parse("c => d"))); @@ -249,7 +249,7 @@ public MaxConflictsHandler(final int maxConflicts) { } @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == SimpleEvent.SAT_CONFLICT_DETECTED) { canceled = numConflicts++ > maxConflicts; } diff --git a/core/src/test/java/com/booleworks/logicng/solvers/sat/SolverTestSet.java b/core/src/test/java/com/booleworks/logicng/solvers/sat/SolverTestSet.java index 0761cc22..8110a9a2 100644 --- a/core/src/test/java/com/booleworks/logicng/solvers/sat/SolverTestSet.java +++ b/core/src/test/java/com/booleworks/logicng/solvers/sat/SolverTestSet.java @@ -1,14 +1,14 @@ package com.booleworks.logicng.solvers.sat; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod.FACTORY_CNF; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod.PG_ON_SOLVER; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.BASIC; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.DEEP; -import static com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization.NONE; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.BASIC; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.DEEP; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization.NONE; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod.FACTORY_CNF; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER; +import static com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod.PG_ON_SOLVER; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.params.provider.Arguments; import java.util.ArrayList; @@ -31,52 +31,52 @@ static List solverSupplierTestSetForParameterizedTests(final Collecti .collect(Collectors.toList()); } - static List solverTestSet(final Collection variance, final FormulaFactory f) { + static List solverTestSet(final Collection variance, final FormulaFactory f) { return solverSupplierTestSet(variance).stream().map(s -> s.apply(f)).collect(Collectors.toList()); } - static List> solverSupplierTestSet( + static List> solverSupplierTestSet( final Collection variance) { - List currentList = List.of(SATSolverConfig.builder().build()); + List currentList = List.of(SatSolverConfig.builder().build()); if (variance.contains(SATSolverConfigParam.PROOF_GENERATION)) { currentList = currentList.stream().flatMap(config -> Stream.of( - SATSolverConfig.copy(config).proofGeneration(false).build(), - SATSolverConfig.copy(config).proofGeneration(true).build() + SatSolverConfig.copy(config).proofGeneration(false).build(), + SatSolverConfig.copy(config).proofGeneration(true).build() )).collect(Collectors.toList()); } if (variance.contains(SATSolverConfigParam.USE_AT_MOST_CLAUSES)) { currentList = currentList.stream().flatMap(config -> Stream.of( - SATSolverConfig.copy(config).useAtMostClauses(false).build(), - SATSolverConfig.copy(config).useAtMostClauses(true).build() + SatSolverConfig.copy(config).useAtMostClauses(false).build(), + SatSolverConfig.copy(config).useAtMostClauses(true).build() )).collect(Collectors.toList()); } if (variance.contains(SATSolverConfigParam.CNF_METHOD)) { currentList = currentList.stream().flatMap(config -> Stream.of( - SATSolverConfig.copy(config).cnfMethod(FACTORY_CNF).build(), - SATSolverConfig.copy(config).cnfMethod(PG_ON_SOLVER).build(), - SATSolverConfig.copy(config).cnfMethod(FULL_PG_ON_SOLVER).build() + SatSolverConfig.copy(config).cnfMethod(FACTORY_CNF).build(), + SatSolverConfig.copy(config).cnfMethod(PG_ON_SOLVER).build(), + SatSolverConfig.copy(config).cnfMethod(FULL_PG_ON_SOLVER).build() )).collect(Collectors.toList()); } if (variance.contains(SATSolverConfigParam.INITIAL_PHASE)) { currentList = currentList.stream().flatMap(config -> Stream.of( - SATSolverConfig.copy(config).initialPhase(false).build(), - SATSolverConfig.copy(config).initialPhase(true).build() + SatSolverConfig.copy(config).initialPhase(false).build(), + SatSolverConfig.copy(config).initialPhase(true).build() )).collect(Collectors.toList()); } if (variance.contains(SATSolverConfigParam.CLAUSE_MINIMIZATION)) { currentList = currentList.stream().flatMap(config -> Stream.of( - SATSolverConfig.copy(config).clauseMinimization(NONE).build(), - SATSolverConfig.copy(config).clauseMinimization(BASIC).build(), - SATSolverConfig.copy(config).clauseMinimization(DEEP).build() + SatSolverConfig.copy(config).clauseMinimization(NONE).build(), + SatSolverConfig.copy(config).clauseMinimization(BASIC).build(), + SatSolverConfig.copy(config).clauseMinimization(DEEP).build() )).collect(Collectors.toList()); } return currentList.stream() - .map(config -> (Function) f -> SATSolver.newSolver(f, config)) + .map(config -> (Function) f -> SatSolver.newSolver(f, config)) .collect(Collectors.toList()); } - static String solverDescription(final SATSolver s, final Collection variance) { - final SATSolverConfig config = s.getConfig(); + static String solverDescription(final SatSolver s, final Collection variance) { + final SatSolverConfig config = s.getConfig(); final List elements = new ArrayList<>(); if (variance.contains(SATSolverConfigParam.PROOF_GENERATION)) { elements.add((config.isProofGeneration() ? "+" : "-") + "PROOF"); diff --git a/core/src/test/java/com/booleworks/logicng/testutils/NQueensGenerator.java b/core/src/test/java/com/booleworks/logicng/testutils/NQueensGenerator.java index c6ec2546..ca211c7a 100644 --- a/core/src/test/java/com/booleworks/logicng/testutils/NQueensGenerator.java +++ b/core/src/test/java/com/booleworks/logicng/testutils/NQueensGenerator.java @@ -24,7 +24,7 @@ public class NQueensGenerator { public NQueensGenerator(final FormulaFactory f) { this.f = f; - this.f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AMO_ENCODER.PURE).build()); + this.f.putConfiguration(EncoderConfig.builder().amoEncoding(EncoderConfig.AmoEncoder.PURE).build()); } public Formula generate(final int n) { diff --git a/core/src/test/java/com/booleworks/logicng/testutils/TestUtil.java b/core/src/test/java/com/booleworks/logicng/testutils/TestUtil.java index 406dc095..f2e5d959 100644 --- a/core/src/test/java/com/booleworks/logicng/testutils/TestUtil.java +++ b/core/src/test/java/com/booleworks/logicng/testutils/TestUtil.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.datastructures.Model; import com.booleworks.logicng.formulas.Formula; import com.booleworks.logicng.formulas.Variable; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import java.math.BigInteger; import java.util.Collections; @@ -30,10 +30,10 @@ public final class TestUtil { * projected to the given set of variables, otherwise {@code false} */ public static boolean equivalentModels(final Formula f1, final Formula f2, final SortedSet vars) { - final SATSolver s1 = SATSolver.newSolver(f1.getFactory()); + final SatSolver s1 = SatSolver.newSolver(f1.getFactory()); s1.add(f1); final List models1 = s1.enumerateAllModels(vars); - final SATSolver s2 = SATSolver.newSolver(f2.getFactory()); + final SatSolver s2 = SatSolver.newSolver(f2.getFactory()); s2.add(f2); final List models2 = s2.enumerateAllModels(vars); if (models1.size() != models2.size()) { diff --git a/core/src/test/java/com/booleworks/logicng/transformations/AIGTest.java b/core/src/test/java/com/booleworks/logicng/transformations/AIGTest.java index 813170f8..e6284398 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/AIGTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/AIGTest.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.predicates.AIGPredicate; +import com.booleworks.logicng.predicates.AigPredicate; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -19,9 +19,9 @@ public class AIGTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testConstants(final FormulaContext _c) { - final AIGPredicate aigPred = new AIGPredicate(_c.f); + final AigPredicate aigPred = new AigPredicate(_c.f); - final AIGTransformation aigCaching = new AIGTransformation(_c.f); + final AigTransformation aigCaching = new AigTransformation(_c.f); assertThat(_c.verum.transform(aigCaching)).isEqualTo(_c.verum); assertThat(_c.falsum.transform(aigCaching)).isEqualTo(_c.falsum); @@ -32,8 +32,8 @@ public void testConstants(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final AIGPredicate aigPred = new AIGPredicate(_c.f); - final AIGTransformation aigCaching = new AIGTransformation(_c.f); + final AigPredicate aigPred = new AigPredicate(_c.f); + final AigTransformation aigCaching = new AigTransformation(_c.f); assertThat(_c.a.transform(aigCaching)).isEqualTo(_c.a); assertThat(_c.na.transform(aigCaching)).isEqualTo(_c.na); @@ -44,9 +44,9 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testBinaryOperators(final FormulaContext _c) throws ParserException { - final AIGPredicate aigPred = new AIGPredicate(_c.f); - final AIGTransformation aigCaching = new AIGTransformation(_c.f); - final AIGTransformation aigNonCaching = new AIGTransformation(_c.f, null); + final AigPredicate aigPred = new AigPredicate(_c.f); + final AigTransformation aigCaching = new AigTransformation(_c.f); + final AigTransformation aigNonCaching = new AigTransformation(_c.f, null); assertThat(_c.imp1.transform(aigCaching)).isEqualTo(_c.p.parse("~(a & ~b)")); assertThat(_c.imp2.transform(aigCaching)).isEqualTo(_c.p.parse("~(~a & b)")); @@ -72,9 +72,9 @@ public void testBinaryOperators(final FormulaContext _c) throws ParserException @ParameterizedTest @MethodSource("contexts") public void testNAryOperators(final FormulaContext _c) throws ParserException { - final AIGPredicate aigPred = new AIGPredicate(_c.f); - final AIGTransformation aigCaching = new AIGTransformation(_c.f); - final AIGTransformation aigNonCaching = new AIGTransformation(_c.f, null); + final AigPredicate aigPred = new AigPredicate(_c.f); + final AigTransformation aigCaching = new AigTransformation(_c.f); + final AigTransformation aigNonCaching = new AigTransformation(_c.f, null); assertThat(_c.and1.transform(aigCaching)).isEqualTo(_c.and1); assertThat(_c.or1.transform(aigCaching)).isEqualTo(_c.p.parse("~(~x & ~y)")); @@ -105,8 +105,8 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testNot(final FormulaContext _c) throws ParserException { - final AIGTransformation aigCaching = new AIGTransformation(_c.f); - final AIGTransformation aigNonCaching = new AIGTransformation(_c.f, null); + final AigTransformation aigCaching = new AigTransformation(_c.f); + final AigTransformation aigNonCaching = new AigTransformation(_c.f, null); assertThat(_c.p.parse("~a").transform(aigCaching)).isEqualTo(_c.p.parse("~a")); assertThat(_c.p.parse("~~a").transform(aigCaching)).isEqualTo(_c.p.parse("a")); @@ -130,9 +130,9 @@ public void testNot(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testPBC(final FormulaContext _c) { - final AIGPredicate aigPred = new AIGPredicate(_c.f); - final AIGTransformation aigCaching = new AIGTransformation(_c.f); - final AIGTransformation aigNonCaching = new AIGTransformation(_c.f, null); + final AigPredicate aigPred = new AigPredicate(_c.f); + final AigTransformation aigCaching = new AigTransformation(_c.f); + final AigTransformation aigNonCaching = new AigTransformation(_c.f, null); assertThat(_c.pbc1.transform(aigCaching).holds(aigPred)).isTrue(); assertThat(_c.pbc1.transform(aigNonCaching).holds(aigPred)).isTrue(); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/PureExpansionTransformationTest.java b/core/src/test/java/com/booleworks/logicng/transformations/PureExpansionTransformationTest.java index 456134af..d9cf489c 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/PureExpansionTransformationTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/PureExpansionTransformationTest.java @@ -14,7 +14,7 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Not; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.modelcounting.ModelCounter; @@ -145,7 +145,7 @@ public void testCornerCases(final FormulaContext _c) { final FormulaCornerCases cornerCases = new FormulaCornerCases(_c.f); for (final Formula formula : cornerCases.cornerCases()) { if (formula.getType() == FType.PBC) { - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; if (!pbc.isAmo() && !pbc.isExo()) { assertThatThrownBy( () -> ModelCounter.count(_c.f, Collections.singletonList(formula), formula.variables(_c.f))) diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/BDDCNFTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/BDDCNFTest.java index e2e41bce..1f65c0b4 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/BDDCNFTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/BDDCNFTest.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; import com.booleworks.logicng.testutils.TestUtil; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -20,7 +20,7 @@ public class BDDCNFTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testConstants(final FormulaContext _c) { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); assertThat(_c.verum.transform(bddcnf)).isEqualTo(_c.verum); assertThat(_c.falsum.transform(bddcnf)).isEqualTo(_c.falsum); @@ -29,7 +29,7 @@ public void testConstants(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); assertThat(_c.a.transform(bddcnf)).isEqualTo(_c.a); assertThat(_c.na.transform(bddcnf)).isEqualTo(_c.na); @@ -38,27 +38,27 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testBinaryOperators(final FormulaContext _c) { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); - assertThat(_c.imp1.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.imp1.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.imp1, _c.imp1.transform(bddcnf), _c.imp1.variables(_c.f))) .isTrue(); - assertThat(_c.imp2.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.imp2.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.imp2, _c.imp2.transform(bddcnf), _c.imp2.variables(_c.f))) .isTrue(); - assertThat(_c.imp3.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.imp3.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.imp3, _c.imp3.transform(bddcnf), _c.imp3.variables(_c.f))) .isTrue(); - assertThat(_c.eq1.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.eq1.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.eq1, _c.eq1.transform(bddcnf), _c.eq1.variables(_c.f))) .isTrue(); - assertThat(_c.eq2.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.eq2.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.eq2, _c.eq2.transform(bddcnf), _c.eq2.variables(_c.f))) .isTrue(); - assertThat(_c.eq3.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.eq3.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.eq3, _c.eq3.transform(bddcnf), _c.eq3.variables(_c.f))) .isTrue(); - assertThat(_c.eq4.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(_c.eq4.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(_c.eq4, _c.eq4.transform(bddcnf), _c.eq4.variables(_c.f))) .isTrue(); } @@ -66,63 +66,63 @@ public void testBinaryOperators(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testNAryOperators(final FormulaContext _c) throws ParserException { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); assertThat(_c.and1.transform(bddcnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bddcnf)).isEqualTo(_c.or1); final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); final Formula f2 = _c.p.parse("~(a & b) | c | ~(x | ~y)"); final Formula f3 = _c.p.parse("a | b | (~x & ~y)"); - assertThat(f1.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f1, f1.transform(bddcnf), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f2, f2.transform(bddcnf), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f3, f3.transform(bddcnf), f3.variables(_c.f))).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testNAryOperatorsWithExternalFactory(final FormulaContext _c) throws ParserException { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); - final BDDCNFTransformation transformation = new BDDCNFTransformation(_c.f, new BDDKernel(_c.f, 7, 100, 1000)); + final BddCnfTransformation transformation = new BddCnfTransformation(_c.f, new BddKernel(_c.f, 7, 100, 1000)); assertThat(_c.and1.transform(bddcnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bddcnf)).isEqualTo(_c.or1); final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); final Formula f2 = _c.p.parse("~(a & b) | c | ~(x | ~y)"); final Formula f3 = _c.p.parse("a | b | (~x & ~y)"); - assertThat(f1.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f1, f1.transform(transformation), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f2, f2.transform(transformation), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f3, f3.transform(transformation), f3.variables(_c.f))).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testNAryOperatorsWithExternalFactory2(final FormulaContext _c) throws ParserException { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); - final BDDCNFTransformation transformation = new BDDCNFTransformation(_c.f, new BDDKernel(_c.f, 7, 50, 50)); + final BddCnfTransformation transformation = new BddCnfTransformation(_c.f, new BddKernel(_c.f, 7, 50, 50)); assertThat(_c.and1.transform(bddcnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bddcnf)).isEqualTo(_c.or1); final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); final Formula f2 = _c.p.parse("~(a & b) | c | ~(x | ~y)"); final Formula f3 = _c.p.parse("a | b | (~x & ~y)"); - assertThat(f1.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f1, f1.transform(transformation), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f2, f2.transform(transformation), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(transformation).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(transformation).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f3, f3.transform(transformation), f3.variables(_c.f))).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testNot(final FormulaContext _c) throws ParserException { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); assertThat(_c.p.parse("~a").transform(bddcnf)).isEqualTo(_c.p.parse("~a")); assertThat(_c.p.parse("~~a").transform(bddcnf)).isEqualTo(_c.p.parse("a")); @@ -132,36 +132,36 @@ public void testNot(final FormulaContext _c) throws ParserException { final Formula f3 = _c.p.parse("~(~(a | b) <=> ~(x | y))"); final Formula f4 = _c.p.parse("~(a & b & ~x & ~y)"); final Formula f5 = _c.p.parse("~(a | b | ~x | ~y)"); - assertThat(f1.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f1, f1.transform(bddcnf), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f2, f2.transform(bddcnf), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f3, f3.transform(bddcnf), f3.variables(_c.f))).isTrue(); - assertThat(f4.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f4, f4.transform(bddcnf), f4.variables(_c.f))).isTrue(); - assertThat(f5.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f5, f5.transform(bddcnf), f5.variables(_c.f))).isTrue(); - assertThat(f5.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f5, f5.transform(bddcnf), f5.variables(_c.f))).isTrue(); } @ParameterizedTest @MethodSource("contexts") public void testCC(final FormulaContext _c) throws ParserException { - final BDDCNFTransformation bddcnf = new BDDCNFTransformation(_c.f); + final BddCnfTransformation bddcnf = new BddCnfTransformation(_c.f); final Formula f1 = _c.p.parse("a <=> (1 * b <= 0)"); final Formula f2 = _c.p.parse("~(1 * b <= 1)"); final Formula f3 = _c.p.parse("(1 * b + 1 * c + 1 * d <= 1)"); final Formula f4 = _c.p.parse("~(1 * b + 1 * c + 1 * d <= 1)"); - assertThat(f1.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f1, f1.transform(bddcnf), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f2, f2.transform(bddcnf), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f3, f3.transform(bddcnf), f3.variables(_c.f))).isTrue(); - assertThat(f4.transform(bddcnf).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(bddcnf).isCnf(_c.f)).isTrue(); assertThat(TestUtil.equivalentModels(f4, f4.transform(bddcnf), f4.variables(_c.f))).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFTest.java index 21058758..e5830b15 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFTest.java @@ -12,9 +12,9 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.FactorizationCreatedClauseEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.io.parsers.ParserException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -28,7 +28,7 @@ public class CNFTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testConstants(final FormulaContext _c) { - final CNFFactorization cnf = new CNFFactorization(_c.f); + final CnfFactorization cnf = new CnfFactorization(_c.f); assertThat(_c.verum.transform(cnf, handler).getResult()).isEqualTo(_c.verum); assertThat(_c.falsum.transform(cnf, handler).getResult()).isEqualTo(_c.falsum); @@ -37,7 +37,7 @@ public void testConstants(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final CNFFactorization cnf = new CNFFactorization(_c.f); + final CnfFactorization cnf = new CnfFactorization(_c.f); assertThat(_c.a.transform(cnf, handler).getResult()).isEqualTo(_c.a); assertThat(_c.na.transform(cnf, handler).getResult()).isEqualTo(_c.na); @@ -46,26 +46,26 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testBinaryOperators(final FormulaContext _c) throws ParserException { - final CNFFactorization cnf = new CNFFactorization(_c.f); + final CnfFactorization cnf = new CnfFactorization(_c.f); assertThat(_c.imp1.transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("~a | b")); assertThat(_c.imp2.transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("a | ~b")); assertThat(_c.imp3.transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("~a | ~b | x | y")); assertThat(_c.eq1.transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("(a | ~b) & (~a | b)")); assertThat(_c.eq2.transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("(~a | b) & (a | ~b)")); - assertThat(_c.imp1.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.imp2.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.imp3.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.eq1.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.eq1.transform(cnf, handler).getResult().isDNF(_c.f)).isFalse(); - assertThat(_c.eq2.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.eq2.transform(cnf, handler).getResult().isDNF(_c.f)).isFalse(); + assertThat(_c.imp1.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.imp2.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.imp3.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.eq1.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.eq1.transform(cnf, handler).getResult().isDnf(_c.f)).isFalse(); + assertThat(_c.eq2.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.eq2.transform(cnf, handler).getResult().isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testNAryOperators(final FormulaContext _c) throws ParserException { - final CNFFactorization cnf = new CNFFactorization(_c.f); + final CnfFactorization cnf = new CnfFactorization(_c.f); assertThat(_c.and1.transform(cnf, handler).getResult()).isEqualTo(_c.and1); assertThat(_c.or1.transform(cnf, handler).getResult()).isEqualTo(_c.or1); @@ -76,29 +76,29 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { .isEqualTo(_c.p.parse("(~a | ~b | c | ~x) & (~a | ~b | c | y)")); assertThat(_c.p.parse("a | b | (~x & ~y)").transform(cnf, handler).getResult()) .isEqualTo(_c.p.parse("(a | b | ~x) & (a | b | ~y)")); - assertThat(_c.and1.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); - assertThat(_c.or1.transform(cnf, handler).getResult().isCNF(_c.f)).isTrue(); + assertThat(_c.and1.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); + assertThat(_c.or1.transform(cnf, handler).getResult().isCnf(_c.f)).isTrue(); assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(cnf, handler) - .getResult().isCNF(_c.f)).isTrue(); + .getResult().isCnf(_c.f)).isTrue(); assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(cnf, handler) - .getResult().isDNF(_c.f)).isFalse(); + .getResult().isDnf(_c.f)).isFalse(); assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(cnf, handler) - .getResult().isCNF(_c.f)).isTrue(); + .getResult().isCnf(_c.f)).isTrue(); assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(cnf, handler) - .getResult().isDNF(_c.f)).isFalse(); + .getResult().isDnf(_c.f)).isFalse(); assertThat(_c.p.parse("a | b | (~x & ~y)").transform(cnf, handler) - .getResult().isCNF(_c.f)).isTrue(); + .getResult().isCnf(_c.f)).isTrue(); assertThat(_c.p.parse("a | b | (~x & ~y)").transform(cnf, handler) - .getResult().isDNF(_c.f)).isFalse(); + .getResult().isDnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testNot(final FormulaContext _c) throws ParserException { - final CNFFactorization cnf = new CNFFactorization(_c.f); + final CnfFactorization cnf = new CnfFactorization(_c.f); final TestFactorizationHandler handler2 = new TestFactorizationHandler(); - final CNFFactorization cnf2 = new CNFFactorization(_c.f, new HashMap<>()); + final CnfFactorization cnf2 = new CnfFactorization(_c.f, new HashMap<>()); assertThat(_c.p.parse("~a2").transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("~a2")); assertThat(_c.p.parse("~~a2").transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("a2")); assertThat(_c.p.parse("~(a2 => b2)").transform(cnf, handler).getResult()).isEqualTo(_c.p.parse("a2 & ~b2")); @@ -144,7 +144,7 @@ public void testWithHandler(final FormulaContext _c) throws ParserException { private int clauses = 0; @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == FACTORIZATION_STARTED) { canceled = false; dists = 0; @@ -159,8 +159,8 @@ public boolean shouldResume(final LNGEvent event) { return !canceled; } }; - final CNFFactorization factorization = new CNFFactorization(_c.f, null); - LNGResult cnf = factorization.apply(formula, handler); + final CnfFactorization factorization = new CnfFactorization(_c.f, null); + LngResult cnf = factorization.apply(formula, handler); assertThat(cnf.isSuccess()).isFalse(); formula = _c.p.parse("~(a | b)"); @@ -175,7 +175,7 @@ private static class TestFactorizationHandler implements ComputationHandler { private long longestClause = 0; @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == FACTORIZATION_STARTED) { distCount = 0; clauseCount = 0; diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumerationTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumerationTest.java similarity index 83% rename from core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumerationTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumerationTest.java index a6defbca..a2741577 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCNFEnumerationTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CanonicalCnfEnumerationTest.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.predicates.CNFPredicate; +import com.booleworks.logicng.predicates.CnfPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaRandomizer; @@ -20,28 +20,28 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class CanonicalCNFEnumerationTest extends TestWithFormulaContext { +public class CanonicalCnfEnumerationTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testSamples(final FormulaContext _c) throws ParserException { - assertThat(_c.f.falsum().transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("$false")); - assertThat(_c.f.verum().transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("$true")); - assertThat(_c.f.parse("a").transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("a")); - assertThat(_c.f.parse("~a").transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("~a")); - assertThat(_c.f.parse("~a & b").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.falsum().transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("$false")); + assertThat(_c.f.verum().transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("$true")); + assertThat(_c.f.parse("a").transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("a")); + assertThat(_c.f.parse("~a").transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("~a")); + assertThat(_c.f.parse("~a & b").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("(~a | b) & (~a | ~b) & (a | b)")); - assertThat(_c.f.parse("~a | b").transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("~a | b")); - assertThat(_c.f.parse("a => b").transform(new CanonicalCNFEnumeration(_c.f))).isEqualTo(_c.f.parse("~a | b")); - assertThat(_c.f.parse("a <=> b").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.parse("~a | b").transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("~a | b")); + assertThat(_c.f.parse("a => b").transform(new CanonicalCnfEnumeration(_c.f))).isEqualTo(_c.f.parse("~a | b")); + assertThat(_c.f.parse("a <=> b").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("(~a | b) & (a | ~b)")); - assertThat(_c.f.parse("a + b = 1").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.parse("a + b = 1").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("(a | b) & (~a | ~b)")); - assertThat(_c.f.parse("a & (b | ~c)").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.parse("a & (b | ~c)").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("(a | b | c) & (a | b | ~c) & (a | ~b | c) & (a | ~b | ~c) & (~a | b | ~c)")); - assertThat(_c.f.parse("a & b & (~a | ~b)").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.parse("a & b & (~a | ~b)").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("(a | b) & (~a | b) & (~a | ~b) & (a | ~b)")); - assertThat(_c.f.parse("a | b | ~a & ~b").transform(new CanonicalCNFEnumeration(_c.f))) + assertThat(_c.f.parse("a | b | ~a & ~b").transform(new CanonicalCnfEnumeration(_c.f))) .isEqualTo(_c.f.parse("$true")); } @@ -68,8 +68,8 @@ public void random(final FormulaContext _c) { private void test(final Formula formula) { final FormulaFactory f = formula.getFactory(); - final Formula cnf = new CanonicalCNFEnumeration(f).apply(formula); - assertThat(cnf.holds(new CNFPredicate(f))).isTrue(); + final Formula cnf = new CanonicalCnfEnumeration(f).apply(formula); + assertThat(cnf.holds(new CnfPredicate(f))).isTrue(); assertThat(f.equivalence(formula, cnf).holds(new TautologyPredicate(f))).isTrue(); if (formula.holds(new TautologyPredicate(f))) { assertThat(cnf).isEqualTo(f.verum()); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFEncoderTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfEncoderTest.java similarity index 80% rename from core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFEncoderTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfEncoderTest.java index 9d15d125..3600fcd6 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFEncoderTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfEncoderTest.java @@ -16,7 +16,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class CNFEncoderTest extends TestWithFormulaContext { +public class CnfEncoderTest extends TestWithFormulaContext { private static final String p1 = "(x1 | x2) & x3 & x4 & ((x1 & x5 & ~(x6 | x7) | x8) | x9)"; private static final String p2 = "(y1 | y2) & y3 & y4 & ((y1 & y5 & ~(y6 | y7) | y8) | y9)"; @@ -29,14 +29,14 @@ public void testFactorization(final FormulaContext _c) throws ParserException { assertThat(phi1.numberOfAtoms(_c.f)).isEqualTo(10); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - _c.f.putConfiguration(CNFConfig.builder().build()); + _c.f.putConfiguration(CnfConfig.builder().build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.FACTORIZATION).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.FACTORIZATION).build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - final CNFConfig config = CNFConfig.builder().algorithm(CNFConfig.Algorithm.FACTORIZATION).build(); - assertThat(CNFEncoder.encode(_c.f, phi1, config)) + final CnfConfig config = CnfConfig.builder().algorithm(CnfConfig.Algorithm.FACTORIZATION).build(); + assertThat(CnfEncoder.encode(_c.f, phi1, config)) .isEqualTo(_c.p.parse( "(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); } @@ -46,17 +46,17 @@ public void testFactorization(final FormulaContext _c) throws ParserException { public void testTseitin(final FormulaContext _c) throws ParserException { final Formula phi1 = _c.p.parse(p1); final Formula phi2 = _c.p.parse(p2); - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).atomBoundary(8).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).atomBoundary(8).build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "(@AUX_%1$s_CNF_0 | ~x1) & (@AUX_%1$s_CNF_0 | ~x2) & (~@AUX_%1$s_CNF_0 | x1 | x2) & (~@AUX_%1$s_CNF_1 | x1) & (~@AUX_%1$s_CNF_1 | x5) & " + "(~@AUX_%1$s_CNF_1 | ~x6) & (~@AUX_%1$s_CNF_1 | ~x7) & (@AUX_%1$s_CNF_1 | ~x1 | ~x5 | x6 | x7) & (@AUX_%1$s_CNF_2 | ~@AUX_%1$s_CNF_1)" + " & (@AUX_%1$s_CNF_2 | ~x8) & (@AUX_%1$s_CNF_2 | ~x9) & (~@AUX_%1$s_CNF_2 | @AUX_%1$s_CNF_1 | x8 | x9) & @AUX_%1$s_CNF_0 & x3 & x4 & " + "@AUX_%1$s_CNF_2", _c.f.getName()))); - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).atomBoundary(11).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).atomBoundary(11).build()); assertThat(phi2.cnf(_c.f)).isEqualTo(_c.p .parse("(y1 | y2) & y3 & y4 & (y1 | y8 | y9) & (y5 | y8 | y9) & (~y6 | y8 | y9) & (~y7 | y8 | y9)")); } @@ -66,17 +66,17 @@ public void testTseitin(final FormulaContext _c) throws ParserException { public void testPG(final FormulaContext _c) throws ParserException { final Formula phi1 = _c.p.parse(p1); final Formula phi2 = _c.p.parse(p2); - _c.f.putConfiguration(CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); _c.f.putConfiguration( - CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(8).build()); + CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(8).build()); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "@AUX_%1$s_CNF_1 & x3 & x4 & @AUX_%1$s_CNF_2 & (~@AUX_%1$s_CNF_1 | x1 | x2) & (~@AUX_%1$s_CNF_2 | @AUX_%1$s_CNF_3 | x8 | x9) & " + "(~@AUX_%1$s_CNF_3 | x1) & (~@AUX_%1$s_CNF_3 | x5) & (~@AUX_%1$s_CNF_3 | ~x6) & (~@AUX_%1$s_CNF_3 | ~x7)" , _c.f.getName()))); _c.f.putConfiguration( - CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(11).build()); + CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(11).build()); assertThat(phi2.cnf(_c.f)).isEqualTo(_c.p .parse("(y1 | y2) & y3 & y4 & (y1 | y8 | y9) & (y5 | y8 | y9) & (~y6 | y8 | y9) & (~y7 | y8 | y9)")); } @@ -89,13 +89,13 @@ public void testAdvanced(final FormulaContext _c) throws ParserException { final Formula phi3 = _c.p.parse(p3); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - _c.f.putConfiguration(CNFConfig.builder().createdClauseBoundary(5).atomBoundary(3).build()); + _c.f.putConfiguration(CnfConfig.builder().createdClauseBoundary(5).atomBoundary(3).build()); assertThat(phi2.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "(y1 | y2) & y3 & y4 & (~@AUX_%1$s_CNF_0 | y1) & (~@AUX_%1$s_CNF_0 | y5) & (~@AUX_%1$s_CNF_0 | ~y6) & (~@AUX_%1$s_CNF_0 | ~y7) & " + "(@AUX_%1$s_CNF_0 | ~y1 | ~y5 | y6 | y7) & (@AUX_%1$s_CNF_0 | y8 | y9)", _c.f.getName()))); _c.f.putConfiguration( - CNFConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3).build()); + CnfConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3).build()); assertThat(phi3.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "(z1 | z2) & z3 & z4 & (~@AUX_%1$s_CNF_2 | z1) & (~@AUX_%1$s_CNF_2 | z5) & (~@AUX_%1$s_CNF_2 | ~z6) & (~@AUX_%1$s_CNF_2 | ~z7) & " + "(@AUX_%1$s_CNF_2 | ~z1 | ~z5 | z6 | z7) & (@AUX_%1$s_CNF_2 | z8 | z9)", @@ -110,14 +110,14 @@ public void testAdvancedWithPGFallback(final FormulaContext _c) throws ParserExc final Formula phi3 = _c.p.parse(p3); assertThat(phi1.cnf(_c.f)).isEqualTo(_c.p .parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - _c.f.putConfiguration(CNFConfig.builder().createdClauseBoundary(5).atomBoundary(3) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().createdClauseBoundary(5).atomBoundary(3) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); assertThat(phi2.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "(y1 | y2) & y3 & y4 & (@AUX_%1$s_CNF_1 | y8 | y9) & (~@AUX_%1$s_CNF_1 | y1) & (~@AUX_%1$s_CNF_1 | y5) & (~@AUX_%1$s_CNF_1 | ~y6) & " + "(~@AUX_%1$s_CNF_1 | ~y7)", _c.f.getName()))); - _c.f.putConfiguration(CNFConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build()); + _c.f.putConfiguration(CnfConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build()); assertThat(phi3.cnf(_c.f)).isEqualTo(_c.p.parse(String.format( "(z1 | z2) & z3 & z4 & (@AUX_%1$s_CNF_3 | z8 | z9) & (~@AUX_%1$s_CNF_3 | z1) & (~@AUX_%1$s_CNF_3 | z5) & (~@AUX_%1$s_CNF_3 | ~z6) & " + "(~@AUX_%1$s_CNF_3 | ~z7)", @@ -128,12 +128,12 @@ public void testAdvancedWithPGFallback(final FormulaContext _c) throws ParserExc @MethodSource("contexts") public void testTseitinEncoder(final FormulaContext _c) throws ParserException { final Formula phi1 = _c.p.parse(p1); - final CNFConfig config1 = CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).build(); - assertThat(CNFEncoder.encode(_c.f, phi1, config1)) + final CnfConfig config1 = CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).build(); + assertThat(CnfEncoder.encode(_c.f, phi1, config1)) .isEqualTo(_c.p.parse( "(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - final CNFConfig config2 = CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).atomBoundary(8).build(); - assertThat(CNFEncoder.encode(_c.f, phi1, config2)).isEqualTo( + final CnfConfig config2 = CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).atomBoundary(8).build(); + assertThat(CnfEncoder.encode(_c.f, phi1, config2)).isEqualTo( _c.p.parse(String.format("(@AUX_%1$s_CNF_0 | ~x1) & (@AUX_%1$s_CNF_0 | ~x2) & (~@AUX_%1$s_CNF_0 | x1 | x2) & " + "(~@AUX_%1$s_CNF_1 | x1) & (~@AUX_%1$s_CNF_1 | x5) & (~@AUX_%1$s_CNF_1 | ~x6) & (~@AUX_%1$s_CNF_1 | ~x7) & (@AUX_%1$s_CNF_1 | ~x1 | " + "~x5 | x6 | x7) & " + @@ -146,13 +146,13 @@ public void testTseitinEncoder(final FormulaContext _c) throws ParserException { @MethodSource("contexts") public void testPGEncoder(final FormulaContext _c) throws ParserException { final Formula phi1 = _c.p.parse(p1); - final CNFConfig config1 = CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build(); - assertThat(CNFEncoder.encode(_c.f, phi1, config1)) + final CnfConfig config1 = CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build(); + assertThat(CnfEncoder.encode(_c.f, phi1, config1)) .isEqualTo(_c.p.parse( "(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 | x9)")); - final CNFConfig config2 = - CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(8).build(); - assertThat(CNFEncoder.encode(_c.f, phi1, config2)) + final CnfConfig config2 = + CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(8).build(); + assertThat(CnfEncoder.encode(_c.f, phi1, config2)) .isEqualTo(_c.p.parse(String.format("@AUX_%1$s_CNF_1 & x3 & x4 & @AUX_%1$s_CNF_2 & (~@AUX_%1$s_CNF_1 | x1 | x2) & " + "(~@AUX_%1$s_CNF_2 | @AUX_%1$s_CNF_3 | x8 | x9) & (~@AUX_%1$s_CNF_3 | x1) & (~@AUX_%1$s_CNF_3 | x5) & (~@AUX_%1$s_CNF_3 | " + "~x6) & (~@AUX_%1$s_CNF_3 | ~x7)", @@ -165,15 +165,15 @@ public void testBDDEncoder(final FormulaContext _c) throws ParserException { final Formula phi1 = _c.p.parse(p1); final Formula phi2 = _c.p.parse(p2); final Formula phi3 = _c.p.parse(p3); - final CNFConfig config = CNFConfig.builder().algorithm(CNFConfig.Algorithm.BDD).build(); - final Formula phi1CNF = CNFEncoder.encode(_c.f, phi1, config); - assertThat(phi1CNF.isCNF(_c.f)).isTrue(); + final CnfConfig config = CnfConfig.builder().algorithm(CnfConfig.Algorithm.BDD).build(); + final Formula phi1CNF = CnfEncoder.encode(_c.f, phi1, config); + assertThat(phi1CNF.isCnf(_c.f)).isTrue(); assertThat(equivalentModels(phi1, phi1CNF, phi1.variables(_c.f))).isTrue(); - final Formula phi2CNF = CNFEncoder.encode(_c.f, phi2, config); - assertThat(phi2CNF.isCNF(_c.f)).isTrue(); + final Formula phi2CNF = CnfEncoder.encode(_c.f, phi2, config); + assertThat(phi2CNF.isCnf(_c.f)).isTrue(); assertThat(equivalentModels(phi2, phi2CNF, phi2.variables(_c.f))).isTrue(); - final Formula phi3CNF = CNFEncoder.encode(_c.f, phi3, config); - assertThat(phi3CNF.isCNF(_c.f)).isTrue(); + final Formula phi3CNF = CnfEncoder.encode(_c.f, phi3, config); + assertThat(phi3CNF.isCnf(_c.f)).isTrue(); assertThat(equivalentModels(phi3, phi3CNF, phi3.variables(_c.f))).isTrue(); } @@ -183,17 +183,17 @@ public void testAdvancedEncoder(final FormulaContext _c) throws ParserException final Formula phi1 = _c.p.parse(p1); final Formula phi2 = _c.p.parse(p2); final Formula phi3 = _c.p.parse(p3); - assertThat(CNFEncoder.encode(_c.f, phi1)).isEqualTo( + assertThat(CnfEncoder.encode(_c.f, phi1)).isEqualTo( _c.p.parse("(x1 | x2) & x3 & x4 & (x1 | x8 | x9) & (x5 | x8 | x9) & (~x6 | x8 | x9) & (~x7 | x8 |" + " x9)")); - final CNFConfig config1 = CNFConfig.builder().createdClauseBoundary(5).atomBoundary(3).build(); - assertThat(CNFEncoder.encode(_c.f, phi2, config1)) + final CnfConfig config1 = CnfConfig.builder().createdClauseBoundary(5).atomBoundary(3).build(); + assertThat(CnfEncoder.encode(_c.f, phi2, config1)) .isEqualTo(_c.p.parse(String.format("(y1 | y2) & y3 & y4 & (~@AUX_%1$s_CNF_0 | y1) & (~@AUX_%1$s_CNF_0 | y5) & " + "(~@AUX_%1$s_CNF_0 | ~y6) & (~@AUX_%1$s_CNF_0 | ~y7) & (@AUX_%1$s_CNF_0 | ~y1 | ~y5 | y6 | y7) & (@AUX_%1$s_CNF_0 | y8 | y9)", _c.f.getName()))); - final CNFConfig config2 = - CNFConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3).build(); - assertThat(CNFEncoder.encode(_c.f, phi3, config2)) + final CnfConfig config2 = + CnfConfig.builder().createdClauseBoundary(-1).distributionBoundary(5).atomBoundary(3).build(); + assertThat(CnfEncoder.encode(_c.f, phi3, config2)) .isEqualTo(_c.p.parse(String.format("(z1 | z2) & z3 & z4 & (~@AUX_%1$s_CNF_2 | z1) & (~@AUX_%1$s_CNF_2 | z5) & " + "(~@AUX_%1$s_CNF_2 | ~z6) & (~@AUX_%1$s_CNF_2 | ~z7) & (@AUX_%1$s_CNF_2 | ~z1 | ~z5 | z6 | z7) & (@AUX_%1$s_CNF_2 | z8 | z9)", _c.f.getName()))); @@ -219,23 +219,23 @@ public void testBugIssueNo4(final FormulaContext _c) throws ParserException { @Test public void testStrings() { - final String expected = String.format("CNFConfig{%n" + + final String expected = String.format("CnfConfig{%n" + "algorithm=TSEITIN%n" + "fallbackAlgorithmForAdvancedEncoding=PLAISTED_GREENBAUM%n" + "distributedBoundary=-1%n" + "createdClauseBoundary=1000%n" + "atomBoundary=12%n" + "}%n"); - final CNFConfig config = CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build(); + final CnfConfig config = CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build(); assertThat(config.toString()).isEqualTo(expected); - assertThat(CNFConfig.Algorithm.valueOf("TSEITIN")).isEqualTo(CNFConfig.Algorithm.TSEITIN); + assertThat(CnfConfig.Algorithm.valueOf("TSEITIN")).isEqualTo(CnfConfig.Algorithm.TSEITIN); } @Test public void testWrongFallbackForConfig() { - assertThatThrownBy(() -> CNFConfig.builder() - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.FACTORIZATION).build()) + assertThatThrownBy(() -> CnfConfig.builder() + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.FACTORIZATION).build()) .isInstanceOf(IllegalArgumentException.class); } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfMethodComparisonTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfMethodComparisonTest.java index 5213c2f0..c6870d65 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfMethodComparisonTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfMethodComparisonTest.java @@ -13,9 +13,9 @@ import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -33,43 +33,43 @@ public class CnfMethodComparisonTest { public static Collection cnfConfigurations() { final List configs = new ArrayList<>(); configs.add(new Object[]{ - CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(12).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); + CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(12).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); configs.add(new Object[]{ - CNFConfig.builder().algorithm(CNFConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(0).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); - configs.add(new Object[]{CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).atomBoundary(0).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); - configs.add(new Object[]{CNFConfig.builder().algorithm(CNFConfig.Algorithm.TSEITIN).atomBoundary(12).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); - configs.add(new Object[]{CNFConfig.builder() - .algorithm(CNFConfig.Algorithm.ADVANCED) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.PLAISTED_GREENBAUM).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); - configs.add(new Object[]{CNFConfig.builder() - .algorithm(CNFConfig.Algorithm.ADVANCED) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.TSEITIN).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF}); - configs.add(new Object[]{CNFConfig.builder().build(), - SATSolverConfig.CNFMethod.PG_ON_SOLVER}); - configs.add(new Object[]{CNFConfig.builder().build(), - SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER}); + CnfConfig.builder().algorithm(CnfConfig.Algorithm.PLAISTED_GREENBAUM).atomBoundary(0).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); + configs.add(new Object[]{CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).atomBoundary(0).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); + configs.add(new Object[]{CnfConfig.builder().algorithm(CnfConfig.Algorithm.TSEITIN).atomBoundary(12).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); + configs.add(new Object[]{CnfConfig.builder() + .algorithm(CnfConfig.Algorithm.ADVANCED) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.PLAISTED_GREENBAUM).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); + configs.add(new Object[]{CnfConfig.builder() + .algorithm(CnfConfig.Algorithm.ADVANCED) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.TSEITIN).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF}); + configs.add(new Object[]{CnfConfig.builder().build(), + SatSolverConfig.CnfMethod.PG_ON_SOLVER}); + configs.add(new Object[]{CnfConfig.builder().build(), + SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER}); return configs; } @ParameterizedTest @MethodSource("cnfConfigurations") @LongRunningTag - public void compareFullBackbonesOnLargeFormulas(final CNFConfig cnfConfig, - final SATSolverConfig.CNFMethod cnfMethod) + public void compareFullBackbonesOnLargeFormulas(final CnfConfig cnfConfig, + final SatSolverConfig.CnfMethod cnfMethod) throws IOException, ParserException { final String baseDir = "../test_files/formulas/"; final List fileNames = Arrays.asList("formula1.txt", "formula2.txt", "formula3.txt", "large_formula.txt", "small_formulas.txt"); for (final String fileName : fileNames) { final String filePath = baseDir + fileName; - final Backbone backboneReference = computeBackbone(filePath, CNFConfig.builder().build(), - SATSolverConfig.builder().build().getCnfMethod()); + final Backbone backboneReference = computeBackbone(filePath, CnfConfig.builder().build(), + SatSolverConfig.builder().build().getCnfMethod()); final Backbone backbone = computeBackbone(filePath, cnfConfig, cnfMethod); assertThat(backboneReference).isEqualTo(backbone); } @@ -83,38 +83,38 @@ public void compareBackbonesForVariablesOnLargeFormulas() throws IOException, Pa compareBackbonePerVariable("../test_files/formulas/small_formulas.txt"); } - private Backbone computeBackbone(final String fileName, final CNFConfig cnfConfig, - final SATSolverConfig.CNFMethod cnfMethod) + private Backbone computeBackbone(final String fileName, final CnfConfig cnfConfig, + final SatSolverConfig.CnfMethod cnfMethod) throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); f.putConfiguration(cnfConfig); final Formula formula = FormulaReader.readFormula(f, fileName); - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().cnfMethod(cnfMethod).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().cnfMethod(cnfMethod).build()); solver.add(formula); return solver.backbone(formula.variables(f)); } private void compareBackbonePerVariable(final String fileName) throws IOException, ParserException { final Map backboneFactory = computeBackbonePerVariable(fileName, - CNFConfig.builder().algorithm(CNFConfig.Algorithm.ADVANCED) - .fallbackAlgorithmForAdvancedEncoding(CNFConfig.Algorithm.TSEITIN).build(), - SATSolverConfig.CNFMethod.FACTORY_CNF); - final Map backbonePg = computeBackbonePerVariable(fileName, CNFConfig.builder().build(), - SATSolverConfig.CNFMethod.PG_ON_SOLVER); - final Map backboneFullPg = computeBackbonePerVariable(fileName, CNFConfig.builder().build(), - SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER); + CnfConfig.builder().algorithm(CnfConfig.Algorithm.ADVANCED) + .fallbackAlgorithmForAdvancedEncoding(CnfConfig.Algorithm.TSEITIN).build(), + SatSolverConfig.CnfMethod.FACTORY_CNF); + final Map backbonePg = computeBackbonePerVariable(fileName, CnfConfig.builder().build(), + SatSolverConfig.CnfMethod.PG_ON_SOLVER); + final Map backboneFullPg = computeBackbonePerVariable(fileName, CnfConfig.builder().build(), + SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER); assertThat(backboneFactory).isEqualTo(backbonePg); assertThat(backboneFactory).isEqualTo(backboneFullPg); } - private Map computeBackbonePerVariable(final String fileName, final CNFConfig cnfConfig, - final SATSolverConfig.CNFMethod cnfMethod) + private Map computeBackbonePerVariable(final String fileName, final CnfConfig cnfConfig, + final SatSolverConfig.CnfMethod cnfMethod) throws IOException, ParserException { // final long start = System.currentTimeMillis(); final FormulaFactory f = FormulaFactory.caching(); f.putConfiguration(cnfConfig); final Formula formula = FormulaReader.readFormula(f, fileName); - final SATSolver solver = SATSolver.newSolver(f, SATSolverConfig.builder().cnfMethod(cnfMethod).build()); + final SatSolver solver = SatSolver.newSolver(f, SatSolverConfig.builder().cnfMethod(cnfMethod).build()); solver.add(formula); final SolverState solverState = solver.saveState(); final Map result = new TreeMap<>(); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFSubsumptionTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfSubsumptionTest.java similarity index 91% rename from core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFSubsumptionTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfSubsumptionTest.java index 9ff029b9..1d8dae5e 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/CNFSubsumptionTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/CnfSubsumptionTest.java @@ -22,12 +22,12 @@ import java.io.IOException; -public class CNFSubsumptionTest extends TestWithFormulaContext { +public class CnfSubsumptionTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testSimpleCNFSubsumption(final FormulaContext _c) throws ParserException { - final CNFSubsumption s = new CNFSubsumption(_c.f); + final CnfSubsumption s = new CnfSubsumption(_c.f); assertThat(s.apply(_c.p.parse("$false"))).isEqualTo(_c.p.parse("$false")); assertThat(s.apply(_c.p.parse("$true"))).isEqualTo(_c.p.parse("$true")); assertThat(s.apply(_c.p.parse("a"))).isEqualTo(_c.p.parse("a")); @@ -46,7 +46,7 @@ public void testSimpleCNFSubsumption(final FormulaContext _c) throws ParserExcep @ParameterizedTest @MethodSource("contexts") public void testLargeCNFSubsumption(final FormulaContext _c) throws ParserException { - final CNFSubsumption s = new CNFSubsumption(_c.f); + final CnfSubsumption s = new CnfSubsumption(_c.f); assertThat(s.apply(_c.p.parse("(a | b | c | d) & (a | b | c | e) & (a | b | c)"))) .isEqualTo(_c.p.parse("(a | b | c)")); Assertions @@ -66,7 +66,7 @@ public void testLargeCNFSubsumption(final FormulaContext _c) throws ParserExcept @Test public void testNotInCNF() { final FormulaFactory f = FormulaFactory.caching(); - final CNFSubsumption s = new CNFSubsumption(f); + final CnfSubsumption s = new CnfSubsumption(f); assertThatThrownBy(() -> s.apply(f.parse("a => b"))).isInstanceOf(IllegalArgumentException.class); } @@ -76,8 +76,8 @@ public void testEvenLargerFormula() throws IOException, ParserException { final FormulaFactory f = FormulaFactory.caching(); final Formula formula = FormulaReader.readFormula(f, "../test_files/formulas/large_formula.txt"); - final Formula cnf = formula.transform(new CNFFactorization(f)); - final Formula subsumed = cnf.transform(new CNFSubsumption(f)); + final Formula cnf = formula.transform(new CnfFactorization(f)); + final Formula subsumed = cnf.transform(new CnfSubsumption(f)); assertThat(f.equivalence(cnf, subsumed).holds(new TautologyPredicate(f))).isTrue(); assertThat(cnf.numberOfOperands() > subsumed.numberOfOperands()).isTrue(); } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTest.java index 099a69ee..a9cbf4c7 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTest.java @@ -41,19 +41,19 @@ public void testLiterals(final FormulaContext _c) { public void testBinaryOperators(final FormulaContext _c) { final PlaistedGreenbaumTransformation pg = new PlaistedGreenbaumTransformation(_c.f, 0); - assertThat(_c.imp1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.imp1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp1, _c.imp1.transform(pg), _c.imp1.variables(_c.f))).isTrue(); - assertThat(_c.imp2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.imp2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp2, _c.imp2.transform(pg), _c.imp2.variables(_c.f))).isTrue(); - assertThat(_c.imp3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.imp3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp3, _c.imp3.transform(pg), _c.imp3.variables(_c.f))).isTrue(); - assertThat(_c.eq1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.eq1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq1, _c.eq1.transform(pg), _c.eq1.variables(_c.f))).isTrue(); - assertThat(_c.eq2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.eq2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq2, _c.eq2.transform(pg), _c.eq2.variables(_c.f))).isTrue(); - assertThat(_c.eq3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.eq3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq3, _c.eq3.transform(pg), _c.eq3.variables(_c.f))).isTrue(); - assertThat(_c.eq4.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(_c.eq4.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq4, _c.eq4.transform(pg), _c.eq4.variables(_c.f))).isTrue(); } @@ -67,11 +67,11 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { final Formula f1 = _c.p.parse("(a & b & x) | (c & d & ~y)"); final Formula f2 = _c.p.parse("(a & b & x) | (c & d & ~y) | (~z | (c & d & ~y)) "); final Formula f3 = _c.p.parse("a | b | (~x & ~y)"); - assertThat(f1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(pg), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(pg), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(pg), f3.variables(_c.f))).isTrue(); } @@ -89,21 +89,21 @@ public void testNotNary(final FormulaContext _c) throws ParserException { final Formula f4 = _c.p.parse("~(a & b & ~x & ~y)"); final Formula f5 = _c.p.parse("~(a | b | ~x | ~y)"); final Formula f6 = _c.p.parse("~(a & b) & (c | (a & b))"); - assertThat(f0.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f0.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f0, f0.transform(pg), f0.variables(_c.f))).isTrue(); - assertThat(f1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(pg), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(pg), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(pg), f3.variables(_c.f))).isTrue(); - assertThat(f4.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f4, f4.transform(pg), f4.variables(_c.f))).isTrue(); - assertThat(f5.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f5, f5.transform(pg), f5.variables(_c.f))).isTrue(); - assertThat(f5.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f5, f5.transform(pg), f5.variables(_c.f))).isTrue(); - assertThat(f6.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f6.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f6, f6.transform(pg), f6.variables(_c.f))).isTrue(); } @@ -117,11 +117,11 @@ public void testNotBinary(final FormulaContext _c) throws ParserException { final Formula f1 = _c.p.parse("~(~(a | b) => ~(x | y))"); final Formula f2 = _c.p.parse("~(a <=> b)"); final Formula f3 = _c.p.parse("~(~(a | b) <=> ~(x | y))"); - assertThat(f1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(pg), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(pg), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(pg), f3.variables(_c.f))).isTrue(); } @@ -163,15 +163,15 @@ public void testFormulas(final FormulaContext _c) throws ParserException { "(~@AUX_%1$s_CNF_2 | @AUX_%1$s_CNF_0) & (~@AUX_%1$s_CNF_0 | @AUX_%1$s_CNF_1 | c) & " + "(~@AUX_%1$s_CNF_1 | ~a) & (~@AUX_%1$s_CNF_1 | ~b) & (~@AUX_%1$s_CNF_4 | ~x) & " + "(~@AUX_%1$s_CNF_4 | ~y)", _c.f.getName()))); - assertThat(f1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(pg), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(pg), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(pg), f3.variables(_c.f))).isTrue(); - assertThat(f4.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f4, f4.transform(pg), f4.variables(_c.f))).isTrue(); - assertThat(f4.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(pg).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f4, f4.transform(pg), f4.variables(_c.f))).isTrue(); } @@ -184,13 +184,13 @@ public void testFactorization(final FormulaContext _c) throws ParserException { final Formula f2 = _c.p.parse("~x & ~y"); final Formula f3 = _c.p.parse("d & ((a | b) => c)"); final Formula f4 = _c.p.parse("d & ((a | b) => c) | ~x & ~y"); - assertThat(f1.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pg).isCnf(_c.f)).isTrue(); assertThat(f1.transform(pg).variables(_c.f).size()).isEqualTo(f1.variables(_c.f).size()); - assertThat(f2.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pg).isCnf(_c.f)).isTrue(); assertThat(f2.transform(pg).variables(_c.f).size()).isEqualTo(f2.variables(_c.f).size()); - assertThat(f3.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pg).isCnf(_c.f)).isTrue(); assertThat(f3.transform(pg).variables(_c.f).size()).isEqualTo(f3.variables(_c.f).size()); - assertThat(f4.transform(pg).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(pg).isCnf(_c.f)).isTrue(); assertThat(f4.transform(pg).variables(_c.f).size()).isEqualTo(f4.variables(_c.f).size()); } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolverTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolverTest.java index 48e74ebf..377a5299 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolverTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/PlaistedGreenbaumTransformationSolverTest.java @@ -14,11 +14,11 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.predicates.satisfiability.SATPredicate; +import com.booleworks.logicng.predicates.satisfiability.SatPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.solvers.SolverState; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -37,10 +37,10 @@ public class PlaistedGreenbaumTransformationSolverTest extends TestWithFormulaCo public void testCornerCases(final FormulaContext _c) { final FormulaCornerCases cornerCases = new FormulaCornerCases(_c.f); for (final Formula formula : cornerCases.cornerCases()) { - final SATSolver solverFactorization = SATSolver.newSolver(_c.f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FACTORY_CNF).build()); - final SATSolver solverFullPG = SATSolver.newSolver(_c.f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER).build()); + final SatSolver solverFactorization = SatSolver.newSolver(_c.f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FACTORY_CNF).build()); + final SatSolver solverFullPG = SatSolver.newSolver(_c.f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER).build()); solverFactorization.add(formula); solverFullPG.add(formula); assertThat(solverFactorization.sat() == solverFullPG.sat()).isTrue(); @@ -52,8 +52,8 @@ public void testCornerCases(final FormulaContext _c) { public void randomCaching() { for (int i = 0; i < 500; i++) { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER).build()); final FormulaRandomizer randomizer = new FormulaRandomizer(f, FormulaRandomizerConfig.builder().numVars(10).weightPbc(1).seed(i * 42).build()); @@ -123,14 +123,14 @@ public void simple(final FormulaContext _c) throws ParserException { private static Formula randomSATFormula(final FormulaFactory f, final FormulaRandomizer randomizer, final int maxDepth) { return Stream.generate(() -> randomizer.formula(maxDepth)) - .filter(formula -> formula.holds(new SATPredicate(f))) + .filter(formula -> formula.holds(new SatPredicate(f))) .findAny().get(); } private static void computeAndVerify(final Formula formula) { final FormulaFactory f = formula.getFactory(); - final SATSolver solver = SATSolver.newSolver(f, - SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.FULL_PG_ON_SOLVER).build()); + final SatSolver solver = SatSolver.newSolver(f, + SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.FULL_PG_ON_SOLVER).build()); solver.add(formula); final List models = solver.enumerateAllModels(formula.variables(f)); final Formula dnf = f.or(models.stream().map(model -> f.and(model.getLiterals())).collect(Collectors.toList())); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/cnf/TseitinTest.java b/core/src/test/java/com/booleworks/logicng/transformations/cnf/TseitinTest.java index d157a7db..3c637f67 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/cnf/TseitinTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/cnf/TseitinTest.java @@ -41,19 +41,19 @@ public void testLiterals(final FormulaContext _c) { public void testBinaryOperators(final FormulaContext _c) { final TseitinTransformation ts = new TseitinTransformation(_c.f, 0); - assertThat(_c.imp1.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.imp1.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp1, _c.imp1.transform(ts), _c.imp1.variables(_c.f))).isTrue(); - assertThat(_c.imp2.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.imp2.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp2, _c.imp2.transform(ts), _c.imp2.variables(_c.f))).isTrue(); - assertThat(_c.imp3.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.imp3.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.imp3, _c.imp3.transform(ts), _c.imp3.variables(_c.f))).isTrue(); - assertThat(_c.eq1.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.eq1.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq1, _c.eq1.transform(ts), _c.eq1.variables(_c.f))).isTrue(); - assertThat(_c.eq2.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.eq2.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq2, _c.eq2.transform(ts), _c.eq2.variables(_c.f))).isTrue(); - assertThat(_c.eq3.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.eq3.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq3, _c.eq3.transform(ts), _c.eq3.variables(_c.f))).isTrue(); - assertThat(_c.eq4.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(_c.eq4.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(_c.eq4, _c.eq4.transform(ts), _c.eq4.variables(_c.f))).isTrue(); } @@ -67,11 +67,11 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); final Formula f2 = _c.p.parse("~(a & b) | c | ~(x | ~y)"); final Formula f3 = _c.p.parse("a | b | (~x & ~y)"); - assertThat(f1.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(ts), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(ts), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(ts), f3.variables(_c.f))).isTrue(); } @@ -88,17 +88,17 @@ public void testNot(final FormulaContext _c) throws ParserException { final Formula f3 = _c.p.parse("~(~(a | b) <=> ~(x | y))"); final Formula f4 = _c.p.parse("~(a & b & ~x & ~y)"); final Formula f5 = _c.p.parse("~(a | b | ~x | ~y)"); - assertThat(f1.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f1, f1.transform(ts), f1.variables(_c.f))).isTrue(); - assertThat(f2.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f2, f2.transform(ts), f2.variables(_c.f))).isTrue(); - assertThat(f3.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f3, f3.transform(ts), f3.variables(_c.f))).isTrue(); - assertThat(f4.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f4, f4.transform(ts), f4.variables(_c.f))).isTrue(); - assertThat(f5.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f5, f5.transform(ts), f5.variables(_c.f))).isTrue(); - assertThat(f5.transform(ts).isCNF(_c.f)).isTrue(); + assertThat(f5.transform(ts).isCnf(_c.f)).isTrue(); assertThat(equivalentModels(f5, f5.transform(ts), f5.variables(_c.f))).isTrue(); } @@ -110,13 +110,13 @@ public void testFactorization(final FormulaContext _c) throws ParserException { final Formula f2 = _c.p.parse("~x & ~y"); final Formula f3 = _c.p.parse("d & ((a | b) => c)"); final Formula f4 = _c.p.parse("d & ((a | b) => c) | ~x & ~y"); - assertThat(f1.transform(pgf).isCNF(_c.f)).isTrue(); + assertThat(f1.transform(pgf).isCnf(_c.f)).isTrue(); assertThat(f1.transform(pgf).variables(_c.f).size()).isEqualTo(f1.variables(_c.f).size()); - assertThat(f2.transform(pgf).isCNF(_c.f)).isTrue(); + assertThat(f2.transform(pgf).isCnf(_c.f)).isTrue(); assertThat(f2.transform(pgf).variables(_c.f).size()).isEqualTo(f2.variables(_c.f).size()); - assertThat(f3.transform(pgf).isCNF(_c.f)).isTrue(); + assertThat(f3.transform(pgf).isCnf(_c.f)).isTrue(); assertThat(f3.transform(pgf).variables(_c.f).size()).isEqualTo(f3.variables(_c.f).size()); - assertThat(f4.transform(pgf).isCNF(_c.f)).isTrue(); + assertThat(f4.transform(pgf).isCnf(_c.f)).isTrue(); assertThat(f4.transform(pgf).variables(_c.f).size()).isEqualTo(f4.variables(_c.f).size()); } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/dnf/BDDDNFTest.java b/core/src/test/java/com/booleworks/logicng/transformations/dnf/BDDDNFTest.java index ac6599e8..d6ea2909 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/dnf/BDDDNFTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/dnf/BDDDNFTest.java @@ -11,8 +11,8 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; -import com.booleworks.logicng.predicates.DNFPredicate; +import com.booleworks.logicng.knowledgecompilation.bdds.jbuddy.BddKernel; +import com.booleworks.logicng.predicates.DnfPredicate; import com.booleworks.logicng.testutils.TestUtil; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -22,7 +22,7 @@ public class BDDDNFTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testConstants(final FormulaContext _c) { - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); assertThat(_c.verum.transform(bdddnf)).isEqualTo(_c.verum); assertThat(_c.falsum.transform(bdddnf)).isEqualTo(_c.falsum); @@ -31,7 +31,7 @@ public void testConstants(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); assertThat(_c.a.transform(bdddnf)).isEqualTo(_c.a); assertThat(_c.na.transform(bdddnf)).isEqualTo(_c.na); @@ -40,8 +40,8 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testBinaryOperators(final FormulaContext _c) { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); assertThat(_c.imp1.transform(bdddnf).holds(dnfPredicate)).isTrue(); assertThat(TestUtil.equivalentModels(_c.imp1, _c.imp1.transform(bdddnf), _c.imp1.variables(_c.f))) @@ -69,8 +69,8 @@ public void testBinaryOperators(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testNAryOperators(final FormulaContext _c) throws ParserException { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); assertThat(_c.and1.transform(bdddnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bdddnf)).isEqualTo(_c.or1); @@ -88,10 +88,10 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testNAryOperatorsWithExternalFactory(final FormulaContext _c) throws ParserException { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); - final BDDDNFTransformation transformation = new BDDDNFTransformation(_c.f, new BDDKernel(_c.f, 7, 100, 1000)); + final BddDnfTransformation transformation = new BddDnfTransformation(_c.f, new BddKernel(_c.f, 7, 100, 1000)); assertThat(_c.and1.transform(bdddnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bdddnf)).isEqualTo(_c.or1); final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); @@ -108,10 +108,10 @@ public void testNAryOperatorsWithExternalFactory(final FormulaContext _c) throws @ParameterizedTest @MethodSource("contexts") public void testNAryOperatorsWithExternalFactory2(final FormulaContext _c) throws ParserException { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); - final BDDDNFTransformation transformation = new BDDDNFTransformation(_c.f, new BDDKernel(_c.f, 7, 50, 50)); + final BddDnfTransformation transformation = new BddDnfTransformation(_c.f, new BddKernel(_c.f, 7, 50, 50)); assertThat(_c.and1.transform(bdddnf)).isEqualTo(_c.and1); assertThat(_c.or1.transform(bdddnf)).isEqualTo(_c.or1); final Formula f1 = _c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)"); @@ -128,8 +128,8 @@ public void testNAryOperatorsWithExternalFactory2(final FormulaContext _c) throw @ParameterizedTest @MethodSource("contexts") public void testNot(final FormulaContext _c) throws ParserException { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); assertThat(_c.p.parse("~a").transform(bdddnf)).isEqualTo(_c.p.parse("~a")); assertThat(_c.p.parse("~~a").transform(bdddnf)).isEqualTo(_c.p.parse("a")); @@ -156,8 +156,8 @@ public void testNot(final FormulaContext _c) throws ParserException { @ParameterizedTest @MethodSource("contexts") public void testCC(final FormulaContext _c) throws ParserException { - final DNFPredicate dnfPredicate = new DNFPredicate(_c.f); - final BDDDNFTransformation bdddnf = new BDDDNFTransformation(_c.f); + final DnfPredicate dnfPredicate = new DnfPredicate(_c.f); + final BddDnfTransformation bdddnf = new BddDnfTransformation(_c.f); final PropositionalParser p = new PropositionalParser(_c.f); final Formula f1 = p.parse("a <=> (1 * b <= 0)"); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumerationTest.java b/core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumerationTest.java similarity index 92% rename from core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumerationTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumerationTest.java index be32ad7d..9d2bc438 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDNFEnumerationTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/dnf/CanonicalDnfEnumerationTest.java @@ -12,7 +12,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.predicates.DNFPredicate; +import com.booleworks.logicng.predicates.DnfPredicate; import com.booleworks.logicng.predicates.satisfiability.ContradictionPredicate; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; import com.booleworks.logicng.util.FormulaCornerCases; @@ -21,12 +21,12 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class CanonicalDNFEnumerationTest extends TestWithFormulaContext { +public class CanonicalDnfEnumerationTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testSamples(final FormulaContext _c) throws ParserException { - final CanonicalDNFEnumeration de = new CanonicalDNFEnumeration(_c.f); + final CanonicalDnfEnumeration de = new CanonicalDnfEnumeration(_c.f); assertThat(_c.f.falsum().transform(de)).isEqualTo(_c.f.parse("$false")); assertThat(_c.f.verum().transform(de)).isEqualTo(_c.f.parse("$true")); assertThat(_c.f.parse("a").transform(de)).isEqualTo(_c.f.parse("a")); @@ -66,8 +66,8 @@ public void random(final FormulaContext _c) { private void test(final Formula formula) { final FormulaFactory f = formula.getFactory(); - final Formula dnf = new CanonicalDNFEnumeration(f).apply(formula); - assertThat(dnf.holds(new DNFPredicate(f))).isTrue(); + final Formula dnf = new CanonicalDnfEnumeration(f).apply(formula); + assertThat(dnf.holds(new DnfPredicate(f))).isTrue(); assertThat(f.equivalence(formula, dnf).holds(new TautologyPredicate(f))).isTrue(); if (formula.holds(new ContradictionPredicate(f))) { assertThat(dnf).isEqualTo(f.falsum()); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFFactorizationTest.java b/core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfFactorizationTest.java similarity index 78% rename from core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFFactorizationTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfFactorizationTest.java index 3a4b755a..a5d28bb8 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFFactorizationTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfFactorizationTest.java @@ -12,19 +12,19 @@ import com.booleworks.logicng.formulas.FormulaContext; import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.events.FactorizationCreatedClauseEvent; -import com.booleworks.logicng.handlers.events.LNGEvent; +import com.booleworks.logicng.handlers.events.LngEvent; import com.booleworks.logicng.io.parsers.ParserException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class DNFFactorizationTest extends TestWithFormulaContext { +public class DnfFactorizationTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testConstants(final FormulaContext _c) { - final DNFFactorization dnfFactorization = new DNFFactorization(_c.f); + final DnfFactorization dnfFactorization = new DnfFactorization(_c.f); assertThat(_c.verum.transform(dnfFactorization)).isEqualTo(_c.verum); assertThat(_c.falsum.transform(dnfFactorization)).isEqualTo(_c.falsum); @@ -33,7 +33,7 @@ public void testConstants(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testLiterals(final FormulaContext _c) { - final DNFFactorization dnfFactorization = new DNFFactorization(_c.f); + final DnfFactorization dnfFactorization = new DnfFactorization(_c.f); assertThat(_c.a.transform(dnfFactorization)).isEqualTo(_c.a); assertThat(_c.na.transform(dnfFactorization)).isEqualTo(_c.na); @@ -42,26 +42,26 @@ public void testLiterals(final FormulaContext _c) { @ParameterizedTest @MethodSource("contexts") public void testBinaryOperators(final FormulaContext _c) throws ParserException { - final DNFFactorization dnfFactorization = new DNFFactorization(_c.f); + final DnfFactorization dnfFactorization = new DnfFactorization(_c.f); assertThat(_c.imp1.transform(dnfFactorization)).isEqualTo(_c.p.parse("~a | b")); assertThat(_c.imp2.transform(dnfFactorization)).isEqualTo(_c.p.parse("a | ~b")); assertThat(_c.imp3.transform(dnfFactorization)).isEqualTo(_c.p.parse("~a | ~b | x | y")); assertThat(_c.eq1.transform(dnfFactorization)).isEqualTo(_c.p.parse("(a & b) | (~a & ~b)")); assertThat(_c.eq2.transform(dnfFactorization)).isEqualTo(_c.p.parse("(a & b) | (~a & ~b)")); - assertThat(_c.imp1.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.imp2.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.imp3.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.eq1.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.eq1.transform(dnfFactorization).isCNF(_c.f)).isFalse(); - assertThat(_c.eq2.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.eq2.transform(dnfFactorization).isCNF(_c.f)).isFalse(); + assertThat(_c.imp1.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.imp2.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.imp3.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.eq1.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.eq1.transform(dnfFactorization).isCnf(_c.f)).isFalse(); + assertThat(_c.eq2.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.eq2.transform(dnfFactorization).isCnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testNAryOperators(final FormulaContext _c) throws ParserException { - final DNFFactorization dnfFactorization = new DNFFactorization(_c.f); + final DnfFactorization dnfFactorization = new DnfFactorization(_c.f); assertThat(_c.and1.transform(dnfFactorization)).isEqualTo(_c.and1); assertThat(_c.or1.transform(dnfFactorization)).isEqualTo(_c.or1); @@ -71,22 +71,22 @@ public void testNAryOperators(final FormulaContext _c) throws ParserException { .isEqualTo(_c.p.parse("(~a & ~b & c & ~x) | (~a & ~b & c & y)")); assertThat(_c.p.parse("a & b & (~x | ~y)").transform(dnfFactorization)) .isEqualTo(_c.p.parse("(a & b & ~x) | (a & b & ~y)")); - assertThat(_c.and1.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.or1.transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(dnfFactorization).isDNF(_c.f)) + assertThat(_c.and1.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.or1.transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(dnfFactorization).isDnf(_c.f)) .isTrue(); - assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(dnfFactorization).isCNF(_c.f)) + assertThat(_c.p.parse("~(a | b) & c & ~(x & ~y) & (w => z)").transform(dnfFactorization).isCnf(_c.f)) .isFalse(); - assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(dnfFactorization).isCNF(_c.f)).isFalse(); - assertThat(_c.p.parse("a | b | (~x & ~y)").transform(dnfFactorization).isDNF(_c.f)).isTrue(); - assertThat(_c.p.parse("a | b | (~x & ~y)").transform(dnfFactorization).isCNF(_c.f)).isFalse(); + assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.p.parse("~(a & b) | c | ~(x | ~y)").transform(dnfFactorization).isCnf(_c.f)).isFalse(); + assertThat(_c.p.parse("a | b | (~x & ~y)").transform(dnfFactorization).isDnf(_c.f)).isTrue(); + assertThat(_c.p.parse("a | b | (~x & ~y)").transform(dnfFactorization).isCnf(_c.f)).isFalse(); } @ParameterizedTest @MethodSource("contexts") public void testNot(final FormulaContext _c) throws ParserException { - final DNFFactorization dnfFactorization = new DNFFactorization(_c.f); + final DnfFactorization dnfFactorization = new DnfFactorization(_c.f); assertThat(_c.p.parse("~a").transform(dnfFactorization)).isEqualTo(_c.p.parse("~a")); assertThat(_c.p.parse("~~a").transform(dnfFactorization)).isEqualTo(_c.p.parse("a")); @@ -108,9 +108,10 @@ public void testNot(final FormulaContext _c) throws ParserException { public void testCDNF(final FormulaContext _c) throws ParserException { final Formula formula = _c.p.parse("x0 & x1 & x3 | ~x1 & ~x2 | x2 & ~x3"); final Formula cdnf = _c.p.parse( - "x0 & x1 & x2 & x3 | x0 & x1 & x2 & ~x3 | x0 & ~x1 & x2 & ~x3 | ~x0 & ~x1 & x2 & ~x3 | ~x0 & ~x1 & ~x2 & ~x3 | x0 & ~x1 & ~x2 & ~x3 | x0 & ~x1 & ~x2 & x3 | x0 & x1 & ~x2 & x3 | ~x0 & x1 & x2 & ~x3 | ~x0 & ~x1 & ~x2 & x3"); - assertThat(formula.transform(new CanonicalDNFEnumeration(_c.f))).isEqualTo(cdnf); - assertThat(_c.f.and(_c.a, _c.na).transform(new CanonicalDNFEnumeration(_c.f))).isEqualTo(_c.falsum); + "x0 & x1 & x2 & x3 | x0 & x1 & x2 & ~x3 | x0 & ~x1 & x2 & ~x3 | ~x0 & ~x1 & x2 & ~x3 | ~x0 & ~x1 & ~x2 & ~x3 | x0 & ~x1 & ~x2 & ~x3 | x0 & " + + "~x1 & ~x2 & x3 | x0 & x1 & ~x2 & x3 | ~x0 & x1 & x2 & ~x3 | ~x0 & ~x1 & ~x2 & x3"); + assertThat(formula.transform(new CanonicalDnfEnumeration(_c.f))).isEqualTo(cdnf); + assertThat(_c.f.and(_c.a, _c.na).transform(new CanonicalDnfEnumeration(_c.f))).isEqualTo(_c.falsum); } @ParameterizedTest @@ -123,7 +124,7 @@ public void testWithHandler(final FormulaContext _c) throws ParserException { private int clauses = 0; @Override - public boolean shouldResume(final LNGEvent event) { + public boolean shouldResume(final LngEvent event) { if (event == FACTORIZATION_STARTED) { canceled = false; dists = 0; @@ -138,8 +139,8 @@ public boolean shouldResume(final LNGEvent event) { return !canceled; } }; - final DNFFactorization factorization = new DNFFactorization(_c.f, null); - LNGResult dnf = factorization.apply(formula, handler); + final DnfFactorization factorization = new DnfFactorization(_c.f, null); + LngResult dnf = factorization.apply(formula, handler); assertThat(dnf.isSuccess()).isFalse(); formula = _c.p.parse("~(a | b)"); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFSubsumptionTest.java b/core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfSubsumptionTest.java similarity index 91% rename from core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFSubsumptionTest.java rename to core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfSubsumptionTest.java index 8015079a..dd78895c 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/dnf/DNFSubsumptionTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/dnf/DnfSubsumptionTest.java @@ -21,12 +21,12 @@ import java.io.IOException; -public class DNFSubsumptionTest extends TestWithFormulaContext { +public class DnfSubsumptionTest extends TestWithFormulaContext { @ParameterizedTest @MethodSource("contexts") public void testSimpleDNFSubsumption(final FormulaContext _c) throws ParserException { - final DNFSubsumption s = new DNFSubsumption(_c.f); + final DnfSubsumption s = new DnfSubsumption(_c.f); assertThat(s.apply(_c.p.parse("$false"))).isEqualTo(_c.p.parse("$false")); assertThat(s.apply(_c.p.parse("$true"))).isEqualTo(_c.p.parse("$true")); @@ -45,7 +45,7 @@ public void testSimpleDNFSubsumption(final FormulaContext _c) throws ParserExcep @ParameterizedTest @MethodSource("contexts") public void testLargeDNFSubsumption(final FormulaContext _c) throws ParserException { - final DNFSubsumption s = new DNFSubsumption(_c.f); + final DnfSubsumption s = new DnfSubsumption(_c.f); assertThat(s.apply(_c.p.parse("(a & b & c & d) | (a & b & c & e) | (a & b & c)"))) .isEqualTo(_c.p.parse("(a & b & c)")); @@ -70,8 +70,8 @@ public void testEvenLargerFormulas(final FormulaContext _c) throws IOException, if (count == 0) { break; } - final Formula dnf = op.transform(new DNFFactorization(_c.f)); - final Formula subsumed = dnf.transform(new DNFSubsumption(_c.f)); + final Formula dnf = op.transform(new DnfFactorization(_c.f)); + final Formula subsumed = dnf.transform(new DnfSubsumption(_c.f)); assertThat(_c.f.equivalence(dnf, subsumed).holds(new TautologyPredicate(_c.f))).isTrue(); assertThat(dnf.numberOfOperands() > subsumed.numberOfOperands()).isTrue(); count--; @@ -81,7 +81,7 @@ public void testEvenLargerFormulas(final FormulaContext _c) throws IOException, @Test public void testNotInDNF() { final FormulaFactory f = FormulaFactory.caching(); - final DNFSubsumption s = new DNFSubsumption(f); + final DnfSubsumption s = new DnfSubsumption(f); assertThatThrownBy(() -> s.apply(f.parse("a => b"))).isInstanceOf(IllegalArgumentException.class); } } diff --git a/core/src/test/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifierTest.java b/core/src/test/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifierTest.java index 2b45a973..d2206690 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifierTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/simplification/AdvancedSimplifierTest.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.handlers.BoundedOptimizationHandler; import com.booleworks.logicng.handlers.ComputationHandler; -import com.booleworks.logicng.handlers.LNGResult; +import com.booleworks.logicng.handlers.LngResult; import com.booleworks.logicng.handlers.TimeoutHandler; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; @@ -162,7 +162,7 @@ private void computeAndVerify(final Formula formula) { private void testHandler(final ComputationHandler handler, final Formula formula, final boolean expCanceled) { final AdvancedSimplifier simplifierWithHandler = new AdvancedSimplifier(formula.getFactory(), AdvancedSimplifierConfig.builder().build()); - final LNGResult simplified = formula.transform(simplifierWithHandler, handler); + final LngResult simplified = formula.transform(simplifierWithHandler, handler); assertThat(simplified.isSuccess()).isEqualTo(!expCanceled); if (expCanceled) { assertThatThrownBy(simplified::getResult).isInstanceOf(IllegalStateException.class); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/simplification/NegationMinimizerTest.java b/core/src/test/java/com/booleworks/logicng/transformations/simplification/NegationMinimizerTest.java index fbd6e8e3..e3913ec7 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/simplification/NegationMinimizerTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/simplification/NegationMinimizerTest.java @@ -14,7 +14,7 @@ import com.booleworks.logicng.formulas.TestWithFormulaContext; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.io.parsers.ParserException; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import com.booleworks.logicng.util.FormulaCornerCases; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; @@ -95,10 +95,10 @@ private static void computeAndVerify(final Formula formula) { final FormulaFactory f = formula.getFactory(); final Formula simplified = formula.transform(new NegationSimplifier(f)); final SortedSet originalVariables = formula.variables(f); - final SATSolver sat1 = SATSolver.newSolver(f); + final SatSolver sat1 = SatSolver.newSolver(f); sat1.add(formula); final Set models1 = new HashSet<>(sat1.enumerateAllModels(originalVariables)); - final SATSolver sat2 = SATSolver.newSolver(f); + final SatSolver sat2 = SatSolver.newSolver(f); sat2.add(simplified); final Set models2 = new HashSet<>(sat2.enumerateAllModels(originalVariables)); assertThat(models1.size()).isEqualTo(models2.size()); diff --git a/core/src/test/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeyTest.java b/core/src/test/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeyTest.java index 538f165c..81ebb064 100644 --- a/core/src/test/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeyTest.java +++ b/core/src/test/java/com/booleworks/logicng/transformations/simplification/QuineMcCluskeyTest.java @@ -15,7 +15,7 @@ import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.readers.FormulaReader; import com.booleworks.logicng.predicates.satisfiability.TautologyPredicate; -import com.booleworks.logicng.solvers.SATSolver; +import com.booleworks.logicng.solvers.SatSolver; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -34,7 +34,7 @@ public void testSimple1(final FormulaContext _c) throws ParserException { final Formula formula = _c.p .parse("(~a & ~b & ~c) | (~a & ~b & c) | (~a & b & ~c) | (a & ~b & c) | (a & b & ~c) | (a & b & c)"); final Formula dnf = formula.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(formula, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } @@ -43,7 +43,7 @@ public void testSimple1(final FormulaContext _c) throws ParserException { public void testSimple2(final FormulaContext _c) throws ParserException { final Formula formula = _c.p.parse("(~a & ~b & ~c) | (~a & b & ~c) | (a & ~b & c) | (a & b & c)"); final Formula dnf = formula.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(formula, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } @@ -60,7 +60,7 @@ public void testSimple3(final FormulaContext _c) throws ParserException { final Formula formula = _c.p.parse( "~5 & ~4 & 3 & 2 & 1 | ~3 & ~7 & ~2 & 1 | ~6 & 1 & ~3 & 2 | ~9 & 6 & 8 & ~1 | 3 & 4 & 2 & 1 | ~2 & 7 & 1 | ~10 & ~8 & ~1"); final Formula dnf = formula.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(formula, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); assertThat(formula.variables(_c.f)).containsAll(dnf.variables(_c.f)); } @@ -70,7 +70,7 @@ public void testSimple3(final FormulaContext _c) throws ParserException { public void testLarge1(final FormulaContext _c) throws ParserException { final Formula formula = _c.p.parse("A => B & ~((D | E | I | J) & ~K) & L"); final Formula dnf = formula.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(formula, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } @@ -79,7 +79,7 @@ public void testLarge1(final FormulaContext _c) throws ParserException { public void testLarge2(final FormulaContext _c) throws ParserException, IOException { final Formula formula = FormulaReader.readFormula(_c.f, "../test_files/formulas/large_formula.txt"); - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(formula); final List models = solver.enumerateAllModels(Arrays.asList( _c.f.variable("v111"), @@ -98,7 +98,7 @@ public void testLarge2(final FormulaContext _c) throws ParserException, IOExcept } final Formula canonicalDNF = _c.f.or(operands); final Formula dnf = canonicalDNF.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(canonicalDNF, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } @@ -107,7 +107,7 @@ public void testLarge2(final FormulaContext _c) throws ParserException, IOExcept public void testLarge3(final FormulaContext _c) throws ParserException, IOException { final Formula formula = FormulaReader.readFormula(_c.f, "../test_files/formulas/large_formula.txt"); - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(formula); final List models = solver.enumerateAllModels(Arrays.asList( _c.f.variable("v111"), @@ -130,7 +130,7 @@ public void testLarge3(final FormulaContext _c) throws ParserException, IOExcept } final Formula canonicalDNF = _c.f.or(operands); final Formula dnf = canonicalDNF.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(canonicalDNF, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } @@ -145,7 +145,7 @@ public void testSmallFormulas(final FormulaContext _c) throws IOException, Parse final List variables = new ArrayList<>(formula.variables(_c.f)); final List projectedVars = variables.subList(0, Math.min(6, variables.size())); - final SATSolver solver = SATSolver.newSolver(_c.f); + final SatSolver solver = SatSolver.newSolver(_c.f); solver.add(formula); final List models = solver.enumerateAllModels(projectedVars); final List operands = new ArrayList<>(models.size()); @@ -155,7 +155,7 @@ public void testSmallFormulas(final FormulaContext _c) throws IOException, Parse final Formula canonicalDNF = _c.f.or(operands); final Formula dnf = canonicalDNF.transform(new QuineMcCluskeySimplifier(_c.f)); - assertThat(dnf.isDNF(_c.f)).isTrue(); + assertThat(dnf.isDnf(_c.f)).isTrue(); assertThat(_c.f.equivalence(canonicalDNF, dnf).holds(new TautologyPredicate(_c.f))).isTrue(); } } diff --git a/core/src/test/java/com/booleworks/logicng/util/FormulaRandomizerTest.java b/core/src/test/java/com/booleworks/logicng/util/FormulaRandomizerTest.java index 17c96121..335f46b0 100644 --- a/core/src/test/java/com/booleworks/logicng/util/FormulaRandomizerTest.java +++ b/core/src/test/java/com/booleworks/logicng/util/FormulaRandomizerTest.java @@ -17,7 +17,7 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.Or; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.functions.FormulaDepthFunction; import org.junit.jupiter.api.Test; @@ -146,8 +146,8 @@ public void testAtom() { numNeg++; } } else { - final PBConstraint pbc = (PBConstraint) formula; - if (!pbc.isCC()) { + final PbConstraint pbc = (PbConstraint) formula; + if (!pbc.isCc()) { numPbc++; } else if (pbc.getRhs() == 1 && pbc.comparator() == CType.LE) { numAmo++; @@ -270,8 +270,8 @@ public void testPbc() { int eq = 0; for (int i = 0; i < 500; i++) { final Formula formula = random.pbc(); - assertThat(formula).isInstanceOf(PBConstraint.class); - final PBConstraint pbc = (PBConstraint) formula; + assertThat(formula).isInstanceOf(PbConstraint.class); + final PbConstraint pbc = (PbConstraint) formula; int posSum = 0; int negSum = 0; for (final int coefficient : pbc.getCoefficients()) { @@ -337,7 +337,7 @@ public void testCc() { final Formula formula = random.cc(); assertThat(formula).isInstanceOf(CardinalityConstraint.class); final CardinalityConstraint cc = (CardinalityConstraint) formula; - assertThat(cc.isCC()).isTrue(); + assertThat(cc.isCc()).isTrue(); assertThat(cc.numberOfOperands()).isLessThanOrEqualTo(10); if (cc.comparator() == CType.GT) { assertThat(cc.getRhs()).isStrictlyBetween(-2, 11); @@ -377,9 +377,9 @@ public void testAmo() { .build()); for (int i = 0; i < 100; i++) { final Formula formula = random.amo(); - assertThat(formula).isInstanceOf(PBConstraint.class); - final PBConstraint amo = (PBConstraint) formula; - assertThat(amo.isCC()).isTrue(); + assertThat(formula).isInstanceOf(PbConstraint.class); + final PbConstraint amo = (PbConstraint) formula; + assertThat(amo.isCc()).isTrue(); assertThat(amo.getRhs()).isEqualTo(1); assertThat(amo.comparator()).isEqualTo(CType.LE); } @@ -392,9 +392,9 @@ public void testExo() { .build()); for (int i = 0; i < 100; i++) { final Formula formula = random.exo(); - assertThat(formula).isInstanceOf(PBConstraint.class); - final PBConstraint amo = (PBConstraint) formula; - assertThat(amo.isCC()).isTrue(); + assertThat(formula).isInstanceOf(PbConstraint.class); + final PbConstraint amo = (PbConstraint) formula; + assertThat(amo.isCc()).isTrue(); assertThat(amo.getRhs()).isEqualTo(1); assertThat(amo.comparator()).isEqualTo(CType.EQ); } @@ -496,8 +496,8 @@ private void countOccurrences(final Formula formula, final Map occurrences.merge("equiv", 1, Integer::sum); break; case PBC: - final PBConstraint pbc = (PBConstraint) formula; - if (!pbc.isCC()) { + final PbConstraint pbc = (PbConstraint) formula; + if (!pbc.isCc()) { occurrences.merge("pbc", 1, Integer::sum); } else if (pbc.getRhs() == 1 && pbc.comparator() == CType.LE) { occurrences.merge("amo", 1, Integer::sum); @@ -561,7 +561,7 @@ public void testMaximumOperandsPbc() { for (int i = 0; i < 100; i++) { final Formula formula = random.pbc(); assertThat(formula.getType()).isEqualTo(FType.PBC); - final PBConstraint pbc = (PBConstraint) formula; + final PbConstraint pbc = (PbConstraint) formula; assertThat(pbc.literals(f).size()).isLessThanOrEqualTo(10); } } diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufCollections.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufCollections.java index 46c1b6d1..536a71a8 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufCollections.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufCollections.java @@ -25,8 +25,8 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } - public interface PBIntVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:collections.PBIntVector) + public interface PbIntVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:collections.PbIntVector) com.google.protobuf.MessageOrBuilder { /** @@ -53,12 +53,12 @@ public interface PBIntVectorOrBuilder extends int getSize(); } /** - * Protobuf type {@code collections.PBIntVector} + * Protobuf type {@code collections.PbIntVector} */ - public static final class PBIntVector extends + public static final class PbIntVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:collections.PBIntVector) - PBIntVectorOrBuilder { + // @@protoc_insertion_point(message_implements:collections.PbIntVector) + PbIntVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -67,27 +67,27 @@ public static final class PBIntVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBIntVector.class.getName()); + PbIntVector.class.getName()); } - // Use PBIntVector.newBuilder() to construct. - private PBIntVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbIntVector.newBuilder() to construct. + private PbIntVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBIntVector() { + private PbIntVector() { element_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @@ -193,10 +193,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector) obj; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -224,44 +224,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -269,26 +269,26 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVect .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -301,7 +301,7 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVect public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -317,26 +317,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code collections.PBIntVector} + * Protobuf type {@code collections.PbIntVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:collections.PBIntVector) - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:collections.PbIntVector) + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.newBuilder() private Builder() { } @@ -358,17 +358,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector build() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector build() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -376,14 +376,14 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector buil } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector(this); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { element_.makeImmutable(); @@ -396,16 +396,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollecti @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) return this; if (!other.element_.isEmpty()) { if (element_.isEmpty()) { element_ = other.element_; @@ -600,23 +600,23 @@ public Builder clearSize() { return this; } - // @@protoc_insertion_point(builder_scope:collections.PBIntVector) + // @@protoc_insertion_point(builder_scope:collections.PbIntVector) } - // @@protoc_insertion_point(class_scope:collections.PBIntVector) - private static final com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:collections.PbIntVector) + private static final com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector(); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBIntVector parsePartialFrom( + public PbIntVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -635,24 +635,24 @@ public PBIntVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBBooleanVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:collections.PBBooleanVector) + public interface PbBooleanVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:collections.PbBooleanVector) com.google.protobuf.MessageOrBuilder { /** @@ -679,12 +679,12 @@ public interface PBBooleanVectorOrBuilder extends int getSize(); } /** - * Protobuf type {@code collections.PBBooleanVector} + * Protobuf type {@code collections.PbBooleanVector} */ - public static final class PBBooleanVector extends + public static final class PbBooleanVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:collections.PBBooleanVector) - PBBooleanVectorOrBuilder { + // @@protoc_insertion_point(message_implements:collections.PbBooleanVector) + PbBooleanVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -693,27 +693,27 @@ public static final class PBBooleanVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBBooleanVector.class.getName()); + PbBooleanVector.class.getName()); } - // Use PBBooleanVector.newBuilder() to construct. - private PBBooleanVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbBooleanVector.newBuilder() to construct. + private PbBooleanVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBBooleanVector() { + private PbBooleanVector() { element_ = emptyBooleanList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBBooleanVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbBooleanVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBBooleanVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbBooleanVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @@ -816,10 +816,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector) obj; + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -847,44 +847,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -892,26 +892,26 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBoolean .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -924,7 +924,7 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBoolean public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -940,26 +940,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code collections.PBBooleanVector} + * Protobuf type {@code collections.PbBooleanVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:collections.PBBooleanVector) - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:collections.PbBooleanVector) + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBBooleanVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbBooleanVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBBooleanVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbBooleanVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.newBuilder() private Builder() { } @@ -981,17 +981,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBBooleanVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbBooleanVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector build() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector build() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -999,14 +999,14 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector(this); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { element_.makeImmutable(); @@ -1019,16 +1019,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollecti @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance()) return this; if (!other.element_.isEmpty()) { if (element_.isEmpty()) { element_ = other.element_; @@ -1230,23 +1230,23 @@ public Builder clearSize() { return this; } - // @@protoc_insertion_point(builder_scope:collections.PBBooleanVector) + // @@protoc_insertion_point(builder_scope:collections.PbBooleanVector) } - // @@protoc_insertion_point(class_scope:collections.PBBooleanVector) - private static final com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:collections.PbBooleanVector) + private static final com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector(); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBBooleanVector parsePartialFrom( + public PbBooleanVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1265,24 +1265,24 @@ public PBBooleanVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBLongVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:collections.PBLongVector) + public interface PbLongVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:collections.PbLongVector) com.google.protobuf.MessageOrBuilder { /** @@ -1309,12 +1309,12 @@ public interface PBLongVectorOrBuilder extends int getSize(); } /** - * Protobuf type {@code collections.PBLongVector} + * Protobuf type {@code collections.PbLongVector} */ - public static final class PBLongVector extends + public static final class PbLongVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:collections.PBLongVector) - PBLongVectorOrBuilder { + // @@protoc_insertion_point(message_implements:collections.PbLongVector) + PbLongVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -1323,27 +1323,27 @@ public static final class PBLongVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBLongVector.class.getName()); + PbLongVector.class.getName()); } - // Use PBLongVector.newBuilder() to construct. - private PBLongVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbLongVector.newBuilder() to construct. + private PbLongVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBLongVector() { + private PbLongVector() { element_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBLongVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbLongVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBLongVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbLongVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @@ -1449,10 +1449,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector) obj; + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -1480,44 +1480,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1525,26 +1525,26 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVec .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1557,7 +1557,7 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVec public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1573,26 +1573,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code collections.PBLongVector} + * Protobuf type {@code collections.PbLongVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:collections.PBLongVector) - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:collections.PbLongVector) + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBLongVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbLongVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBLongVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbLongVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.newBuilder() private Builder() { } @@ -1614,17 +1614,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBLongVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbLongVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector build() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector build() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1632,14 +1632,14 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector bui } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector(this); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { element_.makeImmutable(); @@ -1652,16 +1652,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollecti @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance()) return this; if (!other.element_.isEmpty()) { if (element_.isEmpty()) { element_ = other.element_; @@ -1856,23 +1856,23 @@ public Builder clearSize() { return this; } - // @@protoc_insertion_point(builder_scope:collections.PBLongVector) + // @@protoc_insertion_point(builder_scope:collections.PbLongVector) } - // @@protoc_insertion_point(class_scope:collections.PBLongVector) - private static final com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:collections.PbLongVector) + private static final com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector(); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBLongVector parsePartialFrom( + public PbLongVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1891,48 +1891,48 @@ public PBLongVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBIntVectorVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:collections.PBIntVectorVector) + public interface PbIntVectorVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:collections.PbIntVectorVector) com.google.protobuf.MessageOrBuilder { /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - java.util.List + java.util.List getElementList(); /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElement(int index); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElement(int index); /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ int getElementCount(); /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - java.util.List + java.util.List getElementOrBuilderList(); /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElementOrBuilder( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElementOrBuilder( int index); /** @@ -1942,12 +1942,12 @@ com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder ge int getSize(); } /** - * Protobuf type {@code collections.PBIntVectorVector} + * Protobuf type {@code collections.PbIntVectorVector} */ - public static final class PBIntVectorVector extends + public static final class PbIntVectorVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:collections.PBIntVectorVector) - PBIntVectorVectorOrBuilder { + // @@protoc_insertion_point(message_implements:collections.PbIntVectorVector) + PbIntVectorVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -1956,66 +1956,66 @@ public static final class PBIntVectorVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBIntVectorVector.class.getName()); + PbIntVectorVector.class.getName()); } - // Use PBIntVectorVector.newBuilder() to construct. - private PBIntVectorVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbIntVectorVector.newBuilder() to construct. + private PbIntVectorVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBIntVectorVector() { + private PbIntVectorVector() { element_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVectorVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVectorVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVectorVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List element_; + private java.util.List element_; /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ @java.lang.Override - public java.util.List getElementList() { + public java.util.List getElementList() { return element_; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ @java.lang.Override - public java.util.List + public java.util.List getElementOrBuilderList() { return element_; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ @java.lang.Override public int getElementCount() { return element_.size(); } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElement(int index) { return element_.get(index); } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElementOrBuilder( int index) { return element_.get(index); } @@ -2078,10 +2078,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector) obj; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector other = (com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -2109,44 +2109,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2154,26 +2154,26 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVect .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2186,7 +2186,7 @@ public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVect public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2202,26 +2202,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code collections.PBIntVectorVector} + * Protobuf type {@code collections.PbIntVectorVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:collections.PBIntVectorVector) - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:collections.PbIntVectorVector) + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVectorVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVectorVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVectorVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.class, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.newBuilder() private Builder() { } @@ -2249,17 +2249,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PBIntVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufCollections.internal_static_collections_PbIntVectorVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector build() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector build() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2267,15 +2267,15 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVecto } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector(this); + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector result = new com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector result) { if (elementBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { element_ = java.util.Collections.unmodifiableList(element_); @@ -2287,7 +2287,7 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000002) != 0)) { result.size_ = size_; @@ -2296,16 +2296,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufCollecti @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance()) return this; if (elementBuilder_ == null) { if (!other.element_.isEmpty()) { if (element_.isEmpty()) { @@ -2362,9 +2362,9 @@ public Builder mergeFrom( done = true; break; case 10: { - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector m = + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.parser(), + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.parser(), extensionRegistry); if (elementBuilder_ == null) { ensureElementIsMutable(); @@ -2396,22 +2396,22 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List element_ = + private java.util.List element_ = java.util.Collections.emptyList(); private void ensureElementIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); + element_ = new java.util.ArrayList(element_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> elementBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> elementBuilder_; /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public java.util.List getElementList() { + public java.util.List getElementList() { if (elementBuilder_ == null) { return java.util.Collections.unmodifiableList(element_); } else { @@ -2419,7 +2419,7 @@ public java.util.Listrepeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public int getElementCount() { if (elementBuilder_ == null) { @@ -2429,9 +2429,9 @@ public int getElementCount() { } } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElement(int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -2439,10 +2439,10 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getE } } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + int index, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2456,10 +2456,10 @@ public Builder setElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.set(index, builderForValue.build()); @@ -2470,9 +2470,9 @@ public Builder setElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public Builder addElement(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder addElement(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2486,10 +2486,10 @@ public Builder addElement(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + int index, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2503,10 +2503,10 @@ public Builder addElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder addElement( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(builderForValue.build()); @@ -2517,10 +2517,10 @@ public Builder addElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(index, builderForValue.build()); @@ -2531,10 +2531,10 @@ public Builder addElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder addAllElement( - java.lang.Iterable values) { + java.lang.Iterable values) { if (elementBuilder_ == null) { ensureElementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -2546,7 +2546,7 @@ public Builder addAllElement( return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder clearElement() { if (elementBuilder_ == null) { @@ -2559,7 +2559,7 @@ public Builder clearElement() { return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ public Builder removeElement(int index) { if (elementBuilder_ == null) { @@ -2572,16 +2572,16 @@ public Builder removeElement(int index) { return this; } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getElementBuilder( int index) { return getElementFieldBuilder().getBuilder(index); } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElementOrBuilder( int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -2589,9 +2589,9 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui } } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public java.util.List + public java.util.List getElementOrBuilderList() { if (elementBuilder_ != null) { return elementBuilder_.getMessageOrBuilderList(); @@ -2600,33 +2600,33 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui } } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder addElementBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder addElementBuilder() { return getElementFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()); } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder addElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder addElementBuilder( int index) { return getElementFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()); } /** - * repeated .collections.PBIntVector element = 1; + * repeated .collections.PbIntVector element = 1; */ - public java.util.List + public java.util.List getElementBuilderList() { return getElementFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getElementFieldBuilder() { if (elementBuilder_ == null) { elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( element_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -2668,23 +2668,23 @@ public Builder clearSize() { return this; } - // @@protoc_insertion_point(builder_scope:collections.PBIntVectorVector) + // @@protoc_insertion_point(builder_scope:collections.PbIntVectorVector) } - // @@protoc_insertion_point(class_scope:collections.PBIntVectorVector) - private static final com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:collections.PbIntVectorVector) + private static final com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector(); } - public static com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBIntVectorVector parsePartialFrom( + public PbIntVectorVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2703,42 +2703,42 @@ public PBIntVectorVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_collections_PBIntVector_descriptor; + internal_static_collections_PbIntVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_collections_PBIntVector_fieldAccessorTable; + internal_static_collections_PbIntVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_collections_PBBooleanVector_descriptor; + internal_static_collections_PbBooleanVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_collections_PBBooleanVector_fieldAccessorTable; + internal_static_collections_PbBooleanVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_collections_PBLongVector_descriptor; + internal_static_collections_PbLongVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_collections_PBLongVector_fieldAccessorTable; + internal_static_collections_PbLongVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_collections_PBIntVectorVector_descriptor; + internal_static_collections_PbIntVectorVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_collections_PBIntVectorVector_fieldAccessorTable; + internal_static_collections_PbIntVectorVector_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -2748,12 +2748,12 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVecto descriptor; static { java.lang.String[] descriptorData = { - "\n\021collections.proto\022\013collections\",\n\013PBIn" + + "\n\021collections.proto\022\013collections\",\n\013PbIn" + "tVector\022\017\n\007element\030\001 \003(\005\022\014\n\004size\030\002 \001(\005\"0" + - "\n\017PBBooleanVector\022\017\n\007element\030\001 \003(\010\022\014\n\004si" + - "ze\030\002 \001(\005\"-\n\014PBLongVector\022\017\n\007element\030\001 \003(" + - "\003\022\014\n\004size\030\002 \001(\005\"L\n\021PBIntVectorVector\022)\n\007" + - "element\030\001 \003(\0132\030.collections.PBIntVector\022" + + "\n\017PbBooleanVector\022\017\n\007element\030\001 \003(\010\022\014\n\004si" + + "ze\030\002 \001(\005\"-\n\014PbLongVector\022\017\n\007element\030\001 \003(" + + "\003\022\014\n\004size\030\002 \001(\005\"L\n\021PbIntVectorVector\022)\n\007" + + "element\030\001 \003(\0132\030.collections.PbIntVector\022" + "\014\n\004size\030\002 \001(\005B;\n$com.booleworks.logicng." + "serializationB\023ProtoBufCollectionsb\006prot" + "o3" @@ -2762,29 +2762,29 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVecto .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }); - internal_static_collections_PBIntVector_descriptor = + internal_static_collections_PbIntVector_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_collections_PBIntVector_fieldAccessorTable = new + internal_static_collections_PbIntVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_collections_PBIntVector_descriptor, + internal_static_collections_PbIntVector_descriptor, new java.lang.String[] { "Element", "Size", }); - internal_static_collections_PBBooleanVector_descriptor = + internal_static_collections_PbBooleanVector_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_collections_PBBooleanVector_fieldAccessorTable = new + internal_static_collections_PbBooleanVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_collections_PBBooleanVector_descriptor, + internal_static_collections_PbBooleanVector_descriptor, new java.lang.String[] { "Element", "Size", }); - internal_static_collections_PBLongVector_descriptor = + internal_static_collections_PbLongVector_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_collections_PBLongVector_fieldAccessorTable = new + internal_static_collections_PbLongVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_collections_PBLongVector_descriptor, + internal_static_collections_PbLongVector_descriptor, new java.lang.String[] { "Element", "Size", }); - internal_static_collections_PBIntVectorVector_descriptor = + internal_static_collections_PbIntVectorVector_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_collections_PBIntVectorVector_fieldAccessorTable = new + internal_static_collections_PbIntVectorVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_collections_PBIntVectorVector_descriptor, + internal_static_collections_PbIntVectorVector_descriptor, new java.lang.String[] { "Element", "Size", }); descriptor.resolveAllFeaturesImmutable(); } diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufDnnf.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufDnnf.java index f68d3371..5f1ee3c4 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufDnnf.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufDnnf.java @@ -25,8 +25,8 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } - public interface PBDnnfOrBuilder extends - // @@protoc_insertion_point(interface_extends:dnnf.PBDnnf) + public interface PbDnnfOrBuilder extends + // @@protoc_insertion_point(interface_extends:dnnf.PbDnnf) com.google.protobuf.MessageOrBuilder { /** @@ -55,27 +55,27 @@ public interface PBDnnfOrBuilder extends getOriginalVariablesBytes(int index); /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return Whether the formula field is set. */ boolean hasFormula(); /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return The formula. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula(); /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder(); } /** - * Protobuf type {@code dnnf.PBDnnf} + * Protobuf type {@code dnnf.PbDnnf} */ - public static final class PBDnnf extends + public static final class PbDnnf extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:dnnf.PBDnnf) - PBDnnfOrBuilder { + // @@protoc_insertion_point(message_implements:dnnf.PbDnnf) + PbDnnfOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -84,28 +84,28 @@ public static final class PBDnnf extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBDnnf.class.getName()); + PbDnnf.class.getName()); } - // Use PBDnnf.newBuilder() to construct. - private PBDnnf(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbDnnf.newBuilder() to construct. + private PbDnnf(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBDnnf() { + private PbDnnf() { originalVariables_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PBDnnf_descriptor; + return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PbDnnf_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PBDnnf_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PbDnnf_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.class, com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.Builder.class); + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.class, com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.Builder.class); } private int bitField0_; @@ -147,9 +147,9 @@ public java.lang.String getOriginalVariables(int index) { } public static final int FORMULA_FIELD_NUMBER = 2; - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas formula_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas formula_; /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return Whether the formula field is set. */ @java.lang.Override @@ -157,19 +157,19 @@ public boolean hasFormula() { return ((bitField0_ & 0x00000001) != 0); } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return The formula. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula() { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula() { + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder() { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder() { + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } private byte memoizedIsInitialized = -1; @@ -223,10 +223,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf other = (com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf) obj; + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf other = (com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf) obj; if (!getOriginalVariablesList() .equals(other.getOriginalVariablesList())) return false; @@ -259,44 +259,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -304,26 +304,26 @@ public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -336,7 +336,7 @@ public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf parseFrom public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -352,26 +352,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code dnnf.PBDnnf} + * Protobuf type {@code dnnf.PbDnnf} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:dnnf.PBDnnf) - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnfOrBuilder { + // @@protoc_insertion_point(builder_implements:dnnf.PbDnnf) + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnfOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PBDnnf_descriptor; + return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PbDnnf_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PBDnnf_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PbDnnf_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.class, com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.Builder.class); + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.class, com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -404,17 +404,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PBDnnf_descriptor; + return com.booleworks.logicng.serialization.ProtoBufDnnf.internal_static_dnnf_PbDnnf_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf build() { - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf build() { + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -422,14 +422,14 @@ public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf build() { } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf buildPartial() { - com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf result = new com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf(this); + public com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf buildPartial() { + com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf result = new com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { originalVariables_.makeImmutable(); @@ -447,16 +447,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufDnnf.PBD @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf other) { - if (other == com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf other) { + if (other == com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf.getDefaultInstance()) return this; if (!other.originalVariables_.isEmpty()) { if (originalVariables_.isEmpty()) { originalVariables_ = other.originalVariables_; @@ -637,31 +637,31 @@ public Builder addOriginalVariablesBytes( return this; } - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas formula_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas formula_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder> formulaBuilder_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder> formulaBuilder_; /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return Whether the formula field is set. */ public boolean hasFormula() { return ((bitField0_ & 0x00000002) != 0); } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; * @return The formula. */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula() { if (formulaBuilder_ == null) { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } else { return formulaBuilder_.getMessage(); } } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ - public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas value) { + public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas value) { if (formulaBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -675,10 +675,10 @@ public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas. return this; } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ public Builder setFormula( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder builderForValue) { if (formulaBuilder_ == null) { formula_ = builderForValue.build(); } else { @@ -689,13 +689,13 @@ public Builder setFormula( return this; } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ - public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas value) { + public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas value) { if (formulaBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && formula_ != null && - formula_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance()) { + formula_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance()) { getFormulaBuilder().mergeFrom(value); } else { formula_ = value; @@ -710,7 +710,7 @@ public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormula return this; } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ public Builder clearFormula() { bitField0_ = (bitField0_ & ~0x00000002); @@ -723,33 +723,33 @@ public Builder clearFormula() { return this; } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder getFormulaBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder getFormulaBuilder() { bitField0_ |= 0x00000002; onChanged(); return getFormulaFieldBuilder().getBuilder(); } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder() { if (formulaBuilder_ != null) { return formulaBuilder_.getMessageOrBuilder(); } else { return formula_ == null ? - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } } /** - * .formulas.PBFormulas formula = 2; + * .formulas.PbFormulas formula = 2; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder> + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder> getFormulaFieldBuilder() { if (formulaBuilder_ == null) { formulaBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder>( getFormula(), getParentForChildren(), isClean()); @@ -758,23 +758,23 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder return formulaBuilder_; } - // @@protoc_insertion_point(builder_scope:dnnf.PBDnnf) + // @@protoc_insertion_point(builder_scope:dnnf.PbDnnf) } - // @@protoc_insertion_point(class_scope:dnnf.PBDnnf) - private static final com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:dnnf.PbDnnf) + private static final com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf(); } - public static com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBDnnf parsePartialFrom( + public PbDnnf parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -793,27 +793,27 @@ public PBDnnf parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dnnf_PBDnnf_descriptor; + internal_static_dnnf_PbDnnf_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_dnnf_PBDnnf_fieldAccessorTable; + internal_static_dnnf_PbDnnf_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -823,9 +823,9 @@ public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf getDefaultInstan descriptor; static { java.lang.String[] descriptorData = { - "\n\ndnnf.proto\022\004dnnf\032\016formulas.proto\"J\n\006PB" + + "\n\ndnnf.proto\022\004dnnf\032\016formulas.proto\"J\n\006Pb" + "Dnnf\022\031\n\021originalVariables\030\001 \003(\t\022%\n\007formu" + - "la\030\002 \001(\0132\024.formulas.PBFormulasB4\n$com.bo" + + "la\030\002 \001(\0132\024.formulas.PbFormulasB4\n$com.bo" + "oleworks.logicng.serializationB\014ProtoBuf" + "Dnnfb\006proto3" }; @@ -834,11 +834,11 @@ public com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf getDefaultInstan new com.google.protobuf.Descriptors.FileDescriptor[] { com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor(), }); - internal_static_dnnf_PBDnnf_descriptor = + internal_static_dnnf_PbDnnf_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_dnnf_PBDnnf_fieldAccessorTable = new + internal_static_dnnf_PbDnnf_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_dnnf_PBDnnf_descriptor, + internal_static_dnnf_PbDnnf_descriptor, new java.lang.String[] { "OriginalVariables", "Formula", }); descriptor.resolveAllFeaturesImmutable(); com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor(); diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufFormulas.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufFormulas.java index ba519ecd..04e91eeb 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufFormulas.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufFormulas.java @@ -26,9 +26,9 @@ public static void registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** - * Protobuf enum {@code formulas.PBComparison} + * Protobuf enum {@code formulas.PbComparison} */ - public enum PBComparison + public enum PbComparison implements com.google.protobuf.ProtocolMessageEnum { /** * EQ = 0; @@ -60,7 +60,7 @@ public enum PBComparison /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBComparison.class.getName()); + PbComparison.class.getName()); } /** * EQ = 0; @@ -98,7 +98,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PBComparison valueOf(int value) { + public static PbComparison valueOf(int value) { return forNumber(value); } @@ -106,7 +106,7 @@ public static PBComparison valueOf(int value) { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PBComparison forNumber(int value) { + public static PbComparison forNumber(int value) { switch (value) { case 0: return EQ; case 1: return GT; @@ -117,15 +117,15 @@ public static PBComparison forNumber(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PBComparison> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PBComparison findValueByNumber(int number) { - return PBComparison.forNumber(number); + PbComparison> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PbComparison findValueByNumber(int number) { + return PbComparison.forNumber(number); } }; @@ -146,9 +146,9 @@ public PBComparison findValueByNumber(int number) { return com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor().getEnumTypes().get(0); } - private static final PBComparison[] VALUES = values(); + private static final PbComparison[] VALUES = values(); - public static PBComparison valueOf( + public static PbComparison valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -162,17 +162,17 @@ public static PBComparison valueOf( private final int value; - private PBComparison(int value) { + private PbComparison(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:formulas.PBComparison) + // @@protoc_insertion_point(enum_scope:formulas.PbComparison) } /** - * Protobuf enum {@code formulas.PBFormulaType} + * Protobuf enum {@code formulas.PbFormulaType} */ - public enum PBFormulaType + public enum PbFormulaType implements com.google.protobuf.ProtocolMessageEnum { /** * CONST = 0; @@ -220,7 +220,7 @@ public enum PBFormulaType /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBFormulaType.class.getName()); + PbFormulaType.class.getName()); } /** * CONST = 0; @@ -274,7 +274,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PBFormulaType valueOf(int value) { + public static PbFormulaType valueOf(int value) { return forNumber(value); } @@ -282,7 +282,7 @@ public static PBFormulaType valueOf(int value) { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PBFormulaType forNumber(int value) { + public static PbFormulaType forNumber(int value) { switch (value) { case 0: return CONST; case 1: return LITERAL; @@ -297,15 +297,15 @@ public static PBFormulaType forNumber(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PBFormulaType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PBFormulaType findValueByNumber(int number) { - return PBFormulaType.forNumber(number); + PbFormulaType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PbFormulaType findValueByNumber(int number) { + return PbFormulaType.forNumber(number); } }; @@ -326,9 +326,9 @@ public PBFormulaType findValueByNumber(int number) { return com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor().getEnumTypes().get(1); } - private static final PBFormulaType[] VALUES = values(); + private static final PbFormulaType[] VALUES = values(); - public static PBFormulaType valueOf( + public static PbFormulaType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -342,15 +342,15 @@ public static PBFormulaType valueOf( private final int value; - private PBFormulaType(int value) { + private PbFormulaType(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:formulas.PBFormulaType) + // @@protoc_insertion_point(enum_scope:formulas.PbFormulaType) } - public interface PBFormulasOrBuilder extends - // @@protoc_insertion_point(interface_extends:formulas.PBFormulas) + public interface PbFormulasOrBuilder extends + // @@protoc_insertion_point(interface_extends:formulas.PbFormulas) com.google.protobuf.MessageOrBuilder { /** @@ -371,27 +371,27 @@ public interface PBFormulasOrBuilder extends int getId(int index); /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return Whether the mapping field is set. */ boolean hasMapping(); /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return The mapping. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getMapping(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getMapping(); /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder getMappingOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder getMappingOrBuilder(); } /** - * Protobuf type {@code formulas.PBFormulas} + * Protobuf type {@code formulas.PbFormulas} */ - public static final class PBFormulas extends + public static final class PbFormulas extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:formulas.PBFormulas) - PBFormulasOrBuilder { + // @@protoc_insertion_point(message_implements:formulas.PbFormulas) + PbFormulasOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -400,27 +400,27 @@ public static final class PBFormulas extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBFormulas.class.getName()); + PbFormulas.class.getName()); } - // Use PBFormulas.newBuilder() to construct. - private PBFormulas(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbFormulas.newBuilder() to construct. + private PbFormulas(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBFormulas() { + private PbFormulas() { id_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulas_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulas_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulas_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulas_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder.class); } private int bitField0_; @@ -455,9 +455,9 @@ public int getId(int index) { private int idMemoizedSerializedSize = -1; public static final int MAPPING_FIELD_NUMBER = 2; - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping mapping_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping mapping_; /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return Whether the mapping field is set. */ @java.lang.Override @@ -465,19 +465,19 @@ public boolean hasMapping() { return ((bitField0_ & 0x00000001) != 0); } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return The mapping. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getMapping() { - return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance() : mapping_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getMapping() { + return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance() : mapping_; } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder getMappingOrBuilder() { - return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance() : mapping_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder getMappingOrBuilder() { + return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance() : mapping_; } private byte memoizedIsInitialized = -1; @@ -542,10 +542,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas) obj; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas) obj; if (!getIdList() .equals(other.getIdList())) return false; @@ -578,44 +578,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -623,26 +623,26 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas p .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -655,7 +655,7 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas p public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -671,26 +671,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code formulas.PBFormulas} + * Protobuf type {@code formulas.PbFormulas} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:formulas.PBFormulas) - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder { + // @@protoc_insertion_point(builder_implements:formulas.PbFormulas) + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulas_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulas_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulas_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulas_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -722,17 +722,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulas_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulas_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas build() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas build() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -740,14 +740,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas build() } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas buildPartial() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas(this); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas buildPartial() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { id_.makeImmutable(); @@ -765,16 +765,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas other) { - if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas other) { + if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance()) return this; if (!other.id_.isEmpty()) { if (id_.isEmpty()) { id_ = other.id_; @@ -939,31 +939,31 @@ public Builder clearId() { return this; } - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping mapping_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping mapping_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder> mappingBuilder_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder> mappingBuilder_; /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return Whether the mapping field is set. */ public boolean hasMapping() { return ((bitField0_ & 0x00000002) != 0); } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; * @return The mapping. */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getMapping() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getMapping() { if (mappingBuilder_ == null) { - return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance() : mapping_; + return mapping_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance() : mapping_; } else { return mappingBuilder_.getMessage(); } } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ - public Builder setMapping(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping value) { + public Builder setMapping(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping value) { if (mappingBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -977,10 +977,10 @@ public Builder setMapping(com.booleworks.logicng.serialization.ProtoBufFormulas. return this; } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ public Builder setMapping( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder builderForValue) { if (mappingBuilder_ == null) { mapping_ = builderForValue.build(); } else { @@ -991,13 +991,13 @@ public Builder setMapping( return this; } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ - public Builder mergeMapping(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping value) { + public Builder mergeMapping(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping value) { if (mappingBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && mapping_ != null && - mapping_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance()) { + mapping_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance()) { getMappingBuilder().mergeFrom(value); } else { mapping_ = value; @@ -1012,7 +1012,7 @@ public Builder mergeMapping(com.booleworks.logicng.serialization.ProtoBufFormula return this; } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ public Builder clearMapping() { bitField0_ = (bitField0_ & ~0x00000002); @@ -1025,33 +1025,33 @@ public Builder clearMapping() { return this; } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder getMappingBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder getMappingBuilder() { bitField0_ |= 0x00000002; onChanged(); return getMappingFieldBuilder().getBuilder(); } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder getMappingOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder getMappingOrBuilder() { if (mappingBuilder_ != null) { return mappingBuilder_.getMessageOrBuilder(); } else { return mapping_ == null ? - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance() : mapping_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance() : mapping_; } } /** - * .formulas.PBFormulaMapping mapping = 2; + * .formulas.PbFormulaMapping mapping = 2; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder> + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder> getMappingFieldBuilder() { if (mappingBuilder_ == null) { mappingBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder>( getMapping(), getParentForChildren(), isClean()); @@ -1060,23 +1060,23 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrB return mappingBuilder_; } - // @@protoc_insertion_point(builder_scope:formulas.PBFormulas) + // @@protoc_insertion_point(builder_scope:formulas.PbFormulas) } - // @@protoc_insertion_point(class_scope:formulas.PBFormulas) - private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:formulas.PbFormulas) + private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas(); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBFormulas parsePartialFrom( + public PbFormulas parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1095,32 +1095,32 @@ public PBFormulas parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBFormulaMappingOrBuilder extends - // @@protoc_insertion_point(interface_extends:formulas.PBFormulaMapping) + public interface PbFormulaMappingOrBuilder extends + // @@protoc_insertion_point(interface_extends:formulas.PbFormulaMapping) com.google.protobuf.MessageOrBuilder { /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ int getMappingCount(); /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ boolean containsMapping( int key); @@ -1128,34 +1128,34 @@ boolean containsMapping( * Use {@link #getMappingMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getMapping(); /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ - java.util.Map + java.util.Map getMappingMap(); /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrDefault( +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula defaultValue); +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula defaultValue); /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrThrow( + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrThrow( int key); } /** - * Protobuf type {@code formulas.PBFormulaMapping} + * Protobuf type {@code formulas.PbFormulaMapping} */ - public static final class PBFormulaMapping extends + public static final class PbFormulaMapping extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:formulas.PBFormulaMapping) - PBFormulaMappingOrBuilder { + // @@protoc_insertion_point(message_implements:formulas.PbFormulaMapping) + PbFormulaMappingOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -1164,18 +1164,18 @@ public static final class PBFormulaMapping extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBFormulaMapping.class.getName()); + PbFormulaMapping.class.getName()); } - // Use PBFormulaMapping.newBuilder() to construct. - private PBFormulaMapping(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbFormulaMapping.newBuilder() to construct. + private PbFormulaMapping(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBFormulaMapping() { + private PbFormulaMapping() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -1193,27 +1193,27 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder.class); } public static final int MAPPING_FIELD_NUMBER = 1; private static final class MappingDefaultEntryHolder { static final com.google.protobuf.MapEntry< - java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula> defaultEntry = + java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula> defaultEntry = com.google.protobuf.MapEntry - .newDefaultInstance( - com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_MappingEntry_descriptor, + .newDefaultInstance( + com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_MappingEntry_descriptor, com.google.protobuf.WireFormat.FieldType.INT32, 0, com.google.protobuf.WireFormat.FieldType.MESSAGE, - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.getDefaultInstance()); } @SuppressWarnings("serial") private com.google.protobuf.MapField< - java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula> mapping_; - private com.google.protobuf.MapField + java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula> mapping_; + private com.google.protobuf.MapField internalGetMapping() { if (mapping_ == null) { return com.google.protobuf.MapField.emptyMapField( @@ -1225,7 +1225,7 @@ public int getMappingCount() { return internalGetMapping().getMap().size(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override public boolean containsMapping( @@ -1238,38 +1238,38 @@ public boolean containsMapping( */ @java.lang.Override @java.lang.Deprecated - public java.util.Map getMapping() { + public java.util.Map getMapping() { return getMappingMap(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override - public java.util.Map getMappingMap() { + public java.util.Map getMappingMap() { return internalGetMapping().getMap(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override public /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrDefault( +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula defaultValue) { +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula defaultValue) { - java.util.Map map = + java.util.Map map = internalGetMapping().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrThrow( + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrThrow( int key) { - java.util.Map map = + java.util.Map map = internalGetMapping().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); @@ -1306,9 +1306,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - for (java.util.Map.Entry entry + for (java.util.Map.Entry entry : internalGetMapping().getMap().entrySet()) { - com.google.protobuf.MapEntry + com.google.protobuf.MapEntry mapping__ = MappingDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) @@ -1326,10 +1326,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping) obj; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping) obj; if (!internalGetMapping().equals( other.internalGetMapping())) return false; @@ -1353,44 +1353,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1398,26 +1398,26 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMap .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1430,7 +1430,7 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMap public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1446,15 +1446,15 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code formulas.PBFormulaMapping} + * Protobuf type {@code formulas.PbFormulaMapping} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:formulas.PBFormulaMapping) - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMappingOrBuilder { + // @@protoc_insertion_point(builder_implements:formulas.PbFormulaMapping) + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMappingOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -1482,12 +1482,12 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFi @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.newBuilder() private Builder() { } @@ -1508,17 +1508,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBFormulaMapping_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbFormulaMapping_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping build() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping build() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1526,14 +1526,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping bu } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping buildPartial() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping(this); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping buildPartial() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.mapping_ = internalGetMapping().build(MappingDefaultEntryHolder.defaultEntry); @@ -1542,16 +1542,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping other) { - if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping other) { + if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping.getDefaultInstance()) return this; internalGetMutableMapping().mergeFrom( other.internalGetMapping()); bitField0_ |= 0x00000001; @@ -1582,7 +1582,7 @@ public Builder mergeFrom( done = true; break; case 10: { - com.google.protobuf.MapEntry + com.google.protobuf.MapEntry mapping__ = input.readMessage( MappingDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableMapping().ensureBuilderMap().put( @@ -1607,30 +1607,30 @@ public Builder mergeFrom( } private int bitField0_; - private static final class MappingConverter implements com.google.protobuf.MapFieldBuilder.Converter { + private static final class MappingConverter implements com.google.protobuf.MapFieldBuilder.Converter { @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula build(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormulaOrBuilder val) { - if (val instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) { return (com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) val; } - return ((com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder) val).build(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula build(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormulaOrBuilder val) { + if (val instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) { return (com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) val; } + return ((com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder) val).build(); } @java.lang.Override - public com.google.protobuf.MapEntry defaultEntry() { + public com.google.protobuf.MapEntry defaultEntry() { return MappingDefaultEntryHolder.defaultEntry; } }; private static final MappingConverter mappingConverter = new MappingConverter(); private com.google.protobuf.MapFieldBuilder< - java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormulaOrBuilder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder> mapping_; - private com.google.protobuf.MapFieldBuilder + java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormulaOrBuilder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder> mapping_; + private com.google.protobuf.MapFieldBuilder internalGetMapping() { if (mapping_ == null) { return new com.google.protobuf.MapFieldBuilder<>(mappingConverter); } return mapping_; } - private com.google.protobuf.MapFieldBuilder + private com.google.protobuf.MapFieldBuilder internalGetMutableMapping() { if (mapping_ == null) { mapping_ = new com.google.protobuf.MapFieldBuilder<>(mappingConverter); @@ -1643,7 +1643,7 @@ public int getMappingCount() { return internalGetMapping().ensureBuilderMap().size(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override public boolean containsMapping( @@ -1656,37 +1656,37 @@ public boolean containsMapping( */ @java.lang.Override @java.lang.Deprecated - public java.util.Map getMapping() { + public java.util.Map getMapping() { return getMappingMap(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override - public java.util.Map getMappingMap() { + public java.util.Map getMappingMap() { return internalGetMapping().getImmutableMap(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override public /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrDefault( +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula defaultValue) { +com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula defaultValue) { - java.util.Map map = internalGetMutableMapping().ensureBuilderMap(); + java.util.Map map = internalGetMutableMapping().ensureBuilderMap(); return map.containsKey(key) ? mappingConverter.build(map.get(key)) : defaultValue; } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getMappingOrThrow( + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getMappingOrThrow( int key) { - java.util.Map map = internalGetMutableMapping().ensureBuilderMap(); + java.util.Map map = internalGetMutableMapping().ensureBuilderMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } @@ -1698,7 +1698,7 @@ public Builder clearMapping() { return this; } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ public Builder removeMapping( int key) { @@ -1711,17 +1711,17 @@ public Builder removeMapping( * Use alternate mutation accessors instead. */ @java.lang.Deprecated - public java.util.Map + public java.util.Map getMutableMapping() { bitField0_ |= 0x00000001; return internalGetMutableMapping().ensureMessageMap(); } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ public Builder putMapping( int key, - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula value) { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula value) { if (value == null) { throw new NullPointerException("map value"); } internalGetMutableMapping().ensureBuilderMap() @@ -1730,11 +1730,11 @@ public Builder putMapping( return this; } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ public Builder putAllMapping( - java.util.Map values) { - for (java.util.Map.Entry e : values.entrySet()) { + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { if (e.getKey() == null || e.getValue() == null) { throw new NullPointerException(); } @@ -1745,40 +1745,40 @@ public Builder putAllMapping( return this; } /** - * map<int32, .formulas.PBInternalFormula> mapping = 1; + * map<int32, .formulas.PbInternalFormula> mapping = 1; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder putMappingBuilderIfAbsent( + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder putMappingBuilderIfAbsent( int key) { - java.util.Map builderMap = internalGetMutableMapping().ensureBuilderMap(); - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormulaOrBuilder entry = builderMap.get(key); + java.util.Map builderMap = internalGetMutableMapping().ensureBuilderMap(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormulaOrBuilder entry = builderMap.get(key); if (entry == null) { - entry = com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.newBuilder(); + entry = com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.newBuilder(); builderMap.put(key, entry); } - if (entry instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) { - entry = ((com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) entry).toBuilder(); + if (entry instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) { + entry = ((com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) entry).toBuilder(); builderMap.put(key, entry); } - return (com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder) entry; + return (com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder) entry; } - // @@protoc_insertion_point(builder_scope:formulas.PBFormulaMapping) + // @@protoc_insertion_point(builder_scope:formulas.PbFormulaMapping) } - // @@protoc_insertion_point(class_scope:formulas.PBFormulaMapping) - private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:formulas.PbFormulaMapping) + private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping(); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBFormulaMapping parsePartialFrom( + public PbFormulaMapping parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1797,41 +1797,41 @@ public PBFormulaMapping parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBInternalFormulaOrBuilder extends - // @@protoc_insertion_point(interface_extends:formulas.PBInternalFormula) + public interface PbInternalFormulaOrBuilder extends + // @@protoc_insertion_point(interface_extends:formulas.PbInternalFormula) com.google.protobuf.MessageOrBuilder { /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return Whether the type field is set. */ boolean hasType(); /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return The enum numeric value on the wire for type. */ int getTypeValue(); /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return The type. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType getType(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType getType(); /** *

    @@ -1886,7 +1886,7 @@ public interface PBInternalFormulaOrBuilder extends
          * PBConstraint
          * 
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return Whether the pbConstraint field is set. */ boolean hasPbConstraint(); @@ -1895,18 +1895,18 @@ public interface PBInternalFormulaOrBuilder extends * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return The pbConstraint. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getPbConstraint(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getPbConstraint(); /** *
          * PBConstraint
          * 
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder(); /** *
    @@ -1938,12 +1938,12 @@ public interface PBInternalFormulaOrBuilder extends
         int getOperand(int index);
       }
       /**
    -   * Protobuf type {@code formulas.PBInternalFormula}
    +   * Protobuf type {@code formulas.PbInternalFormula}
        */
    -  public static final class PBInternalFormula extends
    +  public static final class PbInternalFormula extends
           com.google.protobuf.GeneratedMessage implements
    -      // @@protoc_insertion_point(message_implements:formulas.PBInternalFormula)
    -      PBInternalFormulaOrBuilder {
    +      // @@protoc_insertion_point(message_implements:formulas.PbInternalFormula)
    +      PbInternalFormulaOrBuilder {
       private static final long serialVersionUID = 0L;
         static {
           com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    @@ -1952,13 +1952,13 @@ public static final class PBInternalFormula extends
             /* minor= */ 28,
             /* patch= */ 1,
             /* suffix= */ "",
    -        PBInternalFormula.class.getName());
    +        PbInternalFormula.class.getName());
         }
    -    // Use PBInternalFormula.newBuilder() to construct.
    -    private PBInternalFormula(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    // Use PbInternalFormula.newBuilder() to construct.
    +    private PbInternalFormula(com.google.protobuf.GeneratedMessage.Builder builder) {
           super(builder);
         }
    -    private PBInternalFormula() {
    +    private PbInternalFormula() {
           type_ = 0;
           variable_ = "";
           operand_ = emptyIntList();
    @@ -1966,41 +1966,41 @@ private PBInternalFormula() {
     
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalFormula_descriptor;
    +      return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalFormula_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalFormula_fieldAccessorTable
    +      return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalFormula_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder.class);
    +              com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder.class);
         }
     
         private int bitField0_;
         public static final int TYPE_FIELD_NUMBER = 1;
         private int type_ = 0;
         /**
    -     * optional .formulas.PBFormulaType type = 1;
    +     * optional .formulas.PbFormulaType type = 1;
          * @return Whether the type field is set.
          */
         @java.lang.Override public boolean hasType() {
           return ((bitField0_ & 0x00000001) != 0);
         }
         /**
    -     * optional .formulas.PBFormulaType type = 1;
    +     * optional .formulas.PbFormulaType type = 1;
          * @return The enum numeric value on the wire for type.
          */
         @java.lang.Override public int getTypeValue() {
           return type_;
         }
         /**
    -     * optional .formulas.PBFormulaType type = 1;
    +     * optional .formulas.PbFormulaType type = 1;
          * @return The type.
          */
    -    @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType getType() {
    -      com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType result = com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType.forNumber(type_);
    -      return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType.UNRECOGNIZED : result;
    +    @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType getType() {
    +      com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType result = com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType.forNumber(type_);
    +      return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType.UNRECOGNIZED : result;
         }
     
         public static final int VALUE_FIELD_NUMBER = 2;
    @@ -2090,13 +2090,13 @@ public java.lang.String getVariable() {
         }
     
         public static final int PBCONSTRAINT_FIELD_NUMBER = 4;
    -    private com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint pbConstraint_;
    +    private com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint pbConstraint_;
         /**
          * 
          * PBConstraint
          * 
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return Whether the pbConstraint field is set. */ @java.lang.Override @@ -2108,23 +2108,23 @@ public boolean hasPbConstraint() { * PBConstraint *
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return The pbConstraint. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getPbConstraint() { - return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getPbConstraint() { + return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; } /** *
          * PBConstraint
          * 
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder() { - return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder() { + return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; } public static final int OPERAND_FIELD_NUMBER = 5; @@ -2251,10 +2251,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) obj; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) obj; if (hasType() != other.hasType()) return false; if (hasType()) { @@ -2314,44 +2314,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2359,26 +2359,26 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFo .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2391,7 +2391,7 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFo public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2407,26 +2407,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code formulas.PBInternalFormula} + * Protobuf type {@code formulas.PbInternalFormula} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:formulas.PBInternalFormula) - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormulaOrBuilder { + // @@protoc_insertion_point(builder_implements:formulas.PbInternalFormula) + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormulaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalFormula_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalFormula_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalFormula_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalFormula_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2461,17 +2461,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalFormula_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalFormula_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula build() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula build() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2479,14 +2479,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula b } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula buildPartial() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula(this); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula buildPartial() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -2516,16 +2516,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula other) { - if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula other) { + if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } @@ -2634,21 +2634,21 @@ public Builder mergeFrom( private int type_ = 0; /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return Whether the type field is set. */ @java.lang.Override public boolean hasType() { return ((bitField0_ & 0x00000001) != 0); } /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return The enum numeric value on the wire for type. */ @java.lang.Override public int getTypeValue() { return type_; } /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @param value The enum numeric value on the wire for type to set. * @return This builder for chaining. */ @@ -2659,20 +2659,20 @@ public Builder setTypeValue(int value) { return this; } /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return The type. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType getType() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType result = com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType.forNumber(type_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType.UNRECOGNIZED : result; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType getType() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType result = com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType.forNumber(type_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType.UNRECOGNIZED : result; } /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @param value The type to set. * @return This builder for chaining. */ - public Builder setType(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType value) { + public Builder setType(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType value) { if (value == null) { throw new NullPointerException(); } @@ -2682,7 +2682,7 @@ public Builder setType(com.booleworks.logicng.serialization.ProtoBufFormulas.PBF return this; } /** - * optional .formulas.PBFormulaType type = 1; + * optional .formulas.PbFormulaType type = 1; * @return This builder for chaining. */ public Builder clearType() { @@ -2851,15 +2851,15 @@ public Builder setVariableBytes( return this; } - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint pbConstraint_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint pbConstraint_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder> pbConstraintBuilder_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder> pbConstraintBuilder_; /** *
            * PBConstraint
            * 
    * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return Whether the pbConstraint field is set. */ public boolean hasPbConstraint() { @@ -2870,12 +2870,12 @@ public boolean hasPbConstraint() { * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; * @return The pbConstraint. */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getPbConstraint() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getPbConstraint() { if (pbConstraintBuilder_ == null) { - return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; + return pbConstraint_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; } else { return pbConstraintBuilder_.getMessage(); } @@ -2885,9 +2885,9 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ - public Builder setPbConstraint(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint value) { + public Builder setPbConstraint(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint value) { if (pbConstraintBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2905,10 +2905,10 @@ public Builder setPbConstraint(com.booleworks.logicng.serialization.ProtoBufForm * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ public Builder setPbConstraint( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder builderForValue) { if (pbConstraintBuilder_ == null) { pbConstraint_ = builderForValue.build(); } else { @@ -2923,13 +2923,13 @@ public Builder setPbConstraint( * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ - public Builder mergePbConstraint(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint value) { + public Builder mergePbConstraint(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint value) { if (pbConstraintBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && pbConstraint_ != null && - pbConstraint_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance()) { + pbConstraint_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance()) { getPbConstraintBuilder().mergeFrom(value); } else { pbConstraint_ = value; @@ -2948,7 +2948,7 @@ public Builder mergePbConstraint(com.booleworks.logicng.serialization.ProtoBufFo * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ public Builder clearPbConstraint() { bitField0_ = (bitField0_ & ~0x00000008); @@ -2965,9 +2965,9 @@ public Builder clearPbConstraint() { * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder getPbConstraintBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder getPbConstraintBuilder() { bitField0_ |= 0x00000008; onChanged(); return getPbConstraintFieldBuilder().getBuilder(); @@ -2977,14 +2977,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder getPbConstraintOrBuilder() { if (pbConstraintBuilder_ != null) { return pbConstraintBuilder_.getMessageOrBuilder(); } else { return pbConstraint_ == null ? - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance() : pbConstraint_; } } /** @@ -2992,14 +2992,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo * PBConstraint * * - * optional .formulas.PBInternalPseudoBooleanConstraint pbConstraint = 4; + * optional .formulas.PbInternalPseudoBooleanConstraint pbConstraint = 4; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder> + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder> getPbConstraintFieldBuilder() { if (pbConstraintBuilder_ == null) { pbConstraintBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder>( getPbConstraint(), getParentForChildren(), isClean()); @@ -3120,23 +3120,23 @@ public Builder clearOperand() { return this; } - // @@protoc_insertion_point(builder_scope:formulas.PBInternalFormula) + // @@protoc_insertion_point(builder_scope:formulas.PbInternalFormula) } - // @@protoc_insertion_point(class_scope:formulas.PBInternalFormula) - private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:formulas.PbInternalFormula) + private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula(); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBInternalFormula parsePartialFrom( + public PbInternalFormula parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3155,36 +3155,36 @@ public PBInternalFormula parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBInternalPseudoBooleanConstraintOrBuilder extends - // @@protoc_insertion_point(interface_extends:formulas.PBInternalPseudoBooleanConstraint) + public interface PbInternalPseudoBooleanConstraintOrBuilder extends + // @@protoc_insertion_point(interface_extends:formulas.PbInternalPseudoBooleanConstraint) com.google.protobuf.MessageOrBuilder { /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The enum numeric value on the wire for comparator. */ int getComparatorValue(); /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The comparator. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison getComparator(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison getComparator(); /** * int64 rhs = 2; @@ -3251,12 +3251,12 @@ public interface PBInternalPseudoBooleanConstraintOrBuilder extends getLiteralBytes(int index); } /** - * Protobuf type {@code formulas.PBInternalPseudoBooleanConstraint} + * Protobuf type {@code formulas.PbInternalPseudoBooleanConstraint} */ - public static final class PBInternalPseudoBooleanConstraint extends + public static final class PbInternalPseudoBooleanConstraint extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:formulas.PBInternalPseudoBooleanConstraint) - PBInternalPseudoBooleanConstraintOrBuilder { + // @@protoc_insertion_point(message_implements:formulas.PbInternalPseudoBooleanConstraint) + PbInternalPseudoBooleanConstraintOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -3265,13 +3265,13 @@ public static final class PBInternalPseudoBooleanConstraint extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBInternalPseudoBooleanConstraint.class.getName()); + PbInternalPseudoBooleanConstraint.class.getName()); } - // Use PBInternalPseudoBooleanConstraint.newBuilder() to construct. - private PBInternalPseudoBooleanConstraint(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbInternalPseudoBooleanConstraint.newBuilder() to construct. + private PbInternalPseudoBooleanConstraint(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBInternalPseudoBooleanConstraint() { + private PbInternalPseudoBooleanConstraint() { comparator_ = 0; coefficient_ = emptyLongList(); literal_ = @@ -3280,33 +3280,33 @@ private PBInternalPseudoBooleanConstraint() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalPseudoBooleanConstraint_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalPseudoBooleanConstraint_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder.class); } public static final int COMPARATOR_FIELD_NUMBER = 1; private int comparator_ = 0; /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The enum numeric value on the wire for comparator. */ @java.lang.Override public int getComparatorValue() { return comparator_; } /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The comparator. */ - @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison getComparator() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison result = com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.forNumber(comparator_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.UNRECOGNIZED : result; + @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison getComparator() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison result = com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.forNumber(comparator_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.UNRECOGNIZED : result; } public static final int RHS_FIELD_NUMBER = 2; @@ -3418,7 +3418,7 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (comparator_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.EQ.getNumber()) { + if (comparator_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.EQ.getNumber()) { output.writeEnum(1, comparator_); } if (rhs_ != 0L) { @@ -3443,7 +3443,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (comparator_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.EQ.getNumber()) { + if (comparator_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.EQ.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, comparator_); } @@ -3483,10 +3483,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint) obj; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint other = (com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint) obj; if (comparator_ != other.comparator_) return false; if (getRhs() @@ -3524,44 +3524,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3569,26 +3569,26 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPs .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3601,7 +3601,7 @@ public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPs public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3617,26 +3617,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code formulas.PBInternalPseudoBooleanConstraint} + * Protobuf type {@code formulas.PbInternalPseudoBooleanConstraint} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:formulas.PBInternalPseudoBooleanConstraint) - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraintOrBuilder { + // @@protoc_insertion_point(builder_implements:formulas.PbInternalPseudoBooleanConstraint) + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraintOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalPseudoBooleanConstraint_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalPseudoBooleanConstraint_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.Builder.class); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.class, com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.newBuilder() private Builder() { } @@ -3661,17 +3661,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor; + return com.booleworks.logicng.serialization.ProtoBufFormulas.internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint build() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint build() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3679,14 +3679,14 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint buildPartial() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint(this); + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint buildPartial() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint result = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.comparator_ = comparator_; @@ -3706,16 +3706,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufFormulas @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint other) { - if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint other) { + if (other == com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint.getDefaultInstance()) return this; if (other.comparator_ != 0) { setComparatorValue(other.getComparatorValue()); } @@ -3820,14 +3820,14 @@ public Builder mergeFrom( private int comparator_ = 0; /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The enum numeric value on the wire for comparator. */ @java.lang.Override public int getComparatorValue() { return comparator_; } /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @param value The enum numeric value on the wire for comparator to set. * @return This builder for chaining. */ @@ -3838,20 +3838,20 @@ public Builder setComparatorValue(int value) { return this; } /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return The comparator. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison getComparator() { - com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison result = com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.forNumber(comparator_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison.UNRECOGNIZED : result; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison getComparator() { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison result = com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.forNumber(comparator_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison.UNRECOGNIZED : result; } /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @param value The comparator to set. * @return This builder for chaining. */ - public Builder setComparator(com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison value) { + public Builder setComparator(com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison value) { if (value == null) { throw new NullPointerException(); } @@ -3861,7 +3861,7 @@ public Builder setComparator(com.booleworks.logicng.serialization.ProtoBufFormul return this; } /** - * .formulas.PBComparison comparator = 1; + * .formulas.PbComparison comparator = 1; * @return This builder for chaining. */ public Builder clearComparator() { @@ -4134,23 +4134,23 @@ public Builder addLiteralBytes( return this; } - // @@protoc_insertion_point(builder_scope:formulas.PBInternalPseudoBooleanConstraint) + // @@protoc_insertion_point(builder_scope:formulas.PbInternalPseudoBooleanConstraint) } - // @@protoc_insertion_point(class_scope:formulas.PBInternalPseudoBooleanConstraint) - private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:formulas.PbInternalPseudoBooleanConstraint) + private static final com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint(); } - public static com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBInternalPseudoBooleanConstraint parsePartialFrom( + public PbInternalPseudoBooleanConstraint parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4169,47 +4169,47 @@ public PBInternalPseudoBooleanConstraint parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_formulas_PBFormulas_descriptor; + internal_static_formulas_PbFormulas_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_formulas_PBFormulas_fieldAccessorTable; + internal_static_formulas_PbFormulas_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_formulas_PBFormulaMapping_descriptor; + internal_static_formulas_PbFormulaMapping_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_formulas_PBFormulaMapping_fieldAccessorTable; + internal_static_formulas_PbFormulaMapping_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_formulas_PBFormulaMapping_MappingEntry_descriptor; + internal_static_formulas_PbFormulaMapping_MappingEntry_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_formulas_PBFormulaMapping_MappingEntry_fieldAccessorTable; + internal_static_formulas_PbFormulaMapping_MappingEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_formulas_PBInternalFormula_descriptor; + internal_static_formulas_PbInternalFormula_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_formulas_PBInternalFormula_fieldAccessorTable; + internal_static_formulas_PbInternalFormula_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor; + internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_formulas_PBInternalPseudoBooleanConstraint_fieldAccessorTable; + internal_static_formulas_PbInternalPseudoBooleanConstraint_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -4219,24 +4219,24 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo descriptor; static { java.lang.String[] descriptorData = { - "\n\016formulas.proto\022\010formulas\"E\n\nPBFormulas" + + "\n\016formulas.proto\022\010formulas\"E\n\nPbFormulas" + "\022\n\n\002id\030\001 \003(\005\022+\n\007mapping\030\002 \001(\0132\032.formulas" + - ".PBFormulaMapping\"\231\001\n\020PBFormulaMapping\0228" + - "\n\007mapping\030\001 \003(\0132\'.formulas.PBFormulaMapp" + + ".PbFormulaMapping\"\231\001\n\020PbFormulaMapping\0228" + + "\n\007mapping\030\001 \003(\0132\'.formulas.PbFormulaMapp" + "ing.MappingEntry\032K\n\014MappingEntry\022\013\n\003key\030" + - "\001 \001(\005\022*\n\005value\030\002 \001(\0132\033.formulas.PBIntern" + - "alFormula:\0028\001\"\364\001\n\021PBInternalFormula\022*\n\004t" + - "ype\030\001 \001(\0162\027.formulas.PBFormulaTypeH\000\210\001\001\022" + + "\001 \001(\005\022*\n\005value\030\002 \001(\0132\033.formulas.PbIntern" + + "alFormula:\0028\001\"\364\001\n\021PbInternalFormula\022*\n\004t" + + "ype\030\001 \001(\0162\027.formulas.PbFormulaTypeH\000\210\001\001\022" + "\022\n\005value\030\002 \001(\010H\001\210\001\001\022\025\n\010variable\030\003 \001(\tH\002\210" + - "\001\001\022F\n\014pbConstraint\030\004 \001(\0132+.formulas.PBIn" + + "\001\001\022F\n\014pbConstraint\030\004 \001(\0132+.formulas.PbIn" + "ternalPseudoBooleanConstraintH\003\210\001\001\022\017\n\007op" + "erand\030\005 \003(\005B\007\n\005_typeB\010\n\006_valueB\013\n\t_varia" + - "bleB\017\n\r_pbConstraint\"\202\001\n!PBInternalPseud" + + "bleB\017\n\r_pbConstraint\"\202\001\n!PbInternalPseud" + "oBooleanConstraint\022*\n\ncomparator\030\001 \001(\0162\026" + - ".formulas.PBComparison\022\013\n\003rhs\030\002 \001(\003\022\023\n\013c" + - "oefficient\030\003 \003(\003\022\017\n\007literal\030\004 \003(\t*6\n\014PBC" + + ".formulas.PbComparison\022\013\n\003rhs\030\002 \001(\003\022\023\n\013c" + + "oefficient\030\003 \003(\003\022\017\n\007literal\030\004 \003(\t*6\n\014PbC" + "omparison\022\006\n\002EQ\020\000\022\006\n\002GT\020\001\022\006\n\002GE\020\002\022\006\n\002LT\020" + - "\003\022\006\n\002LE\020\004*n\n\rPBFormulaType\022\t\n\005CONST\020\000\022\013\n" + + "\003\022\006\n\002LE\020\004*n\n\rPbFormulaType\022\t\n\005CONST\020\000\022\013\n" + "\007LITERAL\020\001\022\007\n\003NOT\020\002\022\007\n\003AND\020\003\022\006\n\002OR\020\004\022\010\n\004" + "IMPL\020\005\022\t\n\005EQUIV\020\006\022\007\n\003PBC\020\007\022\r\n\tPREDICATE\020" + "\010B8\n$com.booleworks.logicng.serializatio" + @@ -4246,35 +4246,35 @@ public com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBoo .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }); - internal_static_formulas_PBFormulas_descriptor = + internal_static_formulas_PbFormulas_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_formulas_PBFormulas_fieldAccessorTable = new + internal_static_formulas_PbFormulas_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_formulas_PBFormulas_descriptor, + internal_static_formulas_PbFormulas_descriptor, new java.lang.String[] { "Id", "Mapping", }); - internal_static_formulas_PBFormulaMapping_descriptor = + internal_static_formulas_PbFormulaMapping_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_formulas_PBFormulaMapping_fieldAccessorTable = new + internal_static_formulas_PbFormulaMapping_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_formulas_PBFormulaMapping_descriptor, + internal_static_formulas_PbFormulaMapping_descriptor, new java.lang.String[] { "Mapping", }); - internal_static_formulas_PBFormulaMapping_MappingEntry_descriptor = - internal_static_formulas_PBFormulaMapping_descriptor.getNestedTypes().get(0); - internal_static_formulas_PBFormulaMapping_MappingEntry_fieldAccessorTable = new + internal_static_formulas_PbFormulaMapping_MappingEntry_descriptor = + internal_static_formulas_PbFormulaMapping_descriptor.getNestedTypes().get(0); + internal_static_formulas_PbFormulaMapping_MappingEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_formulas_PBFormulaMapping_MappingEntry_descriptor, + internal_static_formulas_PbFormulaMapping_MappingEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_formulas_PBInternalFormula_descriptor = + internal_static_formulas_PbInternalFormula_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_formulas_PBInternalFormula_fieldAccessorTable = new + internal_static_formulas_PbInternalFormula_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_formulas_PBInternalFormula_descriptor, + internal_static_formulas_PbInternalFormula_descriptor, new java.lang.String[] { "Type", "Value", "Variable", "PbConstraint", "Operand", }); - internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor = + internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_formulas_PBInternalPseudoBooleanConstraint_fieldAccessorTable = new + internal_static_formulas_PbInternalPseudoBooleanConstraint_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_formulas_PBInternalPseudoBooleanConstraint_descriptor, + internal_static_formulas_PbInternalPseudoBooleanConstraint_descriptor, new java.lang.String[] { "Comparator", "Rhs", "Coefficient", "Literal", }); descriptor.resolveAllFeaturesImmutable(); } diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufPropositions.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufPropositions.java index 54b445d1..1fd7b887 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufPropositions.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufPropositions.java @@ -25,24 +25,24 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } - public interface PBStandardPropositionOrBuilder extends - // @@protoc_insertion_point(interface_extends:propositions.PBStandardProposition) + public interface PbStandardPropositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:propositions.PbStandardProposition) com.google.protobuf.MessageOrBuilder { /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return Whether the formula field is set. */ boolean hasFormula(); /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return The formula. */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula(); /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder(); /** * string description = 2; @@ -57,12 +57,12 @@ public interface PBStandardPropositionOrBuilder extends getDescriptionBytes(); } /** - * Protobuf type {@code propositions.PBStandardProposition} + * Protobuf type {@code propositions.PbStandardProposition} */ - public static final class PBStandardProposition extends + public static final class PbStandardProposition extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:propositions.PBStandardProposition) - PBStandardPropositionOrBuilder { + // @@protoc_insertion_point(message_implements:propositions.PbStandardProposition) + PbStandardPropositionOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -71,34 +71,34 @@ public static final class PBStandardProposition extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBStandardProposition.class.getName()); + PbStandardProposition.class.getName()); } - // Use PBStandardProposition.newBuilder() to construct. - private PBStandardProposition(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbStandardProposition.newBuilder() to construct. + private PbStandardProposition(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBStandardProposition() { + private PbStandardProposition() { description_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PBStandardProposition_descriptor; + return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PbStandardProposition_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PBStandardProposition_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PbStandardProposition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.class, com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.Builder.class); + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.class, com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.Builder.class); } private int bitField0_; public static final int FORMULA_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas formula_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas formula_; /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return Whether the formula field is set. */ @java.lang.Override @@ -106,19 +106,19 @@ public boolean hasFormula() { return ((bitField0_ & 0x00000001) != 0); } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return The formula. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula() { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula() { + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder() { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder() { + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } public static final int DESCRIPTION_FIELD_NUMBER = 2; @@ -206,10 +206,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition other = (com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition) obj; + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition other = (com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition) obj; if (hasFormula() != other.hasFormula()) return false; if (hasFormula()) { @@ -240,44 +240,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -285,26 +285,26 @@ public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStanda .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -317,7 +317,7 @@ public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStanda public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -333,26 +333,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code propositions.PBStandardProposition} + * Protobuf type {@code propositions.PbStandardProposition} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:propositions.PBStandardProposition) - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardPropositionOrBuilder { + // @@protoc_insertion_point(builder_implements:propositions.PbStandardProposition) + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardPropositionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PBStandardProposition_descriptor; + return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PbStandardProposition_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PBStandardProposition_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PbStandardProposition_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.class, com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.Builder.class); + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.class, com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -384,17 +384,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PBStandardProposition_descriptor; + return com.booleworks.logicng.serialization.ProtoBufPropositions.internal_static_propositions_PbStandardProposition_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition build() { - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition build() { + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -402,14 +402,14 @@ public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardPropo } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition buildPartial() { - com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition result = new com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition(this); + public com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition buildPartial() { + com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition result = new com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -426,16 +426,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufProposit @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition other) { - if (other == com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition other) { + if (other == com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition.getDefaultInstance()) return this; if (other.hasFormula()) { mergeFormula(other.getFormula()); } @@ -499,31 +499,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas formula_; + private com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas formula_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder> formulaBuilder_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder> formulaBuilder_; /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return Whether the formula field is set. */ public boolean hasFormula() { return ((bitField0_ & 0x00000001) != 0); } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; * @return The formula. */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas getFormula() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas getFormula() { if (formulaBuilder_ == null) { - return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + return formula_ == null ? com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } else { return formulaBuilder_.getMessage(); } } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ - public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas value) { + public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas value) { if (formulaBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -537,10 +537,10 @@ public Builder setFormula(com.booleworks.logicng.serialization.ProtoBufFormulas. return this; } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ public Builder setFormula( - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder builderForValue) { if (formulaBuilder_ == null) { formula_ = builderForValue.build(); } else { @@ -551,13 +551,13 @@ public Builder setFormula( return this; } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ - public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas value) { + public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas value) { if (formulaBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && formula_ != null && - formula_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance()) { + formula_ != com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance()) { getFormulaBuilder().mergeFrom(value); } else { formula_ = value; @@ -572,7 +572,7 @@ public Builder mergeFormula(com.booleworks.logicng.serialization.ProtoBufFormula return this; } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ public Builder clearFormula() { bitField0_ = (bitField0_ & ~0x00000001); @@ -585,33 +585,33 @@ public Builder clearFormula() { return this; } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder getFormulaBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder getFormulaBuilder() { bitField0_ |= 0x00000001; onChanged(); return getFormulaFieldBuilder().getBuilder(); } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ - public com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder getFormulaOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder getFormulaOrBuilder() { if (formulaBuilder_ != null) { return formulaBuilder_.getMessageOrBuilder(); } else { return formula_ == null ? - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.getDefaultInstance() : formula_; + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.getDefaultInstance() : formula_; } } /** - * .formulas.PBFormulas formula = 1; + * .formulas.PbFormulas formula = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder> + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder> getFormulaFieldBuilder() { if (formulaBuilder_ == null) { formulaBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulasOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas.Builder, com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulasOrBuilder>( getFormula(), getParentForChildren(), isClean()); @@ -692,23 +692,23 @@ public Builder setDescriptionBytes( return this; } - // @@protoc_insertion_point(builder_scope:propositions.PBStandardProposition) + // @@protoc_insertion_point(builder_scope:propositions.PbStandardProposition) } - // @@protoc_insertion_point(class_scope:propositions.PBStandardProposition) - private static final com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:propositions.PbStandardProposition) + private static final com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition(); } - public static com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBStandardProposition parsePartialFrom( + public PbStandardProposition parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -727,27 +727,27 @@ public PBStandardProposition parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_propositions_PBStandardProposition_descriptor; + internal_static_propositions_PbStandardProposition_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_propositions_PBStandardProposition_fieldAccessorTable; + internal_static_propositions_PbStandardProposition_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -758,8 +758,8 @@ public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardPropo static { java.lang.String[] descriptorData = { "\n\022propositions.proto\022\014propositions\032\016form" + - "ulas.proto\"S\n\025PBStandardProposition\022%\n\007f" + - "ormula\030\001 \001(\0132\024.formulas.PBFormulas\022\023\n\013de" + + "ulas.proto\"S\n\025PbStandardProposition\022%\n\007f" + + "ormula\030\001 \001(\0132\024.formulas.PbFormulas\022\023\n\013de" + "scription\030\002 \001(\tB<\n$com.booleworks.logicn" + "g.serializationB\024ProtoBufPropositionsb\006p" + "roto3" @@ -769,11 +769,11 @@ public com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardPropo new com.google.protobuf.Descriptors.FileDescriptor[] { com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor(), }); - internal_static_propositions_PBStandardProposition_descriptor = + internal_static_propositions_PbStandardProposition_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_propositions_PBStandardProposition_fieldAccessorTable = new + internal_static_propositions_PbStandardProposition_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_propositions_PBStandardProposition_descriptor, + internal_static_propositions_PbStandardProposition_descriptor, new java.lang.String[] { "Formula", "Description", }); descriptor.resolveAllFeaturesImmutable(); com.booleworks.logicng.serialization.ProtoBufFormulas.getDescriptor(); diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSatSolver.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSatSolver.java index ab914ba4..7f6de742 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSatSolver.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSatSolver.java @@ -25,24 +25,24 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } - public interface PBSatSolverOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBSatSolver) + public interface PbSatSolverOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbSatSolver) com.google.protobuf.MessageOrBuilder { /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return Whether the config field is set. */ boolean hasConfig(); /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return The config. */ - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getConfig(); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getConfig(); /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder getConfigOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder getConfigOrBuilder(); /** * bool inSatCall = 2; @@ -83,19 +83,19 @@ int getName2IdxOrThrow( java.lang.String key); /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return Whether the validStates field is set. */ boolean hasValidStates(); /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return The validStates. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getValidStates(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getValidStates(); /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getValidStatesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getValidStatesOrBuilder(); /** * int32 nextStateId = 5; @@ -116,169 +116,169 @@ int getName2IdxOrThrow( int getQhead(); /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return Whether the unitClauses field is set. */ boolean hasUnitClauses(); /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return The unitClauses. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getUnitClauses(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getUnitClauses(); /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getUnitClausesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getUnitClausesOrBuilder(); /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return Whether the clauses field is set. */ boolean hasClauses(); /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return The clauses. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getClauses(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getClauses(); /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getClausesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getClausesOrBuilder(); /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return Whether the learnts field is set. */ boolean hasLearnts(); /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return The learnts. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getLearnts(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getLearnts(); /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getLearntsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getLearntsOrBuilder(); /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return Whether the watches field is set. */ boolean hasWatches(); /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return The watches. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatches(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatches(); /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesOrBuilder(); /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return Whether the vars field is set. */ boolean hasVars(); /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return The vars. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getVars(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getVars(); /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder getVarsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder getVarsOrBuilder(); /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return Whether the orderHeap field is set. */ boolean hasOrderHeap(); /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return The orderHeap. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getOrderHeap(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getOrderHeap(); /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder getOrderHeapOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder getOrderHeapOrBuilder(); /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return Whether the trail field is set. */ boolean hasTrail(); /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return The trail. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrail(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrail(); /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailOrBuilder(); /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return Whether the trailLim field is set. */ boolean hasTrailLim(); /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return The trailLim. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrailLim(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrailLim(); /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailLimOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailLimOrBuilder(); /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return Whether the model field is set. */ boolean hasModel(); /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return The model. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getModel(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getModel(); /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getModelOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getModelOrBuilder(); /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return Whether the assumptionConflict field is set. */ boolean hasAssumptionConflict(); /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return The assumptionConflict. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptionConflict(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptionConflict(); /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionConflictOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionConflictOrBuilder(); /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return Whether the assumptions field is set. */ boolean hasAssumptions(); /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return The assumptions. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptions(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptions(); /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionsOrBuilder(); /** * repeated bytes assumptionPropositions = 19; @@ -298,19 +298,19 @@ int getName2IdxOrThrow( com.google.protobuf.ByteString getAssumptionPropositions(int index); /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return Whether the seen field is set. */ boolean hasSeen(); /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return The seen. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getSeen(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getSeen(); /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getSeenOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getSeenOrBuilder(); /** * int32 analyzeBtLevel = 21; @@ -349,43 +349,43 @@ int getName2IdxOrThrow( int getLearntsLiterals(); /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - java.util.List + java.util.List getPgOriginalClausesList(); /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getPgOriginalClauses(int index); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getPgOriginalClauses(int index); /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ int getPgOriginalClausesCount(); /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - java.util.List + java.util.List getPgOriginalClausesOrBuilderList(); /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder getPgOriginalClausesOrBuilder( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder getPgOriginalClausesOrBuilder( int index); /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return Whether the pgProof field is set. */ boolean hasPgProof(); /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return The pgProof. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getPgProof(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getPgProof(); /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder getPgProofOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder getPgProofOrBuilder(); /** * bool computingBackbone = 29; @@ -394,41 +394,41 @@ com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInforma boolean getComputingBackbone(); /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return Whether the backboneCandidates field is set. */ boolean hasBackboneCandidates(); /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return The backboneCandidates. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneCandidates(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneCandidates(); /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneCandidatesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneCandidatesOrBuilder(); /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return Whether the backboneAssumptions field is set. */ boolean hasBackboneAssumptions(); /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return The backboneAssumptions. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneAssumptions(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneAssumptions(); /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneAssumptionsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneAssumptionsOrBuilder(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ int getBackboneMapCount(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ boolean containsBackboneMap( int key); @@ -436,25 +436,25 @@ boolean containsBackboneMap( * Use {@link #getBackboneMapMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getBackboneMap(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ - java.util.Map + java.util.Map getBackboneMapMap(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrDefault( +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate defaultValue); +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate defaultValue); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrThrow( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrThrow( int key); /** * Use {@link #getBackboneMapValueMap()} instead. @@ -463,36 +463,36 @@ com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate get java.util.Map getBackboneMapValue(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ java.util.Map getBackboneMapValueMap(); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ int getBackboneMapValueOrDefault( int key, int defaultValue); /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ int getBackboneMapValueOrThrow( int key); /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return Whether the selectionOrder field is set. */ boolean hasSelectionOrder(); /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return The selectionOrder. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getSelectionOrder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getSelectionOrder(); /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getSelectionOrderOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getSelectionOrderOrBuilder(); /** * int32 selectionOrderIdx = 34; @@ -501,79 +501,79 @@ int getBackboneMapValueOrThrow( int getSelectionOrderIdx(); /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return Whether the watchesBin field is set. */ boolean hasWatchesBin(); /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return The watchesBin. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatchesBin(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatchesBin(); /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesBinOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesBinOrBuilder(); /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return Whether the permDiff field is set. */ boolean hasPermDiff(); /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return The permDiff. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getPermDiff(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getPermDiff(); /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getPermDiffOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getPermDiffOrBuilder(); /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return Whether the lastDecisionLevel field is set. */ boolean hasLastDecisionLevel(); /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return The lastDecisionLevel. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getLastDecisionLevel(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getLastDecisionLevel(); /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getLastDecisionLevelOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getLastDecisionLevelOrBuilder(); /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return Whether the lbdQueue field is set. */ boolean hasLbdQueue(); /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return The lbdQueue. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getLbdQueue(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getLbdQueue(); /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder getLbdQueueOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder getLbdQueueOrBuilder(); /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return Whether the trailQueue field is set. */ boolean hasTrailQueue(); /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return The trailQueue. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getTrailQueue(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getTrailQueue(); /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder getTrailQueueOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder getTrailQueueOrBuilder(); /** * int32 myflag = 40; @@ -618,12 +618,12 @@ int getBackboneMapValueOrThrow( int getCurRestart(); } /** - * Protobuf type {@code solver.PBSatSolver} + * Protobuf type {@code solver.PbSatSolver} */ - public static final class PBSatSolver extends + public static final class PbSatSolver extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBSatSolver) - PBSatSolverOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbSatSolver) + PbSatSolverOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -632,20 +632,20 @@ public static final class PBSatSolver extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBSatSolver.class.getName()); + PbSatSolver.class.getName()); } - // Use PBSatSolver.newBuilder() to construct. - private PBSatSolver(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbSatSolver.newBuilder() to construct. + private PbSatSolver(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBSatSolver() { + private PbSatSolver() { assumptionPropositions_ = emptyList(com.google.protobuf.ByteString.class); pgOriginalClauses_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -665,16 +665,16 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.class, com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.class, com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.Builder.class); } private int bitField0_; public static final int CONFIG_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig config_; + private com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig config_; /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return Whether the config field is set. */ @java.lang.Override @@ -682,19 +682,19 @@ public boolean hasConfig() { return ((bitField0_ & 0x00000001) != 0); } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return The config. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getConfig() { - return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance() : config_; + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getConfig() { + return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance() : config_; } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder getConfigOrBuilder() { - return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance() : config_; + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder getConfigOrBuilder() { + return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance() : config_; } public static final int INSATCALL_FIELD_NUMBER = 2; @@ -714,7 +714,7 @@ private static final class Name2IdxDefaultEntryHolder { java.lang.String, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( - com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_Name2idxEntry_descriptor, + com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_Name2idxEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.INT32, @@ -786,9 +786,9 @@ public int getName2IdxOrThrow( } public static final int VALIDSTATES_FIELD_NUMBER = 4; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector validStates_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector validStates_; /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return Whether the validStates field is set. */ @java.lang.Override @@ -796,19 +796,19 @@ public boolean hasValidStates() { return ((bitField0_ & 0x00000002) != 0); } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return The validStates. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getValidStates() { - return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : validStates_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getValidStates() { + return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : validStates_; } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getValidStatesOrBuilder() { - return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : validStates_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getValidStatesOrBuilder() { + return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : validStates_; } public static final int NEXTSTATEID_FIELD_NUMBER = 5; @@ -845,9 +845,9 @@ public int getQhead() { } public static final int UNITCLAUSES_FIELD_NUMBER = 8; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector unitClauses_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector unitClauses_; /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return Whether the unitClauses field is set. */ @java.lang.Override @@ -855,25 +855,25 @@ public boolean hasUnitClauses() { return ((bitField0_ & 0x00000004) != 0); } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return The unitClauses. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getUnitClauses() { - return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : unitClauses_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getUnitClauses() { + return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : unitClauses_; } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getUnitClausesOrBuilder() { - return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : unitClauses_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getUnitClausesOrBuilder() { + return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : unitClauses_; } public static final int CLAUSES_FIELD_NUMBER = 9; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector clauses_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector clauses_; /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return Whether the clauses field is set. */ @java.lang.Override @@ -881,25 +881,25 @@ public boolean hasClauses() { return ((bitField0_ & 0x00000008) != 0); } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return The clauses. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getClauses() { - return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : clauses_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getClauses() { + return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : clauses_; } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getClausesOrBuilder() { - return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : clauses_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getClausesOrBuilder() { + return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : clauses_; } public static final int LEARNTS_FIELD_NUMBER = 10; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector learnts_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector learnts_; /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return Whether the learnts field is set. */ @java.lang.Override @@ -907,25 +907,25 @@ public boolean hasLearnts() { return ((bitField0_ & 0x00000010) != 0); } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return The learnts. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getLearnts() { - return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : learnts_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getLearnts() { + return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : learnts_; } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getLearntsOrBuilder() { - return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : learnts_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getLearntsOrBuilder() { + return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : learnts_; } public static final int WATCHES_FIELD_NUMBER = 11; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector watches_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector watches_; /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return Whether the watches field is set. */ @java.lang.Override @@ -933,25 +933,25 @@ public boolean hasWatches() { return ((bitField0_ & 0x00000020) != 0); } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return The watches. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatches() { - return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watches_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatches() { + return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watches_; } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesOrBuilder() { - return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watches_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesOrBuilder() { + return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watches_; } public static final int VARS_FIELD_NUMBER = 12; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector vars_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector vars_; /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return Whether the vars field is set. */ @java.lang.Override @@ -959,25 +959,25 @@ public boolean hasVars() { return ((bitField0_ & 0x00000040) != 0); } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return The vars. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getVars() { - return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance() : vars_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getVars() { + return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance() : vars_; } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder getVarsOrBuilder() { - return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance() : vars_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder getVarsOrBuilder() { + return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance() : vars_; } public static final int ORDERHEAP_FIELD_NUMBER = 13; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap orderHeap_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap orderHeap_; /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return Whether the orderHeap field is set. */ @java.lang.Override @@ -985,25 +985,25 @@ public boolean hasOrderHeap() { return ((bitField0_ & 0x00000080) != 0); } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return The orderHeap. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getOrderHeap() { - return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance() : orderHeap_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getOrderHeap() { + return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance() : orderHeap_; } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder getOrderHeapOrBuilder() { - return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance() : orderHeap_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder getOrderHeapOrBuilder() { + return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance() : orderHeap_; } public static final int TRAIL_FIELD_NUMBER = 14; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector trail_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector trail_; /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return Whether the trail field is set. */ @java.lang.Override @@ -1011,25 +1011,25 @@ public boolean hasTrail() { return ((bitField0_ & 0x00000100) != 0); } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return The trail. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrail() { - return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trail_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrail() { + return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trail_; } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailOrBuilder() { - return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trail_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailOrBuilder() { + return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trail_; } public static final int TRAILLIM_FIELD_NUMBER = 15; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector trailLim_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector trailLim_; /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return Whether the trailLim field is set. */ @java.lang.Override @@ -1037,25 +1037,25 @@ public boolean hasTrailLim() { return ((bitField0_ & 0x00000200) != 0); } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return The trailLim. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrailLim() { - return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trailLim_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrailLim() { + return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trailLim_; } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailLimOrBuilder() { - return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trailLim_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailLimOrBuilder() { + return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trailLim_; } public static final int MODEL_FIELD_NUMBER = 16; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector model_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector model_; /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return Whether the model field is set. */ @java.lang.Override @@ -1063,25 +1063,25 @@ public boolean hasModel() { return ((bitField0_ & 0x00000400) != 0); } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return The model. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getModel() { - return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : model_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getModel() { + return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : model_; } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getModelOrBuilder() { - return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : model_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getModelOrBuilder() { + return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : model_; } public static final int ASSUMPTIONCONFLICT_FIELD_NUMBER = 17; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector assumptionConflict_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector assumptionConflict_; /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return Whether the assumptionConflict field is set. */ @java.lang.Override @@ -1089,25 +1089,25 @@ public boolean hasAssumptionConflict() { return ((bitField0_ & 0x00000800) != 0); } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return The assumptionConflict. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptionConflict() { - return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptionConflict_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptionConflict() { + return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptionConflict_; } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionConflictOrBuilder() { - return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptionConflict_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionConflictOrBuilder() { + return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptionConflict_; } public static final int ASSUMPTIONS_FIELD_NUMBER = 18; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector assumptions_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector assumptions_; /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return Whether the assumptions field is set. */ @java.lang.Override @@ -1115,19 +1115,19 @@ public boolean hasAssumptions() { return ((bitField0_ & 0x00001000) != 0); } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return The assumptions. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptions() { - return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptions_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptions() { + return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptions_; } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionsOrBuilder() { - return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptions_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionsOrBuilder() { + return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptions_; } public static final int ASSUMPTIONPROPOSITIONS_FIELD_NUMBER = 19; @@ -1160,9 +1160,9 @@ public com.google.protobuf.ByteString getAssumptionPropositions(int index) { } public static final int SEEN_FIELD_NUMBER = 20; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector seen_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector seen_; /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return Whether the seen field is set. */ @java.lang.Override @@ -1170,19 +1170,19 @@ public boolean hasSeen() { return ((bitField0_ & 0x00002000) != 0); } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return The seen. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getSeen() { - return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : seen_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getSeen() { + return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : seen_; } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getSeenOrBuilder() { - return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : seen_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getSeenOrBuilder() { + return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : seen_; } public static final int ANALYZEBTLEVEL_FIELD_NUMBER = 21; @@ -1253,49 +1253,49 @@ public int getLearntsLiterals() { public static final int PGORIGINALCLAUSES_FIELD_NUMBER = 27; @SuppressWarnings("serial") - private java.util.List pgOriginalClauses_; + private java.util.List pgOriginalClauses_; /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ @java.lang.Override - public java.util.List getPgOriginalClausesList() { + public java.util.List getPgOriginalClausesList() { return pgOriginalClauses_; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ @java.lang.Override - public java.util.List + public java.util.List getPgOriginalClausesOrBuilderList() { return pgOriginalClauses_; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ @java.lang.Override public int getPgOriginalClausesCount() { return pgOriginalClauses_.size(); } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getPgOriginalClauses(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getPgOriginalClauses(int index) { return pgOriginalClauses_.get(index); } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder getPgOriginalClausesOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder getPgOriginalClausesOrBuilder( int index) { return pgOriginalClauses_.get(index); } public static final int PGPROOF_FIELD_NUMBER = 28; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector pgProof_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector pgProof_; /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return Whether the pgProof field is set. */ @java.lang.Override @@ -1303,19 +1303,19 @@ public boolean hasPgProof() { return ((bitField0_ & 0x00004000) != 0); } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return The pgProof. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getPgProof() { - return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance() : pgProof_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getPgProof() { + return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance() : pgProof_; } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder getPgProofOrBuilder() { - return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance() : pgProof_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder getPgProofOrBuilder() { + return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance() : pgProof_; } public static final int COMPUTINGBACKBONE_FIELD_NUMBER = 29; @@ -1330,9 +1330,9 @@ public boolean getComputingBackbone() { } public static final int BACKBONECANDIDATES_FIELD_NUMBER = 30; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector backboneCandidates_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector backboneCandidates_; /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return Whether the backboneCandidates field is set. */ @java.lang.Override @@ -1340,25 +1340,25 @@ public boolean hasBackboneCandidates() { return ((bitField0_ & 0x00008000) != 0); } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return The backboneCandidates. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneCandidates() { - return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneCandidates_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneCandidates() { + return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneCandidates_; } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneCandidatesOrBuilder() { - return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneCandidates_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneCandidatesOrBuilder() { + return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneCandidates_; } public static final int BACKBONEASSUMPTIONS_FIELD_NUMBER = 31; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector backboneAssumptions_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector backboneAssumptions_; /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return Whether the backboneAssumptions field is set. */ @java.lang.Override @@ -1366,19 +1366,19 @@ public boolean hasBackboneAssumptions() { return ((bitField0_ & 0x00010000) != 0); } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return The backboneAssumptions. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneAssumptions() { - return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneAssumptions_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneAssumptions() { + return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneAssumptions_; } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneAssumptionsOrBuilder() { - return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneAssumptions_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneAssumptionsOrBuilder() { + return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneAssumptions_; } public static final int BACKBONEMAP_FIELD_NUMBER = 32; @@ -1387,11 +1387,11 @@ private static final class BackboneMapDefaultEntryHolder { java.lang.Integer, java.lang.Integer> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( - com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_BackboneMapEntry_descriptor, + com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_BackboneMapEntry_descriptor, com.google.protobuf.WireFormat.FieldType.INT32, 0, com.google.protobuf.WireFormat.FieldType.ENUM, - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.FALSE.getNumber()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.FALSE.getNumber()); } @SuppressWarnings("serial") private com.google.protobuf.MapField< @@ -1406,22 +1406,22 @@ private static final class BackboneMapDefaultEntryHolder { } private static final com.google.protobuf.Internal.MapAdapter.Converter< - java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate> backboneMapValueConverter = + java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate> backboneMapValueConverter = com.google.protobuf.Internal.MapAdapter.newEnumConverter( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.internalGetValueMap(), - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.UNRECOGNIZED); - private static final java.util.Map + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.internalGetValueMap(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.UNRECOGNIZED); + private static final java.util.Map internalGetAdaptedBackboneMapMap( java.util.Map map) { return new com.google.protobuf.Internal.MapAdapter< - java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate, java.lang.Integer>( + java.lang.Integer, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate, java.lang.Integer>( map, backboneMapValueConverter); } public int getBackboneMapCount() { return internalGetBackboneMap().getMap().size(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public boolean containsBackboneMap( @@ -1434,27 +1434,27 @@ public boolean containsBackboneMap( */ @java.lang.Override @java.lang.Deprecated - public java.util.Map + public java.util.Map getBackboneMap() { return getBackboneMapMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override - public java.util.Map + public java.util.Map getBackboneMapMap() { return internalGetAdaptedBackboneMapMap( internalGetBackboneMap().getMap());} /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrDefault( +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate defaultValue) { +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate defaultValue) { java.util.Map map = internalGetBackboneMap().getMap(); @@ -1463,10 +1463,10 @@ com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate get : defaultValue; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrThrow( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrThrow( int key) { java.util.Map map = @@ -1486,7 +1486,7 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTrist return getBackboneMapValueMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public java.util.Map @@ -1494,7 +1494,7 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTrist return internalGetBackboneMap().getMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public int getBackboneMapValueOrDefault( @@ -1506,7 +1506,7 @@ public int getBackboneMapValueOrDefault( return map.containsKey(key) ? map.get(key) : defaultValue; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public int getBackboneMapValueOrThrow( @@ -1521,9 +1521,9 @@ public int getBackboneMapValueOrThrow( } public static final int SELECTIONORDER_FIELD_NUMBER = 33; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector selectionOrder_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector selectionOrder_; /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return Whether the selectionOrder field is set. */ @java.lang.Override @@ -1531,19 +1531,19 @@ public boolean hasSelectionOrder() { return ((bitField0_ & 0x00020000) != 0); } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return The selectionOrder. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getSelectionOrder() { - return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : selectionOrder_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getSelectionOrder() { + return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : selectionOrder_; } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getSelectionOrderOrBuilder() { - return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : selectionOrder_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getSelectionOrderOrBuilder() { + return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : selectionOrder_; } public static final int SELECTIONORDERIDX_FIELD_NUMBER = 34; @@ -1558,9 +1558,9 @@ public int getSelectionOrderIdx() { } public static final int WATCHESBIN_FIELD_NUMBER = 35; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector watchesBin_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector watchesBin_; /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return Whether the watchesBin field is set. */ @java.lang.Override @@ -1568,25 +1568,25 @@ public boolean hasWatchesBin() { return ((bitField0_ & 0x00040000) != 0); } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return The watchesBin. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatchesBin() { - return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watchesBin_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatchesBin() { + return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watchesBin_; } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesBinOrBuilder() { - return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watchesBin_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesBinOrBuilder() { + return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watchesBin_; } public static final int PERMDIFF_FIELD_NUMBER = 36; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector permDiff_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector permDiff_; /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return Whether the permDiff field is set. */ @java.lang.Override @@ -1594,25 +1594,25 @@ public boolean hasPermDiff() { return ((bitField0_ & 0x00080000) != 0); } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return The permDiff. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getPermDiff() { - return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : permDiff_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getPermDiff() { + return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : permDiff_; } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getPermDiffOrBuilder() { - return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : permDiff_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getPermDiffOrBuilder() { + return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : permDiff_; } public static final int LASTDECISIONLEVEL_FIELD_NUMBER = 37; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector lastDecisionLevel_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector lastDecisionLevel_; /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return Whether the lastDecisionLevel field is set. */ @java.lang.Override @@ -1620,25 +1620,25 @@ public boolean hasLastDecisionLevel() { return ((bitField0_ & 0x00100000) != 0); } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return The lastDecisionLevel. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getLastDecisionLevel() { - return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : lastDecisionLevel_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getLastDecisionLevel() { + return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : lastDecisionLevel_; } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getLastDecisionLevelOrBuilder() { - return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : lastDecisionLevel_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getLastDecisionLevelOrBuilder() { + return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : lastDecisionLevel_; } public static final int LBDQUEUE_FIELD_NUMBER = 38; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue lbdQueue_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue lbdQueue_; /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return Whether the lbdQueue field is set. */ @java.lang.Override @@ -1646,25 +1646,25 @@ public boolean hasLbdQueue() { return ((bitField0_ & 0x00200000) != 0); } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return The lbdQueue. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getLbdQueue() { - return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance() : lbdQueue_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getLbdQueue() { + return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance() : lbdQueue_; } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder getLbdQueueOrBuilder() { - return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance() : lbdQueue_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder getLbdQueueOrBuilder() { + return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance() : lbdQueue_; } public static final int TRAILQUEUE_FIELD_NUMBER = 39; - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue trailQueue_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue trailQueue_; /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return Whether the trailQueue field is set. */ @java.lang.Override @@ -1672,19 +1672,19 @@ public boolean hasTrailQueue() { return ((bitField0_ & 0x00400000) != 0); } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return The trailQueue. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getTrailQueue() { - return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance() : trailQueue_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getTrailQueue() { + return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance() : trailQueue_; } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder getTrailQueueOrBuilder() { - return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance() : trailQueue_; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder getTrailQueueOrBuilder() { + return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance() : trailQueue_; } public static final int MYFLAG_FIELD_NUMBER = 40; @@ -2142,10 +2142,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver other = (com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver) obj; + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver other = (com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver) obj; if (hasConfig() != other.hasConfig()) return false; if (hasConfig()) { @@ -2482,44 +2482,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2527,26 +2527,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2559,7 +2559,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2575,15 +2575,15 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBSatSolver} + * Protobuf type {@code solver.PbSatSolver} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBSatSolver) - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolverOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbSatSolver) + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolverOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -2615,12 +2615,12 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFi @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.class, com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.class, com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2814,17 +2814,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PBSatSolver_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSatSolver.internal_static_solver_PbSatSolver_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver build() { - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver build() { + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2832,8 +2832,8 @@ public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver build( } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver result = new com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver(this); + public com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver result = new com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } if (bitField1_ != 0) { buildPartial1(result); } @@ -2841,7 +2841,7 @@ public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver buildP return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver result) { if (pgOriginalClausesBuilder_ == null) { if (((bitField0_ & 0x04000000) != 0)) { pgOriginalClauses_ = java.util.Collections.unmodifiableList(pgOriginalClauses_); @@ -2853,7 +2853,7 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -3006,7 +3006,7 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSatSolve result.bitField0_ |= to_bitField0_; } - private void buildPartial1(com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver result) { + private void buildPartial1(com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver result) { int from_bitField1_ = bitField1_; int to_bitField0_ = 0; if (((from_bitField1_ & 0x00000001) != 0)) { @@ -3074,16 +3074,16 @@ private void buildPartial1(com.booleworks.logicng.serialization.ProtoBufSatSolve @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver.getDefaultInstance()) return this; if (other.hasConfig()) { mergeConfig(other.getConfig()); } @@ -3443,9 +3443,9 @@ public Builder mergeFrom( break; } // case 208 case 218: { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation m = + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.parser(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.parser(), extensionRegistry); if (pgOriginalClausesBuilder_ == null) { ensurePgOriginalClausesIsMutable(); @@ -3590,31 +3590,31 @@ public Builder mergeFrom( private int bitField0_; private int bitField1_; - private com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig config_; + private com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig config_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder> configBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder> configBuilder_; /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return Whether the config field is set. */ public boolean hasConfig() { return ((bitField0_ & 0x00000001) != 0); } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; * @return The config. */ - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getConfig() { + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getConfig() { if (configBuilder_ == null) { - return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance() : config_; + return config_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance() : config_; } else { return configBuilder_.getMessage(); } } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ - public Builder setConfig(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig value) { + public Builder setConfig(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig value) { if (configBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3628,10 +3628,10 @@ public Builder setConfig(com.booleworks.logicng.serialization.ProtoBufSolverComm return this; } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ public Builder setConfig( - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder builderForValue) { if (configBuilder_ == null) { config_ = builderForValue.build(); } else { @@ -3642,13 +3642,13 @@ public Builder setConfig( return this; } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ - public Builder mergeConfig(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig value) { + public Builder mergeConfig(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig value) { if (configBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && config_ != null && - config_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance()) { + config_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance()) { getConfigBuilder().mergeFrom(value); } else { config_ = value; @@ -3663,7 +3663,7 @@ public Builder mergeConfig(com.booleworks.logicng.serialization.ProtoBufSolverCo return this; } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ public Builder clearConfig() { bitField0_ = (bitField0_ & ~0x00000001); @@ -3676,33 +3676,33 @@ public Builder clearConfig() { return this; } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder getConfigBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder getConfigBuilder() { bitField0_ |= 0x00000001; onChanged(); return getConfigFieldBuilder().getBuilder(); } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder getConfigOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder getConfigOrBuilder() { if (configBuilder_ != null) { return configBuilder_.getMessageOrBuilder(); } else { return config_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance() : config_; + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance() : config_; } } /** - * .solver.PBSatSolverConfig config = 1; + * .solver.PbSatSolverConfig config = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder> getConfigFieldBuilder() { if (configBuilder_ == null) { configBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder>( getConfig(), getParentForChildren(), isClean()); @@ -3868,31 +3868,31 @@ public Builder putAllName2Idx( return this; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector validStates_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector validStates_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> validStatesBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> validStatesBuilder_; /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return Whether the validStates field is set. */ public boolean hasValidStates() { return ((bitField0_ & 0x00000008) != 0); } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; * @return The validStates. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getValidStates() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getValidStates() { if (validStatesBuilder_ == null) { - return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : validStates_; + return validStates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : validStates_; } else { return validStatesBuilder_.getMessage(); } } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ - public Builder setValidStates(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setValidStates(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (validStatesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3906,10 +3906,10 @@ public Builder setValidStates(com.booleworks.logicng.serialization.ProtoBufColle return this; } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ public Builder setValidStates( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (validStatesBuilder_ == null) { validStates_ = builderForValue.build(); } else { @@ -3920,13 +3920,13 @@ public Builder setValidStates( return this; } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ - public Builder mergeValidStates(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeValidStates(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (validStatesBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && validStates_ != null && - validStates_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + validStates_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getValidStatesBuilder().mergeFrom(value); } else { validStates_ = value; @@ -3941,7 +3941,7 @@ public Builder mergeValidStates(com.booleworks.logicng.serialization.ProtoBufCol return this; } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ public Builder clearValidStates() { bitField0_ = (bitField0_ & ~0x00000008); @@ -3954,33 +3954,33 @@ public Builder clearValidStates() { return this; } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getValidStatesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getValidStatesBuilder() { bitField0_ |= 0x00000008; onChanged(); return getValidStatesFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getValidStatesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getValidStatesOrBuilder() { if (validStatesBuilder_ != null) { return validStatesBuilder_.getMessageOrBuilder(); } else { return validStates_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : validStates_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : validStates_; } } /** - * .collections.PBIntVector validStates = 4; + * .collections.PbIntVector validStates = 4; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getValidStatesFieldBuilder() { if (validStatesBuilder_ == null) { validStatesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getValidStates(), getParentForChildren(), isClean()); @@ -4085,31 +4085,31 @@ public Builder clearQhead() { return this; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector unitClauses_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector unitClauses_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> unitClausesBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> unitClausesBuilder_; /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return Whether the unitClauses field is set. */ public boolean hasUnitClauses() { return ((bitField0_ & 0x00000080) != 0); } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; * @return The unitClauses. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getUnitClauses() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getUnitClauses() { if (unitClausesBuilder_ == null) { - return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : unitClauses_; + return unitClauses_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : unitClauses_; } else { return unitClausesBuilder_.getMessage(); } } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ - public Builder setUnitClauses(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setUnitClauses(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (unitClausesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4123,10 +4123,10 @@ public Builder setUnitClauses(com.booleworks.logicng.serialization.ProtoBufColle return this; } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ public Builder setUnitClauses( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (unitClausesBuilder_ == null) { unitClauses_ = builderForValue.build(); } else { @@ -4137,13 +4137,13 @@ public Builder setUnitClauses( return this; } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ - public Builder mergeUnitClauses(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeUnitClauses(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (unitClausesBuilder_ == null) { if (((bitField0_ & 0x00000080) != 0) && unitClauses_ != null && - unitClauses_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + unitClauses_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getUnitClausesBuilder().mergeFrom(value); } else { unitClauses_ = value; @@ -4158,7 +4158,7 @@ public Builder mergeUnitClauses(com.booleworks.logicng.serialization.ProtoBufCol return this; } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ public Builder clearUnitClauses() { bitField0_ = (bitField0_ & ~0x00000080); @@ -4171,33 +4171,33 @@ public Builder clearUnitClauses() { return this; } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getUnitClausesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getUnitClausesBuilder() { bitField0_ |= 0x00000080; onChanged(); return getUnitClausesFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getUnitClausesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getUnitClausesOrBuilder() { if (unitClausesBuilder_ != null) { return unitClausesBuilder_.getMessageOrBuilder(); } else { return unitClauses_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : unitClauses_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : unitClauses_; } } /** - * .collections.PBIntVector unitClauses = 8; + * .collections.PbIntVector unitClauses = 8; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getUnitClausesFieldBuilder() { if (unitClausesBuilder_ == null) { unitClausesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getUnitClauses(), getParentForChildren(), isClean()); @@ -4206,31 +4206,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return unitClausesBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector clauses_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector clauses_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder> clausesBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder> clausesBuilder_; /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return Whether the clauses field is set. */ public boolean hasClauses() { return ((bitField0_ & 0x00000100) != 0); } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; * @return The clauses. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getClauses() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getClauses() { if (clausesBuilder_ == null) { - return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : clauses_; + return clauses_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : clauses_; } else { return clausesBuilder_.getMessage(); } } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ - public Builder setClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector value) { + public Builder setClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector value) { if (clausesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4244,10 +4244,10 @@ public Builder setClauses(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ public Builder setClauses( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder builderForValue) { if (clausesBuilder_ == null) { clauses_ = builderForValue.build(); } else { @@ -4258,13 +4258,13 @@ public Builder setClauses( return this; } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ - public Builder mergeClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector value) { + public Builder mergeClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector value) { if (clausesBuilder_ == null) { if (((bitField0_ & 0x00000100) != 0) && clauses_ != null && - clauses_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance()) { + clauses_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance()) { getClausesBuilder().mergeFrom(value); } else { clauses_ = value; @@ -4279,7 +4279,7 @@ public Builder mergeClauses(com.booleworks.logicng.serialization.ProtoBufSolverD return this; } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ public Builder clearClauses() { bitField0_ = (bitField0_ & ~0x00000100); @@ -4292,33 +4292,33 @@ public Builder clearClauses() { return this; } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder getClausesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder getClausesBuilder() { bitField0_ |= 0x00000100; onChanged(); return getClausesFieldBuilder().getBuilder(); } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getClausesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getClausesOrBuilder() { if (clausesBuilder_ != null) { return clausesBuilder_.getMessageOrBuilder(); } else { return clauses_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : clauses_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : clauses_; } } /** - * .solver.PBClauseVector clauses = 9; + * .solver.PbClauseVector clauses = 9; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder> getClausesFieldBuilder() { if (clausesBuilder_ == null) { clausesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder>( getClauses(), getParentForChildren(), isClean()); @@ -4327,31 +4327,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus return clausesBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector learnts_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector learnts_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder> learntsBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder> learntsBuilder_; /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return Whether the learnts field is set. */ public boolean hasLearnts() { return ((bitField0_ & 0x00000200) != 0); } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; * @return The learnts. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getLearnts() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getLearnts() { if (learntsBuilder_ == null) { - return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : learnts_; + return learnts_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : learnts_; } else { return learntsBuilder_.getMessage(); } } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ - public Builder setLearnts(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector value) { + public Builder setLearnts(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector value) { if (learntsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4365,10 +4365,10 @@ public Builder setLearnts(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ public Builder setLearnts( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder builderForValue) { if (learntsBuilder_ == null) { learnts_ = builderForValue.build(); } else { @@ -4379,13 +4379,13 @@ public Builder setLearnts( return this; } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ - public Builder mergeLearnts(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector value) { + public Builder mergeLearnts(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector value) { if (learntsBuilder_ == null) { if (((bitField0_ & 0x00000200) != 0) && learnts_ != null && - learnts_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance()) { + learnts_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance()) { getLearntsBuilder().mergeFrom(value); } else { learnts_ = value; @@ -4400,7 +4400,7 @@ public Builder mergeLearnts(com.booleworks.logicng.serialization.ProtoBufSolverD return this; } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ public Builder clearLearnts() { bitField0_ = (bitField0_ & ~0x00000200); @@ -4413,33 +4413,33 @@ public Builder clearLearnts() { return this; } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder getLearntsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder getLearntsBuilder() { bitField0_ |= 0x00000200; onChanged(); return getLearntsFieldBuilder().getBuilder(); } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder getLearntsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder getLearntsOrBuilder() { if (learntsBuilder_ != null) { return learntsBuilder_.getMessageOrBuilder(); } else { return learnts_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance() : learnts_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance() : learnts_; } } /** - * .solver.PBClauseVector learnts = 10; + * .solver.PbClauseVector learnts = 10; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder> getLearntsFieldBuilder() { if (learntsBuilder_ == null) { learntsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder>( getLearnts(), getParentForChildren(), isClean()); @@ -4448,31 +4448,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus return learntsBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector watches_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector watches_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder> watchesBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder> watchesBuilder_; /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return Whether the watches field is set. */ public boolean hasWatches() { return ((bitField0_ & 0x00000400) != 0); } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; * @return The watches. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatches() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatches() { if (watchesBuilder_ == null) { - return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watches_; + return watches_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watches_; } else { return watchesBuilder_.getMessage(); } } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ - public Builder setWatches(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector value) { + public Builder setWatches(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector value) { if (watchesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4486,10 +4486,10 @@ public Builder setWatches(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ public Builder setWatches( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder builderForValue) { if (watchesBuilder_ == null) { watches_ = builderForValue.build(); } else { @@ -4500,13 +4500,13 @@ public Builder setWatches( return this; } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ - public Builder mergeWatches(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector value) { + public Builder mergeWatches(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector value) { if (watchesBuilder_ == null) { if (((bitField0_ & 0x00000400) != 0) && watches_ != null && - watches_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance()) { + watches_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance()) { getWatchesBuilder().mergeFrom(value); } else { watches_ = value; @@ -4521,7 +4521,7 @@ public Builder mergeWatches(com.booleworks.logicng.serialization.ProtoBufSolverD return this; } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ public Builder clearWatches() { bitField0_ = (bitField0_ & ~0x00000400); @@ -4534,33 +4534,33 @@ public Builder clearWatches() { return this; } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder getWatchesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder getWatchesBuilder() { bitField0_ |= 0x00000400; onChanged(); return getWatchesFieldBuilder().getBuilder(); } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesOrBuilder() { if (watchesBuilder_ != null) { return watchesBuilder_.getMessageOrBuilder(); } else { return watches_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watches_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watches_; } } /** - * .solver.PBWatcherVectorVector watches = 11; + * .solver.PbWatcherVectorVector watches = 11; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder> getWatchesFieldBuilder() { if (watchesBuilder_ == null) { watchesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder>( getWatches(), getParentForChildren(), isClean()); @@ -4569,31 +4569,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch return watchesBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector vars_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector vars_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder> varsBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder> varsBuilder_; /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return Whether the vars field is set. */ public boolean hasVars() { return ((bitField0_ & 0x00000800) != 0); } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; * @return The vars. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getVars() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getVars() { if (varsBuilder_ == null) { - return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance() : vars_; + return vars_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance() : vars_; } else { return varsBuilder_.getMessage(); } } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ - public Builder setVars(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector value) { + public Builder setVars(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector value) { if (varsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4607,10 +4607,10 @@ public Builder setVars(com.booleworks.logicng.serialization.ProtoBufSolverDatast return this; } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ public Builder setVars( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder builderForValue) { if (varsBuilder_ == null) { vars_ = builderForValue.build(); } else { @@ -4621,13 +4621,13 @@ public Builder setVars( return this; } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ - public Builder mergeVars(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector value) { + public Builder mergeVars(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector value) { if (varsBuilder_ == null) { if (((bitField0_ & 0x00000800) != 0) && vars_ != null && - vars_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance()) { + vars_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance()) { getVarsBuilder().mergeFrom(value); } else { vars_ = value; @@ -4642,7 +4642,7 @@ public Builder mergeVars(com.booleworks.logicng.serialization.ProtoBufSolverData return this; } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ public Builder clearVars() { bitField0_ = (bitField0_ & ~0x00000800); @@ -4655,33 +4655,33 @@ public Builder clearVars() { return this; } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder getVarsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder getVarsBuilder() { bitField0_ |= 0x00000800; onChanged(); return getVarsFieldBuilder().getBuilder(); } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder getVarsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder getVarsOrBuilder() { if (varsBuilder_ != null) { return varsBuilder_.getMessageOrBuilder(); } else { return vars_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance() : vars_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance() : vars_; } } /** - * .solver.PBVariableVector vars = 12; + * .solver.PbVariableVector vars = 12; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder> getVarsFieldBuilder() { if (varsBuilder_ == null) { varsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder>( getVars(), getParentForChildren(), isClean()); @@ -4690,31 +4690,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria return varsBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap orderHeap_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap orderHeap_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder> orderHeapBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder> orderHeapBuilder_; /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return Whether the orderHeap field is set. */ public boolean hasOrderHeap() { return ((bitField0_ & 0x00001000) != 0); } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; * @return The orderHeap. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getOrderHeap() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getOrderHeap() { if (orderHeapBuilder_ == null) { - return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance() : orderHeap_; + return orderHeap_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance() : orderHeap_; } else { return orderHeapBuilder_.getMessage(); } } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ - public Builder setOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap value) { + public Builder setOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap value) { if (orderHeapBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4728,10 +4728,10 @@ public Builder setOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolverD return this; } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ public Builder setOrderHeap( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder builderForValue) { if (orderHeapBuilder_ == null) { orderHeap_ = builderForValue.build(); } else { @@ -4742,13 +4742,13 @@ public Builder setOrderHeap( return this; } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ - public Builder mergeOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap value) { + public Builder mergeOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap value) { if (orderHeapBuilder_ == null) { if (((bitField0_ & 0x00001000) != 0) && orderHeap_ != null && - orderHeap_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance()) { + orderHeap_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance()) { getOrderHeapBuilder().mergeFrom(value); } else { orderHeap_ = value; @@ -4763,7 +4763,7 @@ public Builder mergeOrderHeap(com.booleworks.logicng.serialization.ProtoBufSolve return this; } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ public Builder clearOrderHeap() { bitField0_ = (bitField0_ & ~0x00001000); @@ -4776,33 +4776,33 @@ public Builder clearOrderHeap() { return this; } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder getOrderHeapBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder getOrderHeapBuilder() { bitField0_ |= 0x00001000; onChanged(); return getOrderHeapFieldBuilder().getBuilder(); } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder getOrderHeapOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder getOrderHeapOrBuilder() { if (orderHeapBuilder_ != null) { return orderHeapBuilder_.getMessageOrBuilder(); } else { return orderHeap_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance() : orderHeap_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance() : orderHeap_; } } /** - * .solver.PBHeap orderHeap = 13; + * .solver.PbHeap orderHeap = 13; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder> getOrderHeapFieldBuilder() { if (orderHeapBuilder_ == null) { orderHeapBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder>( getOrderHeap(), getParentForChildren(), isClean()); @@ -4811,31 +4811,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapO return orderHeapBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector trail_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector trail_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> trailBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> trailBuilder_; /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return Whether the trail field is set. */ public boolean hasTrail() { return ((bitField0_ & 0x00002000) != 0); } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; * @return The trail. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrail() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrail() { if (trailBuilder_ == null) { - return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trail_; + return trail_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trail_; } else { return trailBuilder_.getMessage(); } } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ - public Builder setTrail(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setTrail(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (trailBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4849,10 +4849,10 @@ public Builder setTrail(com.booleworks.logicng.serialization.ProtoBufCollections return this; } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ public Builder setTrail( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (trailBuilder_ == null) { trail_ = builderForValue.build(); } else { @@ -4863,13 +4863,13 @@ public Builder setTrail( return this; } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ - public Builder mergeTrail(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeTrail(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (trailBuilder_ == null) { if (((bitField0_ & 0x00002000) != 0) && trail_ != null && - trail_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + trail_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getTrailBuilder().mergeFrom(value); } else { trail_ = value; @@ -4884,7 +4884,7 @@ public Builder mergeTrail(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ public Builder clearTrail() { bitField0_ = (bitField0_ & ~0x00002000); @@ -4897,33 +4897,33 @@ public Builder clearTrail() { return this; } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getTrailBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getTrailBuilder() { bitField0_ |= 0x00002000; onChanged(); return getTrailFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailOrBuilder() { if (trailBuilder_ != null) { return trailBuilder_.getMessageOrBuilder(); } else { return trail_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trail_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trail_; } } /** - * .collections.PBIntVector trail = 14; + * .collections.PbIntVector trail = 14; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getTrailFieldBuilder() { if (trailBuilder_ == null) { trailBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getTrail(), getParentForChildren(), isClean()); @@ -4932,31 +4932,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return trailBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector trailLim_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector trailLim_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> trailLimBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> trailLimBuilder_; /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return Whether the trailLim field is set. */ public boolean hasTrailLim() { return ((bitField0_ & 0x00004000) != 0); } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; * @return The trailLim. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getTrailLim() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getTrailLim() { if (trailLimBuilder_ == null) { - return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trailLim_; + return trailLim_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trailLim_; } else { return trailLimBuilder_.getMessage(); } } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ - public Builder setTrailLim(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setTrailLim(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (trailLimBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4970,10 +4970,10 @@ public Builder setTrailLim(com.booleworks.logicng.serialization.ProtoBufCollecti return this; } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ public Builder setTrailLim( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (trailLimBuilder_ == null) { trailLim_ = builderForValue.build(); } else { @@ -4984,13 +4984,13 @@ public Builder setTrailLim( return this; } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ - public Builder mergeTrailLim(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeTrailLim(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (trailLimBuilder_ == null) { if (((bitField0_ & 0x00004000) != 0) && trailLim_ != null && - trailLim_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + trailLim_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getTrailLimBuilder().mergeFrom(value); } else { trailLim_ = value; @@ -5005,7 +5005,7 @@ public Builder mergeTrailLim(com.booleworks.logicng.serialization.ProtoBufCollec return this; } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ public Builder clearTrailLim() { bitField0_ = (bitField0_ & ~0x00004000); @@ -5018,33 +5018,33 @@ public Builder clearTrailLim() { return this; } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getTrailLimBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getTrailLimBuilder() { bitField0_ |= 0x00004000; onChanged(); return getTrailLimFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getTrailLimOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getTrailLimOrBuilder() { if (trailLimBuilder_ != null) { return trailLimBuilder_.getMessageOrBuilder(); } else { return trailLim_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : trailLim_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : trailLim_; } } /** - * .collections.PBIntVector trailLim = 15; + * .collections.PbIntVector trailLim = 15; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getTrailLimFieldBuilder() { if (trailLimBuilder_ == null) { trailLimBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getTrailLim(), getParentForChildren(), isClean()); @@ -5053,31 +5053,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return trailLimBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector model_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector model_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder> modelBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder> modelBuilder_; /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return Whether the model field is set. */ public boolean hasModel() { return ((bitField0_ & 0x00008000) != 0); } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; * @return The model. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getModel() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getModel() { if (modelBuilder_ == null) { - return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : model_; + return model_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : model_; } else { return modelBuilder_.getMessage(); } } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ - public Builder setModel(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector value) { + public Builder setModel(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector value) { if (modelBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5091,10 +5091,10 @@ public Builder setModel(com.booleworks.logicng.serialization.ProtoBufCollections return this; } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ public Builder setModel( - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder builderForValue) { if (modelBuilder_ == null) { model_ = builderForValue.build(); } else { @@ -5105,13 +5105,13 @@ public Builder setModel( return this; } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ - public Builder mergeModel(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector value) { + public Builder mergeModel(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector value) { if (modelBuilder_ == null) { if (((bitField0_ & 0x00008000) != 0) && model_ != null && - model_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance()) { + model_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance()) { getModelBuilder().mergeFrom(value); } else { model_ = value; @@ -5126,7 +5126,7 @@ public Builder mergeModel(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ public Builder clearModel() { bitField0_ = (bitField0_ & ~0x00008000); @@ -5139,33 +5139,33 @@ public Builder clearModel() { return this; } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder getModelBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder getModelBuilder() { bitField0_ |= 0x00008000; onChanged(); return getModelFieldBuilder().getBuilder(); } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getModelOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getModelOrBuilder() { if (modelBuilder_ != null) { return modelBuilder_.getMessageOrBuilder(); } else { return model_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : model_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : model_; } } /** - * .collections.PBBooleanVector model = 16; + * .collections.PbBooleanVector model = 16; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder> getModelFieldBuilder() { if (modelBuilder_ == null) { modelBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder>( getModel(), getParentForChildren(), isClean()); @@ -5174,31 +5174,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorO return modelBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector assumptionConflict_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector assumptionConflict_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> assumptionConflictBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> assumptionConflictBuilder_; /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return Whether the assumptionConflict field is set. */ public boolean hasAssumptionConflict() { return ((bitField0_ & 0x00010000) != 0); } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; * @return The assumptionConflict. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptionConflict() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptionConflict() { if (assumptionConflictBuilder_ == null) { - return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptionConflict_; + return assumptionConflict_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptionConflict_; } else { return assumptionConflictBuilder_.getMessage(); } } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ - public Builder setAssumptionConflict(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setAssumptionConflict(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (assumptionConflictBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5212,10 +5212,10 @@ public Builder setAssumptionConflict(com.booleworks.logicng.serialization.ProtoB return this; } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ public Builder setAssumptionConflict( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (assumptionConflictBuilder_ == null) { assumptionConflict_ = builderForValue.build(); } else { @@ -5226,13 +5226,13 @@ public Builder setAssumptionConflict( return this; } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ - public Builder mergeAssumptionConflict(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeAssumptionConflict(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (assumptionConflictBuilder_ == null) { if (((bitField0_ & 0x00010000) != 0) && assumptionConflict_ != null && - assumptionConflict_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + assumptionConflict_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getAssumptionConflictBuilder().mergeFrom(value); } else { assumptionConflict_ = value; @@ -5247,7 +5247,7 @@ public Builder mergeAssumptionConflict(com.booleworks.logicng.serialization.Prot return this; } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ public Builder clearAssumptionConflict() { bitField0_ = (bitField0_ & ~0x00010000); @@ -5260,33 +5260,33 @@ public Builder clearAssumptionConflict() { return this; } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getAssumptionConflictBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getAssumptionConflictBuilder() { bitField0_ |= 0x00010000; onChanged(); return getAssumptionConflictFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionConflictOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionConflictOrBuilder() { if (assumptionConflictBuilder_ != null) { return assumptionConflictBuilder_.getMessageOrBuilder(); } else { return assumptionConflict_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptionConflict_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptionConflict_; } } /** - * .collections.PBIntVector assumptionConflict = 17; + * .collections.PbIntVector assumptionConflict = 17; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getAssumptionConflictFieldBuilder() { if (assumptionConflictBuilder_ == null) { assumptionConflictBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getAssumptionConflict(), getParentForChildren(), isClean()); @@ -5295,31 +5295,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return assumptionConflictBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector assumptions_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector assumptions_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> assumptionsBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> assumptionsBuilder_; /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return Whether the assumptions field is set. */ public boolean hasAssumptions() { return ((bitField0_ & 0x00020000) != 0); } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; * @return The assumptions. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getAssumptions() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getAssumptions() { if (assumptionsBuilder_ == null) { - return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptions_; + return assumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptions_; } else { return assumptionsBuilder_.getMessage(); } } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ - public Builder setAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (assumptionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5333,10 +5333,10 @@ public Builder setAssumptions(com.booleworks.logicng.serialization.ProtoBufColle return this; } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ public Builder setAssumptions( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (assumptionsBuilder_ == null) { assumptions_ = builderForValue.build(); } else { @@ -5347,13 +5347,13 @@ public Builder setAssumptions( return this; } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ - public Builder mergeAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (assumptionsBuilder_ == null) { if (((bitField0_ & 0x00020000) != 0) && assumptions_ != null && - assumptions_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + assumptions_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getAssumptionsBuilder().mergeFrom(value); } else { assumptions_ = value; @@ -5368,7 +5368,7 @@ public Builder mergeAssumptions(com.booleworks.logicng.serialization.ProtoBufCol return this; } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ public Builder clearAssumptions() { bitField0_ = (bitField0_ & ~0x00020000); @@ -5381,33 +5381,33 @@ public Builder clearAssumptions() { return this; } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getAssumptionsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getAssumptionsBuilder() { bitField0_ |= 0x00020000; onChanged(); return getAssumptionsFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getAssumptionsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getAssumptionsOrBuilder() { if (assumptionsBuilder_ != null) { return assumptionsBuilder_.getMessageOrBuilder(); } else { return assumptions_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : assumptions_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : assumptions_; } } /** - * .collections.PBIntVector assumptions = 18; + * .collections.PbIntVector assumptions = 18; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getAssumptionsFieldBuilder() { if (assumptionsBuilder_ == null) { assumptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getAssumptions(), getParentForChildren(), isClean()); @@ -5500,31 +5500,31 @@ public Builder clearAssumptionPropositions() { return this; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector seen_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector seen_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder> seenBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder> seenBuilder_; /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return Whether the seen field is set. */ public boolean hasSeen() { return ((bitField0_ & 0x00080000) != 0); } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; * @return The seen. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector getSeen() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector getSeen() { if (seenBuilder_ == null) { - return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : seen_; + return seen_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : seen_; } else { return seenBuilder_.getMessage(); } } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ - public Builder setSeen(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector value) { + public Builder setSeen(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector value) { if (seenBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5538,10 +5538,10 @@ public Builder setSeen(com.booleworks.logicng.serialization.ProtoBufCollections. return this; } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ public Builder setSeen( - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder builderForValue) { if (seenBuilder_ == null) { seen_ = builderForValue.build(); } else { @@ -5552,13 +5552,13 @@ public Builder setSeen( return this; } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ - public Builder mergeSeen(com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector value) { + public Builder mergeSeen(com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector value) { if (seenBuilder_ == null) { if (((bitField0_ & 0x00080000) != 0) && seen_ != null && - seen_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance()) { + seen_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance()) { getSeenBuilder().mergeFrom(value); } else { seen_ = value; @@ -5573,7 +5573,7 @@ public Builder mergeSeen(com.booleworks.logicng.serialization.ProtoBufCollection return this; } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ public Builder clearSeen() { bitField0_ = (bitField0_ & ~0x00080000); @@ -5586,33 +5586,33 @@ public Builder clearSeen() { return this; } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder getSeenBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder getSeenBuilder() { bitField0_ |= 0x00080000; onChanged(); return getSeenFieldBuilder().getBuilder(); } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder getSeenOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder getSeenOrBuilder() { if (seenBuilder_ != null) { return seenBuilder_.getMessageOrBuilder(); } else { return seen_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.getDefaultInstance() : seen_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.getDefaultInstance() : seen_; } } /** - * .collections.PBBooleanVector seen = 20; + * .collections.PbBooleanVector seen = 20; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder> getSeenFieldBuilder() { if (seenBuilder_ == null) { seenBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVectorOrBuilder>( getSeen(), getParentForChildren(), isClean()); @@ -5813,22 +5813,22 @@ public Builder clearLearntsLiterals() { return this; } - private java.util.List pgOriginalClauses_ = + private java.util.List pgOriginalClauses_ = java.util.Collections.emptyList(); private void ensurePgOriginalClausesIsMutable() { if (!((bitField0_ & 0x04000000) != 0)) { - pgOriginalClauses_ = new java.util.ArrayList(pgOriginalClauses_); + pgOriginalClauses_ = new java.util.ArrayList(pgOriginalClauses_); bitField0_ |= 0x04000000; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder> pgOriginalClausesBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder> pgOriginalClausesBuilder_; /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public java.util.List getPgOriginalClausesList() { + public java.util.List getPgOriginalClausesList() { if (pgOriginalClausesBuilder_ == null) { return java.util.Collections.unmodifiableList(pgOriginalClauses_); } else { @@ -5836,7 +5836,7 @@ public java.util.Listrepeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public int getPgOriginalClausesCount() { if (pgOriginalClausesBuilder_ == null) { @@ -5846,9 +5846,9 @@ public int getPgOriginalClausesCount() { } } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getPgOriginalClauses(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getPgOriginalClauses(int index) { if (pgOriginalClausesBuilder_ == null) { return pgOriginalClauses_.get(index); } else { @@ -5856,10 +5856,10 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof } } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder setPgOriginalClauses( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation value) { if (pgOriginalClausesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5873,10 +5873,10 @@ public Builder setPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder setPgOriginalClauses( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder builderForValue) { if (pgOriginalClausesBuilder_ == null) { ensurePgOriginalClausesIsMutable(); pgOriginalClauses_.set(index, builderForValue.build()); @@ -5887,9 +5887,9 @@ public Builder setPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public Builder addPgOriginalClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation value) { + public Builder addPgOriginalClauses(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation value) { if (pgOriginalClausesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5903,10 +5903,10 @@ public Builder addPgOriginalClauses(com.booleworks.logicng.serialization.ProtoBu return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder addPgOriginalClauses( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation value) { if (pgOriginalClausesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5920,10 +5920,10 @@ public Builder addPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder addPgOriginalClauses( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder builderForValue) { if (pgOriginalClausesBuilder_ == null) { ensurePgOriginalClausesIsMutable(); pgOriginalClauses_.add(builderForValue.build()); @@ -5934,10 +5934,10 @@ public Builder addPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder addPgOriginalClauses( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder builderForValue) { if (pgOriginalClausesBuilder_ == null) { ensurePgOriginalClausesIsMutable(); pgOriginalClauses_.add(index, builderForValue.build()); @@ -5948,10 +5948,10 @@ public Builder addPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder addAllPgOriginalClauses( - java.lang.Iterable values) { + java.lang.Iterable values) { if (pgOriginalClausesBuilder_ == null) { ensurePgOriginalClausesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -5963,7 +5963,7 @@ public Builder addAllPgOriginalClauses( return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder clearPgOriginalClauses() { if (pgOriginalClausesBuilder_ == null) { @@ -5976,7 +5976,7 @@ public Builder clearPgOriginalClauses() { return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ public Builder removePgOriginalClauses(int index) { if (pgOriginalClausesBuilder_ == null) { @@ -5989,16 +5989,16 @@ public Builder removePgOriginalClauses(int index) { return this; } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder getPgOriginalClausesBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder getPgOriginalClausesBuilder( int index) { return getPgOriginalClausesFieldBuilder().getBuilder(index); } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder getPgOriginalClausesOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder getPgOriginalClausesOrBuilder( int index) { if (pgOriginalClausesBuilder_ == null) { return pgOriginalClauses_.get(index); } else { @@ -6006,9 +6006,9 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof } } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public java.util.List + public java.util.List getPgOriginalClausesOrBuilderList() { if (pgOriginalClausesBuilder_ != null) { return pgOriginalClausesBuilder_.getMessageOrBuilderList(); @@ -6017,33 +6017,33 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof } } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder addPgOriginalClausesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder addPgOriginalClausesBuilder() { return getPgOriginalClausesFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.getDefaultInstance()); } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder addPgOriginalClausesBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder addPgOriginalClausesBuilder( int index) { return getPgOriginalClausesFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.getDefaultInstance()); } /** - * repeated .solver.PBProofInformation pgOriginalClauses = 27; + * repeated .solver.PbProofInformation pgOriginalClauses = 27; */ - public java.util.List + public java.util.List getPgOriginalClausesBuilderList() { return getPgOriginalClausesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder> getPgOriginalClausesFieldBuilder() { if (pgOriginalClausesBuilder_ == null) { pgOriginalClausesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder>( pgOriginalClauses_, ((bitField0_ & 0x04000000) != 0), getParentForChildren(), @@ -6053,31 +6053,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof return pgOriginalClausesBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector pgProof_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector pgProof_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder> pgProofBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder> pgProofBuilder_; /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return Whether the pgProof field is set. */ public boolean hasPgProof() { return ((bitField0_ & 0x08000000) != 0); } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; * @return The pgProof. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector getPgProof() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector getPgProof() { if (pgProofBuilder_ == null) { - return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance() : pgProof_; + return pgProof_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance() : pgProof_; } else { return pgProofBuilder_.getMessage(); } } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ - public Builder setPgProof(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector value) { + public Builder setPgProof(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector value) { if (pgProofBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6091,10 +6091,10 @@ public Builder setPgProof(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ public Builder setPgProof( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder builderForValue) { if (pgProofBuilder_ == null) { pgProof_ = builderForValue.build(); } else { @@ -6105,13 +6105,13 @@ public Builder setPgProof( return this; } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ - public Builder mergePgProof(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector value) { + public Builder mergePgProof(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector value) { if (pgProofBuilder_ == null) { if (((bitField0_ & 0x08000000) != 0) && pgProof_ != null && - pgProof_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance()) { + pgProof_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance()) { getPgProofBuilder().mergeFrom(value); } else { pgProof_ = value; @@ -6126,7 +6126,7 @@ public Builder mergePgProof(com.booleworks.logicng.serialization.ProtoBufCollect return this; } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ public Builder clearPgProof() { bitField0_ = (bitField0_ & ~0x08000000); @@ -6139,33 +6139,33 @@ public Builder clearPgProof() { return this; } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder getPgProofBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder getPgProofBuilder() { bitField0_ |= 0x08000000; onChanged(); return getPgProofFieldBuilder().getBuilder(); } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder getPgProofOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder getPgProofOrBuilder() { if (pgProofBuilder_ != null) { return pgProofBuilder_.getMessageOrBuilder(); } else { return pgProof_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.getDefaultInstance() : pgProof_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.getDefaultInstance() : pgProof_; } } /** - * .collections.PBIntVectorVector pgProof = 28; + * .collections.PbIntVectorVector pgProof = 28; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder> getPgProofFieldBuilder() { if (pgProofBuilder_ == null) { pgProofBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVectorOrBuilder>( getPgProof(), getParentForChildren(), isClean()); @@ -6206,31 +6206,31 @@ public Builder clearComputingBackbone() { return this; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector backboneCandidates_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector backboneCandidates_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> backboneCandidatesBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> backboneCandidatesBuilder_; /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return Whether the backboneCandidates field is set. */ public boolean hasBackboneCandidates() { return ((bitField0_ & 0x20000000) != 0); } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; * @return The backboneCandidates. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneCandidates() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneCandidates() { if (backboneCandidatesBuilder_ == null) { - return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneCandidates_; + return backboneCandidates_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneCandidates_; } else { return backboneCandidatesBuilder_.getMessage(); } } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ - public Builder setBackboneCandidates(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setBackboneCandidates(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (backboneCandidatesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6244,10 +6244,10 @@ public Builder setBackboneCandidates(com.booleworks.logicng.serialization.ProtoB return this; } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ public Builder setBackboneCandidates( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (backboneCandidatesBuilder_ == null) { backboneCandidates_ = builderForValue.build(); } else { @@ -6258,13 +6258,13 @@ public Builder setBackboneCandidates( return this; } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ - public Builder mergeBackboneCandidates(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeBackboneCandidates(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (backboneCandidatesBuilder_ == null) { if (((bitField0_ & 0x20000000) != 0) && backboneCandidates_ != null && - backboneCandidates_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + backboneCandidates_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getBackboneCandidatesBuilder().mergeFrom(value); } else { backboneCandidates_ = value; @@ -6279,7 +6279,7 @@ public Builder mergeBackboneCandidates(com.booleworks.logicng.serialization.Prot return this; } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ public Builder clearBackboneCandidates() { bitField0_ = (bitField0_ & ~0x20000000); @@ -6292,33 +6292,33 @@ public Builder clearBackboneCandidates() { return this; } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getBackboneCandidatesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getBackboneCandidatesBuilder() { bitField0_ |= 0x20000000; onChanged(); return getBackboneCandidatesFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneCandidatesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneCandidatesOrBuilder() { if (backboneCandidatesBuilder_ != null) { return backboneCandidatesBuilder_.getMessageOrBuilder(); } else { return backboneCandidates_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneCandidates_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneCandidates_; } } /** - * .collections.PBIntVector backboneCandidates = 30; + * .collections.PbIntVector backboneCandidates = 30; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getBackboneCandidatesFieldBuilder() { if (backboneCandidatesBuilder_ == null) { backboneCandidatesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getBackboneCandidates(), getParentForChildren(), isClean()); @@ -6327,31 +6327,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return backboneCandidatesBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector backboneAssumptions_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector backboneAssumptions_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> backboneAssumptionsBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> backboneAssumptionsBuilder_; /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return Whether the backboneAssumptions field is set. */ public boolean hasBackboneAssumptions() { return ((bitField0_ & 0x40000000) != 0); } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; * @return The backboneAssumptions. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getBackboneAssumptions() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getBackboneAssumptions() { if (backboneAssumptionsBuilder_ == null) { - return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneAssumptions_; + return backboneAssumptions_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneAssumptions_; } else { return backboneAssumptionsBuilder_.getMessage(); } } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ - public Builder setBackboneAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setBackboneAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (backboneAssumptionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6365,10 +6365,10 @@ public Builder setBackboneAssumptions(com.booleworks.logicng.serialization.Proto return this; } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ public Builder setBackboneAssumptions( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (backboneAssumptionsBuilder_ == null) { backboneAssumptions_ = builderForValue.build(); } else { @@ -6379,13 +6379,13 @@ public Builder setBackboneAssumptions( return this; } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ - public Builder mergeBackboneAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeBackboneAssumptions(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (backboneAssumptionsBuilder_ == null) { if (((bitField0_ & 0x40000000) != 0) && backboneAssumptions_ != null && - backboneAssumptions_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + backboneAssumptions_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getBackboneAssumptionsBuilder().mergeFrom(value); } else { backboneAssumptions_ = value; @@ -6400,7 +6400,7 @@ public Builder mergeBackboneAssumptions(com.booleworks.logicng.serialization.Pro return this; } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ public Builder clearBackboneAssumptions() { bitField0_ = (bitField0_ & ~0x40000000); @@ -6413,33 +6413,33 @@ public Builder clearBackboneAssumptions() { return this; } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getBackboneAssumptionsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getBackboneAssumptionsBuilder() { bitField0_ |= 0x40000000; onChanged(); return getBackboneAssumptionsFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getBackboneAssumptionsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getBackboneAssumptionsOrBuilder() { if (backboneAssumptionsBuilder_ != null) { return backboneAssumptionsBuilder_.getMessageOrBuilder(); } else { return backboneAssumptions_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : backboneAssumptions_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : backboneAssumptions_; } } /** - * .collections.PBIntVector backboneAssumptions = 31; + * .collections.PbIntVector backboneAssumptions = 31; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getBackboneAssumptionsFieldBuilder() { if (backboneAssumptionsBuilder_ == null) { backboneAssumptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getBackboneAssumptions(), getParentForChildren(), isClean()); @@ -6475,7 +6475,7 @@ public int getBackboneMapCount() { return internalGetBackboneMap().getMap().size(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public boolean containsBackboneMap( @@ -6488,27 +6488,27 @@ public boolean containsBackboneMap( */ @java.lang.Override @java.lang.Deprecated - public java.util.Map + public java.util.Map getBackboneMap() { return getBackboneMapMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override - public java.util.Map + public java.util.Map getBackboneMapMap() { return internalGetAdaptedBackboneMapMap( internalGetBackboneMap().getMap());} /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrDefault( +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrDefault( int key, /* nullable */ -com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate defaultValue) { +com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate defaultValue) { java.util.Map map = internalGetBackboneMap().getMap(); @@ -6517,10 +6517,10 @@ com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate get : defaultValue; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getBackboneMapOrThrow( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getBackboneMapOrThrow( int key) { java.util.Map map = @@ -6540,7 +6540,7 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTrist return getBackboneMapValueMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public java.util.Map @@ -6548,7 +6548,7 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTrist return internalGetBackboneMap().getMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public int getBackboneMapValueOrDefault( @@ -6560,7 +6560,7 @@ public int getBackboneMapValueOrDefault( return map.containsKey(key) ? map.get(key) : defaultValue; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ @java.lang.Override public int getBackboneMapValueOrThrow( @@ -6580,7 +6580,7 @@ public Builder clearBackboneMap() { return this; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ public Builder removeBackboneMap( int key) { @@ -6593,18 +6593,18 @@ public Builder removeBackboneMap( * Use alternate mutation accessors instead. */ @java.lang.Deprecated - public java.util.Map + public java.util.Map getMutableBackboneMap() { bitField0_ |= 0x80000000; return internalGetAdaptedBackboneMapMap( internalGetMutableBackboneMap().getMutableMap()); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ public Builder putBackboneMap( int key, - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate value) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate value) { internalGetMutableBackboneMap().getMutableMap() @@ -6613,10 +6613,10 @@ public Builder putBackboneMap( return this; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ public Builder putAllBackboneMap( - java.util.Map values) { + java.util.Map values) { internalGetAdaptedBackboneMapMap( internalGetMutableBackboneMap().getMutableMap()) .putAll(values); @@ -6633,7 +6633,7 @@ public Builder putAllBackboneMap( return internalGetMutableBackboneMap().getMutableMap(); } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ public Builder putBackboneMapValue( int key, @@ -6646,7 +6646,7 @@ public Builder putBackboneMapValue( return this; } /** - * map<int32, .solver.PBTristate> backboneMap = 32; + * map<int32, .solver.PbTristate> backboneMap = 32; */ public Builder putAllBackboneMapValue( java.util.Map values) { @@ -6656,31 +6656,31 @@ public Builder putAllBackboneMapValue( return this; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector selectionOrder_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector selectionOrder_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> selectionOrderBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> selectionOrderBuilder_; /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return Whether the selectionOrder field is set. */ public boolean hasSelectionOrder() { return ((bitField1_ & 0x00000001) != 0); } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; * @return The selectionOrder. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getSelectionOrder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getSelectionOrder() { if (selectionOrderBuilder_ == null) { - return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : selectionOrder_; + return selectionOrder_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : selectionOrder_; } else { return selectionOrderBuilder_.getMessage(); } } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ - public Builder setSelectionOrder(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setSelectionOrder(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (selectionOrderBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6694,10 +6694,10 @@ public Builder setSelectionOrder(com.booleworks.logicng.serialization.ProtoBufCo return this; } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ public Builder setSelectionOrder( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (selectionOrderBuilder_ == null) { selectionOrder_ = builderForValue.build(); } else { @@ -6708,13 +6708,13 @@ public Builder setSelectionOrder( return this; } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ - public Builder mergeSelectionOrder(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeSelectionOrder(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (selectionOrderBuilder_ == null) { if (((bitField1_ & 0x00000001) != 0) && selectionOrder_ != null && - selectionOrder_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + selectionOrder_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getSelectionOrderBuilder().mergeFrom(value); } else { selectionOrder_ = value; @@ -6729,7 +6729,7 @@ public Builder mergeSelectionOrder(com.booleworks.logicng.serialization.ProtoBuf return this; } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ public Builder clearSelectionOrder() { bitField1_ = (bitField1_ & ~0x00000001); @@ -6742,33 +6742,33 @@ public Builder clearSelectionOrder() { return this; } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getSelectionOrderBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getSelectionOrderBuilder() { bitField1_ |= 0x00000001; onChanged(); return getSelectionOrderFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getSelectionOrderOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getSelectionOrderOrBuilder() { if (selectionOrderBuilder_ != null) { return selectionOrderBuilder_.getMessageOrBuilder(); } else { return selectionOrder_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : selectionOrder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : selectionOrder_; } } /** - * .collections.PBIntVector selectionOrder = 33; + * .collections.PbIntVector selectionOrder = 33; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getSelectionOrderFieldBuilder() { if (selectionOrderBuilder_ == null) { selectionOrderBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getSelectionOrder(), getParentForChildren(), isClean()); @@ -6809,31 +6809,31 @@ public Builder clearSelectionOrderIdx() { return this; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector watchesBin_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector watchesBin_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder> watchesBinBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder> watchesBinBuilder_; /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return Whether the watchesBin field is set. */ public boolean hasWatchesBin() { return ((bitField1_ & 0x00000004) != 0); } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; * @return The watchesBin. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getWatchesBin() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getWatchesBin() { if (watchesBinBuilder_ == null) { - return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watchesBin_; + return watchesBin_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watchesBin_; } else { return watchesBinBuilder_.getMessage(); } } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ - public Builder setWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector value) { + public Builder setWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector value) { if (watchesBinBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6847,10 +6847,10 @@ public Builder setWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolver return this; } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ public Builder setWatchesBin( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder builderForValue) { if (watchesBinBuilder_ == null) { watchesBin_ = builderForValue.build(); } else { @@ -6861,13 +6861,13 @@ public Builder setWatchesBin( return this; } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ - public Builder mergeWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector value) { + public Builder mergeWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector value) { if (watchesBinBuilder_ == null) { if (((bitField1_ & 0x00000004) != 0) && watchesBin_ != null && - watchesBin_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance()) { + watchesBin_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance()) { getWatchesBinBuilder().mergeFrom(value); } else { watchesBin_ = value; @@ -6882,7 +6882,7 @@ public Builder mergeWatchesBin(com.booleworks.logicng.serialization.ProtoBufSolv return this; } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ public Builder clearWatchesBin() { bitField1_ = (bitField1_ & ~0x00000004); @@ -6895,33 +6895,33 @@ public Builder clearWatchesBin() { return this; } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder getWatchesBinBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder getWatchesBinBuilder() { bitField1_ |= 0x00000004; onChanged(); return getWatchesBinFieldBuilder().getBuilder(); } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder getWatchesBinOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder getWatchesBinOrBuilder() { if (watchesBinBuilder_ != null) { return watchesBinBuilder_.getMessageOrBuilder(); } else { return watchesBin_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance() : watchesBin_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance() : watchesBin_; } } /** - * .solver.PBWatcherVectorVector watchesBin = 35; + * .solver.PbWatcherVectorVector watchesBin = 35; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder> getWatchesBinFieldBuilder() { if (watchesBinBuilder_ == null) { watchesBinBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder>( getWatchesBin(), getParentForChildren(), isClean()); @@ -6930,31 +6930,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch return watchesBinBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector permDiff_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector permDiff_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> permDiffBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> permDiffBuilder_; /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return Whether the permDiff field is set. */ public boolean hasPermDiff() { return ((bitField1_ & 0x00000008) != 0); } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; * @return The permDiff. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getPermDiff() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getPermDiff() { if (permDiffBuilder_ == null) { - return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : permDiff_; + return permDiff_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : permDiff_; } else { return permDiffBuilder_.getMessage(); } } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ - public Builder setPermDiff(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setPermDiff(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (permDiffBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6968,10 +6968,10 @@ public Builder setPermDiff(com.booleworks.logicng.serialization.ProtoBufCollecti return this; } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ public Builder setPermDiff( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (permDiffBuilder_ == null) { permDiff_ = builderForValue.build(); } else { @@ -6982,13 +6982,13 @@ public Builder setPermDiff( return this; } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ - public Builder mergePermDiff(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergePermDiff(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (permDiffBuilder_ == null) { if (((bitField1_ & 0x00000008) != 0) && permDiff_ != null && - permDiff_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + permDiff_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getPermDiffBuilder().mergeFrom(value); } else { permDiff_ = value; @@ -7003,7 +7003,7 @@ public Builder mergePermDiff(com.booleworks.logicng.serialization.ProtoBufCollec return this; } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ public Builder clearPermDiff() { bitField1_ = (bitField1_ & ~0x00000008); @@ -7016,33 +7016,33 @@ public Builder clearPermDiff() { return this; } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getPermDiffBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getPermDiffBuilder() { bitField1_ |= 0x00000008; onChanged(); return getPermDiffFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getPermDiffOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getPermDiffOrBuilder() { if (permDiffBuilder_ != null) { return permDiffBuilder_.getMessageOrBuilder(); } else { return permDiff_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : permDiff_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : permDiff_; } } /** - * .collections.PBIntVector permDiff = 36; + * .collections.PbIntVector permDiff = 36; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getPermDiffFieldBuilder() { if (permDiffBuilder_ == null) { permDiffBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getPermDiff(), getParentForChildren(), isClean()); @@ -7051,31 +7051,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return permDiffBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector lastDecisionLevel_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector lastDecisionLevel_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> lastDecisionLevelBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> lastDecisionLevelBuilder_; /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return Whether the lastDecisionLevel field is set. */ public boolean hasLastDecisionLevel() { return ((bitField1_ & 0x00000010) != 0); } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; * @return The lastDecisionLevel. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getLastDecisionLevel() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getLastDecisionLevel() { if (lastDecisionLevelBuilder_ == null) { - return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : lastDecisionLevel_; + return lastDecisionLevel_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : lastDecisionLevel_; } else { return lastDecisionLevelBuilder_.getMessage(); } } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ - public Builder setLastDecisionLevel(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setLastDecisionLevel(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (lastDecisionLevelBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7089,10 +7089,10 @@ public Builder setLastDecisionLevel(com.booleworks.logicng.serialization.ProtoBu return this; } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ public Builder setLastDecisionLevel( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (lastDecisionLevelBuilder_ == null) { lastDecisionLevel_ = builderForValue.build(); } else { @@ -7103,13 +7103,13 @@ public Builder setLastDecisionLevel( return this; } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ - public Builder mergeLastDecisionLevel(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeLastDecisionLevel(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (lastDecisionLevelBuilder_ == null) { if (((bitField1_ & 0x00000010) != 0) && lastDecisionLevel_ != null && - lastDecisionLevel_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + lastDecisionLevel_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getLastDecisionLevelBuilder().mergeFrom(value); } else { lastDecisionLevel_ = value; @@ -7124,7 +7124,7 @@ public Builder mergeLastDecisionLevel(com.booleworks.logicng.serialization.Proto return this; } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ public Builder clearLastDecisionLevel() { bitField1_ = (bitField1_ & ~0x00000010); @@ -7137,33 +7137,33 @@ public Builder clearLastDecisionLevel() { return this; } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getLastDecisionLevelBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getLastDecisionLevelBuilder() { bitField1_ |= 0x00000010; onChanged(); return getLastDecisionLevelFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getLastDecisionLevelOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getLastDecisionLevelOrBuilder() { if (lastDecisionLevelBuilder_ != null) { return lastDecisionLevelBuilder_.getMessageOrBuilder(); } else { return lastDecisionLevel_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : lastDecisionLevel_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : lastDecisionLevel_; } } /** - * .collections.PBIntVector lastDecisionLevel = 37; + * .collections.PbIntVector lastDecisionLevel = 37; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getLastDecisionLevelFieldBuilder() { if (lastDecisionLevelBuilder_ == null) { lastDecisionLevelBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getLastDecisionLevel(), getParentForChildren(), isClean()); @@ -7172,31 +7172,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return lastDecisionLevelBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue lbdQueue_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue lbdQueue_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder> lbdQueueBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder> lbdQueueBuilder_; /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return Whether the lbdQueue field is set. */ public boolean hasLbdQueue() { return ((bitField1_ & 0x00000020) != 0); } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; * @return The lbdQueue. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getLbdQueue() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getLbdQueue() { if (lbdQueueBuilder_ == null) { - return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance() : lbdQueue_; + return lbdQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance() : lbdQueue_; } else { return lbdQueueBuilder_.getMessage(); } } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ - public Builder setLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue value) { + public Builder setLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue value) { if (lbdQueueBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7210,10 +7210,10 @@ public Builder setLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolverDa return this; } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ public Builder setLbdQueue( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder builderForValue) { if (lbdQueueBuilder_ == null) { lbdQueue_ = builderForValue.build(); } else { @@ -7224,13 +7224,13 @@ public Builder setLbdQueue( return this; } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ - public Builder mergeLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue value) { + public Builder mergeLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue value) { if (lbdQueueBuilder_ == null) { if (((bitField1_ & 0x00000020) != 0) && lbdQueue_ != null && - lbdQueue_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance()) { + lbdQueue_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance()) { getLbdQueueBuilder().mergeFrom(value); } else { lbdQueue_ = value; @@ -7245,7 +7245,7 @@ public Builder mergeLbdQueue(com.booleworks.logicng.serialization.ProtoBufSolver return this; } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ public Builder clearLbdQueue() { bitField1_ = (bitField1_ & ~0x00000020); @@ -7258,33 +7258,33 @@ public Builder clearLbdQueue() { return this; } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder getLbdQueueBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder getLbdQueueBuilder() { bitField1_ |= 0x00000020; onChanged(); return getLbdQueueFieldBuilder().getBuilder(); } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder getLbdQueueOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder getLbdQueueOrBuilder() { if (lbdQueueBuilder_ != null) { return lbdQueueBuilder_.getMessageOrBuilder(); } else { return lbdQueue_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance() : lbdQueue_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance() : lbdQueue_; } } /** - * .solver.PBBoundedLongQueue lbdQueue = 38; + * .solver.PbBoundedLongQueue lbdQueue = 38; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder> getLbdQueueFieldBuilder() { if (lbdQueueBuilder_ == null) { lbdQueueBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder>( getLbdQueue(), getParentForChildren(), isClean()); @@ -7293,31 +7293,31 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBound return lbdQueueBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue trailQueue_; + private com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue trailQueue_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder> trailQueueBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder> trailQueueBuilder_; /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return Whether the trailQueue field is set. */ public boolean hasTrailQueue() { return ((bitField1_ & 0x00000040) != 0); } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; * @return The trailQueue. */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getTrailQueue() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getTrailQueue() { if (trailQueueBuilder_ == null) { - return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance() : trailQueue_; + return trailQueue_ == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance() : trailQueue_; } else { return trailQueueBuilder_.getMessage(); } } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ - public Builder setTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue value) { + public Builder setTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue value) { if (trailQueueBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7331,10 +7331,10 @@ public Builder setTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolver return this; } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ public Builder setTrailQueue( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder builderForValue) { if (trailQueueBuilder_ == null) { trailQueue_ = builderForValue.build(); } else { @@ -7345,13 +7345,13 @@ public Builder setTrailQueue( return this; } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ - public Builder mergeTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue value) { + public Builder mergeTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue value) { if (trailQueueBuilder_ == null) { if (((bitField1_ & 0x00000040) != 0) && trailQueue_ != null && - trailQueue_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance()) { + trailQueue_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance()) { getTrailQueueBuilder().mergeFrom(value); } else { trailQueue_ = value; @@ -7366,7 +7366,7 @@ public Builder mergeTrailQueue(com.booleworks.logicng.serialization.ProtoBufSolv return this; } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ public Builder clearTrailQueue() { bitField1_ = (bitField1_ & ~0x00000040); @@ -7379,33 +7379,33 @@ public Builder clearTrailQueue() { return this; } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder getTrailQueueBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder getTrailQueueBuilder() { bitField1_ |= 0x00000040; onChanged(); return getTrailQueueFieldBuilder().getBuilder(); } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder getTrailQueueOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder getTrailQueueOrBuilder() { if (trailQueueBuilder_ != null) { return trailQueueBuilder_.getMessageOrBuilder(); } else { return trailQueue_ == null ? - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance() : trailQueue_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance() : trailQueue_; } } /** - * .solver.PBBoundedIntQueue trailQueue = 39; + * .solver.PbBoundedIntQueue trailQueue = 39; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder> getTrailQueueFieldBuilder() { if (trailQueueBuilder_ == null) { trailQueueBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder>( getTrailQueue(), getParentForChildren(), isClean()); @@ -7638,23 +7638,23 @@ public Builder clearCurRestart() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBSatSolver) + // @@protoc_insertion_point(builder_scope:solver.PbSatSolver) } - // @@protoc_insertion_point(class_scope:solver.PBSatSolver) - private static final com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbSatSolver) + private static final com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver(); } - public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBSatSolver parsePartialFrom( + public PbSatSolver parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7673,37 +7673,37 @@ public PBSatSolver parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSatSolver.PbSatSolver getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBSatSolver_descriptor; + internal_static_solver_PbSatSolver_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBSatSolver_fieldAccessorTable; + internal_static_solver_PbSatSolver_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBSatSolver_Name2idxEntry_descriptor; + internal_static_solver_PbSatSolver_Name2idxEntry_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBSatSolver_Name2idxEntry_fieldAccessorTable; + internal_static_solver_PbSatSolver_Name2idxEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBSatSolver_BackboneMapEntry_descriptor; + internal_static_solver_PbSatSolver_BackboneMapEntry_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBSatSolver_BackboneMapEntry_fieldAccessorTable; + internal_static_solver_PbSatSolver_BackboneMapEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -7715,51 +7715,51 @@ public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver getDef java.lang.String[] descriptorData = { "\n\017satsolver.proto\022\006solver\032\021collections.p" + "roto\032\033solver_datastructures.proto\032\024solve" + - "r_commons.proto\"\201\016\n\013PBSatSolver\022)\n\006confi" + - "g\030\001 \001(\0132\031.solver.PBSatSolverConfig\022\021\n\tin" + + "r_commons.proto\"\201\016\n\013PbSatSolver\022)\n\006confi" + + "g\030\001 \001(\0132\031.solver.PbSatSolverConfig\022\021\n\tin" + "SatCall\030\002 \001(\010\0223\n\010name2idx\030\003 \003(\0132!.solver" + - ".PBSatSolver.Name2idxEntry\022-\n\013validState" + - "s\030\004 \001(\0132\030.collections.PBIntVector\022\023\n\013nex" + + ".PbSatSolver.Name2idxEntry\022-\n\013validState" + + "s\030\004 \001(\0132\030.collections.PbIntVector\022\023\n\013nex" + "tStateId\030\005 \001(\005\022\n\n\002ok\030\006 \001(\010\022\r\n\005qhead\030\007 \001(" + - "\005\022-\n\013unitClauses\030\010 \001(\0132\030.collections.PBI" + - "ntVector\022\'\n\007clauses\030\t \001(\0132\026.solver.PBCla" + - "useVector\022\'\n\007learnts\030\n \001(\0132\026.solver.PBCl" + - "auseVector\022.\n\007watches\030\013 \001(\0132\035.solver.PBW" + + "\005\022-\n\013unitClauses\030\010 \001(\0132\030.collections.PbI" + + "ntVector\022\'\n\007clauses\030\t \001(\0132\026.solver.PbCla" + + "useVector\022\'\n\007learnts\030\n \001(\0132\026.solver.PbCl" + + "auseVector\022.\n\007watches\030\013 \001(\0132\035.solver.PbW" + "atcherVectorVector\022&\n\004vars\030\014 \001(\0132\030.solve" + - "r.PBVariableVector\022!\n\torderHeap\030\r \001(\0132\016." + - "solver.PBHeap\022\'\n\005trail\030\016 \001(\0132\030.collectio" + - "ns.PBIntVector\022*\n\010trailLim\030\017 \001(\0132\030.colle" + - "ctions.PBIntVector\022+\n\005model\030\020 \001(\0132\034.coll" + - "ections.PBBooleanVector\0224\n\022assumptionCon" + - "flict\030\021 \001(\0132\030.collections.PBIntVector\022-\n" + - "\013assumptions\030\022 \001(\0132\030.collections.PBIntVe" + + "r.PbVariableVector\022!\n\torderHeap\030\r \001(\0132\016." + + "solver.PbHeap\022\'\n\005trail\030\016 \001(\0132\030.collectio" + + "ns.PbIntVector\022*\n\010trailLim\030\017 \001(\0132\030.colle" + + "ctions.PbIntVector\022+\n\005model\030\020 \001(\0132\034.coll" + + "ections.PbBooleanVector\0224\n\022assumptionCon" + + "flict\030\021 \001(\0132\030.collections.PbIntVector\022-\n" + + "\013assumptions\030\022 \001(\0132\030.collections.PbIntVe" + "ctor\022\036\n\026assumptionPropositions\030\023 \003(\014\022*\n\004" + - "seen\030\024 \001(\0132\034.collections.PBBooleanVector" + + "seen\030\024 \001(\0132\034.collections.PbBooleanVector" + "\022\026\n\016analyzeBtLevel\030\025 \001(\005\022\016\n\006claInc\030\026 \001(\001" + "\022\016\n\006varInc\030\027 \001(\001\022\020\n\010varDecay\030\030 \001(\001\022\027\n\017cl" + "ausesLiterals\030\031 \001(\005\022\027\n\017learntsLiterals\030\032" + " \001(\005\0225\n\021pgOriginalClauses\030\033 \003(\0132\032.solver" + - ".PBProofInformation\022/\n\007pgProof\030\034 \001(\0132\036.c" + - "ollections.PBIntVectorVector\022\031\n\021computin" + + ".PbProofInformation\022/\n\007pgProof\030\034 \001(\0132\036.c" + + "ollections.PbIntVectorVector\022\031\n\021computin" + "gBackbone\030\035 \001(\010\0224\n\022backboneCandidates\030\036 " + - "\001(\0132\030.collections.PBIntVector\0225\n\023backbon" + - "eAssumptions\030\037 \001(\0132\030.collections.PBIntVe" + - "ctor\0229\n\013backboneMap\030 \003(\0132$.solver.PBSat" + + "\001(\0132\030.collections.PbIntVector\0225\n\023backbon" + + "eAssumptions\030\037 \001(\0132\030.collections.PbIntVe" + + "ctor\0229\n\013backboneMap\030 \003(\0132$.solver.PbSat" + "Solver.BackboneMapEntry\0220\n\016selectionOrde" + - "r\030! \001(\0132\030.collections.PBIntVector\022\031\n\021sel" + + "r\030! \001(\0132\030.collections.PbIntVector\022\031\n\021sel" + "ectionOrderIdx\030\" \001(\005\0221\n\nwatchesBin\030# \001(\013" + - "2\035.solver.PBWatcherVectorVector\022*\n\010permD" + - "iff\030$ \001(\0132\030.collections.PBIntVector\0223\n\021l" + - "astDecisionLevel\030% \001(\0132\030.collections.PBI" + - "ntVector\022,\n\010lbdQueue\030& \001(\0132\032.solver.PBBo" + + "2\035.solver.PbWatcherVectorVector\022*\n\010permD" + + "iff\030$ \001(\0132\030.collections.PbIntVector\0223\n\021l" + + "astDecisionLevel\030% \001(\0132\030.collections.PbI" + + "ntVector\022,\n\010lbdQueue\030& \001(\0132\032.solver.PbBo" + "undedLongQueue\022-\n\ntrailQueue\030\' \001(\0132\031.sol" + - "ver.PBBoundedIntQueue\022\016\n\006myflag\030( \001(\005\022\022\n" + + "ver.PbBoundedIntQueue\022\016\n\006myflag\030( \001(\005\022\022\n" + "\nanalyzeLBD\030) \001(\003\022\035\n\025nbClausesBeforeRedu" + "ce\030* \001(\005\022\021\n\tconflicts\030+ \001(\005\022\031\n\021conflicts" + "Restarts\030, \001(\005\022\016\n\006sumLBD\030- \001(\001\022\022\n\ncurRes" + "tart\030. \001(\005\032/\n\rName2idxEntry\022\013\n\003key\030\001 \001(\t" + "\022\r\n\005value\030\002 \001(\005:\0028\001\032F\n\020BackboneMapEntry\022" + - "\013\n\003key\030\001 \001(\005\022!\n\005value\030\002 \001(\0162\022.solver.PBT" + + "\013\n\003key\030\001 \001(\005\022!\n\005value\030\002 \001(\0162\022.solver.PbT" + "ristate:\0028\001B9\n$com.booleworks.logicng.se" + "rializationB\021ProtoBufSatSolverb\006proto3" }; @@ -7770,23 +7770,23 @@ public com.booleworks.logicng.serialization.ProtoBufSatSolver.PBSatSolver getDef com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.getDescriptor(), com.booleworks.logicng.serialization.ProtoBufSolverCommons.getDescriptor(), }); - internal_static_solver_PBSatSolver_descriptor = + internal_static_solver_PbSatSolver_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_solver_PBSatSolver_fieldAccessorTable = new + internal_static_solver_PbSatSolver_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBSatSolver_descriptor, + internal_static_solver_PbSatSolver_descriptor, new java.lang.String[] { "Config", "InSatCall", "Name2Idx", "ValidStates", "NextStateId", "Ok", "Qhead", "UnitClauses", "Clauses", "Learnts", "Watches", "Vars", "OrderHeap", "Trail", "TrailLim", "Model", "AssumptionConflict", "Assumptions", "AssumptionPropositions", "Seen", "AnalyzeBtLevel", "ClaInc", "VarInc", "VarDecay", "ClausesLiterals", "LearntsLiterals", "PgOriginalClauses", "PgProof", "ComputingBackbone", "BackboneCandidates", "BackboneAssumptions", "BackboneMap", "SelectionOrder", "SelectionOrderIdx", "WatchesBin", "PermDiff", "LastDecisionLevel", "LbdQueue", "TrailQueue", "Myflag", "AnalyzeLBD", "NbClausesBeforeReduce", "Conflicts", "ConflictsRestarts", "SumLBD", "CurRestart", }); - internal_static_solver_PBSatSolver_Name2idxEntry_descriptor = - internal_static_solver_PBSatSolver_descriptor.getNestedTypes().get(0); - internal_static_solver_PBSatSolver_Name2idxEntry_fieldAccessorTable = new + internal_static_solver_PbSatSolver_Name2idxEntry_descriptor = + internal_static_solver_PbSatSolver_descriptor.getNestedTypes().get(0); + internal_static_solver_PbSatSolver_Name2idxEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBSatSolver_Name2idxEntry_descriptor, + internal_static_solver_PbSatSolver_Name2idxEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_solver_PBSatSolver_BackboneMapEntry_descriptor = - internal_static_solver_PBSatSolver_descriptor.getNestedTypes().get(1); - internal_static_solver_PBSatSolver_BackboneMapEntry_fieldAccessorTable = new + internal_static_solver_PbSatSolver_BackboneMapEntry_descriptor = + internal_static_solver_PbSatSolver_descriptor.getNestedTypes().get(1); + internal_static_solver_PbSatSolver_BackboneMapEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBSatSolver_BackboneMapEntry_descriptor, + internal_static_solver_PbSatSolver_BackboneMapEntry_descriptor, new java.lang.String[] { "Key", "Value", }); descriptor.resolveAllFeaturesImmutable(); com.booleworks.logicng.serialization.ProtoBufCollections.getDescriptor(); diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverCommons.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverCommons.java index 685b197e..0fec7d08 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverCommons.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverCommons.java @@ -26,9 +26,9 @@ public static void registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** - * Protobuf enum {@code solver.PBClauseMinimization} + * Protobuf enum {@code solver.PbClauseMinimization} */ - public enum PBClauseMinimization + public enum PbClauseMinimization implements com.google.protobuf.ProtocolMessageEnum { /** * NONE = 0; @@ -52,7 +52,7 @@ public enum PBClauseMinimization /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBClauseMinimization.class.getName()); + PbClauseMinimization.class.getName()); } /** * NONE = 0; @@ -82,7 +82,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PBClauseMinimization valueOf(int value) { + public static PbClauseMinimization valueOf(int value) { return forNumber(value); } @@ -90,7 +90,7 @@ public static PBClauseMinimization valueOf(int value) { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PBClauseMinimization forNumber(int value) { + public static PbClauseMinimization forNumber(int value) { switch (value) { case 0: return NONE; case 1: return BASIC; @@ -99,15 +99,15 @@ public static PBClauseMinimization forNumber(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PBClauseMinimization> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PBClauseMinimization findValueByNumber(int number) { - return PBClauseMinimization.forNumber(number); + PbClauseMinimization> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PbClauseMinimization findValueByNumber(int number) { + return PbClauseMinimization.forNumber(number); } }; @@ -128,9 +128,9 @@ public PBClauseMinimization findValueByNumber(int number) { return com.booleworks.logicng.serialization.ProtoBufSolverCommons.getDescriptor().getEnumTypes().get(0); } - private static final PBClauseMinimization[] VALUES = values(); + private static final PbClauseMinimization[] VALUES = values(); - public static PBClauseMinimization valueOf( + public static PbClauseMinimization valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -144,17 +144,17 @@ public static PBClauseMinimization valueOf( private final int value; - private PBClauseMinimization(int value) { + private PbClauseMinimization(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:solver.PBClauseMinimization) + // @@protoc_insertion_point(enum_scope:solver.PbClauseMinimization) } /** - * Protobuf enum {@code solver.PBCnfMethod} + * Protobuf enum {@code solver.PbCnfMethod} */ - public enum PBCnfMethod + public enum PbCnfMethod implements com.google.protobuf.ProtocolMessageEnum { /** * FACTORY_CNF = 0; @@ -178,7 +178,7 @@ public enum PBCnfMethod /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBCnfMethod.class.getName()); + PbCnfMethod.class.getName()); } /** * FACTORY_CNF = 0; @@ -208,7 +208,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PBCnfMethod valueOf(int value) { + public static PbCnfMethod valueOf(int value) { return forNumber(value); } @@ -216,7 +216,7 @@ public static PBCnfMethod valueOf(int value) { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PBCnfMethod forNumber(int value) { + public static PbCnfMethod forNumber(int value) { switch (value) { case 0: return FACTORY_CNF; case 1: return PG_ON_SOLVER; @@ -225,15 +225,15 @@ public static PBCnfMethod forNumber(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PBCnfMethod> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PBCnfMethod findValueByNumber(int number) { - return PBCnfMethod.forNumber(number); + PbCnfMethod> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PbCnfMethod findValueByNumber(int number) { + return PbCnfMethod.forNumber(number); } }; @@ -254,9 +254,9 @@ public PBCnfMethod findValueByNumber(int number) { return com.booleworks.logicng.serialization.ProtoBufSolverCommons.getDescriptor().getEnumTypes().get(1); } - private static final PBCnfMethod[] VALUES = values(); + private static final PbCnfMethod[] VALUES = values(); - public static PBCnfMethod valueOf( + public static PbCnfMethod valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -270,15 +270,15 @@ public static PBCnfMethod valueOf( private final int value; - private PBCnfMethod(int value) { + private PbCnfMethod(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:solver.PBCnfMethod) + // @@protoc_insertion_point(enum_scope:solver.PbCnfMethod) } - public interface PBSatSolverConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBSatSolverConfig) + public interface PbSatSolverConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbSatSolverConfig) com.google.protobuf.MessageOrBuilder { /** @@ -294,26 +294,26 @@ public interface PBSatSolverConfigOrBuilder extends boolean getUseAtMostClauses(); /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The enum numeric value on the wire for cnfMethod. */ int getCnfMethodValue(); /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The cnfMethod. */ - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod getCnfMethod(); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod getCnfMethod(); /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The enum numeric value on the wire for clauseMinimization. */ int getClauseMinimizationValue(); /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The clauseMinimization. */ - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization getClauseMinimization(); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization getClauseMinimization(); /** * bool initialPhase = 5; @@ -352,16 +352,16 @@ public interface PBSatSolverConfigOrBuilder extends double getClauseDecay(); /** - * int32 lbLBDMinimizingClause = 11; - * @return The lbLBDMinimizingClause. + * int32 lbLbdMinimizingClause = 11; + * @return The lbLbdMinimizingClause. */ - int getLbLBDMinimizingClause(); + int getLbLbdMinimizingClause(); /** - * int32 lbLBDFrozenClause = 12; - * @return The lbLBDFrozenClause. + * int32 lbLbdFrozenClause = 12; + * @return The lbLbdFrozenClause. */ - int getLbLBDFrozenClause(); + int getLbLbdFrozenClause(); /** * int32 lbSizeMinimizingClause = 13; @@ -370,22 +370,22 @@ public interface PBSatSolverConfigOrBuilder extends int getLbSizeMinimizingClause(); /** - * int32 firstReduceDB = 14; - * @return The firstReduceDB. + * int32 firstReduceDb = 14; + * @return The firstReduceDb. */ - int getFirstReduceDB(); + int getFirstReduceDb(); /** - * int32 specialIncReduceDB = 15; - * @return The specialIncReduceDB. + * int32 specialIncReduceDb = 15; + * @return The specialIncReduceDb. */ - int getSpecialIncReduceDB(); + int getSpecialIncReduceDb(); /** - * int32 incReduceDB = 16; - * @return The incReduceDB. + * int32 incReduceDb = 16; + * @return The incReduceDb. */ - int getIncReduceDB(); + int getIncReduceDb(); /** * double factorK = 17; @@ -400,10 +400,10 @@ public interface PBSatSolverConfigOrBuilder extends double getFactorR(); /** - * int32 sizeLBDQueue = 19; - * @return The sizeLBDQueue. + * int32 sizeLbdQueue = 19; + * @return The sizeLbdQueue. */ - int getSizeLBDQueue(); + int getSizeLbdQueue(); /** * int32 sizeTrailQueue = 20; @@ -430,12 +430,12 @@ public interface PBSatSolverConfigOrBuilder extends double getMaxVarDecay(); } /** - * Protobuf type {@code solver.PBSatSolverConfig} + * Protobuf type {@code solver.PbSatSolverConfig} */ - public static final class PBSatSolverConfig extends + public static final class PbSatSolverConfig extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBSatSolverConfig) - PBSatSolverConfigOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbSatSolverConfig) + PbSatSolverConfigOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -444,28 +444,28 @@ public static final class PBSatSolverConfig extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBSatSolverConfig.class.getName()); + PbSatSolverConfig.class.getName()); } - // Use PBSatSolverConfig.newBuilder() to construct. - private PBSatSolverConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbSatSolverConfig.newBuilder() to construct. + private PbSatSolverConfig(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBSatSolverConfig() { + private PbSatSolverConfig() { cnfMethod_ = 0; clauseMinimization_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PBSatSolverConfig_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PbSatSolverConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PBSatSolverConfig_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PbSatSolverConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.class, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.class, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder.class); } public static final int PROOFGENERATION_FIELD_NUMBER = 1; @@ -493,37 +493,37 @@ public boolean getUseAtMostClauses() { public static final int CNFMETHOD_FIELD_NUMBER = 3; private int cnfMethod_ = 0; /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The enum numeric value on the wire for cnfMethod. */ @java.lang.Override public int getCnfMethodValue() { return cnfMethod_; } /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The cnfMethod. */ - @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod getCnfMethod() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.forNumber(cnfMethod_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.UNRECOGNIZED : result; + @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod getCnfMethod() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.forNumber(cnfMethod_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.UNRECOGNIZED : result; } public static final int CLAUSEMINIMIZATION_FIELD_NUMBER = 4; private int clauseMinimization_ = 0; /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The enum numeric value on the wire for clauseMinimization. */ @java.lang.Override public int getClauseMinimizationValue() { return clauseMinimization_; } /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The clauseMinimization. */ - @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization getClauseMinimization() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.forNumber(clauseMinimization_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.UNRECOGNIZED : result; + @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization getClauseMinimization() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.forNumber(clauseMinimization_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.UNRECOGNIZED : result; } public static final int INITIALPHASE_FIELD_NUMBER = 5; @@ -593,25 +593,25 @@ public double getClauseDecay() { } public static final int LBLBDMINIMIZINGCLAUSE_FIELD_NUMBER = 11; - private int lbLBDMinimizingClause_ = 0; + private int lbLbdMinimizingClause_ = 0; /** - * int32 lbLBDMinimizingClause = 11; - * @return The lbLBDMinimizingClause. + * int32 lbLbdMinimizingClause = 11; + * @return The lbLbdMinimizingClause. */ @java.lang.Override - public int getLbLBDMinimizingClause() { - return lbLBDMinimizingClause_; + public int getLbLbdMinimizingClause() { + return lbLbdMinimizingClause_; } public static final int LBLBDFROZENCLAUSE_FIELD_NUMBER = 12; - private int lbLBDFrozenClause_ = 0; + private int lbLbdFrozenClause_ = 0; /** - * int32 lbLBDFrozenClause = 12; - * @return The lbLBDFrozenClause. + * int32 lbLbdFrozenClause = 12; + * @return The lbLbdFrozenClause. */ @java.lang.Override - public int getLbLBDFrozenClause() { - return lbLBDFrozenClause_; + public int getLbLbdFrozenClause() { + return lbLbdFrozenClause_; } public static final int LBSIZEMINIMIZINGCLAUSE_FIELD_NUMBER = 13; @@ -626,36 +626,36 @@ public int getLbSizeMinimizingClause() { } public static final int FIRSTREDUCEDB_FIELD_NUMBER = 14; - private int firstReduceDB_ = 0; + private int firstReduceDb_ = 0; /** - * int32 firstReduceDB = 14; - * @return The firstReduceDB. + * int32 firstReduceDb = 14; + * @return The firstReduceDb. */ @java.lang.Override - public int getFirstReduceDB() { - return firstReduceDB_; + public int getFirstReduceDb() { + return firstReduceDb_; } public static final int SPECIALINCREDUCEDB_FIELD_NUMBER = 15; - private int specialIncReduceDB_ = 0; + private int specialIncReduceDb_ = 0; /** - * int32 specialIncReduceDB = 15; - * @return The specialIncReduceDB. + * int32 specialIncReduceDb = 15; + * @return The specialIncReduceDb. */ @java.lang.Override - public int getSpecialIncReduceDB() { - return specialIncReduceDB_; + public int getSpecialIncReduceDb() { + return specialIncReduceDb_; } public static final int INCREDUCEDB_FIELD_NUMBER = 16; - private int incReduceDB_ = 0; + private int incReduceDb_ = 0; /** - * int32 incReduceDB = 16; - * @return The incReduceDB. + * int32 incReduceDb = 16; + * @return The incReduceDb. */ @java.lang.Override - public int getIncReduceDB() { - return incReduceDB_; + public int getIncReduceDb() { + return incReduceDb_; } public static final int FACTORK_FIELD_NUMBER = 17; @@ -681,14 +681,14 @@ public double getFactorR() { } public static final int SIZELBDQUEUE_FIELD_NUMBER = 19; - private int sizeLBDQueue_ = 0; + private int sizeLbdQueue_ = 0; /** - * int32 sizeLBDQueue = 19; - * @return The sizeLBDQueue. + * int32 sizeLbdQueue = 19; + * @return The sizeLbdQueue. */ @java.lang.Override - public int getSizeLBDQueue() { - return sizeLBDQueue_; + public int getSizeLbdQueue() { + return sizeLbdQueue_; } public static final int SIZETRAILQUEUE_FIELD_NUMBER = 20; @@ -755,10 +755,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (useAtMostClauses_ != false) { output.writeBool(2, useAtMostClauses_); } - if (cnfMethod_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.FACTORY_CNF.getNumber()) { + if (cnfMethod_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.FACTORY_CNF.getNumber()) { output.writeEnum(3, cnfMethod_); } - if (clauseMinimization_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.NONE.getNumber()) { + if (clauseMinimization_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.NONE.getNumber()) { output.writeEnum(4, clauseMinimization_); } if (initialPhase_ != false) { @@ -779,23 +779,23 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (java.lang.Double.doubleToRawLongBits(clauseDecay_) != 0) { output.writeDouble(10, clauseDecay_); } - if (lbLBDMinimizingClause_ != 0) { - output.writeInt32(11, lbLBDMinimizingClause_); + if (lbLbdMinimizingClause_ != 0) { + output.writeInt32(11, lbLbdMinimizingClause_); } - if (lbLBDFrozenClause_ != 0) { - output.writeInt32(12, lbLBDFrozenClause_); + if (lbLbdFrozenClause_ != 0) { + output.writeInt32(12, lbLbdFrozenClause_); } if (lbSizeMinimizingClause_ != 0) { output.writeInt32(13, lbSizeMinimizingClause_); } - if (firstReduceDB_ != 0) { - output.writeInt32(14, firstReduceDB_); + if (firstReduceDb_ != 0) { + output.writeInt32(14, firstReduceDb_); } - if (specialIncReduceDB_ != 0) { - output.writeInt32(15, specialIncReduceDB_); + if (specialIncReduceDb_ != 0) { + output.writeInt32(15, specialIncReduceDb_); } - if (incReduceDB_ != 0) { - output.writeInt32(16, incReduceDB_); + if (incReduceDb_ != 0) { + output.writeInt32(16, incReduceDb_); } if (java.lang.Double.doubleToRawLongBits(factorK_) != 0) { output.writeDouble(17, factorK_); @@ -803,8 +803,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (java.lang.Double.doubleToRawLongBits(factorR_) != 0) { output.writeDouble(18, factorR_); } - if (sizeLBDQueue_ != 0) { - output.writeInt32(19, sizeLBDQueue_); + if (sizeLbdQueue_ != 0) { + output.writeInt32(19, sizeLbdQueue_); } if (sizeTrailQueue_ != 0) { output.writeInt32(20, sizeTrailQueue_); @@ -835,11 +835,11 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(2, useAtMostClauses_); } - if (cnfMethod_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.FACTORY_CNF.getNumber()) { + if (cnfMethod_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.FACTORY_CNF.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, cnfMethod_); } - if (clauseMinimization_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.NONE.getNumber()) { + if (clauseMinimization_ != com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, clauseMinimization_); } @@ -867,29 +867,29 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeDoubleSize(10, clauseDecay_); } - if (lbLBDMinimizingClause_ != 0) { + if (lbLbdMinimizingClause_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(11, lbLBDMinimizingClause_); + .computeInt32Size(11, lbLbdMinimizingClause_); } - if (lbLBDFrozenClause_ != 0) { + if (lbLbdFrozenClause_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(12, lbLBDFrozenClause_); + .computeInt32Size(12, lbLbdFrozenClause_); } if (lbSizeMinimizingClause_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(13, lbSizeMinimizingClause_); } - if (firstReduceDB_ != 0) { + if (firstReduceDb_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(14, firstReduceDB_); + .computeInt32Size(14, firstReduceDb_); } - if (specialIncReduceDB_ != 0) { + if (specialIncReduceDb_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(15, specialIncReduceDB_); + .computeInt32Size(15, specialIncReduceDb_); } - if (incReduceDB_ != 0) { + if (incReduceDb_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(16, incReduceDB_); + .computeInt32Size(16, incReduceDb_); } if (java.lang.Double.doubleToRawLongBits(factorK_) != 0) { size += com.google.protobuf.CodedOutputStream @@ -899,9 +899,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeDoubleSize(18, factorR_); } - if (sizeLBDQueue_ != 0) { + if (sizeLbdQueue_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(19, sizeLBDQueue_); + .computeInt32Size(19, sizeLbdQueue_); } if (sizeTrailQueue_ != 0) { size += com.google.protobuf.CodedOutputStream @@ -929,10 +929,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig other = (com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig) obj; + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig other = (com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig) obj; if (getProofGeneration() != other.getProofGeneration()) return false; @@ -956,26 +956,26 @@ public boolean equals(final java.lang.Object obj) { if (java.lang.Double.doubleToLongBits(getClauseDecay()) != java.lang.Double.doubleToLongBits( other.getClauseDecay())) return false; - if (getLbLBDMinimizingClause() - != other.getLbLBDMinimizingClause()) return false; - if (getLbLBDFrozenClause() - != other.getLbLBDFrozenClause()) return false; + if (getLbLbdMinimizingClause() + != other.getLbLbdMinimizingClause()) return false; + if (getLbLbdFrozenClause() + != other.getLbLbdFrozenClause()) return false; if (getLbSizeMinimizingClause() != other.getLbSizeMinimizingClause()) return false; - if (getFirstReduceDB() - != other.getFirstReduceDB()) return false; - if (getSpecialIncReduceDB() - != other.getSpecialIncReduceDB()) return false; - if (getIncReduceDB() - != other.getIncReduceDB()) return false; + if (getFirstReduceDb() + != other.getFirstReduceDb()) return false; + if (getSpecialIncReduceDb() + != other.getSpecialIncReduceDb()) return false; + if (getIncReduceDb() + != other.getIncReduceDb()) return false; if (java.lang.Double.doubleToLongBits(getFactorK()) != java.lang.Double.doubleToLongBits( other.getFactorK())) return false; if (java.lang.Double.doubleToLongBits(getFactorR()) != java.lang.Double.doubleToLongBits( other.getFactorR())) return false; - if (getSizeLBDQueue() - != other.getSizeLBDQueue()) return false; + if (getSizeLbdQueue() + != other.getSizeLbdQueue()) return false; if (getSizeTrailQueue() != other.getSizeTrailQueue()) return false; if (getReduceOnSize() @@ -1024,17 +1024,17 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getClauseDecay())); hash = (37 * hash) + LBLBDMINIMIZINGCLAUSE_FIELD_NUMBER; - hash = (53 * hash) + getLbLBDMinimizingClause(); + hash = (53 * hash) + getLbLbdMinimizingClause(); hash = (37 * hash) + LBLBDFROZENCLAUSE_FIELD_NUMBER; - hash = (53 * hash) + getLbLBDFrozenClause(); + hash = (53 * hash) + getLbLbdFrozenClause(); hash = (37 * hash) + LBSIZEMINIMIZINGCLAUSE_FIELD_NUMBER; hash = (53 * hash) + getLbSizeMinimizingClause(); hash = (37 * hash) + FIRSTREDUCEDB_FIELD_NUMBER; - hash = (53 * hash) + getFirstReduceDB(); + hash = (53 * hash) + getFirstReduceDb(); hash = (37 * hash) + SPECIALINCREDUCEDB_FIELD_NUMBER; - hash = (53 * hash) + getSpecialIncReduceDB(); + hash = (53 * hash) + getSpecialIncReduceDb(); hash = (37 * hash) + INCREDUCEDB_FIELD_NUMBER; - hash = (53 * hash) + getIncReduceDB(); + hash = (53 * hash) + getIncReduceDb(); hash = (37 * hash) + FACTORK_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getFactorK())); @@ -1042,7 +1042,7 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getFactorR())); hash = (37 * hash) + SIZELBDQUEUE_FIELD_NUMBER; - hash = (53 * hash) + getSizeLBDQueue(); + hash = (53 * hash) + getSizeLbdQueue(); hash = (37 * hash) + SIZETRAILQUEUE_FIELD_NUMBER; hash = (53 * hash) + getSizeTrailQueue(); hash = (37 * hash) + REDUCEONSIZE_FIELD_NUMBER; @@ -1058,44 +1058,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1103,26 +1103,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSo .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1135,7 +1135,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSo public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1151,26 +1151,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBSatSolverConfig} + * Protobuf type {@code solver.PbSatSolverConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBSatSolverConfig) - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbSatSolverConfig) + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PBSatSolverConfig_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PbSatSolverConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PBSatSolverConfig_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PbSatSolverConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.class, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.class, com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.newBuilder() private Builder() { } @@ -1194,15 +1194,15 @@ public Builder clear() { restartFirst_ = 0; restartInc_ = 0D; clauseDecay_ = 0D; - lbLBDMinimizingClause_ = 0; - lbLBDFrozenClause_ = 0; + lbLbdMinimizingClause_ = 0; + lbLbdFrozenClause_ = 0; lbSizeMinimizingClause_ = 0; - firstReduceDB_ = 0; - specialIncReduceDB_ = 0; - incReduceDB_ = 0; + firstReduceDb_ = 0; + specialIncReduceDb_ = 0; + incReduceDb_ = 0; factorK_ = 0D; factorR_ = 0D; - sizeLBDQueue_ = 0; + sizeLbdQueue_ = 0; sizeTrailQueue_ = 0; reduceOnSize_ = false; reduceOnSizeSize_ = 0; @@ -1213,17 +1213,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PBSatSolverConfig_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.internal_static_solver_PbSatSolverConfig_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig build() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig build() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1231,14 +1231,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverCon } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig result = new com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig(this); + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig result = new com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.proofGeneration_ = proofGeneration_; @@ -1271,22 +1271,22 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverCo result.clauseDecay_ = clauseDecay_; } if (((from_bitField0_ & 0x00000400) != 0)) { - result.lbLBDMinimizingClause_ = lbLBDMinimizingClause_; + result.lbLbdMinimizingClause_ = lbLbdMinimizingClause_; } if (((from_bitField0_ & 0x00000800) != 0)) { - result.lbLBDFrozenClause_ = lbLBDFrozenClause_; + result.lbLbdFrozenClause_ = lbLbdFrozenClause_; } if (((from_bitField0_ & 0x00001000) != 0)) { result.lbSizeMinimizingClause_ = lbSizeMinimizingClause_; } if (((from_bitField0_ & 0x00002000) != 0)) { - result.firstReduceDB_ = firstReduceDB_; + result.firstReduceDb_ = firstReduceDb_; } if (((from_bitField0_ & 0x00004000) != 0)) { - result.specialIncReduceDB_ = specialIncReduceDB_; + result.specialIncReduceDb_ = specialIncReduceDb_; } if (((from_bitField0_ & 0x00008000) != 0)) { - result.incReduceDB_ = incReduceDB_; + result.incReduceDb_ = incReduceDb_; } if (((from_bitField0_ & 0x00010000) != 0)) { result.factorK_ = factorK_; @@ -1295,7 +1295,7 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverCo result.factorR_ = factorR_; } if (((from_bitField0_ & 0x00040000) != 0)) { - result.sizeLBDQueue_ = sizeLBDQueue_; + result.sizeLbdQueue_ = sizeLbdQueue_; } if (((from_bitField0_ & 0x00080000) != 0)) { result.sizeTrailQueue_ = sizeTrailQueue_; @@ -1313,16 +1313,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverCo @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig.getDefaultInstance()) return this; if (other.getProofGeneration() != false) { setProofGeneration(other.getProofGeneration()); } @@ -1353,23 +1353,23 @@ public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverComm if (other.getClauseDecay() != 0D) { setClauseDecay(other.getClauseDecay()); } - if (other.getLbLBDMinimizingClause() != 0) { - setLbLBDMinimizingClause(other.getLbLBDMinimizingClause()); + if (other.getLbLbdMinimizingClause() != 0) { + setLbLbdMinimizingClause(other.getLbLbdMinimizingClause()); } - if (other.getLbLBDFrozenClause() != 0) { - setLbLBDFrozenClause(other.getLbLBDFrozenClause()); + if (other.getLbLbdFrozenClause() != 0) { + setLbLbdFrozenClause(other.getLbLbdFrozenClause()); } if (other.getLbSizeMinimizingClause() != 0) { setLbSizeMinimizingClause(other.getLbSizeMinimizingClause()); } - if (other.getFirstReduceDB() != 0) { - setFirstReduceDB(other.getFirstReduceDB()); + if (other.getFirstReduceDb() != 0) { + setFirstReduceDb(other.getFirstReduceDb()); } - if (other.getSpecialIncReduceDB() != 0) { - setSpecialIncReduceDB(other.getSpecialIncReduceDB()); + if (other.getSpecialIncReduceDb() != 0) { + setSpecialIncReduceDb(other.getSpecialIncReduceDb()); } - if (other.getIncReduceDB() != 0) { - setIncReduceDB(other.getIncReduceDB()); + if (other.getIncReduceDb() != 0) { + setIncReduceDb(other.getIncReduceDb()); } if (other.getFactorK() != 0D) { setFactorK(other.getFactorK()); @@ -1377,8 +1377,8 @@ public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverComm if (other.getFactorR() != 0D) { setFactorR(other.getFactorR()); } - if (other.getSizeLBDQueue() != 0) { - setSizeLBDQueue(other.getSizeLBDQueue()); + if (other.getSizeLbdQueue() != 0) { + setSizeLbdQueue(other.getSizeLbdQueue()); } if (other.getSizeTrailQueue() != 0) { setSizeTrailQueue(other.getSizeTrailQueue()); @@ -1469,12 +1469,12 @@ public Builder mergeFrom( break; } // case 81 case 88: { - lbLBDMinimizingClause_ = input.readInt32(); + lbLbdMinimizingClause_ = input.readInt32(); bitField0_ |= 0x00000400; break; } // case 88 case 96: { - lbLBDFrozenClause_ = input.readInt32(); + lbLbdFrozenClause_ = input.readInt32(); bitField0_ |= 0x00000800; break; } // case 96 @@ -1484,17 +1484,17 @@ public Builder mergeFrom( break; } // case 104 case 112: { - firstReduceDB_ = input.readInt32(); + firstReduceDb_ = input.readInt32(); bitField0_ |= 0x00002000; break; } // case 112 case 120: { - specialIncReduceDB_ = input.readInt32(); + specialIncReduceDb_ = input.readInt32(); bitField0_ |= 0x00004000; break; } // case 120 case 128: { - incReduceDB_ = input.readInt32(); + incReduceDb_ = input.readInt32(); bitField0_ |= 0x00008000; break; } // case 128 @@ -1509,7 +1509,7 @@ public Builder mergeFrom( break; } // case 145 case 152: { - sizeLBDQueue_ = input.readInt32(); + sizeLbdQueue_ = input.readInt32(); bitField0_ |= 0x00040000; break; } // case 152 @@ -1616,14 +1616,14 @@ public Builder clearUseAtMostClauses() { private int cnfMethod_ = 0; /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The enum numeric value on the wire for cnfMethod. */ @java.lang.Override public int getCnfMethodValue() { return cnfMethod_; } /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @param value The enum numeric value on the wire for cnfMethod to set. * @return This builder for chaining. */ @@ -1634,20 +1634,20 @@ public Builder setCnfMethodValue(int value) { return this; } /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return The cnfMethod. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod getCnfMethod() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.forNumber(cnfMethod_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod.UNRECOGNIZED : result; + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod getCnfMethod() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.forNumber(cnfMethod_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod.UNRECOGNIZED : result; } /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @param value The cnfMethod to set. * @return This builder for chaining. */ - public Builder setCnfMethod(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod value) { + public Builder setCnfMethod(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod value) { if (value == null) { throw new NullPointerException(); } @@ -1657,7 +1657,7 @@ public Builder setCnfMethod(com.booleworks.logicng.serialization.ProtoBufSolverC return this; } /** - * .solver.PBCnfMethod cnfMethod = 3; + * .solver.PbCnfMethod cnfMethod = 3; * @return This builder for chaining. */ public Builder clearCnfMethod() { @@ -1669,14 +1669,14 @@ public Builder clearCnfMethod() { private int clauseMinimization_ = 0; /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The enum numeric value on the wire for clauseMinimization. */ @java.lang.Override public int getClauseMinimizationValue() { return clauseMinimization_; } /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @param value The enum numeric value on the wire for clauseMinimization to set. * @return This builder for chaining. */ @@ -1687,20 +1687,20 @@ public Builder setClauseMinimizationValue(int value) { return this; } /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return The clauseMinimization. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization getClauseMinimization() { - com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.forNumber(clauseMinimization_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization.UNRECOGNIZED : result; + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization getClauseMinimization() { + com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization result = com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.forNumber(clauseMinimization_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization.UNRECOGNIZED : result; } /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @param value The clauseMinimization to set. * @return This builder for chaining. */ - public Builder setClauseMinimization(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization value) { + public Builder setClauseMinimization(com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization value) { if (value == null) { throw new NullPointerException(); } @@ -1710,7 +1710,7 @@ public Builder setClauseMinimization(com.booleworks.logicng.serialization.ProtoB return this; } /** - * .solver.PBClauseMinimization clauseMinimization = 4; + * .solver.PbClauseMinimization clauseMinimization = 4; * @return This builder for chaining. */ public Builder clearClauseMinimization() { @@ -1912,66 +1912,66 @@ public Builder clearClauseDecay() { return this; } - private int lbLBDMinimizingClause_ ; + private int lbLbdMinimizingClause_ ; /** - * int32 lbLBDMinimizingClause = 11; - * @return The lbLBDMinimizingClause. + * int32 lbLbdMinimizingClause = 11; + * @return The lbLbdMinimizingClause. */ @java.lang.Override - public int getLbLBDMinimizingClause() { - return lbLBDMinimizingClause_; + public int getLbLbdMinimizingClause() { + return lbLbdMinimizingClause_; } /** - * int32 lbLBDMinimizingClause = 11; - * @param value The lbLBDMinimizingClause to set. + * int32 lbLbdMinimizingClause = 11; + * @param value The lbLbdMinimizingClause to set. * @return This builder for chaining. */ - public Builder setLbLBDMinimizingClause(int value) { + public Builder setLbLbdMinimizingClause(int value) { - lbLBDMinimizingClause_ = value; + lbLbdMinimizingClause_ = value; bitField0_ |= 0x00000400; onChanged(); return this; } /** - * int32 lbLBDMinimizingClause = 11; + * int32 lbLbdMinimizingClause = 11; * @return This builder for chaining. */ - public Builder clearLbLBDMinimizingClause() { + public Builder clearLbLbdMinimizingClause() { bitField0_ = (bitField0_ & ~0x00000400); - lbLBDMinimizingClause_ = 0; + lbLbdMinimizingClause_ = 0; onChanged(); return this; } - private int lbLBDFrozenClause_ ; + private int lbLbdFrozenClause_ ; /** - * int32 lbLBDFrozenClause = 12; - * @return The lbLBDFrozenClause. + * int32 lbLbdFrozenClause = 12; + * @return The lbLbdFrozenClause. */ @java.lang.Override - public int getLbLBDFrozenClause() { - return lbLBDFrozenClause_; + public int getLbLbdFrozenClause() { + return lbLbdFrozenClause_; } /** - * int32 lbLBDFrozenClause = 12; - * @param value The lbLBDFrozenClause to set. + * int32 lbLbdFrozenClause = 12; + * @param value The lbLbdFrozenClause to set. * @return This builder for chaining. */ - public Builder setLbLBDFrozenClause(int value) { + public Builder setLbLbdFrozenClause(int value) { - lbLBDFrozenClause_ = value; + lbLbdFrozenClause_ = value; bitField0_ |= 0x00000800; onChanged(); return this; } /** - * int32 lbLBDFrozenClause = 12; + * int32 lbLbdFrozenClause = 12; * @return This builder for chaining. */ - public Builder clearLbLBDFrozenClause() { + public Builder clearLbLbdFrozenClause() { bitField0_ = (bitField0_ & ~0x00000800); - lbLBDFrozenClause_ = 0; + lbLbdFrozenClause_ = 0; onChanged(); return this; } @@ -2008,98 +2008,98 @@ public Builder clearLbSizeMinimizingClause() { return this; } - private int firstReduceDB_ ; + private int firstReduceDb_ ; /** - * int32 firstReduceDB = 14; - * @return The firstReduceDB. + * int32 firstReduceDb = 14; + * @return The firstReduceDb. */ @java.lang.Override - public int getFirstReduceDB() { - return firstReduceDB_; + public int getFirstReduceDb() { + return firstReduceDb_; } /** - * int32 firstReduceDB = 14; - * @param value The firstReduceDB to set. + * int32 firstReduceDb = 14; + * @param value The firstReduceDb to set. * @return This builder for chaining. */ - public Builder setFirstReduceDB(int value) { + public Builder setFirstReduceDb(int value) { - firstReduceDB_ = value; + firstReduceDb_ = value; bitField0_ |= 0x00002000; onChanged(); return this; } /** - * int32 firstReduceDB = 14; + * int32 firstReduceDb = 14; * @return This builder for chaining. */ - public Builder clearFirstReduceDB() { + public Builder clearFirstReduceDb() { bitField0_ = (bitField0_ & ~0x00002000); - firstReduceDB_ = 0; + firstReduceDb_ = 0; onChanged(); return this; } - private int specialIncReduceDB_ ; + private int specialIncReduceDb_ ; /** - * int32 specialIncReduceDB = 15; - * @return The specialIncReduceDB. + * int32 specialIncReduceDb = 15; + * @return The specialIncReduceDb. */ @java.lang.Override - public int getSpecialIncReduceDB() { - return specialIncReduceDB_; + public int getSpecialIncReduceDb() { + return specialIncReduceDb_; } /** - * int32 specialIncReduceDB = 15; - * @param value The specialIncReduceDB to set. + * int32 specialIncReduceDb = 15; + * @param value The specialIncReduceDb to set. * @return This builder for chaining. */ - public Builder setSpecialIncReduceDB(int value) { + public Builder setSpecialIncReduceDb(int value) { - specialIncReduceDB_ = value; + specialIncReduceDb_ = value; bitField0_ |= 0x00004000; onChanged(); return this; } /** - * int32 specialIncReduceDB = 15; + * int32 specialIncReduceDb = 15; * @return This builder for chaining. */ - public Builder clearSpecialIncReduceDB() { + public Builder clearSpecialIncReduceDb() { bitField0_ = (bitField0_ & ~0x00004000); - specialIncReduceDB_ = 0; + specialIncReduceDb_ = 0; onChanged(); return this; } - private int incReduceDB_ ; + private int incReduceDb_ ; /** - * int32 incReduceDB = 16; - * @return The incReduceDB. + * int32 incReduceDb = 16; + * @return The incReduceDb. */ @java.lang.Override - public int getIncReduceDB() { - return incReduceDB_; + public int getIncReduceDb() { + return incReduceDb_; } /** - * int32 incReduceDB = 16; - * @param value The incReduceDB to set. + * int32 incReduceDb = 16; + * @param value The incReduceDb to set. * @return This builder for chaining. */ - public Builder setIncReduceDB(int value) { + public Builder setIncReduceDb(int value) { - incReduceDB_ = value; + incReduceDb_ = value; bitField0_ |= 0x00008000; onChanged(); return this; } /** - * int32 incReduceDB = 16; + * int32 incReduceDb = 16; * @return This builder for chaining. */ - public Builder clearIncReduceDB() { + public Builder clearIncReduceDb() { bitField0_ = (bitField0_ & ~0x00008000); - incReduceDB_ = 0; + incReduceDb_ = 0; onChanged(); return this; } @@ -2168,34 +2168,34 @@ public Builder clearFactorR() { return this; } - private int sizeLBDQueue_ ; + private int sizeLbdQueue_ ; /** - * int32 sizeLBDQueue = 19; - * @return The sizeLBDQueue. + * int32 sizeLbdQueue = 19; + * @return The sizeLbdQueue. */ @java.lang.Override - public int getSizeLBDQueue() { - return sizeLBDQueue_; + public int getSizeLbdQueue() { + return sizeLbdQueue_; } /** - * int32 sizeLBDQueue = 19; - * @param value The sizeLBDQueue to set. + * int32 sizeLbdQueue = 19; + * @param value The sizeLbdQueue to set. * @return This builder for chaining. */ - public Builder setSizeLBDQueue(int value) { + public Builder setSizeLbdQueue(int value) { - sizeLBDQueue_ = value; + sizeLbdQueue_ = value; bitField0_ |= 0x00040000; onChanged(); return this; } /** - * int32 sizeLBDQueue = 19; + * int32 sizeLbdQueue = 19; * @return This builder for chaining. */ - public Builder clearSizeLBDQueue() { + public Builder clearSizeLbdQueue() { bitField0_ = (bitField0_ & ~0x00040000); - sizeLBDQueue_ = 0; + sizeLbdQueue_ = 0; onChanged(); return this; } @@ -2328,23 +2328,23 @@ public Builder clearMaxVarDecay() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBSatSolverConfig) + // @@protoc_insertion_point(builder_scope:solver.PbSatSolverConfig) } - // @@protoc_insertion_point(class_scope:solver.PBSatSolverConfig) - private static final com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbSatSolverConfig) + private static final com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBSatSolverConfig parsePartialFrom( + public PbSatSolverConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2363,27 +2363,27 @@ public PBSatSolverConfig parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBSatSolverConfig_descriptor; + internal_static_solver_PbSatSolverConfig_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBSatSolverConfig_fieldAccessorTable; + internal_static_solver_PbSatSolverConfig_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -2393,24 +2393,24 @@ public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverCon descriptor; static { java.lang.String[] descriptorData = { - "\n\024solver_commons.proto\022\006solver\"\326\004\n\021PBSat" + + "\n\024solver_commons.proto\022\006solver\"\326\004\n\021PbSat" + "SolverConfig\022\027\n\017proofGeneration\030\001 \001(\010\022\030\n" + "\020useAtMostClauses\030\002 \001(\010\022&\n\tcnfMethod\030\003 \001" + - "(\0162\023.solver.PBCnfMethod\0228\n\022clauseMinimiz" + - "ation\030\004 \001(\0162\034.solver.PBClauseMinimizatio" + + "(\0162\023.solver.PbCnfMethod\0228\n\022clauseMinimiz" + + "ation\030\004 \001(\0162\034.solver.PbClauseMinimizatio" + "n\022\024\n\014initialPhase\030\005 \001(\010\022\020\n\010varDecay\030\006 \001(" + "\001\022\016\n\006varInc\030\007 \001(\001\022\024\n\014restartFirst\030\010 \001(\005\022" + "\022\n\nrestartInc\030\t \001(\001\022\023\n\013clauseDecay\030\n \001(\001" + - "\022\035\n\025lbLBDMinimizingClause\030\013 \001(\005\022\031\n\021lbLBD" + + "\022\035\n\025lbLbdMinimizingClause\030\013 \001(\005\022\031\n\021lbLbd" + "FrozenClause\030\014 \001(\005\022\036\n\026lbSizeMinimizingCl" + - "ause\030\r \001(\005\022\025\n\rfirstReduceDB\030\016 \001(\005\022\032\n\022spe" + - "cialIncReduceDB\030\017 \001(\005\022\023\n\013incReduceDB\030\020 \001" + + "ause\030\r \001(\005\022\025\n\rfirstReduceDb\030\016 \001(\005\022\032\n\022spe" + + "cialIncReduceDb\030\017 \001(\005\022\023\n\013incReduceDb\030\020 \001" + "(\005\022\017\n\007factorK\030\021 \001(\001\022\017\n\007factorR\030\022 \001(\001\022\024\n\014" + - "sizeLBDQueue\030\023 \001(\005\022\026\n\016sizeTrailQueue\030\024 \001" + + "sizeLbdQueue\030\023 \001(\005\022\026\n\016sizeTrailQueue\030\024 \001" + "(\005\022\024\n\014reduceOnSize\030\025 \001(\010\022\030\n\020reduceOnSize" + - "Size\030\026 \001(\005\022\023\n\013maxVarDecay\030\027 \001(\001*5\n\024PBCla" + + "Size\030\026 \001(\005\022\023\n\013maxVarDecay\030\027 \001(\001*5\n\024PbCla" + "useMinimization\022\010\n\004NONE\020\000\022\t\n\005BASIC\020\001\022\010\n\004" + - "DEEP\020\002*G\n\013PBCnfMethod\022\017\n\013FACTORY_CNF\020\000\022\020" + + "DEEP\020\002*G\n\013PbCnfMethod\022\017\n\013FACTORY_CNF\020\000\022\020" + "\n\014PG_ON_SOLVER\020\001\022\025\n\021FULL_PG_ON_SOLVER\020\002B" + "=\n$com.booleworks.logicng.serializationB" + "\025ProtoBufSolverCommonsb\006proto3" @@ -2419,12 +2419,12 @@ public com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverCon .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }); - internal_static_solver_PBSatSolverConfig_descriptor = + internal_static_solver_PbSatSolverConfig_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_solver_PBSatSolverConfig_fieldAccessorTable = new + internal_static_solver_PbSatSolverConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBSatSolverConfig_descriptor, - new java.lang.String[] { "ProofGeneration", "UseAtMostClauses", "CnfMethod", "ClauseMinimization", "InitialPhase", "VarDecay", "VarInc", "RestartFirst", "RestartInc", "ClauseDecay", "LbLBDMinimizingClause", "LbLBDFrozenClause", "LbSizeMinimizingClause", "FirstReduceDB", "SpecialIncReduceDB", "IncReduceDB", "FactorK", "FactorR", "SizeLBDQueue", "SizeTrailQueue", "ReduceOnSize", "ReduceOnSizeSize", "MaxVarDecay", }); + internal_static_solver_PbSatSolverConfig_descriptor, + new java.lang.String[] { "ProofGeneration", "UseAtMostClauses", "CnfMethod", "ClauseMinimization", "InitialPhase", "VarDecay", "VarInc", "RestartFirst", "RestartInc", "ClauseDecay", "LbLbdMinimizingClause", "LbLbdFrozenClause", "LbSizeMinimizingClause", "FirstReduceDb", "SpecialIncReduceDb", "IncReduceDb", "FactorK", "FactorR", "SizeLbdQueue", "SizeTrailQueue", "ReduceOnSize", "ReduceOnSizeSize", "MaxVarDecay", }); descriptor.resolveAllFeaturesImmutable(); } diff --git a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverDatastructures.java b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverDatastructures.java index 6d76ddd6..9a966c0d 100644 --- a/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverDatastructures.java +++ b/serialization/src/main/generated/java/com/booleworks/logicng/serialization/ProtoBufSolverDatastructures.java @@ -26,9 +26,9 @@ public static void registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** - * Protobuf enum {@code solver.PBTristate} + * Protobuf enum {@code solver.PbTristate} */ - public enum PBTristate + public enum PbTristate implements com.google.protobuf.ProtocolMessageEnum { /** * FALSE = 0; @@ -52,7 +52,7 @@ public enum PBTristate /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBTristate.class.getName()); + PbTristate.class.getName()); } /** * FALSE = 0; @@ -82,7 +82,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PBTristate valueOf(int value) { + public static PbTristate valueOf(int value) { return forNumber(value); } @@ -90,7 +90,7 @@ public static PBTristate valueOf(int value) { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PBTristate forNumber(int value) { + public static PbTristate forNumber(int value) { switch (value) { case 0: return FALSE; case 1: return TRUE; @@ -99,15 +99,15 @@ public static PBTristate forNumber(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PBTristate> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PBTristate findValueByNumber(int number) { - return PBTristate.forNumber(number); + PbTristate> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PbTristate findValueByNumber(int number) { + return PbTristate.forNumber(number); } }; @@ -128,9 +128,9 @@ public PBTristate findValueByNumber(int number) { return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.getDescriptor().getEnumTypes().get(0); } - private static final PBTristate[] VALUES = values(); + private static final PbTristate[] VALUES = values(); - public static PBTristate valueOf( + public static PbTristate valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -144,31 +144,31 @@ public static PBTristate valueOf( private final int value; - private PBTristate(int value) { + private PbTristate(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:solver.PBTristate) + // @@protoc_insertion_point(enum_scope:solver.PbTristate) } - public interface PBClauseOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBClause) + public interface PbClauseOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbClause) com.google.protobuf.MessageOrBuilder { /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return Whether the data field is set. */ boolean hasData(); /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return The data. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getData(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getData(); /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getDataOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getDataOrBuilder(); /** * int32 learntOnState = 2; @@ -225,12 +225,12 @@ public interface PBClauseOrBuilder extends int getId(); } /** - * Protobuf type {@code solver.PBClause} + * Protobuf type {@code solver.PbClause} */ - public static final class PBClause extends + public static final class PbClause extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBClause) - PBClauseOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbClause) + PbClauseOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -239,33 +239,33 @@ public static final class PBClause extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBClause.class.getName()); + PbClause.class.getName()); } - // Use PBClause.newBuilder() to construct. - private PBClause(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbClause.newBuilder() to construct. + private PbClause(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBClause() { + private PbClause() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClause_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClause_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClause_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClause_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder.class); } private int bitField0_; public static final int DATA_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector data_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector data_; /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return Whether the data field is set. */ @java.lang.Override @@ -273,19 +273,19 @@ public boolean hasData() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return The data. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getData() { - return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : data_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getData() { + return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : data_; } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getDataOrBuilder() { - return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : data_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getDataOrBuilder() { + return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : data_; } public static final int LEARNTONSTATE_FIELD_NUMBER = 2; @@ -490,10 +490,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause) obj; if (hasData() != other.hasData()) return false; if (hasData()) { @@ -563,44 +563,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -608,26 +608,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -640,7 +640,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -656,26 +656,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBClause} + * Protobuf type {@code solver.PbClause} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBClause) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbClause) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClause_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClause_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClause_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClause_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -715,17 +715,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClause_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClause_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -733,14 +733,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -781,16 +781,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.getDefaultInstance()) return this; if (other.hasData()) { mergeData(other.getData()); } @@ -916,31 +916,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector data_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector data_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> dataBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> dataBuilder_; /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return Whether the data field is set. */ public boolean hasData() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; * @return The data. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getData() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getData() { if (dataBuilder_ == null) { - return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : data_; + return data_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : data_; } else { return dataBuilder_.getMessage(); } } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ - public Builder setData(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setData(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (dataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -954,10 +954,10 @@ public Builder setData(com.booleworks.logicng.serialization.ProtoBufCollections. return this; } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ public Builder setData( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (dataBuilder_ == null) { data_ = builderForValue.build(); } else { @@ -968,13 +968,13 @@ public Builder setData( return this; } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ - public Builder mergeData(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeData(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (dataBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && data_ != null && - data_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + data_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getDataBuilder().mergeFrom(value); } else { data_ = value; @@ -989,7 +989,7 @@ public Builder mergeData(com.booleworks.logicng.serialization.ProtoBufCollection return this; } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ public Builder clearData() { bitField0_ = (bitField0_ & ~0x00000001); @@ -1002,33 +1002,33 @@ public Builder clearData() { return this; } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getDataBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getDataBuilder() { bitField0_ |= 0x00000001; onChanged(); return getDataFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getDataOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getDataOrBuilder() { if (dataBuilder_ != null) { return dataBuilder_.getMessageOrBuilder(); } else { return data_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : data_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : data_; } } /** - * .collections.PBIntVector data = 1; + * .collections.PbIntVector data = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getDataFieldBuilder() { if (dataBuilder_ == null) { dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getData(), getParentForChildren(), isClean()); @@ -1325,23 +1325,23 @@ public Builder clearId() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBClause) + // @@protoc_insertion_point(builder_scope:solver.PbClause) } - // @@protoc_insertion_point(class_scope:solver.PBClause) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbClause) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBClause parsePartialFrom( + public PbClause parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1360,57 +1360,57 @@ public PBClause parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBClauseVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBClauseVector) + public interface PbClauseVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbClauseVector) com.google.protobuf.MessageOrBuilder { /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - java.util.List + java.util.List getElementList(); /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getElement(int index); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getElement(int index); /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ int getElementCount(); /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - java.util.List + java.util.List getElementOrBuilderList(); /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder getElementOrBuilder( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder getElementOrBuilder( int index); } /** - * Protobuf type {@code solver.PBClauseVector} + * Protobuf type {@code solver.PbClauseVector} */ - public static final class PBClauseVector extends + public static final class PbClauseVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBClauseVector) - PBClauseVectorOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbClauseVector) + PbClauseVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -1419,66 +1419,66 @@ public static final class PBClauseVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBClauseVector.class.getName()); + PbClauseVector.class.getName()); } - // Use PBClauseVector.newBuilder() to construct. - private PBClauseVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbClauseVector.newBuilder() to construct. + private PbClauseVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBClauseVector() { + private PbClauseVector() { element_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClauseVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClauseVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClauseVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClauseVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List element_; + private java.util.List element_; /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ @java.lang.Override - public java.util.List getElementList() { + public java.util.List getElementList() { return element_; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ @java.lang.Override - public java.util.List + public java.util.List getElementOrBuilderList() { return element_; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ @java.lang.Override public int getElementCount() { return element_.size(); } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getElement(int index) { return element_.get(index); } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder getElementOrBuilder( int index) { return element_.get(index); } @@ -1523,10 +1523,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -1550,44 +1550,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1595,26 +1595,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1627,7 +1627,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1643,26 +1643,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBClauseVector} + * Protobuf type {@code solver.PbClauseVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBClauseVector) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbClauseVector) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClauseVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClauseVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClauseVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClauseVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.newBuilder() private Builder() { } @@ -1689,17 +1689,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBClauseVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbClauseVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1707,15 +1707,15 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector result) { if (elementBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { element_ = java.util.Collections.unmodifiableList(element_); @@ -1727,22 +1727,22 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector result) { int from_bitField0_ = bitField0_; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector.getDefaultInstance()) return this; if (elementBuilder_ == null) { if (!other.element_.isEmpty()) { if (element_.isEmpty()) { @@ -1796,9 +1796,9 @@ public Builder mergeFrom( done = true; break; case 10: { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause m = + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.parser(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.parser(), extensionRegistry); if (elementBuilder_ == null) { ensureElementIsMutable(); @@ -1825,22 +1825,22 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List element_ = + private java.util.List element_ = java.util.Collections.emptyList(); private void ensureElementIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); + element_ = new java.util.ArrayList(element_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder> elementBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder> elementBuilder_; /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public java.util.List getElementList() { + public java.util.List getElementList() { if (elementBuilder_ == null) { return java.util.Collections.unmodifiableList(element_); } else { @@ -1848,7 +1848,7 @@ public java.util.Listrepeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public int getElementCount() { if (elementBuilder_ == null) { @@ -1858,9 +1858,9 @@ public int getElementCount() { } } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause getElement(int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -1868,10 +1868,10 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus } } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1885,10 +1885,10 @@ public Builder setElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.set(index, builderForValue.build()); @@ -1899,9 +1899,9 @@ public Builder setElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause value) { + public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1915,10 +1915,10 @@ public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1932,10 +1932,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder addElement( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(builderForValue.build()); @@ -1946,10 +1946,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(index, builderForValue.build()); @@ -1960,10 +1960,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder addAllElement( - java.lang.Iterable values) { + java.lang.Iterable values) { if (elementBuilder_ == null) { ensureElementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -1975,7 +1975,7 @@ public Builder addAllElement( return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder clearElement() { if (elementBuilder_ == null) { @@ -1988,7 +1988,7 @@ public Builder clearElement() { return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ public Builder removeElement(int index) { if (elementBuilder_ == null) { @@ -2001,16 +2001,16 @@ public Builder removeElement(int index) { return this; } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder getElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder getElementBuilder( int index) { return getElementFieldBuilder().getBuilder(index); } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder getElementOrBuilder( int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -2018,9 +2018,9 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus } } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public java.util.List + public java.util.List getElementOrBuilderList() { if (elementBuilder_ != null) { return elementBuilder_.getMessageOrBuilderList(); @@ -2029,33 +2029,33 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus } } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder addElementBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder addElementBuilder() { return getElementFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.getDefaultInstance()); } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder addElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder addElementBuilder( int index) { return getElementFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.getDefaultInstance()); } /** - * repeated .solver.PBClause element = 1; + * repeated .solver.PbClause element = 1; */ - public java.util.List + public java.util.List getElementBuilderList() { return getElementFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder> getElementFieldBuilder() { if (elementBuilder_ == null) { elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseOrBuilder>( element_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -2065,23 +2065,23 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClaus return elementBuilder_; } - // @@protoc_insertion_point(builder_scope:solver.PBClauseVector) + // @@protoc_insertion_point(builder_scope:solver.PbClauseVector) } - // @@protoc_insertion_point(class_scope:solver.PBClauseVector) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbClauseVector) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBClauseVector parsePartialFrom( + public PbClauseVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2100,24 +2100,24 @@ public PBClauseVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClauseVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClauseVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBWatcherOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBWatcher) + public interface PbWatcherOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbWatcher) com.google.protobuf.MessageOrBuilder { /** @@ -2133,12 +2133,12 @@ public interface PBWatcherOrBuilder extends int getBlocker(); } /** - * Protobuf type {@code solver.PBWatcher} + * Protobuf type {@code solver.PbWatcher} */ - public static final class PBWatcher extends + public static final class PbWatcher extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBWatcher) - PBWatcherOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbWatcher) + PbWatcherOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -2147,26 +2147,26 @@ public static final class PBWatcher extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBWatcher.class.getName()); + PbWatcher.class.getName()); } - // Use PBWatcher.newBuilder() to construct. - private PBWatcher(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbWatcher.newBuilder() to construct. + private PbWatcher(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBWatcher() { + private PbWatcher() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcher_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcher_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcher_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcher_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder.class); } public static final int CLAUSE_FIELD_NUMBER = 1; @@ -2238,10 +2238,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher) obj; if (getClause() != other.getClause()) return false; @@ -2267,44 +2267,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2312,26 +2312,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2344,7 +2344,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2360,26 +2360,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBWatcher} + * Protobuf type {@code solver.PbWatcher} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBWatcher) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbWatcher) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcher_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcher_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcher_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcher_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.newBuilder() private Builder() { } @@ -2401,17 +2401,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcher_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcher_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2419,14 +2419,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.clause_ = clause_; @@ -2438,16 +2438,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.getDefaultInstance()) return this; if (other.getClause() != 0) { setClause(other.getClause()); } @@ -2571,23 +2571,23 @@ public Builder clearBlocker() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBWatcher) + // @@protoc_insertion_point(builder_scope:solver.PbWatcher) } - // @@protoc_insertion_point(class_scope:solver.PBWatcher) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbWatcher) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBWatcher parsePartialFrom( + public PbWatcher parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2606,57 +2606,57 @@ public PBWatcher parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBWatcherVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBWatcherVector) + public interface PbWatcherVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbWatcherVector) com.google.protobuf.MessageOrBuilder { /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - java.util.List + java.util.List getElementList(); /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getElement(int index); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getElement(int index); /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ int getElementCount(); /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - java.util.List + java.util.List getElementOrBuilderList(); /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder getElementOrBuilder( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder getElementOrBuilder( int index); } /** - * Protobuf type {@code solver.PBWatcherVector} + * Protobuf type {@code solver.PbWatcherVector} */ - public static final class PBWatcherVector extends + public static final class PbWatcherVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBWatcherVector) - PBWatcherVectorOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbWatcherVector) + PbWatcherVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -2665,66 +2665,66 @@ public static final class PBWatcherVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBWatcherVector.class.getName()); + PbWatcherVector.class.getName()); } - // Use PBWatcherVector.newBuilder() to construct. - private PBWatcherVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbWatcherVector.newBuilder() to construct. + private PbWatcherVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBWatcherVector() { + private PbWatcherVector() { element_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List element_; + private java.util.List element_; /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ @java.lang.Override - public java.util.List getElementList() { + public java.util.List getElementList() { return element_; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ @java.lang.Override - public java.util.List + public java.util.List getElementOrBuilderList() { return element_; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ @java.lang.Override public int getElementCount() { return element_.size(); } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getElement(int index) { return element_.get(index); } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder getElementOrBuilder( int index) { return element_.get(index); } @@ -2769,10 +2769,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -2796,44 +2796,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2841,26 +2841,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2873,7 +2873,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2889,26 +2889,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBWatcherVector} + * Protobuf type {@code solver.PbWatcherVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBWatcherVector) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbWatcherVector) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.newBuilder() private Builder() { } @@ -2935,17 +2935,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2953,15 +2953,15 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector result) { if (elementBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { element_ = java.util.Collections.unmodifiableList(element_); @@ -2973,22 +2973,22 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector result) { int from_bitField0_ = bitField0_; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.getDefaultInstance()) return this; if (elementBuilder_ == null) { if (!other.element_.isEmpty()) { if (element_.isEmpty()) { @@ -3042,9 +3042,9 @@ public Builder mergeFrom( done = true; break; case 10: { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher m = + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.parser(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.parser(), extensionRegistry); if (elementBuilder_ == null) { ensureElementIsMutable(); @@ -3071,22 +3071,22 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List element_ = + private java.util.List element_ = java.util.Collections.emptyList(); private void ensureElementIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); + element_ = new java.util.ArrayList(element_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder> elementBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder> elementBuilder_; /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public java.util.List getElementList() { + public java.util.List getElementList() { if (elementBuilder_ == null) { return java.util.Collections.unmodifiableList(element_); } else { @@ -3094,7 +3094,7 @@ public java.util.Listrepeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public int getElementCount() { if (elementBuilder_ == null) { @@ -3104,9 +3104,9 @@ public int getElementCount() { } } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher getElement(int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -3114,10 +3114,10 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3131,10 +3131,10 @@ public Builder setElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.set(index, builderForValue.build()); @@ -3145,9 +3145,9 @@ public Builder setElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher value) { + public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3161,10 +3161,10 @@ public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3178,10 +3178,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder addElement( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(builderForValue.build()); @@ -3192,10 +3192,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(index, builderForValue.build()); @@ -3206,10 +3206,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder addAllElement( - java.lang.Iterable values) { + java.lang.Iterable values) { if (elementBuilder_ == null) { ensureElementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3221,7 +3221,7 @@ public Builder addAllElement( return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder clearElement() { if (elementBuilder_ == null) { @@ -3234,7 +3234,7 @@ public Builder clearElement() { return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ public Builder removeElement(int index) { if (elementBuilder_ == null) { @@ -3247,16 +3247,16 @@ public Builder removeElement(int index) { return this; } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder getElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder getElementBuilder( int index) { return getElementFieldBuilder().getBuilder(index); } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder getElementOrBuilder( int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -3264,9 +3264,9 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public java.util.List + public java.util.List getElementOrBuilderList() { if (elementBuilder_ != null) { return elementBuilder_.getMessageOrBuilderList(); @@ -3275,33 +3275,33 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder addElementBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder addElementBuilder() { return getElementFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.getDefaultInstance()); } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder addElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder addElementBuilder( int index) { return getElementFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.getDefaultInstance()); } /** - * repeated .solver.PBWatcher element = 1; + * repeated .solver.PbWatcher element = 1; */ - public java.util.List + public java.util.List getElementBuilderList() { return getElementFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder> getElementFieldBuilder() { if (elementBuilder_ == null) { elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherOrBuilder>( element_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -3311,23 +3311,23 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch return elementBuilder_; } - // @@protoc_insertion_point(builder_scope:solver.PBWatcherVector) + // @@protoc_insertion_point(builder_scope:solver.PbWatcherVector) } - // @@protoc_insertion_point(class_scope:solver.PBWatcherVector) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbWatcherVector) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBWatcherVector parsePartialFrom( + public PbWatcherVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3346,57 +3346,57 @@ public PBWatcherVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBWatcherVectorVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBWatcherVectorVector) + public interface PbWatcherVectorVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbWatcherVectorVector) com.google.protobuf.MessageOrBuilder { /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - java.util.List + java.util.List getElementList(); /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getElement(int index); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getElement(int index); /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ int getElementCount(); /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - java.util.List + java.util.List getElementOrBuilderList(); /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder getElementOrBuilder( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder getElementOrBuilder( int index); } /** - * Protobuf type {@code solver.PBWatcherVectorVector} + * Protobuf type {@code solver.PbWatcherVectorVector} */ - public static final class PBWatcherVectorVector extends + public static final class PbWatcherVectorVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBWatcherVectorVector) - PBWatcherVectorVectorOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbWatcherVectorVector) + PbWatcherVectorVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -3405,66 +3405,66 @@ public static final class PBWatcherVectorVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBWatcherVectorVector.class.getName()); + PbWatcherVectorVector.class.getName()); } - // Use PBWatcherVectorVector.newBuilder() to construct. - private PBWatcherVectorVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbWatcherVectorVector.newBuilder() to construct. + private PbWatcherVectorVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBWatcherVectorVector() { + private PbWatcherVectorVector() { element_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVectorVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVectorVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVectorVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List element_; + private java.util.List element_; /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ @java.lang.Override - public java.util.List getElementList() { + public java.util.List getElementList() { return element_; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ @java.lang.Override - public java.util.List + public java.util.List getElementOrBuilderList() { return element_; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ @java.lang.Override public int getElementCount() { return element_.size(); } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getElement(int index) { return element_.get(index); } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder getElementOrBuilder( int index) { return element_.get(index); } @@ -3509,10 +3509,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -3536,44 +3536,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3581,26 +3581,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3613,7 +3613,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3629,26 +3629,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBWatcherVectorVector} + * Protobuf type {@code solver.PbWatcherVectorVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBWatcherVectorVector) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbWatcherVectorVector) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVectorVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVectorVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVectorVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.newBuilder() private Builder() { } @@ -3675,17 +3675,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBWatcherVectorVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbWatcherVectorVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3693,15 +3693,15 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector result) { if (elementBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { element_ = java.util.Collections.unmodifiableList(element_); @@ -3713,22 +3713,22 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector result) { int from_bitField0_ = bitField0_; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector.getDefaultInstance()) return this; if (elementBuilder_ == null) { if (!other.element_.isEmpty()) { if (element_.isEmpty()) { @@ -3782,9 +3782,9 @@ public Builder mergeFrom( done = true; break; case 10: { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector m = + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.parser(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.parser(), extensionRegistry); if (elementBuilder_ == null) { ensureElementIsMutable(); @@ -3811,22 +3811,22 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List element_ = + private java.util.List element_ = java.util.Collections.emptyList(); private void ensureElementIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); + element_ = new java.util.ArrayList(element_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder> elementBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder> elementBuilder_; /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public java.util.List getElementList() { + public java.util.List getElementList() { if (elementBuilder_ == null) { return java.util.Collections.unmodifiableList(element_); } else { @@ -3834,7 +3834,7 @@ public java.util.Listrepeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public int getElementCount() { if (elementBuilder_ == null) { @@ -3844,9 +3844,9 @@ public int getElementCount() { } } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector getElement(int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -3854,10 +3854,10 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3871,10 +3871,10 @@ public Builder setElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.set(index, builderForValue.build()); @@ -3885,9 +3885,9 @@ public Builder setElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector value) { + public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3901,10 +3901,10 @@ public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3918,10 +3918,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder addElement( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(builderForValue.build()); @@ -3932,10 +3932,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(index, builderForValue.build()); @@ -3946,10 +3946,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder addAllElement( - java.lang.Iterable values) { + java.lang.Iterable values) { if (elementBuilder_ == null) { ensureElementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3961,7 +3961,7 @@ public Builder addAllElement( return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder clearElement() { if (elementBuilder_ == null) { @@ -3974,7 +3974,7 @@ public Builder clearElement() { return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ public Builder removeElement(int index) { if (elementBuilder_ == null) { @@ -3987,16 +3987,16 @@ public Builder removeElement(int index) { return this; } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder getElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder getElementBuilder( int index) { return getElementFieldBuilder().getBuilder(index); } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder getElementOrBuilder( int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -4004,9 +4004,9 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public java.util.List + public java.util.List getElementOrBuilderList() { if (elementBuilder_ != null) { return elementBuilder_.getMessageOrBuilderList(); @@ -4015,33 +4015,33 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch } } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder addElementBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder addElementBuilder() { return getElementFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.getDefaultInstance()); } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder addElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder addElementBuilder( int index) { return getElementFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.getDefaultInstance()); } /** - * repeated .solver.PBWatcherVector element = 1; + * repeated .solver.PbWatcherVector element = 1; */ - public java.util.List + public java.util.List getElementBuilderList() { return getElementFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder> getElementFieldBuilder() { if (elementBuilder_ == null) { elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVector.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorOrBuilder>( element_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -4051,23 +4051,23 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatch return elementBuilder_; } - // @@protoc_insertion_point(builder_scope:solver.PBWatcherVectorVector) + // @@protoc_insertion_point(builder_scope:solver.PbWatcherVectorVector) } - // @@protoc_insertion_point(class_scope:solver.PBWatcherVectorVector) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbWatcherVectorVector) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBWatcherVectorVector parsePartialFrom( + public PbWatcherVectorVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4086,36 +4086,36 @@ public PBWatcherVectorVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcherVectorVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcherVectorVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBVariableOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBVariable) + public interface PbVariableOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbVariable) com.google.protobuf.MessageOrBuilder { /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The enum numeric value on the wire for assignment. */ int getAssignmentValue(); /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The assignment. */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getAssignment(); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getAssignment(); /** * int32 level = 2; @@ -4148,12 +4148,12 @@ public interface PBVariableOrBuilder extends boolean getDecision(); } /** - * Protobuf type {@code solver.PBVariable} + * Protobuf type {@code solver.PbVariable} */ - public static final class PBVariable extends + public static final class PbVariable extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBVariable) - PBVariableOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbVariable) + PbVariableOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -4162,45 +4162,45 @@ public static final class PBVariable extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBVariable.class.getName()); + PbVariable.class.getName()); } - // Use PBVariable.newBuilder() to construct. - private PBVariable(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbVariable.newBuilder() to construct. + private PbVariable(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBVariable() { + private PbVariable() { assignment_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariable_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariable_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariable_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariable_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder.class); } public static final int ASSIGNMENT_FIELD_NUMBER = 1; private int assignment_ = 0; /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The enum numeric value on the wire for assignment. */ @java.lang.Override public int getAssignmentValue() { return assignment_; } /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The assignment. */ - @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getAssignment() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate result = com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.forNumber(assignment_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.UNRECOGNIZED : result; + @java.lang.Override public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getAssignment() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate result = com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.forNumber(assignment_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.UNRECOGNIZED : result; } public static final int LEVEL_FIELD_NUMBER = 2; @@ -4272,7 +4272,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (assignment_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.FALSE.getNumber()) { + if (assignment_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.FALSE.getNumber()) { output.writeEnum(1, assignment_); } if (level_ != 0) { @@ -4299,7 +4299,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (assignment_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.FALSE.getNumber()) { + if (assignment_ != com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.FALSE.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, assignment_); } @@ -4333,10 +4333,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable) obj; if (assignment_ != other.assignment_) return false; if (getLevel() @@ -4381,44 +4381,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4426,26 +4426,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4458,7 +4458,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4474,26 +4474,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBVariable} + * Protobuf type {@code solver.PbVariable} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBVariable) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbVariable) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariable_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariable_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariable_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariable_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.newBuilder() private Builder() { } @@ -4519,17 +4519,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariable_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariable_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4537,14 +4537,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.assignment_ = assignment_; @@ -4568,16 +4568,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.getDefaultInstance()) return this; if (other.assignment_ != 0) { setAssignmentValue(other.getAssignmentValue()); } @@ -4671,14 +4671,14 @@ public Builder mergeFrom( private int assignment_ = 0; /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The enum numeric value on the wire for assignment. */ @java.lang.Override public int getAssignmentValue() { return assignment_; } /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @param value The enum numeric value on the wire for assignment to set. * @return This builder for chaining. */ @@ -4689,20 +4689,20 @@ public Builder setAssignmentValue(int value) { return this; } /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return The assignment. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate getAssignment() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate result = com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.forNumber(assignment_); - return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate.UNRECOGNIZED : result; + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate getAssignment() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate result = com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.forNumber(assignment_); + return result == null ? com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate.UNRECOGNIZED : result; } /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @param value The assignment to set. * @return This builder for chaining. */ - public Builder setAssignment(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate value) { + public Builder setAssignment(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate value) { if (value == null) { throw new NullPointerException(); } @@ -4712,7 +4712,7 @@ public Builder setAssignment(com.booleworks.logicng.serialization.ProtoBufSolver return this; } /** - * .solver.PBTristate assignment = 1; + * .solver.PbTristate assignment = 1; * @return This builder for chaining. */ public Builder clearAssignment() { @@ -4882,23 +4882,23 @@ public Builder clearDecision() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBVariable) + // @@protoc_insertion_point(builder_scope:solver.PbVariable) } - // @@protoc_insertion_point(class_scope:solver.PBVariable) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbVariable) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBVariable parsePartialFrom( + public PbVariable parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4917,57 +4917,57 @@ public PBVariable parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBVariableVectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBVariableVector) + public interface PbVariableVectorOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbVariableVector) com.google.protobuf.MessageOrBuilder { /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - java.util.List + java.util.List getElementList(); /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getElement(int index); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getElement(int index); /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ int getElementCount(); /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - java.util.List + java.util.List getElementOrBuilderList(); /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder getElementOrBuilder( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder getElementOrBuilder( int index); } /** - * Protobuf type {@code solver.PBVariableVector} + * Protobuf type {@code solver.PbVariableVector} */ - public static final class PBVariableVector extends + public static final class PbVariableVector extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBVariableVector) - PBVariableVectorOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbVariableVector) + PbVariableVectorOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -4976,66 +4976,66 @@ public static final class PBVariableVector extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBVariableVector.class.getName()); + PbVariableVector.class.getName()); } - // Use PBVariableVector.newBuilder() to construct. - private PBVariableVector(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbVariableVector.newBuilder() to construct. + private PbVariableVector(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBVariableVector() { + private PbVariableVector() { element_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariableVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariableVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariableVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariableVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder.class); } public static final int ELEMENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List element_; + private java.util.List element_; /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ @java.lang.Override - public java.util.List getElementList() { + public java.util.List getElementList() { return element_; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ @java.lang.Override - public java.util.List + public java.util.List getElementOrBuilderList() { return element_; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ @java.lang.Override public int getElementCount() { return element_.size(); } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getElement(int index) { return element_.get(index); } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder getElementOrBuilder( int index) { return element_.get(index); } @@ -5080,10 +5080,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector) obj; if (!getElementList() .equals(other.getElementList())) return false; @@ -5107,44 +5107,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5152,26 +5152,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5184,7 +5184,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -5200,26 +5200,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBVariableVector} + * Protobuf type {@code solver.PbVariableVector} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBVariableVector) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVectorOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbVariableVector) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariableVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariableVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariableVector_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariableVector_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.newBuilder() private Builder() { } @@ -5246,17 +5246,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBVariableVector_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbVariableVector_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -5264,15 +5264,15 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector result) { + private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector result) { if (elementBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { element_ = java.util.Collections.unmodifiableList(element_); @@ -5284,22 +5284,22 @@ private void buildPartialRepeatedFields(com.booleworks.logicng.serialization.Pro } } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector result) { int from_bitField0_ = bitField0_; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector.getDefaultInstance()) return this; if (elementBuilder_ == null) { if (!other.element_.isEmpty()) { if (element_.isEmpty()) { @@ -5353,9 +5353,9 @@ public Builder mergeFrom( done = true; break; case 10: { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable m = + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable m = input.readMessage( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.parser(), + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.parser(), extensionRegistry); if (elementBuilder_ == null) { ensureElementIsMutable(); @@ -5382,22 +5382,22 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List element_ = + private java.util.List element_ = java.util.Collections.emptyList(); private void ensureElementIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); + element_ = new java.util.ArrayList(element_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder> elementBuilder_; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder> elementBuilder_; /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public java.util.List getElementList() { + public java.util.List getElementList() { if (elementBuilder_ == null) { return java.util.Collections.unmodifiableList(element_); } else { @@ -5405,7 +5405,7 @@ public java.util.Listrepeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public int getElementCount() { if (elementBuilder_ == null) { @@ -5415,9 +5415,9 @@ public int getElementCount() { } } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable getElement(int index) { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable getElement(int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -5425,10 +5425,10 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria } } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5442,10 +5442,10 @@ public Builder setElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder setElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.set(index, builderForValue.build()); @@ -5456,9 +5456,9 @@ public Builder setElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable value) { + public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5472,10 +5472,10 @@ public Builder addElement(com.booleworks.logicng.serialization.ProtoBufSolverDat return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable value) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable value) { if (elementBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5489,10 +5489,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder addElement( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(builderForValue.build()); @@ -5503,10 +5503,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder addElement( - int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder builderForValue) { + int index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder builderForValue) { if (elementBuilder_ == null) { ensureElementIsMutable(); element_.add(index, builderForValue.build()); @@ -5517,10 +5517,10 @@ public Builder addElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder addAllElement( - java.lang.Iterable values) { + java.lang.Iterable values) { if (elementBuilder_ == null) { ensureElementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -5532,7 +5532,7 @@ public Builder addAllElement( return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder clearElement() { if (elementBuilder_ == null) { @@ -5545,7 +5545,7 @@ public Builder clearElement() { return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ public Builder removeElement(int index) { if (elementBuilder_ == null) { @@ -5558,16 +5558,16 @@ public Builder removeElement(int index) { return this; } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder getElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder getElementBuilder( int index) { return getElementFieldBuilder().getBuilder(index); } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder getElementOrBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder getElementOrBuilder( int index) { if (elementBuilder_ == null) { return element_.get(index); } else { @@ -5575,9 +5575,9 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria } } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public java.util.List + public java.util.List getElementOrBuilderList() { if (elementBuilder_ != null) { return elementBuilder_.getMessageOrBuilderList(); @@ -5586,33 +5586,33 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria } } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder addElementBuilder() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder addElementBuilder() { return getElementFieldBuilder().addBuilder( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.getDefaultInstance()); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.getDefaultInstance()); } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder addElementBuilder( + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder addElementBuilder( int index) { return getElementFieldBuilder().addBuilder( - index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.getDefaultInstance()); + index, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.getDefaultInstance()); } /** - * repeated .solver.PBVariable element = 1; + * repeated .solver.PbVariable element = 1; */ - public java.util.List + public java.util.List getElementBuilderList() { return getElementFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder> + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder> getElementFieldBuilder() { if (elementBuilder_ == null) { elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable.Builder, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableOrBuilder>( element_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -5622,23 +5622,23 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVaria return elementBuilder_; } - // @@protoc_insertion_point(builder_scope:solver.PBVariableVector) + // @@protoc_insertion_point(builder_scope:solver.PbVariableVector) } - // @@protoc_insertion_point(class_scope:solver.PBVariableVector) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbVariableVector) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBVariableVector parsePartialFrom( + public PbVariableVector parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5657,63 +5657,63 @@ public PBVariableVector parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariableVector getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariableVector getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBHeapOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBHeap) + public interface PbHeapOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbHeap) com.google.protobuf.MessageOrBuilder { /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return Whether the heap field is set. */ boolean hasHeap(); /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return The heap. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getHeap(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getHeap(); /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getHeapOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getHeapOrBuilder(); /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return Whether the indices field is set. */ boolean hasIndices(); /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return The indices. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getIndices(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getIndices(); /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getIndicesOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getIndicesOrBuilder(); } /** - * Protobuf type {@code solver.PBHeap} + * Protobuf type {@code solver.PbHeap} */ - public static final class PBHeap extends + public static final class PbHeap extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBHeap) - PBHeapOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbHeap) + PbHeapOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -5722,33 +5722,33 @@ public static final class PBHeap extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBHeap.class.getName()); + PbHeap.class.getName()); } - // Use PBHeap.newBuilder() to construct. - private PBHeap(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbHeap.newBuilder() to construct. + private PbHeap(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBHeap() { + private PbHeap() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBHeap_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbHeap_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBHeap_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbHeap_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder.class); } private int bitField0_; public static final int HEAP_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector heap_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector heap_; /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return Whether the heap field is set. */ @java.lang.Override @@ -5756,25 +5756,25 @@ public boolean hasHeap() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return The heap. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getHeap() { - return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : heap_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getHeap() { + return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : heap_; } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getHeapOrBuilder() { - return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : heap_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getHeapOrBuilder() { + return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : heap_; } public static final int INDICES_FIELD_NUMBER = 2; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector indices_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector indices_; /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return Whether the indices field is set. */ @java.lang.Override @@ -5782,19 +5782,19 @@ public boolean hasIndices() { return ((bitField0_ & 0x00000002) != 0); } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return The indices. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getIndices() { - return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : indices_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getIndices() { + return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : indices_; } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getIndicesOrBuilder() { - return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : indices_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getIndicesOrBuilder() { + return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : indices_; } private byte memoizedIsInitialized = -1; @@ -5844,10 +5844,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap) obj; if (hasHeap() != other.hasHeap()) return false; if (hasHeap()) { @@ -5883,44 +5883,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5928,26 +5928,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5960,7 +5960,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -5976,26 +5976,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBHeap} + * Protobuf type {@code solver.PbHeap} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBHeap) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeapOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbHeap) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeapOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBHeap_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbHeap_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBHeap_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbHeap_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6032,17 +6032,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBHeap_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbHeap_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6050,14 +6050,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -6077,16 +6077,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap.getDefaultInstance()) return this; if (other.hasHeap()) { mergeHeap(other.getHeap()); } @@ -6150,31 +6150,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector heap_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector heap_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> heapBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> heapBuilder_; /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return Whether the heap field is set. */ public boolean hasHeap() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; * @return The heap. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getHeap() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getHeap() { if (heapBuilder_ == null) { - return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : heap_; + return heap_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : heap_; } else { return heapBuilder_.getMessage(); } } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ - public Builder setHeap(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setHeap(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (heapBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6188,10 +6188,10 @@ public Builder setHeap(com.booleworks.logicng.serialization.ProtoBufCollections. return this; } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ public Builder setHeap( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (heapBuilder_ == null) { heap_ = builderForValue.build(); } else { @@ -6202,13 +6202,13 @@ public Builder setHeap( return this; } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ - public Builder mergeHeap(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeHeap(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (heapBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && heap_ != null && - heap_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + heap_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getHeapBuilder().mergeFrom(value); } else { heap_ = value; @@ -6223,7 +6223,7 @@ public Builder mergeHeap(com.booleworks.logicng.serialization.ProtoBufCollection return this; } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ public Builder clearHeap() { bitField0_ = (bitField0_ & ~0x00000001); @@ -6236,33 +6236,33 @@ public Builder clearHeap() { return this; } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getHeapBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getHeapBuilder() { bitField0_ |= 0x00000001; onChanged(); return getHeapFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getHeapOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getHeapOrBuilder() { if (heapBuilder_ != null) { return heapBuilder_.getMessageOrBuilder(); } else { return heap_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : heap_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : heap_; } } /** - * .collections.PBIntVector heap = 1; + * .collections.PbIntVector heap = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getHeapFieldBuilder() { if (heapBuilder_ == null) { heapBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getHeap(), getParentForChildren(), isClean()); @@ -6271,31 +6271,31 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return heapBuilder_; } - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector indices_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector indices_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> indicesBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> indicesBuilder_; /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return Whether the indices field is set. */ public boolean hasIndices() { return ((bitField0_ & 0x00000002) != 0); } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; * @return The indices. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getIndices() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getIndices() { if (indicesBuilder_ == null) { - return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : indices_; + return indices_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : indices_; } else { return indicesBuilder_.getMessage(); } } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ - public Builder setIndices(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setIndices(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (indicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6309,10 +6309,10 @@ public Builder setIndices(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ public Builder setIndices( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (indicesBuilder_ == null) { indices_ = builderForValue.build(); } else { @@ -6323,13 +6323,13 @@ public Builder setIndices( return this; } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ - public Builder mergeIndices(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeIndices(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (indicesBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && indices_ != null && - indices_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + indices_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getIndicesBuilder().mergeFrom(value); } else { indices_ = value; @@ -6344,7 +6344,7 @@ public Builder mergeIndices(com.booleworks.logicng.serialization.ProtoBufCollect return this; } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ public Builder clearIndices() { bitField0_ = (bitField0_ & ~0x00000002); @@ -6357,33 +6357,33 @@ public Builder clearIndices() { return this; } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getIndicesBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getIndicesBuilder() { bitField0_ |= 0x00000002; onChanged(); return getIndicesFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getIndicesOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getIndicesOrBuilder() { if (indicesBuilder_ != null) { return indicesBuilder_.getMessageOrBuilder(); } else { return indices_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : indices_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : indices_; } } /** - * .collections.PBIntVector indices = 2; + * .collections.PbIntVector indices = 2; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getIndicesFieldBuilder() { if (indicesBuilder_ == null) { indicesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getIndices(), getParentForChildren(), isClean()); @@ -6392,23 +6392,23 @@ public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBui return indicesBuilder_; } - // @@protoc_insertion_point(builder_scope:solver.PBHeap) + // @@protoc_insertion_point(builder_scope:solver.PbHeap) } - // @@protoc_insertion_point(class_scope:solver.PBHeap) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbHeap) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBHeap parsePartialFrom( + public PbHeap parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6427,40 +6427,40 @@ public PBHeap parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBBoundedIntQueueOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBBoundedIntQueue) + public interface PbBoundedIntQueueOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbBoundedIntQueue) com.google.protobuf.MessageOrBuilder { /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return Whether the elems field is set. */ boolean hasElems(); /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return The elems. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElems(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElems(); /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElemsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElemsOrBuilder(); /** * int32 first = 2; @@ -6493,12 +6493,12 @@ public interface PBBoundedIntQueueOrBuilder extends int getQueueSize(); } /** - * Protobuf type {@code solver.PBBoundedIntQueue} + * Protobuf type {@code solver.PbBoundedIntQueue} */ - public static final class PBBoundedIntQueue extends + public static final class PbBoundedIntQueue extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBBoundedIntQueue) - PBBoundedIntQueueOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbBoundedIntQueue) + PbBoundedIntQueueOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -6507,33 +6507,33 @@ public static final class PBBoundedIntQueue extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBBoundedIntQueue.class.getName()); + PbBoundedIntQueue.class.getName()); } - // Use PBBoundedIntQueue.newBuilder() to construct. - private PBBoundedIntQueue(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbBoundedIntQueue.newBuilder() to construct. + private PbBoundedIntQueue(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBBoundedIntQueue() { + private PbBoundedIntQueue() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedIntQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedIntQueue_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedIntQueue_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedIntQueue_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder.class); } private int bitField0_; public static final int ELEMS_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector elems_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector elems_; /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return Whether the elems field is set. */ @java.lang.Override @@ -6541,19 +6541,19 @@ public boolean hasElems() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return The elems. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElems() { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : elems_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElems() { + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : elems_; } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElemsOrBuilder() { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : elems_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElemsOrBuilder() { + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : elems_; } public static final int FIRST_FIELD_NUMBER = 2; @@ -6686,10 +6686,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue) obj; if (hasElems() != other.hasElems()) return false; if (hasElems()) { @@ -6737,44 +6737,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6782,26 +6782,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6814,7 +6814,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -6830,26 +6830,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBBoundedIntQueue} + * Protobuf type {@code solver.PbBoundedIntQueue} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBBoundedIntQueue) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueueOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbBoundedIntQueue) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueueOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedIntQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedIntQueue_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedIntQueue_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedIntQueue_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6885,17 +6885,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedIntQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedIntQueue_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6903,14 +6903,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBound } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -6939,16 +6939,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue.getDefaultInstance()) return this; if (other.hasElems()) { mergeElems(other.getElems()); } @@ -7042,31 +7042,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector elems_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector elems_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> elemsBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> elemsBuilder_; /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return Whether the elems field is set. */ public boolean hasElems() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; * @return The elems. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getElems() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getElems() { if (elemsBuilder_ == null) { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : elems_; + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : elems_; } else { return elemsBuilder_.getMessage(); } } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ - public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (elemsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7080,10 +7080,10 @@ public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections return this; } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ public Builder setElems( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (elemsBuilder_ == null) { elems_ = builderForValue.build(); } else { @@ -7094,13 +7094,13 @@ public Builder setElems( return this; } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ - public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (elemsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && elems_ != null && - elems_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + elems_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getElemsBuilder().mergeFrom(value); } else { elems_ = value; @@ -7115,7 +7115,7 @@ public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ public Builder clearElems() { bitField0_ = (bitField0_ & ~0x00000001); @@ -7128,33 +7128,33 @@ public Builder clearElems() { return this; } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getElemsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getElemsBuilder() { bitField0_ |= 0x00000001; onChanged(); return getElemsFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getElemsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getElemsOrBuilder() { if (elemsBuilder_ != null) { return elemsBuilder_.getMessageOrBuilder(); } else { return elems_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : elems_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : elems_; } } /** - * .collections.PBIntVector elems = 1; + * .collections.PbIntVector elems = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getElemsFieldBuilder() { if (elemsBuilder_ == null) { elemsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getElems(), getParentForChildren(), isClean()); @@ -7323,23 +7323,23 @@ public Builder clearQueueSize() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBBoundedIntQueue) + // @@protoc_insertion_point(builder_scope:solver.PbBoundedIntQueue) } - // @@protoc_insertion_point(class_scope:solver.PBBoundedIntQueue) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbBoundedIntQueue) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBBoundedIntQueue parsePartialFrom( + public PbBoundedIntQueue parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7358,40 +7358,40 @@ public PBBoundedIntQueue parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBBoundedLongQueueOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBBoundedLongQueue) + public interface PbBoundedLongQueueOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbBoundedLongQueue) com.google.protobuf.MessageOrBuilder { /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return Whether the elems field is set. */ boolean hasElems(); /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return The elems. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getElems(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getElems(); /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder getElemsOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder getElemsOrBuilder(); /** * int32 first = 2; @@ -7424,12 +7424,12 @@ public interface PBBoundedLongQueueOrBuilder extends int getQueueSize(); } /** - * Protobuf type {@code solver.PBBoundedLongQueue} + * Protobuf type {@code solver.PbBoundedLongQueue} */ - public static final class PBBoundedLongQueue extends + public static final class PbBoundedLongQueue extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBBoundedLongQueue) - PBBoundedLongQueueOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbBoundedLongQueue) + PbBoundedLongQueueOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -7438,33 +7438,33 @@ public static final class PBBoundedLongQueue extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBBoundedLongQueue.class.getName()); + PbBoundedLongQueue.class.getName()); } - // Use PBBoundedLongQueue.newBuilder() to construct. - private PBBoundedLongQueue(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbBoundedLongQueue.newBuilder() to construct. + private PbBoundedLongQueue(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBBoundedLongQueue() { + private PbBoundedLongQueue() { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedLongQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedLongQueue_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedLongQueue_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedLongQueue_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder.class); } private int bitField0_; public static final int ELEMS_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector elems_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector elems_; /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return Whether the elems field is set. */ @java.lang.Override @@ -7472,19 +7472,19 @@ public boolean hasElems() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return The elems. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getElems() { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance() : elems_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getElems() { + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance() : elems_; } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder getElemsOrBuilder() { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance() : elems_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder getElemsOrBuilder() { + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance() : elems_; } public static final int FIRST_FIELD_NUMBER = 2; @@ -7617,10 +7617,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue) obj; if (hasElems() != other.hasElems()) return false; if (hasElems()) { @@ -7668,44 +7668,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -7713,26 +7713,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -7745,7 +7745,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -7761,26 +7761,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBBoundedLongQueue} + * Protobuf type {@code solver.PbBoundedLongQueue} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBBoundedLongQueue) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueueOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbBoundedLongQueue) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueueOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedLongQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedLongQueue_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedLongQueue_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedLongQueue_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -7816,17 +7816,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBBoundedLongQueue_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbBoundedLongQueue_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -7834,14 +7834,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBound } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -7870,16 +7870,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue.getDefaultInstance()) return this; if (other.hasElems()) { mergeElems(other.getElems()); } @@ -7973,31 +7973,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector elems_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector elems_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder> elemsBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder> elemsBuilder_; /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return Whether the elems field is set. */ public boolean hasElems() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; * @return The elems. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector getElems() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector getElems() { if (elemsBuilder_ == null) { - return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance() : elems_; + return elems_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance() : elems_; } else { return elemsBuilder_.getMessage(); } } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ - public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector value) { + public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector value) { if (elemsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -8011,10 +8011,10 @@ public Builder setElems(com.booleworks.logicng.serialization.ProtoBufCollections return this; } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ public Builder setElems( - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder builderForValue) { if (elemsBuilder_ == null) { elems_ = builderForValue.build(); } else { @@ -8025,13 +8025,13 @@ public Builder setElems( return this; } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ - public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector value) { + public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector value) { if (elemsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && elems_ != null && - elems_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance()) { + elems_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance()) { getElemsBuilder().mergeFrom(value); } else { elems_ = value; @@ -8046,7 +8046,7 @@ public Builder mergeElems(com.booleworks.logicng.serialization.ProtoBufCollectio return this; } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ public Builder clearElems() { bitField0_ = (bitField0_ & ~0x00000001); @@ -8059,33 +8059,33 @@ public Builder clearElems() { return this; } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder getElemsBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder getElemsBuilder() { bitField0_ |= 0x00000001; onChanged(); return getElemsFieldBuilder().getBuilder(); } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder getElemsOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder getElemsOrBuilder() { if (elemsBuilder_ != null) { return elemsBuilder_.getMessageOrBuilder(); } else { return elems_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.getDefaultInstance() : elems_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.getDefaultInstance() : elems_; } } /** - * .collections.PBLongVector elems = 1; + * .collections.PbLongVector elems = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder> getElemsFieldBuilder() { if (elemsBuilder_ == null) { elemsBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVectorOrBuilder>( getElems(), getParentForChildren(), isClean()); @@ -8254,23 +8254,23 @@ public Builder clearQueueSize() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBBoundedLongQueue) + // @@protoc_insertion_point(builder_scope:solver.PbBoundedLongQueue) } - // @@protoc_insertion_point(class_scope:solver.PBBoundedLongQueue) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbBoundedLongQueue) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBBoundedLongQueue parsePartialFrom( + public PbBoundedLongQueue parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8289,40 +8289,40 @@ public PBBoundedLongQueue parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PBProofInformationOrBuilder extends - // @@protoc_insertion_point(interface_extends:solver.PBProofInformation) + public interface PbProofInformationOrBuilder extends + // @@protoc_insertion_point(interface_extends:solver.PbProofInformation) com.google.protobuf.MessageOrBuilder { /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return Whether the clause field is set. */ boolean hasClause(); /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return The clause. */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getClause(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getClause(); /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getClauseOrBuilder(); + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getClauseOrBuilder(); /** * optional bytes proposition = 2; @@ -8336,12 +8336,12 @@ public interface PBProofInformationOrBuilder extends com.google.protobuf.ByteString getProposition(); } /** - * Protobuf type {@code solver.PBProofInformation} + * Protobuf type {@code solver.PbProofInformation} */ - public static final class PBProofInformation extends + public static final class PbProofInformation extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:solver.PBProofInformation) - PBProofInformationOrBuilder { + // @@protoc_insertion_point(message_implements:solver.PbProofInformation) + PbProofInformationOrBuilder { private static final long serialVersionUID = 0L; static { com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( @@ -8350,34 +8350,34 @@ public static final class PBProofInformation extends /* minor= */ 28, /* patch= */ 1, /* suffix= */ "", - PBProofInformation.class.getName()); + PbProofInformation.class.getName()); } - // Use PBProofInformation.newBuilder() to construct. - private PBProofInformation(com.google.protobuf.GeneratedMessage.Builder builder) { + // Use PbProofInformation.newBuilder() to construct. + private PbProofInformation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private PBProofInformation() { + private PbProofInformation() { proposition_ = com.google.protobuf.ByteString.EMPTY; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBProofInformation_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbProofInformation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBProofInformation_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbProofInformation_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder.class); } private int bitField0_; public static final int CLAUSE_FIELD_NUMBER = 1; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector clause_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector clause_; /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return Whether the clause field is set. */ @java.lang.Override @@ -8385,19 +8385,19 @@ public boolean hasClause() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return The clause. */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getClause() { - return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : clause_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getClause() { + return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : clause_; } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getClauseOrBuilder() { - return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : clause_; + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getClauseOrBuilder() { + return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : clause_; } public static final int PROPOSITION_FIELD_NUMBER = 2; @@ -8466,10 +8466,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation)) { + if (!(obj instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation)) { return super.equals(obj); } - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation) obj; + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation other = (com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation) obj; if (hasClause() != other.hasClause()) return false; if (hasClause()) { @@ -8505,44 +8505,44 @@ public int hashCode() { return hash; } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom(byte[] data) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -8550,26 +8550,26 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseDelimitedFrom(java.io.InputStream input) + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseDelimitedFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation parseFrom( + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -8582,7 +8582,7 @@ public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures. public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation prototype) { + public static Builder newBuilder(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -8598,26 +8598,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code solver.PBProofInformation} + * Protobuf type {@code solver.PbProofInformation} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:solver.PBProofInformation) - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformationOrBuilder { + // @@protoc_insertion_point(builder_implements:solver.PbProofInformation) + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBProofInformation_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbProofInformation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBProofInformation_fieldAccessorTable + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbProofInformation_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.Builder.class); + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.class, com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.Builder.class); } - // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.newBuilder() + // Construct using com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -8649,17 +8649,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PBProofInformation_descriptor; + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.internal_static_solver_PbProofInformation_descriptor; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getDefaultInstanceForType() { - return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.getDefaultInstance(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getDefaultInstanceForType() { + return com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.getDefaultInstance(); } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation build() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation result = buildPartial(); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation build() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -8667,14 +8667,14 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation buildPartial() { - com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation(this); + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation buildPartial() { + com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation result = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation result) { + private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -8692,16 +8692,16 @@ private void buildPartial0(com.booleworks.logicng.serialization.ProtoBufSolverDa @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation) { - return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation)other); + if (other instanceof com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation) { + return mergeFrom((com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation other) { - if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation.getDefaultInstance()) return this; + public Builder mergeFrom(com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation other) { + if (other == com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation.getDefaultInstance()) return this; if (other.hasClause()) { mergeClause(other.getClause()); } @@ -8763,31 +8763,31 @@ public Builder mergeFrom( } private int bitField0_; - private com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector clause_; + private com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector clause_; private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> clauseBuilder_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> clauseBuilder_; /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return Whether the clause field is set. */ public boolean hasClause() { return ((bitField0_ & 0x00000001) != 0); } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; * @return The clause. */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector getClause() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector getClause() { if (clauseBuilder_ == null) { - return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : clause_; + return clause_ == null ? com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : clause_; } else { return clauseBuilder_.getMessage(); } } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ - public Builder setClause(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder setClause(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (clauseBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -8801,10 +8801,10 @@ public Builder setClause(com.booleworks.logicng.serialization.ProtoBufCollection return this; } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ public Builder setClause( - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder builderForValue) { + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder builderForValue) { if (clauseBuilder_ == null) { clause_ = builderForValue.build(); } else { @@ -8815,13 +8815,13 @@ public Builder setClause( return this; } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ - public Builder mergeClause(com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector value) { + public Builder mergeClause(com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector value) { if (clauseBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && clause_ != null && - clause_ != com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance()) { + clause_ != com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance()) { getClauseBuilder().mergeFrom(value); } else { clause_ = value; @@ -8836,7 +8836,7 @@ public Builder mergeClause(com.booleworks.logicng.serialization.ProtoBufCollecti return this; } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ public Builder clearClause() { bitField0_ = (bitField0_ & ~0x00000001); @@ -8849,33 +8849,33 @@ public Builder clearClause() { return this; } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder getClauseBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder getClauseBuilder() { bitField0_ |= 0x00000001; onChanged(); return getClauseFieldBuilder().getBuilder(); } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ - public com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder getClauseOrBuilder() { + public com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder getClauseOrBuilder() { if (clauseBuilder_ != null) { return clauseBuilder_.getMessageOrBuilder(); } else { return clause_ == null ? - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.getDefaultInstance() : clause_; + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.getDefaultInstance() : clause_; } } /** - * .collections.PBIntVector clause = 1; + * .collections.PbIntVector clause = 1; */ private com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder> + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder> getClauseFieldBuilder() { if (clauseBuilder_ == null) { clauseBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorOrBuilder>( + com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector.Builder, com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorOrBuilder>( getClause(), getParentForChildren(), isClean()); @@ -8924,23 +8924,23 @@ public Builder clearProposition() { return this; } - // @@protoc_insertion_point(builder_scope:solver.PBProofInformation) + // @@protoc_insertion_point(builder_scope:solver.PbProofInformation) } - // @@protoc_insertion_point(class_scope:solver.PBProofInformation) - private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:solver.PbProofInformation) + private static final com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation(); + DEFAULT_INSTANCE = new com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation(); } - public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getDefaultInstance() { + public static com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PBProofInformation parsePartialFrom( + public PbProofInformation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8959,77 +8959,77 @@ public PBProofInformation parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProofInformation getDefaultInstanceForType() { + public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbProofInformation getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBClause_descriptor; + internal_static_solver_PbClause_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBClause_fieldAccessorTable; + internal_static_solver_PbClause_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBClauseVector_descriptor; + internal_static_solver_PbClauseVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBClauseVector_fieldAccessorTable; + internal_static_solver_PbClauseVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBWatcher_descriptor; + internal_static_solver_PbWatcher_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBWatcher_fieldAccessorTable; + internal_static_solver_PbWatcher_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBWatcherVector_descriptor; + internal_static_solver_PbWatcherVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBWatcherVector_fieldAccessorTable; + internal_static_solver_PbWatcherVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBWatcherVectorVector_descriptor; + internal_static_solver_PbWatcherVectorVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBWatcherVectorVector_fieldAccessorTable; + internal_static_solver_PbWatcherVectorVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBVariable_descriptor; + internal_static_solver_PbVariable_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBVariable_fieldAccessorTable; + internal_static_solver_PbVariable_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBVariableVector_descriptor; + internal_static_solver_PbVariableVector_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBVariableVector_fieldAccessorTable; + internal_static_solver_PbVariableVector_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBHeap_descriptor; + internal_static_solver_PbHeap_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBHeap_fieldAccessorTable; + internal_static_solver_PbHeap_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBBoundedIntQueue_descriptor; + internal_static_solver_PbBoundedIntQueue_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBBoundedIntQueue_fieldAccessorTable; + internal_static_solver_PbBoundedIntQueue_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBBoundedLongQueue_descriptor; + internal_static_solver_PbBoundedLongQueue_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBBoundedLongQueue_fieldAccessorTable; + internal_static_solver_PbBoundedLongQueue_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_solver_PBProofInformation_descriptor; + internal_static_solver_PbProofInformation_descriptor; private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_solver_PBProofInformation_fieldAccessorTable; + internal_static_solver_PbProofInformation_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -9040,35 +9040,35 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof static { java.lang.String[] descriptorData = { "\n\033solver_datastructures.proto\022\006solver\032\021c" + - "ollections.proto\"\322\001\n\010PBClause\022&\n\004data\030\001 " + - "\001(\0132\030.collections.PBIntVector\022\025\n\rlearntO" + + "ollections.proto\"\322\001\n\010PbClause\022&\n\004data\030\001 " + + "\001(\0132\030.collections.PbIntVector\022\025\n\rlearntO" + "nState\030\002 \001(\005\022\020\n\010isAtMost\030\003 \001(\010\022\020\n\010activi" + "ty\030\004 \001(\001\022\014\n\004seen\030\006 \001(\010\022\013\n\003lbd\030\007 \001(\003\022\020\n\010c" + "anBeDel\030\010 \001(\010\022\022\n\noneWatched\030\t \001(\010\022\026\n\016atM" + - "ostWatchers\030\n \001(\005\022\n\n\002id\030\013 \001(\005\"3\n\016PBClaus" + - "eVector\022!\n\007element\030\001 \003(\0132\020.solver.PBClau" + - "se\",\n\tPBWatcher\022\016\n\006clause\030\001 \001(\005\022\017\n\007block" + - "er\030\002 \001(\005\"5\n\017PBWatcherVector\022\"\n\007element\030\001" + - " \003(\0132\021.solver.PBWatcher\"A\n\025PBWatcherVect" + - "orVector\022(\n\007element\030\001 \003(\0132\027.solver.PBWat" + - "cherVector\"\211\001\n\nPBVariable\022&\n\nassignment\030" + - "\001 \001(\0162\022.solver.PBTristate\022\r\n\005level\030\002 \001(\005" + + "ostWatchers\030\n \001(\005\022\n\n\002id\030\013 \001(\005\"3\n\016PbClaus" + + "eVector\022!\n\007element\030\001 \003(\0132\020.solver.PbClau" + + "se\",\n\tPbWatcher\022\016\n\006clause\030\001 \001(\005\022\017\n\007block" + + "er\030\002 \001(\005\"5\n\017PbWatcherVector\022\"\n\007element\030\001" + + " \003(\0132\021.solver.PbWatcher\"A\n\025PbWatcherVect" + + "orVector\022(\n\007element\030\001 \003(\0132\027.solver.PbWat" + + "cherVector\"\211\001\n\nPbVariable\022&\n\nassignment\030" + + "\001 \001(\0162\022.solver.PbTristate\022\r\n\005level\030\002 \001(\005" + "\022\016\n\006reason\030\003 \001(\005\022\020\n\010activity\030\004 \001(\001\022\020\n\010po" + - "larity\030\005 \001(\010\022\020\n\010decision\030\006 \001(\010\"7\n\020PBVari" + - "ableVector\022#\n\007element\030\001 \003(\0132\022.solver.PBV" + - "ariable\"[\n\006PBHeap\022&\n\004heap\030\001 \001(\0132\030.collec" + - "tions.PBIntVector\022)\n\007indices\030\002 \001(\0132\030.col" + - "lections.PBIntVector\"\221\001\n\021PBBoundedIntQue" + - "ue\022\'\n\005elems\030\001 \001(\0132\030.collections.PBIntVec" + + "larity\030\005 \001(\010\022\020\n\010decision\030\006 \001(\010\"7\n\020PbVari" + + "ableVector\022#\n\007element\030\001 \003(\0132\022.solver.PbV" + + "ariable\"[\n\006PbHeap\022&\n\004heap\030\001 \001(\0132\030.collec" + + "tions.PbIntVector\022)\n\007indices\030\002 \001(\0132\030.col" + + "lections.PbIntVector\"\221\001\n\021PbBoundedIntQue" + + "ue\022\'\n\005elems\030\001 \001(\0132\030.collections.PbIntVec" + "tor\022\r\n\005first\030\002 \001(\005\022\014\n\004last\030\003 \001(\005\022\022\n\nsumO" + "fQueue\030\004 \001(\003\022\017\n\007maxSize\030\005 \001(\005\022\021\n\tqueueSi" + - "ze\030\006 \001(\005\"\223\001\n\022PBBoundedLongQueue\022(\n\005elems" + - "\030\001 \001(\0132\031.collections.PBLongVector\022\r\n\005fir" + + "ze\030\006 \001(\005\"\223\001\n\022PbBoundedLongQueue\022(\n\005elems" + + "\030\001 \001(\0132\031.collections.PbLongVector\022\r\n\005fir" + "st\030\002 \001(\005\022\014\n\004last\030\003 \001(\005\022\022\n\nsumOfQueue\030\004 \001" + "(\003\022\017\n\007maxSize\030\005 \001(\005\022\021\n\tqueueSize\030\006 \001(\005\"h" + - "\n\022PBProofInformation\022(\n\006clause\030\001 \001(\0132\030.c" + - "ollections.PBIntVector\022\030\n\013proposition\030\002 " + - "\001(\014H\000\210\001\001B\016\n\014_proposition*,\n\nPBTristate\022\t" + + "\n\022PbProofInformation\022(\n\006clause\030\001 \001(\0132\030.c" + + "ollections.PbIntVector\022\030\n\013proposition\030\002 " + + "\001(\014H\000\210\001\001B\016\n\014_proposition*,\n\nPbTristate\022\t" + "\n\005FALSE\020\000\022\010\n\004TRUE\020\001\022\t\n\005UNDEF\020\002BD\n$com.bo" + "oleworks.logicng.serializationB\034ProtoBuf" + "SolverDatastructuresb\006proto3" @@ -9078,71 +9078,71 @@ public com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBProof new com.google.protobuf.Descriptors.FileDescriptor[] { com.booleworks.logicng.serialization.ProtoBufCollections.getDescriptor(), }); - internal_static_solver_PBClause_descriptor = + internal_static_solver_PbClause_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_solver_PBClause_fieldAccessorTable = new + internal_static_solver_PbClause_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBClause_descriptor, + internal_static_solver_PbClause_descriptor, new java.lang.String[] { "Data", "LearntOnState", "IsAtMost", "Activity", "Seen", "Lbd", "CanBeDel", "OneWatched", "AtMostWatchers", "Id", }); - internal_static_solver_PBClauseVector_descriptor = + internal_static_solver_PbClauseVector_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_solver_PBClauseVector_fieldAccessorTable = new + internal_static_solver_PbClauseVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBClauseVector_descriptor, + internal_static_solver_PbClauseVector_descriptor, new java.lang.String[] { "Element", }); - internal_static_solver_PBWatcher_descriptor = + internal_static_solver_PbWatcher_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_solver_PBWatcher_fieldAccessorTable = new + internal_static_solver_PbWatcher_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBWatcher_descriptor, + internal_static_solver_PbWatcher_descriptor, new java.lang.String[] { "Clause", "Blocker", }); - internal_static_solver_PBWatcherVector_descriptor = + internal_static_solver_PbWatcherVector_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_solver_PBWatcherVector_fieldAccessorTable = new + internal_static_solver_PbWatcherVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBWatcherVector_descriptor, + internal_static_solver_PbWatcherVector_descriptor, new java.lang.String[] { "Element", }); - internal_static_solver_PBWatcherVectorVector_descriptor = + internal_static_solver_PbWatcherVectorVector_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_solver_PBWatcherVectorVector_fieldAccessorTable = new + internal_static_solver_PbWatcherVectorVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBWatcherVectorVector_descriptor, + internal_static_solver_PbWatcherVectorVector_descriptor, new java.lang.String[] { "Element", }); - internal_static_solver_PBVariable_descriptor = + internal_static_solver_PbVariable_descriptor = getDescriptor().getMessageTypes().get(5); - internal_static_solver_PBVariable_fieldAccessorTable = new + internal_static_solver_PbVariable_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBVariable_descriptor, + internal_static_solver_PbVariable_descriptor, new java.lang.String[] { "Assignment", "Level", "Reason", "Activity", "Polarity", "Decision", }); - internal_static_solver_PBVariableVector_descriptor = + internal_static_solver_PbVariableVector_descriptor = getDescriptor().getMessageTypes().get(6); - internal_static_solver_PBVariableVector_fieldAccessorTable = new + internal_static_solver_PbVariableVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBVariableVector_descriptor, + internal_static_solver_PbVariableVector_descriptor, new java.lang.String[] { "Element", }); - internal_static_solver_PBHeap_descriptor = + internal_static_solver_PbHeap_descriptor = getDescriptor().getMessageTypes().get(7); - internal_static_solver_PBHeap_fieldAccessorTable = new + internal_static_solver_PbHeap_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBHeap_descriptor, + internal_static_solver_PbHeap_descriptor, new java.lang.String[] { "Heap", "Indices", }); - internal_static_solver_PBBoundedIntQueue_descriptor = + internal_static_solver_PbBoundedIntQueue_descriptor = getDescriptor().getMessageTypes().get(8); - internal_static_solver_PBBoundedIntQueue_fieldAccessorTable = new + internal_static_solver_PbBoundedIntQueue_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBBoundedIntQueue_descriptor, + internal_static_solver_PbBoundedIntQueue_descriptor, new java.lang.String[] { "Elems", "First", "Last", "SumOfQueue", "MaxSize", "QueueSize", }); - internal_static_solver_PBBoundedLongQueue_descriptor = + internal_static_solver_PbBoundedLongQueue_descriptor = getDescriptor().getMessageTypes().get(9); - internal_static_solver_PBBoundedLongQueue_fieldAccessorTable = new + internal_static_solver_PbBoundedLongQueue_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBBoundedLongQueue_descriptor, + internal_static_solver_PbBoundedLongQueue_descriptor, new java.lang.String[] { "Elems", "First", "Last", "SumOfQueue", "MaxSize", "QueueSize", }); - internal_static_solver_PBProofInformation_descriptor = + internal_static_solver_PbProofInformation_descriptor = getDescriptor().getMessageTypes().get(10); - internal_static_solver_PBProofInformation_fieldAccessorTable = new + internal_static_solver_PbProofInformation_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_solver_PBProofInformation_descriptor, + internal_static_solver_PbProofInformation_descriptor, new java.lang.String[] { "Clause", "Proposition", }); descriptor.resolveAllFeaturesImmutable(); com.booleworks.logicng.serialization.ProtoBufCollections.getDescriptor(); diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/Collections.java b/serialization/src/main/java/com/booleworks/logicng/serialization/Collections.java index dfda668c..5b131180 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/Collections.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/Collections.java @@ -3,14 +3,14 @@ package com.booleworks.logicng.serialization; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGLongVector; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVectorVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngLongVector; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVectorVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector; /** * Serialization methods for LogicNG collections. @@ -24,8 +24,8 @@ public interface Collections { * @param vec the Boolean vector * @return the protocol buffer */ - static PBBooleanVector serializeBoolVec(final LNGBooleanVector vec) { - final PBBooleanVector.Builder builder = PBBooleanVector.newBuilder().setSize(vec.size()); + static PbBooleanVector serializeBoolVec(final LngBooleanVector vec) { + final PbBooleanVector.Builder builder = PbBooleanVector.newBuilder().setSize(vec.size()); for (int i = 0; i < vec.size(); i++) { builder.addElement(vec.get(i)); } @@ -37,12 +37,12 @@ static PBBooleanVector serializeBoolVec(final LNGBooleanVector vec) { * @param bin the protocol buffer * @return the Boolean vector */ - static LNGBooleanVector deserializeBooVec(final PBBooleanVector bin) { + static LngBooleanVector deserializeBooVec(final PbBooleanVector bin) { final boolean[] elements = new boolean[bin.getElementCount()]; for (int i = 0; i < elements.length; i++) { elements[i] = bin.getElement(i); } - return new LNGBooleanVector(elements, bin.getSize()); + return new LngBooleanVector(elements, bin.getSize()); } /** @@ -50,8 +50,8 @@ static LNGBooleanVector deserializeBooVec(final PBBooleanVector bin) { * @param vec the integer vector * @return the protocol buffer */ - static PBIntVector serializeIntVec(final LNGIntVector vec) { - final PBIntVector.Builder builder = PBIntVector.newBuilder().setSize(vec.size()); + static PbIntVector serializeIntVec(final LngIntVector vec) { + final PbIntVector.Builder builder = PbIntVector.newBuilder().setSize(vec.size()); for (int i = 0; i < vec.size(); i++) { builder.addElement(vec.get(i)); } @@ -63,12 +63,12 @@ static PBIntVector serializeIntVec(final LNGIntVector vec) { * @param bin the protocol buffer * @return the integer vector */ - static LNGIntVector deserializeIntVec(final PBIntVector bin) { + static LngIntVector deserializeIntVec(final PbIntVector bin) { final int[] elements = new int[bin.getElementCount()]; for (int i = 0; i < elements.length; i++) { elements[i] = bin.getElement(i); } - return new LNGIntVector(elements, bin.getSize()); + return new LngIntVector(elements, bin.getSize()); } /** @@ -76,8 +76,8 @@ static LNGIntVector deserializeIntVec(final PBIntVector bin) { * @param vec the vector of integer vectors * @return the protocol buffer */ - static PBIntVectorVector serializeVec(final LNGVector vec) { - final PBIntVectorVector.Builder builder = PBIntVectorVector.newBuilder().setSize(vec.size()); + static PbIntVectorVector serializeVec(final LngVector vec) { + final PbIntVectorVector.Builder builder = PbIntVectorVector.newBuilder().setSize(vec.size()); for (int i = 0; i < vec.size(); i++) { builder.addElement(serializeIntVec(vec.get(i))); } @@ -89,9 +89,9 @@ static PBIntVectorVector serializeVec(final LNGVector vec) { * @param bin the protocol buffer * @return the vector of integer vectors */ - static LNGVector deserializeVec(final PBIntVectorVector bin) { - final LNGVector vec = new LNGVector<>(bin.getSize()); - for (final PBIntVector i : bin.getElementList()) { + static LngVector deserializeVec(final PbIntVectorVector bin) { + final LngVector vec = new LngVector<>(bin.getSize()); + for (final PbIntVector i : bin.getElementList()) { vec.push(deserializeIntVec(i)); } return vec; @@ -102,8 +102,8 @@ static LNGVector deserializeVec(final PBIntVectorVector bin) { * @param vec the long vector * @return the protocol buffer */ - static PBLongVector serializeLongVec(final LNGLongVector vec) { - final PBLongVector.Builder builder = PBLongVector.newBuilder().setSize(vec.size()); + static PbLongVector serializeLongVec(final LngLongVector vec) { + final PbLongVector.Builder builder = PbLongVector.newBuilder().setSize(vec.size()); for (int i = 0; i < vec.size(); i++) { builder.addElement(vec.get(i)); } @@ -115,11 +115,11 @@ static PBLongVector serializeLongVec(final LNGLongVector vec) { * @param bin the protocol buffer * @return the long vector */ - static LNGLongVector deserializeLongVec(final PBLongVector bin) { + static LngLongVector deserializeLongVec(final PbLongVector bin) { final long[] elements = new long[bin.getElementCount()]; for (int i = 0; i < elements.length; i++) { elements[i] = bin.getElement(i); } - return new LNGLongVector(elements, bin.getSize()); + return new LngLongVector(elements, bin.getSize()); } } diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/Dnnfs.java b/serialization/src/main/java/com/booleworks/logicng/serialization/Dnnfs.java index 7119df38..4b2ea6e3 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/Dnnfs.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/Dnnfs.java @@ -6,7 +6,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.formulas.Variable; import com.booleworks.logicng.knowledgecompilation.dnnf.datastructures.Dnnf; -import com.booleworks.logicng.serialization.ProtoBufDnnf.PBDnnf; +import com.booleworks.logicng.serialization.ProtoBufDnnf.PbDnnf; import java.util.SortedSet; import java.util.TreeSet; @@ -24,8 +24,8 @@ public interface Dnnfs { * @param dnnf the DNNF * @return the protocol buffer */ - static PBDnnf serializeDnnf(final Dnnf dnnf) { - final PBDnnf.Builder builder = PBDnnf.newBuilder(); + static PbDnnf serializeDnnf(final Dnnf dnnf) { + final PbDnnf.Builder builder = PbDnnf.newBuilder(); builder.setFormula(Formulas.serializeFormula(dnnf.getFormula())); builder.addAllOriginalVariables(dnnf.getOriginalVariables().stream().map(Variable::getName).collect(Collectors.toList())); return builder.build(); @@ -37,7 +37,7 @@ static PBDnnf serializeDnnf(final Dnnf dnnf) { * @param bin the protocol buffer * @return the DNNF */ - static Dnnf deserializeDnnf(final FormulaFactory f, final PBDnnf bin) { + static Dnnf deserializeDnnf(final FormulaFactory f, final PbDnnf bin) { final SortedSet vars = bin.getOriginalVariablesList().stream() .map(f::variable) .collect(Collectors.toCollection(TreeSet::new)); diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/Formulas.java b/serialization/src/main/java/com/booleworks/logicng/serialization/Formulas.java index cb44b137..5cdf9f3d 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/Formulas.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/Formulas.java @@ -19,14 +19,14 @@ import com.booleworks.logicng.formulas.Literal; import com.booleworks.logicng.formulas.Not; import com.booleworks.logicng.formulas.Or; -import com.booleworks.logicng.formulas.PBConstraint; +import com.booleworks.logicng.formulas.PbConstraint; import com.booleworks.logicng.functions.SubNodeFunction; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBComparison; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaMapping; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulaType; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalFormula; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBInternalPseudoBooleanConstraint; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbComparison; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaMapping; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulaType; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalFormula; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbInternalPseudoBooleanConstraint; import com.booleworks.logicng.util.Pair; import java.io.IOException; @@ -126,7 +126,7 @@ static void serializeFormulaToStream(final Formula formula, final OutputStream s * @throws IOException if there is a problem reading from the stream */ static Formula deserializeFormulaFromStream(final FormulaFactory f, final InputStream stream) throws IOException { - return deserializeFormula(f, PBFormulas.newBuilder().mergeFrom(stream).build()); + return deserializeFormula(f, PbFormulas.newBuilder().mergeFrom(stream).build()); } /** @@ -147,7 +147,7 @@ static void serializeFormulaListToStream(final Collection formulas, fin * @throws IOException if there is a problem reading from the stream */ static List deserializeFormulaListFromStream(final FormulaFactory f, final InputStream stream) throws IOException { - return deserializeFormulaList(f, PBFormulas.newBuilder().mergeFrom(stream).build()); + return deserializeFormulaList(f, PbFormulas.newBuilder().mergeFrom(stream).build()); } /** @@ -155,7 +155,7 @@ static List deserializeFormulaListFromStream(final FormulaFactory f, fi * @param formula the formula * @return the protocol buffer */ - static PBFormulas serializeFormula(final Formula formula) { + static PbFormulas serializeFormula(final Formula formula) { return serializeFormulas(Collections.singletonList(formula)); } @@ -164,17 +164,17 @@ static PBFormulas serializeFormula(final Formula formula) { * @param formulas the formulas * @return the protocol buffer */ - static PBFormulas serializeFormulas(final Collection formulas) { - final Pair, Map> maps; + static PbFormulas serializeFormulas(final Collection formulas) { + final Pair, Map> maps; if (formulas.isEmpty()) { maps = new Pair<>(Map.of(), Map.of()); } else { maps = computeMappings(formulas.iterator().next().getFactory(), formulas); } final List ids = formulas.stream().map(maps.getFirst()::get).collect(Collectors.toList()); - return PBFormulas.newBuilder() + return PbFormulas.newBuilder() .addAllId(ids) - .setMapping(PBFormulaMapping.newBuilder().putAllMapping(maps.getSecond()).build()) + .setMapping(PbFormulaMapping.newBuilder().putAllMapping(maps.getSecond()).build()) .build(); } @@ -184,12 +184,12 @@ static PBFormulas serializeFormulas(final Collection formulas) { * @return a mapping from formula to ID and a mapping from ID to serialized formula (protocol buffer) * for each sub-node of the formulas. */ - static Pair, Map> computeMappings( + static Pair, Map> computeMappings( final FormulaFactory f, final Collection formulas ) { final Map formula2id = new LinkedHashMap<>(); - final Map id2formula = new LinkedHashMap<>(); + final Map id2formula = new LinkedHashMap<>(); int id = 0; final SubNodeFunction subNodeFunction = new SubNodeFunction(f); for (final Formula formula : formulas) { @@ -210,60 +210,60 @@ static Pair, Map> computeMappi * @param formula2id a mapping from formula to ID (must contain all sub-nodes of the formula) * @return the protocol buffer. */ - static PBInternalFormula serialize(final Formula formula, final Map formula2id) { - final PBInternalFormula.Builder builder = PBInternalFormula.newBuilder(); + static PbInternalFormula serialize(final Formula formula, final Map formula2id) { + final PbInternalFormula.Builder builder = PbInternalFormula.newBuilder(); switch (formula.getType()) { case FALSE: case TRUE: - builder.setType(PBFormulaType.CONST); + builder.setType(PbFormulaType.CONST); builder.setValue(formula.getType() == FType.TRUE); break; case LITERAL: - builder.setType(PBFormulaType.LITERAL); + builder.setType(PbFormulaType.LITERAL); final Literal lit = (Literal) formula; builder.setValue(lit.getPhase()); builder.setVariable(lit.getName()); break; case NOT: - builder.setType(PBFormulaType.NOT); + builder.setType(PbFormulaType.NOT); final Not not = (Not) formula; builder.addOperand(formula2id.get(not.getOperand())); break; case EQUIV: - builder.setType(PBFormulaType.EQUIV); + builder.setType(PbFormulaType.EQUIV); final Equivalence eq = (Equivalence) formula; builder.addOperand(formula2id.get(eq.getLeft())); builder.addOperand(formula2id.get(eq.getRight())); break; case IMPL: - builder.setType(PBFormulaType.IMPL); + builder.setType(PbFormulaType.IMPL); final Implication impl = (Implication) formula; builder.addOperand(formula2id.get(impl.getLeft())); builder.addOperand(formula2id.get(impl.getRight())); break; case OR: - builder.setType(PBFormulaType.OR); + builder.setType(PbFormulaType.OR); final Or or = (Or) formula; for (final Formula op : or) { builder.addOperand(formula2id.get(op)); } break; case AND: - builder.setType(PBFormulaType.AND); + builder.setType(PbFormulaType.AND); final And and = (And) formula; for (final Formula op : and) { builder.addOperand(formula2id.get(op)); } break; case PBC: - builder.setType(PBFormulaType.PBC); - final PBConstraint pbc = (PBConstraint) formula; - final PBInternalPseudoBooleanConstraint.Builder pbBuilder = PBInternalPseudoBooleanConstraint.newBuilder(); - pbBuilder.setRhs(pbc.getRhs()); - pbBuilder.setComparator(serializeCType(pbc.comparator())); - pbc.getCoefficients().forEach(pbBuilder::addCoefficient); - pbc.getOperands().forEach(it -> pbBuilder.addLiteral(it.toString())); - builder.setPbConstraint(pbBuilder.build()); + builder.setType(PbFormulaType.PBC); + final PbConstraint Pbc = (PbConstraint) formula; + final PbInternalPseudoBooleanConstraint.Builder PbBuilder = PbInternalPseudoBooleanConstraint.newBuilder(); + PbBuilder.setRhs(Pbc.getRhs()); + PbBuilder.setComparator(serializeCType(Pbc.comparator())); + Pbc.getCoefficients().forEach(PbBuilder::addCoefficient); + Pbc.getOperands().forEach(it -> PbBuilder.addLiteral(it.toString())); + builder.setPbConstraint(PbBuilder.build()); break; } return builder.build(); @@ -275,7 +275,7 @@ static PBInternalFormula serialize(final Formula formula, final Map deserializeFormulaList(final FormulaFactory f, final PBFormulas bin) { + static List deserializeFormulaList(final FormulaFactory f, final PbFormulas bin) { final Map id2formula = deserializeFormula(f, bin.getMapping()); return bin.getIdList().stream().map(id2formula::get).collect(Collectors.toList()); } @@ -296,7 +296,7 @@ static List deserializeFormulaList(final FormulaFactory f, final PBForm * @param bin the protocol buffer * @return the mapping from ID to formula */ - static Map deserializeFormula(final FormulaFactory f, final PBFormulaMapping bin) { + static Map deserializeFormula(final FormulaFactory f, final PbFormulaMapping bin) { final Map id2formula = new TreeMap<>(); bin.getMappingMap().forEach((k, v) -> { id2formula.put(k, deserialize(f, v, id2formula)); @@ -311,7 +311,7 @@ static Map deserializeFormula(final FormulaFactory f, final PB * @param id2formula a mapping from ID to formula (must contain all sub-nodes of the formula) * @return the formula */ - static Formula deserialize(final FormulaFactory f, final PBInternalFormula bin, final Map id2formula) { + static Formula deserialize(final FormulaFactory f, final PbInternalFormula bin, final Map id2formula) { switch (bin.getType()) { case CONST: return f.constant(bin.getValue()); @@ -321,11 +321,11 @@ static Formula deserialize(final FormulaFactory f, final PBInternalFormula bin, return f.not(id2formula.get(bin.getOperand(0))); case IMPL: case EQUIV: - final FType binType = bin.getType() == PBFormulaType.IMPL ? FType.IMPL : FType.EQUIV; + final FType binType = bin.getType() == PbFormulaType.IMPL ? FType.IMPL : FType.EQUIV; return f.binaryOperator(binType, id2formula.get(bin.getOperand(0)), id2formula.get(bin.getOperand(1))); case AND: case OR: - final FType naryType = bin.getType() == PBFormulaType.AND ? FType.AND : FType.OR; + final FType naryType = bin.getType() == PbFormulaType.AND ? FType.AND : FType.OR; return f.naryOperator(naryType, bin.getOperandList().stream().map(id2formula::get).collect(Collectors.toList())); case PBC: final int rhs = (int) bin.getPbConstraint().getRhs(); @@ -350,18 +350,18 @@ static Formula deserialize(final FormulaFactory f, final PBInternalFormula bin, * @param comparison the comparator * @return the protocol buffer */ - static PBComparison serializeCType(final CType comparison) { + static PbComparison serializeCType(final CType comparison) { switch (comparison) { case EQ: - return PBComparison.EQ; + return PbComparison.EQ; case GT: - return PBComparison.GT; + return PbComparison.GT; case GE: - return PBComparison.GE; + return PbComparison.GE; case LT: - return PBComparison.LT; + return PbComparison.LT; case LE: - return PBComparison.LE; + return PbComparison.LE; default: throw new IllegalArgumentException("Unknown comparison type" + comparison); } @@ -372,7 +372,7 @@ static PBComparison serializeCType(final CType comparison) { * @param bin the protocol buffer * @return the comparator */ - static CType deserializeCType(final PBComparison bin) { + static CType deserializeCType(final PbComparison bin) { switch (bin) { case EQ: return EQ; diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/Propositions.java b/serialization/src/main/java/com/booleworks/logicng/serialization/Propositions.java index 751fa02a..a9fcd8ee 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/Propositions.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/Propositions.java @@ -5,7 +5,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.serialization.ProtoBufPropositions.PBStandardProposition; +import com.booleworks.logicng.serialization.ProtoBufPropositions.PbStandardProposition; /** * Serialization methods for LogicNG propositions. @@ -22,8 +22,8 @@ public interface Propositions { * @param prop the proposition * @return the protocol buffer */ - static PBStandardProposition serializePropositions(final StandardProposition prop) { - final PBStandardProposition.Builder builder = PBStandardProposition.newBuilder(); + static PbStandardProposition serializePropositions(final StandardProposition prop) { + final PbStandardProposition.Builder builder = PbStandardProposition.newBuilder(); builder.setFormula(Formulas.serializeFormula(prop.getFormula())); return builder.setDescription(prop.getDescription()).build(); } @@ -34,7 +34,7 @@ static PBStandardProposition serializePropositions(final StandardProposition pro * @param bin the protocol buffer * @return the proposition */ - static StandardProposition deserializePropositions(final FormulaFactory f, final PBStandardProposition bin) { + static StandardProposition deserializePropositions(final FormulaFactory f, final PbStandardProposition bin) { return new StandardProposition(bin.getDescription(), Formulas.deserializeFormula(f, bin.getFormula())); } } diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/SatSolverConfigs.java b/serialization/src/main/java/com/booleworks/logicng/serialization/SatSolverConfigs.java index 9200a946..c09c58a9 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/SatSolverConfigs.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/SatSolverConfigs.java @@ -3,13 +3,13 @@ package com.booleworks.logicng.serialization; -import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBClauseMinimization; -import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBCnfMethod; -import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PBSatSolverConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; -import com.booleworks.logicng.solvers.sat.SATSolverConfig.CNFMethod; -import com.booleworks.logicng.solvers.sat.SATSolverConfig.ClauseMinimization; -import com.booleworks.logicng.solvers.sat.SATSolverLowLevelConfig; +import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbClauseMinimization; +import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbCnfMethod; +import com.booleworks.logicng.serialization.ProtoBufSolverCommons.PbSatSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; +import com.booleworks.logicng.solvers.sat.SatSolverConfig.ClauseMinimization; +import com.booleworks.logicng.solvers.sat.SatSolverConfig.CnfMethod; +import com.booleworks.logicng.solvers.sat.SatSolverLowLevelConfig; /** * Serialization methods for SAT solver configurations. @@ -23,8 +23,8 @@ public interface SatSolverConfigs { * @param config the configuration * @return the protocol buffer */ - static PBSatSolverConfig serializeSatSolverConfig(final SATSolverConfig config) { - return PBSatSolverConfig.newBuilder() + static PbSatSolverConfig serializeSatSolverConfig(final SatSolverConfig config) { + return PbSatSolverConfig.newBuilder() .setProofGeneration(config.isProofGeneration()) .setUseAtMostClauses(config.isUseAtMostClauses()) .setCnfMethod(serializeCnfMode(config.getCnfMethod())) @@ -37,15 +37,15 @@ static PBSatSolverConfig serializeSatSolverConfig(final SATSolverConfig config) .setRestartInc(config.getLowLevelConfig().getRestartInc()) .setClauseDecay(config.getLowLevelConfig().getClauseDecay()) - .setLbLBDMinimizingClause(config.getLowLevelConfig().getLbLBDMinimizingClause()) - .setLbLBDFrozenClause(config.getLowLevelConfig().getLbLBDFrozenClause()) + .setLbLbdMinimizingClause(config.getLowLevelConfig().getLbLbdMinimizingClause()) + .setLbLbdFrozenClause(config.getLowLevelConfig().getLbLbdFrozenClause()) .setLbSizeMinimizingClause(config.getLowLevelConfig().getLbSizeMinimizingClause()) - .setFirstReduceDB(config.getLowLevelConfig().getFirstReduceDB()) - .setSpecialIncReduceDB(config.getLowLevelConfig().getSpecialIncReduceDB()) - .setIncReduceDB(config.getLowLevelConfig().getIncReduceDB()) + .setFirstReduceDb(config.getLowLevelConfig().getFirstReduceDb()) + .setSpecialIncReduceDb(config.getLowLevelConfig().getSpecialIncReduceDb()) + .setIncReduceDb(config.getLowLevelConfig().getIncReduceDb()) .setFactorK(config.getLowLevelConfig().getFactorK()) .setFactorR(config.getLowLevelConfig().getFactorR()) - .setSizeLBDQueue(config.getLowLevelConfig().getSizeLBDQueue()) + .setSizeLbdQueue(config.getLowLevelConfig().getSizeLbdQueue()) .setSizeTrailQueue(config.getLowLevelConfig().getSizeTrailQueue()) .setReduceOnSize(config.getLowLevelConfig().isReduceOnSize()) .setReduceOnSizeSize(config.getLowLevelConfig().getReduceOnSizeSize()) @@ -59,23 +59,23 @@ static PBSatSolverConfig serializeSatSolverConfig(final SATSolverConfig config) * @param bin the protocol buffer * @return the configuration */ - static SATSolverConfig deserializeSatSolverConfig(final PBSatSolverConfig bin) { - final var llConfig = SATSolverLowLevelConfig.builder() + static SatSolverConfig deserializeSatSolverConfig(final PbSatSolverConfig bin) { + final var llConfig = SatSolverLowLevelConfig.builder() .varDecay(bin.getVarDecay()) .varInc(bin.getVarInc()) .restartFirst(bin.getRestartFirst()) .restartInc(bin.getRestartInc()) .clauseDecay(bin.getClauseDecay()) - .lbLBDMinimizingClause(bin.getLbLBDMinimizingClause()) - .lbLBDFrozenClause(bin.getLbLBDFrozenClause()) + .lbLbdMinimizingClause(bin.getLbLbdMinimizingClause()) + .lbLbdFrozenClause(bin.getLbLbdFrozenClause()) .lbSizeMinimizingClause(bin.getLbSizeMinimizingClause()) - .firstReduceDB(bin.getFirstReduceDB()) - .specialIncReduceDB(bin.getSpecialIncReduceDB()) - .incReduceDB(bin.getIncReduceDB()) + .firstReduceDb(bin.getFirstReduceDb()) + .specialIncReduceDb(bin.getSpecialIncReduceDb()) + .incReduceDb(bin.getIncReduceDb()) .factorK(bin.getFactorK()) .factorR(bin.getFactorR()) - .sizeLBDQueue(bin.getSizeLBDQueue()) + .sizeLbdQueue(bin.getSizeLbdQueue()) .sizeTrailQueue(bin.getSizeTrailQueue()) .reduceOnSize(bin.getReduceOnSize()) .reduceOnSizeSize(bin.getReduceOnSizeSize()) @@ -83,7 +83,7 @@ static SATSolverConfig deserializeSatSolverConfig(final PBSatSolverConfig bin) { .build(); - return SATSolverConfig.builder() + return SatSolverConfig.builder() .proofGeneration(bin.getProofGeneration()) .useAtMostClauses(bin.getUseAtMostClauses()) .cnfMethod(deserializeCnfMode(bin.getCnfMethod())) @@ -98,14 +98,14 @@ static SATSolverConfig deserializeSatSolverConfig(final PBSatSolverConfig bin) { * @param minimization the algorithm * @return the protocol buffer */ - static PBClauseMinimization serializeMinMode(final ClauseMinimization minimization) { + static PbClauseMinimization serializeMinMode(final ClauseMinimization minimization) { switch (minimization) { case NONE: - return PBClauseMinimization.NONE; + return PbClauseMinimization.NONE; case BASIC: - return PBClauseMinimization.BASIC; + return PbClauseMinimization.BASIC; case DEEP: - return PBClauseMinimization.DEEP; + return PbClauseMinimization.DEEP; default: throw new IllegalArgumentException("Unknown clause minimization: " + minimization); } @@ -116,7 +116,7 @@ static PBClauseMinimization serializeMinMode(final ClauseMinimization minimizati * @param bin the protocol buffer * @return the algorithm */ - static ClauseMinimization deserializeMinMode(final PBClauseMinimization bin) { + static ClauseMinimization deserializeMinMode(final PbClauseMinimization bin) { switch (bin) { case NONE: return ClauseMinimization.NONE; @@ -134,14 +134,14 @@ static ClauseMinimization deserializeMinMode(final PBClauseMinimization bin) { * @param cnf the algorithm * @return the protocol buffer */ - static PBCnfMethod serializeCnfMode(final CNFMethod cnf) { + static PbCnfMethod serializeCnfMode(final CnfMethod cnf) { switch (cnf) { case FACTORY_CNF: - return PBCnfMethod.FACTORY_CNF; + return PbCnfMethod.FACTORY_CNF; case PG_ON_SOLVER: - return PBCnfMethod.PG_ON_SOLVER; + return PbCnfMethod.PG_ON_SOLVER; case FULL_PG_ON_SOLVER: - return PBCnfMethod.FULL_PG_ON_SOLVER; + return PbCnfMethod.FULL_PG_ON_SOLVER; default: throw new IllegalArgumentException("Unknown CNF method: " + cnf); } @@ -152,14 +152,14 @@ static PBCnfMethod serializeCnfMode(final CNFMethod cnf) { * @param bin the protocol buffer * @return the algorithm */ - static CNFMethod deserializeCnfMode(final PBCnfMethod bin) { + static CnfMethod deserializeCnfMode(final PbCnfMethod bin) { switch (bin) { case FACTORY_CNF: - return CNFMethod.FACTORY_CNF; + return CnfMethod.FACTORY_CNF; case PG_ON_SOLVER: - return CNFMethod.PG_ON_SOLVER; + return CnfMethod.PG_ON_SOLVER; case FULL_PG_ON_SOLVER: - return CNFMethod.FULL_PG_ON_SOLVER; + return CnfMethod.FULL_PG_ON_SOLVER; default: throw new IllegalArgumentException("Unknown CNF method: " + bin); } diff --git a/serialization/src/main/java/com/booleworks/logicng/serialization/SolverDatastructures.java b/serialization/src/main/java/com/booleworks/logicng/serialization/SolverDatastructures.java index 08b5a1a5..bb2de646 100644 --- a/serialization/src/main/java/com/booleworks/logicng/serialization/SolverDatastructures.java +++ b/serialization/src/main/java/com/booleworks/logicng/serialization/SolverDatastructures.java @@ -3,22 +3,22 @@ package com.booleworks.logicng.serialization; -import com.booleworks.logicng.collections.LNGIntVector; +import com.booleworks.logicng.collections.LngIntVector; import com.booleworks.logicng.datastructures.Tristate; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBTristate; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedIntQueue; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedLongQueue; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGHeap; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; -import com.booleworks.logicng.solvers.datastructures.LNGWatcher; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbTristate; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher; +import com.booleworks.logicng.solvers.datastructures.LngBoundedIntQueue; +import com.booleworks.logicng.solvers.datastructures.LngBoundedLongQueue; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngHeap; +import com.booleworks.logicng.solvers.datastructures.LngVariable; +import com.booleworks.logicng.solvers.datastructures.LngWatcher; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; import java.util.IdentityHashMap; import java.util.Map; @@ -35,14 +35,14 @@ public interface SolverDatastructures { * @param tristate the tristate value * @return the protocol buffer */ - static PBTristate serializeTristate(final Tristate tristate) { + static PbTristate serializeTristate(final Tristate tristate) { switch (tristate) { case FALSE: - return PBTristate.FALSE; + return PbTristate.FALSE; case TRUE: - return PBTristate.TRUE; + return PbTristate.TRUE; case UNDEF: - return PBTristate.UNDEF; + return PbTristate.UNDEF; default: throw new IllegalArgumentException("Unknown tristate: " + tristate); } @@ -53,7 +53,7 @@ static PBTristate serializeTristate(final Tristate tristate) { * @param bin the protocol buffer * @return the tristate */ - static Tristate deserializeTristate(final PBTristate bin) { + static Tristate deserializeTristate(final PbTristate bin) { switch (bin) { case FALSE: return Tristate.FALSE; @@ -71,8 +71,8 @@ static Tristate deserializeTristate(final PBTristate bin) { * @param heap the heap * @return the protocol buffer */ - static PBHeap serializeHeap(final LNGHeap heap) { - return PBHeap.newBuilder() + static PbHeap serializeHeap(final LngHeap heap) { + return PbHeap.newBuilder() .setHeap(Collections.serializeIntVec(heap.getHeap())) .setIndices(Collections.serializeIntVec(heap.getIndices())) .build(); @@ -83,10 +83,10 @@ static PBHeap serializeHeap(final LNGHeap heap) { * @param bin the protocol buffer * @return the heap */ - static LNGHeap deserializeHeap(final PBHeap bin, final LNGCoreSolver solver) { - final LNGIntVector heap = Collections.deserializeIntVec(bin.getHeap()); - final LNGIntVector indices = Collections.deserializeIntVec(bin.getIndices()); - return new LNGHeap(solver, heap, indices); + static LngHeap deserializeHeap(final PbHeap bin, final LngCoreSolver solver) { + final LngIntVector heap = Collections.deserializeIntVec(bin.getHeap()); + final LngIntVector indices = Collections.deserializeIntVec(bin.getIndices()); + return new LngHeap(solver, heap, indices); } /** @@ -95,8 +95,8 @@ static LNGHeap deserializeHeap(final PBHeap bin, final LNGCoreSolver solver) { * @param id the clause ID * @return the protocol buffer */ - static PBClause serializeClause(final LNGClause clause, final int id) { - return PBClause.newBuilder() + static PbClause serializeClause(final LngClause clause, final int id) { + return PbClause.newBuilder() .setData(Collections.serializeIntVec(clause.getData())) .setLearntOnState(clause.getLearntOnState()) .setIsAtMost(clause.isAtMost()) @@ -115,8 +115,8 @@ static PBClause serializeClause(final LNGClause clause, final int id) { * @param bin the protocol buffer * @return the clause */ - static LNGClause deserializeClause(final PBClause bin) { - return new LNGClause( + static LngClause deserializeClause(final PbClause bin) { + return new LngClause( Collections.deserializeIntVec(bin.getData()), bin.getLearntOnState(), bin.getIsAtMost(), @@ -135,8 +135,8 @@ static LNGClause deserializeClause(final PBClause bin) { * @param clauseMap a mapping from clause to clause ID * @return the protocol buffer */ - static PBVariable serializeVariable(final LNGVariable variable, final IdentityHashMap clauseMap) { - return PBVariable.newBuilder() + static PbVariable serializeVariable(final LngVariable variable, final IdentityHashMap clauseMap) { + return PbVariable.newBuilder() .setAssignment(serializeTristate(variable.assignment())) .setLevel(variable.level()) .setActivity(variable.activity()) @@ -151,9 +151,9 @@ static PBVariable serializeVariable(final LNGVariable variable, final IdentityHa * @param clauseMap a mapping from clause ID to clause * @return the variable */ - static LNGVariable deserializeVariable(final PBVariable bin, final Map clauseMap) { - final LNGClause reason = bin.getReason() == -1 ? null : clauseMap.get(bin.getReason()); - return new LNGVariable(deserializeTristate(bin.getAssignment()), bin.getLevel(), reason, bin.getActivity(), bin.getPolarity(), bin.getDecision()); + static LngVariable deserializeVariable(final PbVariable bin, final Map clauseMap) { + final LngClause reason = bin.getReason() == -1 ? null : clauseMap.get(bin.getReason()); + return new LngVariable(deserializeTristate(bin.getAssignment()), bin.getLevel(), reason, bin.getActivity(), bin.getPolarity(), bin.getDecision()); } /** @@ -162,8 +162,8 @@ static LNGVariable deserializeVariable(final PBVariable bin, final Map clauseMap) { - return PBWatcher.newBuilder() + static PbWatcher serializeWatcher(final LngWatcher watcher, final IdentityHashMap clauseMap) { + return PbWatcher.newBuilder() .setClause(clauseMap.get(watcher.clause())) .setBlocker(watcher.blocker()) .build(); @@ -175,8 +175,8 @@ static PBWatcher serializeWatcher(final LNGWatcher watcher, final IdentityHashMa * @param clauseMap a mapping from clause ID to clause * @return the watcher */ - static LNGWatcher deserializeWatcher(final PBWatcher bin, final Map clauseMap) { - return new LNGWatcher(clauseMap.get(bin.getClause()), bin.getBlocker()); + static LngWatcher deserializeWatcher(final PbWatcher bin, final Map clauseMap) { + return new LngWatcher(clauseMap.get(bin.getClause()), bin.getBlocker()); } /** @@ -184,8 +184,8 @@ static LNGWatcher deserializeWatcher(final PBWatcher bin, final Map deserializer = (final byte[] bs) -> { try { - return Propositions.deserializePropositions(f, ProtoBufPropositions.PBStandardProposition.newBuilder().mergeFrom(bs).build()); + return Propositions.deserializePropositions(f, ProtoBufPropositions.PbStandardProposition.newBuilder().mergeFrom(bs).build()); } catch (final InvalidProtocolBufferException e) { throw new IllegalArgumentException("Can only deserialize Standard propositions"); } @@ -127,7 +127,7 @@ public static SolverSerializer withCustomPropositions( * @param compress a flag whether the file should be compressed (zip) * @throws IOException if there is a problem writing the file */ - public void serializeSolverToFile(final SATSolver solver, final Path path, final boolean compress) throws IOException { + public void serializeSolverToFile(final SatSolver solver, final Path path, final boolean compress) throws IOException { try (final OutputStream outputStream = compress ? new GZIPOutputStream(Files.newOutputStream(path)) : Files.newOutputStream(path)) { serializeSolverToStream(solver, outputStream); } @@ -139,7 +139,7 @@ public void serializeSolverToFile(final SATSolver solver, final Path path, final * @param stream the stream * @throws IOException if there is a problem writing to the stream */ - public void serializeSolverToStream(final SATSolver solver, final OutputStream stream) throws IOException { + public void serializeSolverToStream(final SatSolver solver, final OutputStream stream) throws IOException { serializeSolver(solver).writeTo(stream); } @@ -148,7 +148,7 @@ public void serializeSolverToStream(final SATSolver solver, final OutputStream s * @param solver the SAT solver * @return the protocol buffer */ - public PBSatSolver serializeSolver(final SATSolver solver) { + public PbSatSolver serializeSolver(final SatSolver solver) { return serialize(solver); } @@ -159,7 +159,7 @@ public PBSatSolver serializeSolver(final SATSolver solver) { * @return the solver * @throws IOException if there is a problem reading the file */ - public SATSolver deserializeSatSolverFromFile(final Path path, final boolean compress) throws IOException { + public SatSolver deserializeSatSolverFromFile(final Path path, final boolean compress) throws IOException { try (final InputStream inputStream = compress ? new GZIPInputStream(Files.newInputStream(path)) : Files.newInputStream(path)) { return deserializeSatSolverFromStream(inputStream); } @@ -171,8 +171,8 @@ public SATSolver deserializeSatSolverFromFile(final Path path, final boolean com * @return the solver * @throws IOException if there is a problem reading from the stream */ - public SATSolver deserializeSatSolverFromStream(final InputStream stream) throws IOException { - return deserializeSatSolver(PBSatSolver.newBuilder().mergeFrom(stream).build()); + public SatSolver deserializeSatSolverFromStream(final InputStream stream) throws IOException { + return deserializeSatSolver(PbSatSolver.newBuilder().mergeFrom(stream).build()); } /** @@ -180,16 +180,16 @@ public SATSolver deserializeSatSolverFromStream(final InputStream stream) throws * @param bin the protocol buffer * @return the solver */ - public SATSolver deserializeSatSolver(final PBSatSolver bin) { + public SatSolver deserializeSatSolver(final PbSatSolver bin) { return deserialize(bin); } - PBSatSolver serialize(final SATSolver solver) { + PbSatSolver serialize(final SatSolver solver) { final var core = solver.getUnderlyingSolver(); - final LNGVector clauses = getField(core, "clauses"); - final LNGVector learnts = getField(core, "learnts"); - final IdentityHashMap clauseMap = generateClauseMap(clauses, learnts); - final PBSatSolver.Builder builder = PBSatSolver.newBuilder(); + final LngVector clauses = getField(core, "clauses"); + final LngVector learnts = getField(core, "learnts"); + final IdentityHashMap clauseMap = generateClauseMap(clauses, learnts); + final PbSatSolver.Builder builder = PbSatSolver.newBuilder(); builder.setConfig(SatSolverConfigs.serializeSatSolverConfig(getField(core, "config"))); builder.setInSatCall(getField(core, "inSatCall")); @@ -218,11 +218,11 @@ PBSatSolver serialize(final SATSolver solver) { builder.setClausesLiterals(getField(core, "clausesLiterals")); builder.setLearntsLiterals(getField(core, "learntsLiterals")); - final LNGVector pgProof = getField(core, "pgProof"); + final LngVector pgProof = getField(core, "pgProof"); if (pgProof != null) { builder.setPgProof(Collections.serializeVec(pgProof)); } - final LNGVector pgOriginalClauses = getField(core, "pgOriginalClauses"); + final LngVector pgOriginalClauses = getField(core, "pgOriginalClauses"); if (pgOriginalClauses != null) { for (final ProofInformation oc : pgOriginalClauses) { builder.addPgOriginalClauses(serialize(oc)); @@ -234,7 +234,7 @@ PBSatSolver serialize(final SATSolver solver) { if (backboneCandidates != null) { builder.setBackboneCandidates(serializeStack(backboneCandidates)); } - final LNGIntVector backboneAssumptions = getField(core, "backboneAssumptions"); + final LngIntVector backboneAssumptions = getField(core, "backboneAssumptions"); if (backboneAssumptions != null) { builder.setBackboneAssumptions(serializeIntVec(backboneAssumptions)); } @@ -252,19 +252,19 @@ PBSatSolver serialize(final SATSolver solver) { builder.setLbdQueue(serializeLongQueue(getField(core, "lbdQueue"))); builder.setTrailQueue(serializeIntQueue(getField(core, "trailQueue"))); builder.setMyflag(getField(core, "myflag")); - builder.setAnalyzeLBD(getField(core, "analyzeLBD")); + builder.setAnalyzeLBD(getField(core, "analyzeLbd")); builder.setNbClausesBeforeReduce(getField(core, "nbClausesBeforeReduce")); builder.setConflicts(getField(core, "conflicts")); builder.setConflictsRestarts(getField(core, "conflictsRestarts")); - builder.setSumLBD(getField(core, "sumLBD")); + builder.setSumLBD(getField(core, "sumLbd")); builder.setCurRestart(getField(core, "curRestart")); return builder.build(); } - SATSolver deserialize(final PBSatSolver bin) { - final Map clauseMap = new TreeMap<>(); - final var core = new LNGCoreSolver(f, SatSolverConfigs.deserializeSatSolverConfig(bin.getConfig())); + SatSolver deserialize(final PbSatSolver bin) { + final Map clauseMap = new TreeMap<>(); + final var core = new LngCoreSolver(f, SatSolverConfigs.deserializeSatSolverConfig(bin.getConfig())); setField(core, "inSatCall", bin.getInSatCall()); setField(core, "name2idx", new TreeMap<>(bin.getName2IdxMap())); final Map idx2name = new TreeMap<>(); @@ -298,8 +298,8 @@ SATSolver deserialize(final PBSatSolver bin) { setField(core, "pgProof", Collections.deserializeVec(bin.getPgProof())); } if (bin.getPgOriginalClausesCount() > 0) { - final LNGVector originalClauses = new LNGVector<>(bin.getPgOriginalClausesCount()); - for (final PBProofInformation pi : bin.getPgOriginalClausesList()) { + final LngVector originalClauses = new LngVector<>(bin.getPgOriginalClausesCount()); + for (final PbProofInformation pi : bin.getPgOriginalClausesList()) { originalClauses.push(deserialize(pi)); } setField(core, "pgOriginalClauses", originalClauses); @@ -322,52 +322,52 @@ SATSolver deserialize(final PBSatSolver bin) { setField(core, "lbdQueue", deserializeLongQueue(bin.getLbdQueue())); setField(core, "trailQueue", deserializeIntQueue(bin.getTrailQueue())); setField(core, "myflag", bin.getMyflag()); - setField(core, "analyzeLBD", bin.getAnalyzeLBD()); + setField(core, "analyzeLbd", bin.getAnalyzeLBD()); setField(core, "nbClausesBeforeReduce", bin.getNbClausesBeforeReduce()); setField(core, "conflicts", bin.getConflicts()); setField(core, "conflictsRestarts", bin.getConflictsRestarts()); - setField(core, "sumLBD", bin.getSumLBD()); + setField(core, "sumLbd", bin.getSumLBD()); setField(core, "curRestart", bin.getCurRestart()); - return new SATSolver(f, core); + return new SatSolver(f, core); } - private static IdentityHashMap generateClauseMap(final LNGVector clauses, final LNGVector learnts) { - final IdentityHashMap clauseMap = new IdentityHashMap<>(); - for (final LNGClause clause : clauses) { + private static IdentityHashMap generateClauseMap(final LngVector clauses, final LngVector learnts) { + final IdentityHashMap clauseMap = new IdentityHashMap<>(); + for (final LngClause clause : clauses) { clauseMap.put(clause, clauseMap.size()); } - for (final LNGClause learnt : learnts) { + for (final LngClause learnt : learnts) { clauseMap.put(learnt, clauseMap.size()); } return clauseMap; } - private static PBClauseVector serializeClauseVec(final LNGVector vec, - final IdentityHashMap clauseMap) { - final PBClauseVector.Builder builder = PBClauseVector.newBuilder(); - for (final LNGClause clause : vec) { + private static PbClauseVector serializeClauseVec(final LngVector vec, + final IdentityHashMap clauseMap) { + final PbClauseVector.Builder builder = PbClauseVector.newBuilder(); + for (final LngClause clause : vec) { builder.addElement(SolverDatastructures.serializeClause(clause, clauseMap.get(clause))); } return builder.build(); } - private static LNGVector deserializeClauseVec(final PBClauseVector bin, final Map clauseMap) { - final LNGVector vec = new LNGVector<>(bin.getElementCount()); + private static LngVector deserializeClauseVec(final PbClauseVector bin, final Map clauseMap) { + final LngVector vec = new LngVector<>(bin.getElementCount()); for (int i = 0; i < bin.getElementCount(); i++) { - final PBClause binClause = bin.getElement(i); - final LNGClause clause = SolverDatastructures.deserializeClause(binClause); + final PbClause binClause = bin.getElement(i); + final LngClause clause = SolverDatastructures.deserializeClause(binClause); clauseMap.put(binClause.getId(), clause); vec.push(clause); } return vec; } - private static PBWatcherVectorVector serializeWatches(final LNGVector> vec, - final IdentityHashMap clauseMap) { - final PBWatcherVectorVector.Builder builder = PBWatcherVectorVector.newBuilder(); - for (final LNGVector watchList : vec) { - final PBWatcherVector.Builder watchBuilder = PBWatcherVector.newBuilder(); - for (final LNGWatcher watch : watchList) { + private static PbWatcherVectorVector serializeWatches(final LngVector> vec, + final IdentityHashMap clauseMap) { + final PbWatcherVectorVector.Builder builder = PbWatcherVectorVector.newBuilder(); + for (final LngVector watchList : vec) { + final PbWatcherVector.Builder watchBuilder = PbWatcherVector.newBuilder(); + for (final LngWatcher watch : watchList) { watchBuilder.addElement(SolverDatastructures.serializeWatcher(watch, clauseMap)); } builder.addElement(watchBuilder.build()); @@ -375,12 +375,12 @@ private static PBWatcherVectorVector serializeWatches(final LNGVector> deserializeWatches(final PBWatcherVectorVector bin, - final Map clauseMap) { - final LNGVector> vec = new LNGVector<>(bin.getElementCount()); + private static LngVector> deserializeWatches(final PbWatcherVectorVector bin, + final Map clauseMap) { + final LngVector> vec = new LngVector<>(bin.getElementCount()); for (int i = 0; i < bin.getElementCount(); i++) { - final PBWatcherVector binWatch = bin.getElement(i); - final LNGVector watch = new LNGVector<>(binWatch.getElementCount()); + final PbWatcherVector binWatch = bin.getElement(i); + final LngVector watch = new LngVector<>(binWatch.getElementCount()); for (int j = 0; j < binWatch.getElementCount(); j++) { watch.push(SolverDatastructures.deserializeWatcher(binWatch.getElement(j), clauseMap)); } @@ -389,28 +389,28 @@ private static LNGVector> deserializeWatches(final PBWatch return vec; } - private static PBVariableVector serializeVarVec(final LNGVector vec, - final IdentityHashMap clauseMap) { - final PBVariableVector.Builder builder = PBVariableVector.newBuilder(); - for (final LNGVariable var : vec) { + private static PbVariableVector serializeVarVec(final LngVector vec, + final IdentityHashMap clauseMap) { + final PbVariableVector.Builder builder = PbVariableVector.newBuilder(); + for (final LngVariable var : vec) { builder.addElement(SolverDatastructures.serializeVariable(var, clauseMap)); } return builder.build(); } - private static LNGVector deserializeVarVec(final PBVariableVector bin, final Map clauseMap) { - final LNGVector vec = new LNGVector<>(bin.getElementCount()); + private static LngVector deserializeVarVec(final PbVariableVector bin, final Map clauseMap) { + final LngVector vec = new LngVector<>(bin.getElementCount()); for (int i = 0; i < bin.getElementCount(); i++) { vec.push(SolverDatastructures.deserializeVariable(bin.getElement(i), clauseMap)); } return vec; } - public static ProtoBufCollections.PBIntVector serializeStack(final Stack stack) { + public static ProtoBufCollections.PbIntVector serializeStack(final Stack stack) { if (stack == null) { return null; } - final ProtoBufCollections.PBIntVector.Builder vec = ProtoBufCollections.PBIntVector.newBuilder(); + final ProtoBufCollections.PbIntVector.Builder vec = ProtoBufCollections.PbIntVector.newBuilder(); for (final Integer integer : stack) { vec.addElement(integer); } @@ -418,7 +418,7 @@ public static ProtoBufCollections.PBIntVector serializeStack(final Stack deserializeStack(final ProtoBufCollections.PBIntVector vec) { + public static Stack deserializeStack(final ProtoBufCollections.PbIntVector vec) { final Stack stack = new Stack<>(); for (int i = 0; i < vec.getSize(); i++) { stack.push(vec.getElement(i)); @@ -426,13 +426,13 @@ public static Stack deserializeStack(final ProtoBufCollections.PBIntVec return stack; } - private static HashMap serializeBbMap(final Map map) { - final HashMap ser = new HashMap<>(); + private static HashMap serializeBbMap(final Map map) { + final HashMap ser = new HashMap<>(); map.forEach((k, v) -> ser.put(k, SolverDatastructures.serializeTristate(v))); return ser; } - private static HashMap deserializeBbMap(final Map map) { + private static HashMap deserializeBbMap(final Map map) { if (map.isEmpty()) { return null; } @@ -441,20 +441,20 @@ private static HashMap deserializeBbMap(final Map serializeProps(final LNGVector props) { + private List serializeProps(final LngVector props) { final List res = new ArrayList<>(); for (final Proposition prop : props) { res.add(ByteString.copyFrom(serializer.apply(prop))); @@ -462,8 +462,8 @@ private List serializeProps(final LNGVector props) { return res; } - private LNGVector deserializeProps(final List bin) { - return new LNGVector<>(bin.stream() + private LngVector deserializeProps(final List bin) { + return new LngVector<>(bin.stream() .map(it -> deserializer.apply(it.toByteArray())) .collect(Collectors.toList())); } diff --git a/serialization/src/main/proto/collections.proto b/serialization/src/main/proto/collections.proto index 2582da10..07c945d9 100644 --- a/serialization/src/main/proto/collections.proto +++ b/serialization/src/main/proto/collections.proto @@ -3,22 +3,22 @@ package collections; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufCollections"; -message PBIntVector { +message PbIntVector { repeated int32 element = 1; int32 size = 2; } -message PBBooleanVector { +message PbBooleanVector { repeated bool element = 1; int32 size = 2; } -message PBLongVector { +message PbLongVector { repeated int64 element = 1; int32 size = 2; } -message PBIntVectorVector { - repeated PBIntVector element = 1; +message PbIntVectorVector { + repeated PbIntVector element = 1; int32 size = 2; } diff --git a/serialization/src/main/proto/dnnf.proto b/serialization/src/main/proto/dnnf.proto index f061bd9e..df561231 100644 --- a/serialization/src/main/proto/dnnf.proto +++ b/serialization/src/main/proto/dnnf.proto @@ -4,7 +4,7 @@ import "formulas.proto"; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufDnnf"; -message PBDnnf { +message PbDnnf { repeated string originalVariables = 1; - formulas.PBFormulas formula = 2; + formulas.PbFormulas formula = 2; } diff --git a/serialization/src/main/proto/formulas.proto b/serialization/src/main/proto/formulas.proto index adc7d404..3f94e99d 100644 --- a/serialization/src/main/proto/formulas.proto +++ b/serialization/src/main/proto/formulas.proto @@ -3,7 +3,7 @@ package formulas; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufFormulas"; -enum PBComparison { +enum PbComparison { EQ = 0; GT = 1; GE = 2; @@ -11,7 +11,7 @@ enum PBComparison { LE = 4; } -enum PBFormulaType { +enum PbFormulaType { CONST = 0; LITERAL = 1; NOT = 2; @@ -23,25 +23,25 @@ enum PBFormulaType { PREDICATE = 8; } -message PBFormulas { +message PbFormulas { repeated int32 id = 1; - PBFormulaMapping mapping = 2; + PbFormulaMapping mapping = 2; } -message PBFormulaMapping { - map mapping = 1; +message PbFormulaMapping { + map mapping = 1; } -message PBInternalFormula { - optional PBFormulaType type = 1; +message PbInternalFormula { + optional PbFormulaType type = 1; optional bool value = 2; // constants optional string variable = 3; // literal (together with value) - optional PBInternalPseudoBooleanConstraint pbConstraint = 4; // PBConstraint + optional PbInternalPseudoBooleanConstraint pbConstraint = 4; // PBConstraint repeated int32 operand = 5; // not = 1, impl/equiv = 2, and/or = n } -message PBInternalPseudoBooleanConstraint { - PBComparison comparator = 1; +message PbInternalPseudoBooleanConstraint { + PbComparison comparator = 1; int64 rhs = 2; repeated int64 coefficient = 3; repeated string literal = 4; // including phase with/out `-` diff --git a/serialization/src/main/proto/propositions.proto b/serialization/src/main/proto/propositions.proto index a49ec634..e0f981de 100644 --- a/serialization/src/main/proto/propositions.proto +++ b/serialization/src/main/proto/propositions.proto @@ -4,7 +4,7 @@ import "formulas.proto"; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufPropositions"; -message PBStandardProposition { - formulas.PBFormulas formula = 1; +message PbStandardProposition { + formulas.PbFormulas formula = 1; string description = 2; } diff --git a/serialization/src/main/proto/satsolver.proto b/serialization/src/main/proto/satsolver.proto index 7a5bd0e6..b3e15660 100644 --- a/serialization/src/main/proto/satsolver.proto +++ b/serialization/src/main/proto/satsolver.proto @@ -6,29 +6,29 @@ import "solver_commons.proto"; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufSatSolver"; -message PBSatSolver { - PBSatSolverConfig config = 1; +message PbSatSolver { + PbSatSolverConfig config = 1; bool inSatCall = 2; map name2idx = 3; - collections.PBIntVector validStates = 4; + collections.PbIntVector validStates = 4; int32 nextStateId = 5; bool ok = 6; int32 qhead = 7; - collections.PBIntVector unitClauses = 8; - PBClauseVector clauses = 9; - PBClauseVector learnts = 10; - PBWatcherVectorVector watches = 11; - PBVariableVector vars = 12; - PBHeap orderHeap = 13; - collections.PBIntVector trail = 14; - collections.PBIntVector trailLim = 15; - collections.PBBooleanVector model = 16; - collections.PBIntVector assumptionConflict = 17; - collections.PBIntVector assumptions = 18; + collections.PbIntVector unitClauses = 8; + PbClauseVector clauses = 9; + PbClauseVector learnts = 10; + PbWatcherVectorVector watches = 11; + PbVariableVector vars = 12; + PbHeap orderHeap = 13; + collections.PbIntVector trail = 14; + collections.PbIntVector trailLim = 15; + collections.PbBooleanVector model = 16; + collections.PbIntVector assumptionConflict = 17; + collections.PbIntVector assumptions = 18; repeated bytes assumptionPropositions = 19; - collections.PBBooleanVector seen = 20; + collections.PbBooleanVector seen = 20; int32 analyzeBtLevel = 21; double claInc = 22; double varInc = 23; @@ -36,22 +36,22 @@ message PBSatSolver { int32 clausesLiterals = 25; int32 learntsLiterals = 26; - repeated solver.PBProofInformation pgOriginalClauses = 27; - collections.PBIntVectorVector pgProof = 28; + repeated solver.PbProofInformation pgOriginalClauses = 27; + collections.PbIntVectorVector pgProof = 28; bool computingBackbone = 29; - collections.PBIntVector backboneCandidates = 30; - collections.PBIntVector backboneAssumptions = 31; - map backboneMap = 32; + collections.PbIntVector backboneCandidates = 30; + collections.PbIntVector backboneAssumptions = 31; + map backboneMap = 32; - collections.PBIntVector selectionOrder = 33; + collections.PbIntVector selectionOrder = 33; int32 selectionOrderIdx = 34; - PBWatcherVectorVector watchesBin = 35; - collections.PBIntVector permDiff = 36; - collections.PBIntVector lastDecisionLevel = 37; - PBBoundedLongQueue lbdQueue = 38; - PBBoundedIntQueue trailQueue = 39; + PbWatcherVectorVector watchesBin = 35; + collections.PbIntVector permDiff = 36; + collections.PbIntVector lastDecisionLevel = 37; + PbBoundedLongQueue lbdQueue = 38; + PbBoundedIntQueue trailQueue = 39; int32 myflag = 40; int64 analyzeLBD = 41; int32 nbClausesBeforeReduce = 42; diff --git a/serialization/src/main/proto/solver_commons.proto b/serialization/src/main/proto/solver_commons.proto index f18ec08a..2491e3e8 100644 --- a/serialization/src/main/proto/solver_commons.proto +++ b/serialization/src/main/proto/solver_commons.proto @@ -3,23 +3,23 @@ package solver; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufSolverCommons"; -enum PBClauseMinimization { +enum PbClauseMinimization { NONE = 0; BASIC = 1; DEEP = 2; } -enum PBCnfMethod { +enum PbCnfMethod { FACTORY_CNF = 0; PG_ON_SOLVER = 1; FULL_PG_ON_SOLVER = 2; } -message PBSatSolverConfig { +message PbSatSolverConfig { bool proofGeneration = 1; bool useAtMostClauses = 2; - PBCnfMethod cnfMethod = 3; - PBClauseMinimization clauseMinimization = 4; + PbCnfMethod cnfMethod = 3; + PbClauseMinimization clauseMinimization = 4; bool initialPhase = 5; double varDecay = 6; @@ -28,15 +28,15 @@ message PBSatSolverConfig { double restartInc = 9; double clauseDecay = 10; - int32 lbLBDMinimizingClause = 11; - int32 lbLBDFrozenClause = 12; + int32 lbLbdMinimizingClause = 11; + int32 lbLbdFrozenClause = 12; int32 lbSizeMinimizingClause = 13; - int32 firstReduceDB = 14; - int32 specialIncReduceDB = 15; - int32 incReduceDB = 16; + int32 firstReduceDb = 14; + int32 specialIncReduceDb = 15; + int32 incReduceDb = 16; double factorK = 17; double factorR = 18; - int32 sizeLBDQueue = 19; + int32 sizeLbdQueue = 19; int32 sizeTrailQueue = 20; bool reduceOnSize = 21; int32 reduceOnSizeSize = 22; diff --git a/serialization/src/main/proto/solver_datastructures.proto b/serialization/src/main/proto/solver_datastructures.proto index b4797d23..8403cc9d 100644 --- a/serialization/src/main/proto/solver_datastructures.proto +++ b/serialization/src/main/proto/solver_datastructures.proto @@ -4,14 +4,14 @@ import "collections.proto"; option java_package = "com.booleworks.logicng.serialization"; option java_outer_classname = "ProtoBufSolverDatastructures"; -enum PBTristate { +enum PbTristate { FALSE = 0; TRUE = 1; UNDEF = 2; } -message PBClause { - collections.PBIntVector data = 1; +message PbClause { + collections.PbIntVector data = 1; int32 learntOnState = 2; bool isAtMost = 3; double activity = 4; @@ -23,25 +23,25 @@ message PBClause { int32 id = 11; } -message PBClauseVector { - repeated PBClause element = 1; +message PbClauseVector { + repeated PbClause element = 1; } -message PBWatcher { +message PbWatcher { int32 clause = 1; int32 blocker = 2; } -message PBWatcherVector { - repeated PBWatcher element = 1; +message PbWatcherVector { + repeated PbWatcher element = 1; } -message PBWatcherVectorVector { - repeated PBWatcherVector element = 1; +message PbWatcherVectorVector { + repeated PbWatcherVector element = 1; } -message PBVariable { - PBTristate assignment = 1; +message PbVariable { + PbTristate assignment = 1; int32 level = 2; int32 reason = 3; double activity = 4; @@ -49,17 +49,17 @@ message PBVariable { bool decision = 6; } -message PBVariableVector { - repeated PBVariable element = 1; +message PbVariableVector { + repeated PbVariable element = 1; } -message PBHeap { - collections.PBIntVector heap = 1; - collections.PBIntVector indices = 2; +message PbHeap { + collections.PbIntVector heap = 1; + collections.PbIntVector indices = 2; } -message PBBoundedIntQueue { - collections.PBIntVector elems = 1; +message PbBoundedIntQueue { + collections.PbIntVector elems = 1; int32 first = 2; int32 last = 3; int64 sumOfQueue = 4; @@ -67,8 +67,8 @@ message PBBoundedIntQueue { int32 queueSize = 6; } -message PBBoundedLongQueue { - collections.PBLongVector elems = 1; +message PbBoundedLongQueue { + collections.PbLongVector elems = 1; int32 first = 2; int32 last = 3; int64 sumOfQueue = 4; @@ -76,7 +76,7 @@ message PBBoundedLongQueue { int32 queueSize = 6; } -message PBProofInformation { - collections.PBIntVector clause = 1; +message PbProofInformation { + collections.PbIntVector clause = 1; optional bytes proposition = 2; } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionComperator.java b/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionComperator.java index 8c41dd29..e3acd9e0 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionComperator.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionComperator.java @@ -5,13 +5,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGLongVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngLongVector; public class CollectionComperator { - public static void assertBoolVecEquals(final LNGBooleanVector v1, final LNGBooleanVector v2) { + public static void assertBoolVecEquals(final LngBooleanVector v1, final LngBooleanVector v2) { if (v1 == null && v2 == null) { return; } @@ -21,7 +21,7 @@ public static void assertBoolVecEquals(final LNGBooleanVector v1, final LNGBoole } } - public static void assertIntVecEquals(final LNGIntVector v1, final LNGIntVector v2) { + public static void assertIntVecEquals(final LngIntVector v1, final LngIntVector v2) { if (v1 == null && v2 == null) { return; } @@ -31,7 +31,7 @@ public static void assertIntVecEquals(final LNGIntVector v1, final LNGIntVector } } - public static void assertLongVecEquals(final LNGLongVector v1, final LNGLongVector v2) { + public static void assertLongVecEquals(final LngLongVector v1, final LngLongVector v2) { if (v1 == null && v2 == null) { return; } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionsTest.java b/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionsTest.java index 57277ae6..0370472d 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionsTest.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/CollectionsTest.java @@ -3,12 +3,12 @@ package com.booleworks.logicng.serialization; -import com.booleworks.logicng.collections.LNGBooleanVector; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGLongVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBBooleanVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBIntVector; -import com.booleworks.logicng.serialization.ProtoBufCollections.PBLongVector; +import com.booleworks.logicng.collections.LngBooleanVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngLongVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbBooleanVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbIntVector; +import com.booleworks.logicng.serialization.ProtoBufCollections.PbLongVector; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -21,16 +21,16 @@ public class CollectionsTest { @Test public void testLngBooleanVector() { final Random random = new Random(42); - final List vecs = new ArrayList<>(); + final List vecs = new ArrayList<>(); for (int i = 0; i < 1000; i++) { - final LNGBooleanVector vec = new LNGBooleanVector(); + final LngBooleanVector vec = new LngBooleanVector(); for (int j = 0; j < 500; j++) { vec.push(random.nextBoolean()); } vecs.add(vec); } - final List serialized = vecs.stream().map(Collections::serializeBoolVec).collect(Collectors.toList()); - final List deserialized = serialized.stream().map(Collections::deserializeBooVec).collect(Collectors.toList()); + final List serialized = vecs.stream().map(Collections::serializeBoolVec).collect(Collectors.toList()); + final List deserialized = serialized.stream().map(Collections::deserializeBooVec).collect(Collectors.toList()); for (int i = 0; i < vecs.size(); i++) { CollectionComperator.assertBoolVecEquals(vecs.get(i), deserialized.get(i)); } @@ -39,16 +39,16 @@ public void testLngBooleanVector() { @Test public void testLngIntVector() { final Random random = new Random(42); - final List vecs = new ArrayList<>(); + final List vecs = new ArrayList<>(); for (int i = 0; i < 1000; i++) { - final LNGIntVector vec = new LNGIntVector(); + final LngIntVector vec = new LngIntVector(); for (int j = 0; j < 500; j++) { vec.push(random.nextInt()); } vecs.add(vec); } - final List serialized = vecs.stream().map(Collections::serializeIntVec).collect(Collectors.toList()); - final List deserialized = serialized.stream().map(Collections::deserializeIntVec).collect(Collectors.toList()); + final List serialized = vecs.stream().map(Collections::serializeIntVec).collect(Collectors.toList()); + final List deserialized = serialized.stream().map(Collections::deserializeIntVec).collect(Collectors.toList()); for (int i = 0; i < vecs.size(); i++) { CollectionComperator.assertIntVecEquals(vecs.get(i), deserialized.get(i)); } @@ -57,16 +57,16 @@ public void testLngIntVector() { @Test public void testLngLongVector() { final Random random = new Random(42); - final List vecs = new ArrayList<>(); + final List vecs = new ArrayList<>(); for (int i = 0; i < 1000; i++) { - final LNGLongVector vec = new LNGLongVector(); + final LngLongVector vec = new LngLongVector(); for (int j = 0; j < 500; j++) { vec.push(random.nextLong()); } vecs.add(vec); } - final List serialized = vecs.stream().map(Collections::serializeLongVec).collect(Collectors.toList()); - final List deserialized = serialized.stream().map(Collections::deserializeLongVec).collect(Collectors.toList()); + final List serialized = vecs.stream().map(Collections::serializeLongVec).collect(Collectors.toList()); + final List deserialized = serialized.stream().map(Collections::deserializeLongVec).collect(Collectors.toList()); for (int i = 0; i < vecs.size(); i++) { CollectionComperator.assertLongVecEquals(vecs.get(i), deserialized.get(i)); } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/FormulasTest.java b/serialization/src/test/java/com/booleworks/logicng/serialization/FormulasTest.java index edc8376b..0427db7c 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/FormulasTest.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/FormulasTest.java @@ -10,7 +10,7 @@ import com.booleworks.logicng.formulas.FormulaFactory; import com.booleworks.logicng.io.parsers.ParserException; import com.booleworks.logicng.io.parsers.PropositionalParser; -import com.booleworks.logicng.serialization.ProtoBufFormulas.PBFormulas; +import com.booleworks.logicng.serialization.ProtoBufFormulas.PbFormulas; import com.booleworks.logicng.util.FormulaRandomizer; import com.booleworks.logicng.util.FormulaRandomizerConfig; import org.junit.jupiter.api.Test; @@ -48,7 +48,7 @@ public void testConstraintPerformance() throws IOException, ParserException { final FormulaFactory f2 = FormulaFactory.caching(); final long t1 = System.currentTimeMillis(); - final PBFormulas bin = Formulas.serializeFormulas(constraints); + final PbFormulas bin = Formulas.serializeFormulas(constraints); final long t2 = System.currentTimeMillis(); bin.writeTo(Files.newOutputStream(PROTO)); final long t3 = System.currentTimeMillis(); @@ -58,11 +58,11 @@ public void testConstraintPerformance() throws IOException, ParserException { final long t4 = System.currentTimeMillis(); final FormulaFactory f3 = FormulaFactory.caching(); - final PBFormulas binList = PBFormulas.newBuilder().mergeFrom(Files.newInputStream(PROTO)).build(); + final PbFormulas binList = PbFormulas.newBuilder().mergeFrom(Files.newInputStream(PROTO)).build(); final long t5 = System.currentTimeMillis(); final List deserialized = deserializeFormulaList(f2, binList); final long t6 = System.currentTimeMillis(); - final PBFormulas zipList = PBFormulas.newBuilder().mergeFrom(new GZIPInputStream(Files.newInputStream(ZIP))).build(); + final PbFormulas zipList = PbFormulas.newBuilder().mergeFrom(new GZIPInputStream(Files.newInputStream(ZIP))).build(); final long t7 = System.currentTimeMillis(); final List deserializedZipped = deserializeFormulaList(f3, zipList); @@ -101,7 +101,7 @@ public void testRandomizedFormulas() throws IOException { final FormulaRandomizer randomizer = new FormulaRandomizer(f, FormulaRandomizerConfig.builder().seed(42).build()); for (int i = 0; i < 1000; i++) { final Formula original = randomizer.formula(5); - final PBFormulas serialized = Formulas.serializeFormula(original); + final PbFormulas serialized = Formulas.serializeFormula(original); Formula deserialized = Formulas.deserializeFormula(f, serialized); assertThat(deserialized).isEqualTo(original); diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/SatSolversTest.java b/serialization/src/test/java/com/booleworks/logicng/serialization/SatSolversTest.java index 588aede0..ecf515a3 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/SatSolversTest.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/SatSolversTest.java @@ -15,8 +15,8 @@ import com.booleworks.logicng.propositions.Proposition; import com.booleworks.logicng.propositions.PropositionBackpack; import com.booleworks.logicng.propositions.StandardProposition; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.SATSolverConfig; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.SatSolverConfig; import com.google.protobuf.InvalidProtocolBufferException; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -35,17 +35,17 @@ import java.util.stream.Collectors; public class SatSolversTest { - private static final SATSolverConfig STAND_CONFIG = SATSolverConfig.builder() + private static final SatSolverConfig STAND_CONFIG = SatSolverConfig.builder() .useAtMostClauses(false) .build(); - private static final SATSolverConfig CARD_CONFIG = SATSolverConfig.builder() + private static final SatSolverConfig CARD_CONFIG = SatSolverConfig.builder() .useAtMostClauses(true) .build(); - private static final SATSolverConfig STAND_PROOF_CONFIG = SATSolverConfig.builder() + private static final SatSolverConfig STAND_PROOF_CONFIG = SatSolverConfig.builder() .proofGeneration(true) .useAtMostClauses(false) .build(); - private static final SATSolverConfig CARD_PROOF_CONFIG = SATSolverConfig.builder() + private static final SatSolverConfig CARD_PROOF_CONFIG = SatSolverConfig.builder() .proofGeneration(true) .useAtMostClauses(true) .build(); @@ -74,7 +74,7 @@ public static void cleanUp() throws IOException { @ParameterizedTest @ValueSource(booleans = {false, true}) public void testSatSolverSimple(final boolean compress) throws IOException { - final var solverBefore = SATSolver.newSolver(f, STAND_CONFIG); + final var solverBefore = SatSolver.newSolver(f, STAND_CONFIG); solverBefore.add(formula); serializer.serializeSolverToFile(solverBefore, tempFile, compress); final var solverAfter = SolverSerializer.withoutPropositions(FormulaFactory.nonCaching()).deserializeSatSolverFromFile(tempFile, compress); @@ -85,7 +85,7 @@ public void testSatSolverSimple(final boolean compress) throws IOException { @ParameterizedTest @ValueSource(booleans = {false, true}) public void testCardSolverSimple(final boolean compress) throws IOException { - final var solverBefore = SATSolver.newSolver(f, CARD_CONFIG); + final var solverBefore = SatSolver.newSolver(f, CARD_CONFIG); solverBefore.add(formula); serializer.serializeSolverToFile(solverBefore, tempFile, compress); final var solverAfter = SolverSerializer.withoutPropositions(FormulaFactory.nonCaching()).deserializeSatSolverFromFile(tempFile, compress); @@ -96,7 +96,7 @@ public void testCardSolverSimple(final boolean compress) throws IOException { @ParameterizedTest @ValueSource(booleans = {false, true}) public void testSatSolverSolved(final boolean compress) throws IOException { - final var solverBefore = SATSolver.newSolver(f, STAND_CONFIG); + final var solverBefore = SatSolver.newSolver(f, STAND_CONFIG); solverBefore.add(formula); solverBefore.sat(); serializer.serializeSolverToFile(solverBefore, tempFile, compress); @@ -113,7 +113,7 @@ public void testSatSolverSolved(final boolean compress) throws IOException { @ParameterizedTest @ValueSource(booleans = {false, true}) public void testCardSolverSolved(final boolean compress) throws IOException { - final var solverBefore = SATSolver.newSolver(f, CARD_CONFIG); + final var solverBefore = SatSolver.newSolver(f, CARD_CONFIG); solverBefore.add(formula); solverBefore.sat(); serializer.serializeSolverToFile(solverBefore, tempFile, compress); @@ -130,7 +130,7 @@ public void testCardSolverSolved(final boolean compress) throws IOException { @ParameterizedTest @ValueSource(booleans = {false, true}) public void testSatSolverWithProof(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, STAND_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, STAND_PROOF_CONFIG); solverBefore.add(formula); serializer.serializeSolverToFile(solverBefore, tempFile, compress); final FormulaFactory ff = FormulaFactory.caching(); @@ -148,7 +148,7 @@ public void testSatSolverWithProof(final boolean compress) throws IOException, P @ParameterizedTest @ValueSource(booleans = {false, true}) public void testCardSolverWithProof(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, CARD_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, CARD_PROOF_CONFIG); solverBefore.add(formula); serializer.serializeSolverToFile(solverBefore, tempFile, compress); final FormulaFactory ff = FormulaFactory.nonCaching(); @@ -170,7 +170,7 @@ public void testCardSolverWithProof(final boolean compress) throws IOException, @ParameterizedTest @ValueSource(booleans = {false, true}) public void testSatSolverWithStandardPropositions(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, STAND_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, STAND_PROOF_CONFIG); for (int i = 0; i < formula.size(); i++) { solverBefore.add(new StandardProposition("Prop " + i, formula.get(i))); } @@ -191,7 +191,7 @@ public void testSatSolverWithStandardPropositions(final boolean compress) throws @ParameterizedTest @ValueSource(booleans = {false, true}) public void testCardSolverWithStandardPropositions(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, CARD_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, CARD_PROOF_CONFIG); for (int i = 0; i < formula.size(); i++) { solverBefore.add(new StandardProposition("Prop " + i, formula.get(i))); } @@ -212,7 +212,7 @@ public void testCardSolverWithStandardPropositions(final boolean compress) throw @ParameterizedTest @ValueSource(booleans = {false, true}) public void testSatSolverWithCustomPropositions(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, STAND_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, STAND_PROOF_CONFIG); for (int i = 0; i < formula.size(); i++) { solverBefore.add(new ExtendedProposition<>(new CustomBackpack(i), formula.get(i))); } @@ -236,7 +236,7 @@ public void testSatSolverWithCustomPropositions(final boolean compress) throws I @ParameterizedTest @ValueSource(booleans = {false, true}) public void testCardSolverWithCustomPropositions(final boolean compress) throws IOException, ParserException { - final var solverBefore = SATSolver.newSolver(f, CARD_PROOF_CONFIG); + final var solverBefore = SatSolver.newSolver(f, CARD_PROOF_CONFIG); for (int i = 0; i < formula.size(); i++) { solverBefore.add(new ExtendedProposition<>(new CustomBackpack(i), formula.get(i))); } @@ -257,7 +257,7 @@ public void testCardSolverWithCustomPropositions(final boolean compress) throws SolverComparator.compareSolverStates(solverBefore, solverAfter); } - private static void compareSolverModels(final SATSolver solver1, final SATSolver solver2) { + private static void compareSolverModels(final SatSolver solver1, final SatSolver solver2) { solver1.sat(); solver2.sat(); final var model1 = solver1.satCall().model(variables).positiveVariables(); @@ -288,7 +288,7 @@ private CustomBackpack(final int i) { buffer.get(formulaBytes); try { return new ExtendedProposition<>(new CustomBackpack(integer), - Formulas.deserializeFormula(f, ProtoBufFormulas.PBFormulas.parseFrom(formulaBytes))); + Formulas.deserializeFormula(f, ProtoBufFormulas.PbFormulas.parseFrom(formulaBytes))); } catch (InvalidProtocolBufferException e) { throw new RuntimeException(e); } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverComparator.java b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverComparator.java index 6cdef9f9..287bc646 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverComparator.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverComparator.java @@ -12,17 +12,17 @@ import static com.booleworks.logicng.serialization.SolverDatastructureComparator.assertWatchListsEquals; import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver; -import com.booleworks.logicng.solvers.sat.LNGCoreSolver.ProofInformation; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver; +import com.booleworks.logicng.solvers.sat.LngCoreSolver.ProofInformation; public class SolverComparator { - public static void compareSolverStates(final SATSolver solver1, final SATSolver solver2) { - final LNGCoreSolver s1 = solver1.getUnderlyingSolver(); - final LNGCoreSolver s2 = solver2.getUnderlyingSolver(); + public static void compareSolverStates(final SatSolver solver1, final SatSolver solver2) { + final LngCoreSolver s1 = solver1.getUnderlyingSolver(); + final LngCoreSolver s2 = solver2.getUnderlyingSolver(); assertFieldEqual(s1, s2, "config"); assertFieldEqual(s1, s2, "llConfig"); @@ -69,23 +69,23 @@ public static void compareSolverStates(final SATSolver solver1, final SATSolver assertIntVecEquals(getField(s1, "permDiff"), getField(s2, "permDiff")); assertIntVecEquals(getField(s1, "lastDecisionLevel"), getField(s2, "lastDecisionLevel")); assertFieldEqual(s1, s2, "myflag"); - assertFieldEqual(s1, s2, "analyzeLBD"); + assertFieldEqual(s1, s2, "analyzeLbd"); assertFieldEqual(s1, s2, "nbClausesBeforeReduce"); assertFieldEqual(s1, s2, "conflicts"); assertFieldEqual(s1, s2, "conflictsRestarts"); - assertFieldEqual(s1, s2, "sumLBD"); + assertFieldEqual(s1, s2, "sumLbd"); assertFieldEqual(s1, s2, "curRestart"); } - private static void assertFieldEqual(final LNGCoreSolver s1, final LNGCoreSolver s2, final String field) { + private static void assertFieldEqual(final LngCoreSolver s1, final LngCoreSolver s2, final String field) { final Object f1 = getField(s1, field); final Object f2 = getField(s2, field); assertThat(f1).isEqualTo(f2); } - private static void assertProofEqual(final LNGCoreSolver s1, final LNGCoreSolver s2) { - final LNGVector pg1 = getField(s1, "pgOriginalClauses"); - final LNGVector pg2 = getField(s2, "pgOriginalClauses"); + private static void assertProofEqual(final LngCoreSolver s1, final LngCoreSolver s2) { + final LngVector pg1 = getField(s1, "pgOriginalClauses"); + final LngVector pg2 = getField(s2, "pgOriginalClauses"); if (pg1 == null) { assertThat(pg2).isNull(); } @@ -103,8 +103,8 @@ private static void assertProofEqual(final LNGCoreSolver s1, final LNGCoreSolver assertThat(pi1.getProposition()).isEqualTo(pi2.getProposition()); } - final LNGVector proof1 = getField(s1, "pgProof"); - final LNGVector proof2 = getField(s2, "pgProof"); + final LngVector proof1 = getField(s1, "pgProof"); + final LngVector proof2 = getField(s2, "pgProof"); if (proof1 == null) { assertThat(proof2).isNull(); } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructureComparator.java b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructureComparator.java index 1a85f910..f6f4bb24 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructureComparator.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructureComparator.java @@ -5,22 +5,22 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGVector; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGHeap; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; -import com.booleworks.logicng.solvers.datastructures.LNGWatcher; +import com.booleworks.logicng.collections.LngVector; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngHeap; +import com.booleworks.logicng.solvers.datastructures.LngVariable; +import com.booleworks.logicng.solvers.datastructures.LngWatcher; public class SolverDatastructureComparator { - public static void assertClausesEquals(final LNGVector c1, final LNGVector c2) { + public static void assertClausesEquals(final LngVector c1, final LngVector c2) { assertThat(c1.size()).isEqualTo(c2.size()); for (int i = 0; i < c1.size(); i++) { assertClauseEquals(c1.get(i), c2.get(i)); } } - public static void assertClauseEquals(final LNGClause c1, final LNGClause c2) { + public static void assertClauseEquals(final LngClause c1, final LngClause c2) { if (c1 == null && c2 == null) { return; } @@ -38,14 +38,14 @@ public static void assertClauseEquals(final LNGClause c1, final LNGClause c2) { } } - public static void assertVariablesEquals(final LNGVector v1, final LNGVector v2) { + public static void assertVariablesEquals(final LngVector v1, final LngVector v2) { assertThat(v1.size()).isEqualTo(v2.size()); for (int i = 0; i < v1.size(); i++) { assertVariableEquals(v1.get(i), v2.get(i)); } } - public static void assertVariableEquals(final LNGVariable v1, final LNGVariable v2) { + public static void assertVariableEquals(final LngVariable v1, final LngVariable v2) { assertThat(v1.assignment()).isEqualTo(v2.assignment()); assertThat(v1.level()).isEqualTo(v2.level()); assertClauseEquals(v1.reason(), v2.reason()); @@ -55,26 +55,26 @@ public static void assertVariableEquals(final LNGVariable v1, final LNGVariable assertThat(v1.decision()).isEqualTo(v2.decision()); } - public static void assertHeapEquals(final LNGHeap heap1, final LNGHeap heap2) { + public static void assertHeapEquals(final LngHeap heap1, final LngHeap heap2) { CollectionComperator.assertIntVecEquals(heap1.getHeap(), heap2.getHeap()); CollectionComperator.assertIntVecEquals(heap1.getIndices(), heap2.getIndices()); } - public static void assertWatchListsEquals(final LNGVector> w1, final LNGVector> w2) { + public static void assertWatchListsEquals(final LngVector> w1, final LngVector> w2) { assertThat(w1.size()).isEqualTo(w2.size()); for (int i = 0; i < w1.size(); i++) { assertWatchesEquals(w1.get(i), w2.get(i)); } } - public static void assertWatchesEquals(final LNGVector w1, final LNGVector w2) { + public static void assertWatchesEquals(final LngVector w1, final LngVector w2) { assertThat(w1.size()).isEqualTo(w2.size()); for (int i = 0; i < w1.size(); i++) { assertWatchEquals(w1.get(i), w2.get(i)); } } - public static void assertWatchEquals(final LNGWatcher w1, final LNGWatcher w2) { + public static void assertWatchEquals(final LngWatcher w1, final LngWatcher w2) { assertClauseEquals(w1.clause(), w2.clause()); assertThat(w1.blocker()).isEqualTo(w2.blocker()); } diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructuresTest.java b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructuresTest.java index cfb0cce2..ef53021a 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructuresTest.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/SolverDatastructuresTest.java @@ -5,23 +5,23 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.booleworks.logicng.collections.LNGIntVector; -import com.booleworks.logicng.collections.LNGLongVector; +import com.booleworks.logicng.collections.LngIntVector; +import com.booleworks.logicng.collections.LngLongVector; import com.booleworks.logicng.datastructures.Tristate; import com.booleworks.logicng.formulas.FormulaFactory; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedIntQueue; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBBoundedLongQueue; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBClause; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBHeap; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBVariable; -import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PBWatcher; -import com.booleworks.logicng.solvers.SATSolver; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedIntQueue; -import com.booleworks.logicng.solvers.datastructures.LNGBoundedLongQueue; -import com.booleworks.logicng.solvers.datastructures.LNGClause; -import com.booleworks.logicng.solvers.datastructures.LNGHeap; -import com.booleworks.logicng.solvers.datastructures.LNGVariable; -import com.booleworks.logicng.solvers.datastructures.LNGWatcher; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedIntQueue; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbBoundedLongQueue; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbClause; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbHeap; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbVariable; +import com.booleworks.logicng.serialization.ProtoBufSolverDatastructures.PbWatcher; +import com.booleworks.logicng.solvers.SatSolver; +import com.booleworks.logicng.solvers.datastructures.LngBoundedIntQueue; +import com.booleworks.logicng.solvers.datastructures.LngBoundedLongQueue; +import com.booleworks.logicng.solvers.datastructures.LngClause; +import com.booleworks.logicng.solvers.datastructures.LngHeap; +import com.booleworks.logicng.solvers.datastructures.LngVariable; +import com.booleworks.logicng.solvers.datastructures.LngWatcher; import org.junit.jupiter.api.Test; import java.util.HashMap; @@ -33,25 +33,25 @@ public class SolverDatastructuresTest { @Test public void testLngHeap() { final FormulaFactory f = FormulaFactory.caching(); - final SATSolver solver = SATSolver.newSolver(f); + final SatSolver solver = SatSolver.newSolver(f); - final LNGIntVector heapContent = new LNGIntVector(new int[]{1, 3, 5, -7, 9}, 5); - final LNGIntVector indices = new LNGIntVector(new int[]{42, 43, 44}, 3); + final LngIntVector heapContent = new LngIntVector(new int[]{1, 3, 5, -7, 9}, 5); + final LngIntVector indices = new LngIntVector(new int[]{42, 43, 44}, 3); - final LNGHeap heap = new LNGHeap(solver.getUnderlyingSolver(), heapContent, indices); + final LngHeap heap = new LngHeap(solver.getUnderlyingSolver(), heapContent, indices); - final PBHeap serialized = SolverDatastructures.serializeHeap(heap); - final LNGHeap deserialized = SolverDatastructures.deserializeHeap(serialized, solver.getUnderlyingSolver()); + final PbHeap serialized = SolverDatastructures.serializeHeap(heap); + final LngHeap deserialized = SolverDatastructures.deserializeHeap(serialized, solver.getUnderlyingSolver()); CollectionComperator.assertIntVecEquals(heap.getHeap(), deserialized.getHeap()); CollectionComperator.assertIntVecEquals(heap.getIndices(), deserialized.getIndices()); } @Test public void testLngClause() { - final LNGIntVector data = new LNGIntVector(new int[]{1, 3, 5, -7, 9}, 5); - final LNGClause clause = new LNGClause(data, 17, true, 3.3, true, 8990L, true, false, 7); - final PBClause serialized = SolverDatastructures.serializeClause(clause, 47); - final LNGClause deserialized = SolverDatastructures.deserializeClause(serialized); + final LngIntVector data = new LngIntVector(new int[]{1, 3, 5, -7, 9}, 5); + final LngClause clause = new LngClause(data, 17, true, 3.3, true, 8990L, true, false, 7); + final PbClause serialized = SolverDatastructures.serializeClause(clause, 47); + final LngClause deserialized = SolverDatastructures.deserializeClause(serialized); assertThat(deserialized.get(0)).isEqualTo(1); assertThat(deserialized.get(1)).isEqualTo(3); @@ -72,21 +72,21 @@ public void testLngClause() { @Test public void testMsVariable() { - final LNGIntVector data = new LNGIntVector(new int[]{1, 3, 5, -7, 9}, 5); - final LNGClause clause = new LNGClause(data, 17, true, 3.3, true, 8990L, true, false, 7); - final LNGVariable variable = new LNGVariable(true); + final LngIntVector data = new LngIntVector(new int[]{1, 3, 5, -7, 9}, 5); + final LngClause clause = new LngClause(data, 17, true, 3.3, true, 8990L, true, false, 7); + final LngVariable variable = new LngVariable(true); variable.assign(Tristate.UNDEF); variable.setLevel(42); variable.setReason(clause); variable.incrementActivity(23.3); variable.setDecision(true); - final IdentityHashMap clauseMap = new IdentityHashMap<>(); + final IdentityHashMap clauseMap = new IdentityHashMap<>(); clauseMap.put(clause, 42); - final Map reverseMap = new HashMap<>(); + final Map reverseMap = new HashMap<>(); reverseMap.put(42, clause); - final PBVariable serialized = SolverDatastructures.serializeVariable(variable, clauseMap); - final LNGVariable deserialized = SolverDatastructures.deserializeVariable(serialized, reverseMap); + final PbVariable serialized = SolverDatastructures.serializeVariable(variable, clauseMap); + final LngVariable deserialized = SolverDatastructures.deserializeVariable(serialized, reverseMap); assertThat(deserialized.assignment()).isEqualTo(Tristate.UNDEF); assertThat(deserialized.level()).isEqualTo(42); @@ -97,16 +97,16 @@ public void testMsVariable() { @Test public void testLngWatcher() { - final LNGIntVector data = new LNGIntVector(new int[]{1, 3, 5, -7, 9}, 5); - final LNGClause clause = new LNGClause(data, 17, true, 3.3, true, 8990L, true, false, 7); - final LNGWatcher watcher = new LNGWatcher(clause, 42); - final IdentityHashMap clauseMap = new IdentityHashMap<>(); + final LngIntVector data = new LngIntVector(new int[]{1, 3, 5, -7, 9}, 5); + final LngClause clause = new LngClause(data, 17, true, 3.3, true, 8990L, true, false, 7); + final LngWatcher watcher = new LngWatcher(clause, 42); + final IdentityHashMap clauseMap = new IdentityHashMap<>(); clauseMap.put(clause, 42); - final Map reverseMap = new HashMap<>(); + final Map reverseMap = new HashMap<>(); reverseMap.put(42, clause); - final PBWatcher serialized = SolverDatastructures.serializeWatcher(watcher, clauseMap); - final LNGWatcher deserialized = SolverDatastructures.deserializeWatcher(serialized, reverseMap); + final PbWatcher serialized = SolverDatastructures.serializeWatcher(watcher, clauseMap); + final LngWatcher deserialized = SolverDatastructures.deserializeWatcher(serialized, reverseMap); assertThat(deserialized.blocker()).isEqualTo(42); assertThat(deserialized.clause().get(1)).isEqualTo(3); @@ -126,9 +126,9 @@ public void testLngWatcher() { @Test public void testLngBoundedIntQueue() { - final LNGBoundedIntQueue queue = new LNGBoundedIntQueue(new LNGIntVector(new int[]{1, 3, 5, 8}, 4), 1, 3, 5, 17, 42); - final PBBoundedIntQueue serialized = SolverDatastructures.serializeIntQueue(queue); - final LNGBoundedIntQueue deserialized = SolverDatastructures.deserializeIntQueue(serialized); + final LngBoundedIntQueue queue = new LngBoundedIntQueue(new LngIntVector(new int[]{1, 3, 5, 8}, 4), 1, 3, 5, 17, 42); + final PbBoundedIntQueue serialized = SolverDatastructures.serializeIntQueue(queue); + final LngBoundedIntQueue deserialized = SolverDatastructures.deserializeIntQueue(serialized); assertThat(deserialized.getElems().get(0)).isEqualTo(1); assertThat(deserialized.getElems().get(1)).isEqualTo(3); @@ -144,9 +144,9 @@ public void testLngBoundedIntQueue() { @Test public void testLngBoundedLongQueue() { - final LNGBoundedLongQueue queue = new LNGBoundedLongQueue(new LNGLongVector(1, 3, 5, 8), 1, 3, 5, 17, 42); - final PBBoundedLongQueue serialized = SolverDatastructures.serializeLongQueue(queue); - final LNGBoundedLongQueue deserialized = SolverDatastructures.deserializeLongQueue(serialized); + final LngBoundedLongQueue queue = new LngBoundedLongQueue(new LngLongVector(1, 3, 5, 8), 1, 3, 5, 17, 42); + final PbBoundedLongQueue serialized = SolverDatastructures.serializeLongQueue(queue); + final LngBoundedLongQueue deserialized = SolverDatastructures.deserializeLongQueue(serialized); assertThat(deserialized.getElems().get(0)).isEqualTo(1); assertThat(deserialized.getElems().get(1)).isEqualTo(3); diff --git a/serialization/src/test/java/com/booleworks/logicng/serialization/SolversCommonsTest.java b/serialization/src/test/java/com/booleworks/logicng/serialization/SolversCommonsTest.java index f06d7da6..bb43c506 100644 --- a/serialization/src/test/java/com/booleworks/logicng/serialization/SolversCommonsTest.java +++ b/serialization/src/test/java/com/booleworks/logicng/serialization/SolversCommonsTest.java @@ -21,7 +21,7 @@ public void testStack() { for (int i = 0; i < 1000; i++) { stack.push(random.nextInt()); } - final ProtoBufCollections.PBIntVector serialized = serializeStack(stack); + final ProtoBufCollections.PbIntVector serialized = serializeStack(stack); final Stack deserialized = deserializeStack(serialized); assertThat(deserialized).isEqualTo(stack);