Skip to content

Commit a06339f

Browse files
committed
Fixed typos in comments
1 parent 8f9391f commit a06339f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+165
-165
lines changed

src/main/java/org/logicng/backbones/Backbone.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
/**
4848
* This class represents a backbone. A backbone of a formula is a set of literals (positive and/or negative) which
49-
* are present in their respective polarity in every model of the given formula. Therefore the literals must be set
49+
* are present in their respective polarity in every model of the given formula. Therefore, the literals must be set
5050
* accordingly in order for the formula to evaluate to true.
5151
* <p>
5252
* A backbone of a formula has up to three sets of variables

src/main/java/org/logicng/cardinalityconstraints/CCAMOCommander.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private void encodeRecursive() {
125125
}
126126

127127
/**
128-
* Internal non recursive encoding.
128+
* Internal non-recursive encoding.
129129
* @param literals the current literals
130130
*/
131131
private void encodeNonRecursive(final LNGVector<Literal> literals) {

src/main/java/org/logicng/cardinalityconstraints/CCAtLeastK.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public interface CCAtLeastK {
4141
* Builds a cardinality constraint of the form {@code var_1 + var_2 + ... + var_n >= k}.
4242
* @param result the result of the encoding
4343
* @param vars the variables {@code var_1 ... var_n}
44-
* @param rhs the right hand side {@code k} of the constraint
45-
* @throws IllegalArgumentException if the right hand side of the cardinality constraint is negative
44+
* @param rhs the right-hand side {@code k} of the constraint
45+
* @throws IllegalArgumentException if the right-hand side of the cardinality constraint is negative
4646
*/
4747
void build(final EncodingResult result, final Variable[] vars, int rhs);
4848

src/main/java/org/logicng/cardinalityconstraints/CCAtMostK.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public interface CCAtMostK {
4242
* Builds a cardinality constraint of the form {@code var_1 + var_2 + ... + var_n <= k}.
4343
* @param result the result for the encoding
4444
* @param vars the variables {@code var_1 ... var_n}
45-
* @param rhs the right hand side {@code k} of the constraint
46-
* @throws IllegalArgumentException if the right hand side of the cardinality constraint is negative
45+
* @param rhs the right-hand side {@code k} of the constraint
46+
* @throws IllegalArgumentException if the right-hand side of the cardinality constraint is negative
4747
*/
4848
void build(final EncodingResult result, final Variable[] vars, int rhs);
4949

src/main/java/org/logicng/cardinalityconstraints/CCEncoder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ protected void exo(final EncodingResult result, final Variable... vars) {
303303
* Encodes an at-most-k constraint.
304304
* @param result the result
305305
* @param vars the variables of the constraint
306-
* @param rhs the right hand side of the constraint
306+
* @param rhs the right-hand side of the constraint
307307
*/
308308
protected void amk(final EncodingResult result, final Variable[] vars, final int rhs) {
309309
if (rhs < 0) {
@@ -350,7 +350,7 @@ protected void amk(final EncodingResult result, final Variable[] vars, final int
350350
* Encodes an at-most-k constraint for incremental usage.
351351
* @param result the result
352352
* @param vars the variables of the constraint
353-
* @param rhs the right hand side of the constraint
353+
* @param rhs the right-hand side of the constraint
354354
* @return the incremental data
355355
*/
356356
protected CCIncrementalData amkIncremental(final EncodingResult result, final Variable[] vars, final int rhs) {
@@ -398,7 +398,7 @@ protected CCIncrementalData amkIncremental(final EncodingResult result, final Va
398398
* Encodes an at-lest-k constraint.
399399
* @param result the result
400400
* @param vars the variables of the constraint
401-
* @param rhs the right hand side of the constraint
401+
* @param rhs the right-hand side of the constraint
402402
*/
403403
protected void alk(final EncodingResult result, final Variable[] vars, final int rhs) {
404404
if (rhs < 0) {
@@ -452,7 +452,7 @@ protected void alk(final EncodingResult result, final Variable[] vars, final int
452452
* Encodes an at-lest-k constraint for incremental usage.
453453
* @param result the result
454454
* @param vars the variables of the constraint
455-
* @param rhs the right hand side of the constraint
455+
* @param rhs the right-hand side of the constraint
456456
* @return the incremental data
457457
*/
458458
protected CCIncrementalData alkIncremental(final EncodingResult result, final Variable[] vars, final int rhs) {
@@ -507,7 +507,7 @@ protected CCIncrementalData alkIncremental(final EncodingResult result, final Va
507507
* Encodes an exactly-k constraint.
508508
* @param result the result
509509
* @param vars the variables of the constraint
510-
* @param rhs the right hand side of the constraint
510+
* @param rhs the right-hand side of the constraint
511511
*/
512512
protected void exk(final EncodingResult result, final Variable[] vars, final int rhs) {
513513
if (rhs < 0) {
@@ -573,7 +573,7 @@ protected CCAtMostOne bestAMO(final int n) {
573573

574574
/**
575575
* Returns the best at-most-k encoder for a given number of variables. The valuation is based on theoretical and
576-
* practical observations. Currently the modular totalizer is the best encoder for all sizes and therefore is always
576+
* practical observations. Currently, the modular totalizer is the best encoder for all sizes and therefore is always
577577
* chosen.
578578
* @param n the number of variables
579579
* @return the best at-most-one encoder
@@ -587,7 +587,7 @@ protected CCAtMostK bestAMK(final int n) {
587587

588588
/**
589589
* Returns the best at-least-k encoder for a given number of variables. The valuation is based on theoretical and
590-
* practical observations. Currently the modular totalizer is the best encoder for all sizes and therefore is always
590+
* practical observations. Currently, the modular totalizer is the best encoder for all sizes and therefore is always
591591
* chosen.
592592
* @param n the number of variables
593593
* @return the best at-most-one encoder
@@ -601,7 +601,7 @@ protected CCAtLeastK bestALK(final int n) {
601601

602602
/**
603603
* Returns the best exactly-k encoder for a given number of variables. The valuation is based on theoretical and
604-
* practical observations. Currently the totalizer is the best encoder for all sizes and therefore is always
604+
* practical observations. Currently, the totalizer is the best encoder for all sizes and therefore is always
605605
* chosen.
606606
* @param n the number of variables
607607
* @return the best at-most-one encoder

src/main/java/org/logicng/cardinalityconstraints/CCExactlyK.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public interface CCExactlyK {
4141
* Builds a cardinality constraint of the form {@code var_1 + var_2 + ... + var_n = k}.
4242
* @param result the result of the encoding
4343
* @param vars the variables {@code var_1 ... var_n}
44-
* @param rhs the right hand side {@code k} of the constraint
45-
* @throws IllegalArgumentException if the right hand side of the cardinality constraint is negative
44+
* @param rhs the right-hand side {@code k} of the constraint
45+
* @throws IllegalArgumentException if the right-hand side of the cardinality constraint is negative
4646
*/
4747
void build(final EncodingResult result, final Variable[] vars, int rhs);
4848

src/main/java/org/logicng/cardinalityconstraints/CCIncrementalData.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
/**
6262
* Incremental data for an at-most-k cardinality constraint. When an at-most-k cardinality constraint is constructed,
63-
* it is possible to save incremental data with it. Then one can modify the constraint after it is was created by
63+
* it is possible to save incremental data with it. Then one can modify the constraint after it was created by
6464
* tightening the original bound.
6565
* @version 1.1
6666
* @since 1.1
@@ -156,7 +156,7 @@ public List<Formula> newUpperBound(final int rhs) {
156156
* Tightens the upper bound of an at-most-k constraint and encodes it on the solver of the result.
157157
* <p>
158158
* Usage constraints:
159-
* -New right hand side must be smaller than current right hand side.
159+
* -New right-hand side must be smaller than current right-hand side.
160160
* -Cannot be used for at-least-k constraints.
161161
* @param rhs the new upperBound
162162
*/
@@ -227,7 +227,7 @@ public List<Formula> newLowerBound(final int rhs) {
227227
* Tightens the lower bound of an at-least-k constraint and encodes it on the solver of the result.
228228
* <p>
229229
* Usage constraints:
230-
* -New right hand side must be greater than current right hand side.
230+
* -New right-hand side must be greater than current right-hand side.
231231
* -Cannot be used for at-most-k constraints.
232232
* @param rhs the new upperBound
233233
*/
@@ -286,8 +286,8 @@ private void computeLBConstraint(final EncodingResult result, final int rhs) {
286286
}
287287

288288
/**
289-
* Returns the current right hand side of this CCIncrementalData.
290-
* @return the current right hand side of this CCIncrementalData.
289+
* Returns the current right-hand side of this CCIncrementalData.
290+
* @return the current right-hand side of this CCIncrementalData.
291291
*/
292292
public int currentRHS() {
293293
return this.currentRHS;

src/main/java/org/logicng/cardinalityconstraints/CCModularTotalizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public final class CCModularTotalizer {
8888
* Builds an at-most-k constraint.
8989
* @param result the result of the encoding
9090
* @param vars the variables of the constraint
91-
* @param rhs the right hand side of the constraint
91+
* @param rhs the right-hand side of the constraint
9292
*/
9393
void buildAMK(final EncodingResult result, final Variable[] vars, final int rhs) {
9494
final int mod = this.initialize(result, rhs, vars.length);

src/main/java/org/logicng/cardinalityconstraints/CCSorting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private static int directSorterValue(final int n) {
9696

9797
/**
9898
* Generates a sorter encoding for the given input.
99-
* @param m the the counter
99+
* @param m the counter
100100
* @param input the input literals
101101
* @param result the result of the encoding
102102
* @param output the output literals

src/main/java/org/logicng/cardinalityconstraints/CCTotalizer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private enum Bound {LOWER, UPPER, BOTH}
7878
* @param result the result
7979
* @param vars the variables
8080
* @param rhs the right-hand side
81-
* @throws IllegalArgumentException if the right hand side of the constraint was negative
81+
* @throws IllegalArgumentException if the right-hand side of the constraint was negative
8282
*/
8383
void buildAMK(final EncodingResult result, final Variable[] vars, final int rhs) {
8484
final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);
@@ -95,7 +95,7 @@ void buildAMK(final EncodingResult result, final Variable[] vars, final int rhs)
9595
* @param result the result
9696
* @param vars the variables
9797
* @param rhs the right-hand side
98-
* @throws IllegalArgumentException if the right hand side of the constraint was negative
98+
* @throws IllegalArgumentException if the right-hand side of the constraint was negative
9999
*/
100100
void buildALK(final EncodingResult result, final Variable[] vars, final int rhs) {
101101
final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);
@@ -111,7 +111,7 @@ void buildALK(final EncodingResult result, final Variable[] vars, final int rhs)
111111
* Builds an exactly-k constraint.
112112
* @param vars the variables
113113
* @param rhs the right-hand side
114-
* @throws IllegalArgumentException if the right hand side of the constraint was negative
114+
* @throws IllegalArgumentException if the right-hand side of the constraint was negative
115115
*/
116116
void buildEXK(final EncodingResult result, final Variable[] vars, final int rhs) {
117117
final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);

src/main/java/org/logicng/collections/LNGBooleanVector.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public LNGBooleanVector() {
5555
* Creates a vector with a given capacity.
5656
* @param size the capacity of the vector.
5757
*/
58-
public LNGBooleanVector(int size) {
58+
public LNGBooleanVector(final int size) {
5959
this.elements = new boolean[size];
6060
}
6161

@@ -64,7 +64,7 @@ public LNGBooleanVector(int size) {
6464
* @param size the capacity of the vector
6565
* @param pad the initial element
6666
*/
67-
public LNGBooleanVector(int size, boolean pad) {
67+
public LNGBooleanVector(final int size, final boolean pad) {
6868
this.elements = new boolean[size];
6969
Arrays.fill(this.elements, pad);
7070
this.size = size;
@@ -117,7 +117,7 @@ public boolean back() {
117117
* @param element the element to push
118118
*/
119119
public void push(final boolean element) {
120-
int newSize = this.size + 1;
120+
final int newSize = this.size + 1;
121121
this.ensure(newSize);
122122
this.elements[this.size++] = element;
123123
}
@@ -137,7 +137,7 @@ public void unsafePush(final boolean element) {
137137
* @return the element at the position
138138
* @throws ArrayIndexOutOfBoundsException if the position is not found in the vector
139139
*/
140-
public boolean get(int position) {
140+
public boolean get(final int position) {
141141
return this.elements[position];
142142
}
143143

@@ -147,7 +147,7 @@ public boolean get(int position) {
147147
* @param element the element
148148
* @throws ArrayIndexOutOfBoundsException if the position is not found in the vector
149149
*/
150-
public void set(int position, boolean element) {
150+
public void set(final int position, final boolean element) {
151151
this.elements[position] = element;
152152
}
153153

@@ -159,11 +159,11 @@ public void pop() {
159159
}
160160

161161
/**
162-
* Shrinks the vector to a given size if the new size is less then the current size. Otherwise the size remains
162+
* Shrinks the vector to a given size if the new size is less than the current size. Otherwise, the size remains
163163
* the same.
164164
* @param newSize the new size
165165
*/
166-
public void shrinkTo(int newSize) {
166+
public void shrinkTo(final int newSize) {
167167
if (newSize < this.size) {
168168
this.size = newSize;
169169
}
@@ -174,7 +174,7 @@ public void shrinkTo(int newSize) {
174174
* @param size the new size
175175
* @param pad the value for new elements
176176
*/
177-
public void growTo(int size, boolean pad) {
177+
public void growTo(final int size, final boolean pad) {
178178
if (this.size >= size) {
179179
return;
180180
}
@@ -190,7 +190,7 @@ public void growTo(int size, boolean pad) {
190190
* @param num the number of elements to remove.
191191
* @throws ArrayIndexOutOfBoundsException if the number of elements to remove is larger than the size of the vector
192192
*/
193-
public void removeElements(int num) {
193+
public void removeElements(final int num) {
194194
int count = num;
195195
while (count-- > 0) {
196196
this.elements[--this.size] = false;
@@ -202,7 +202,7 @@ public void removeElements(int num) {
202202
*/
203203
public void reverseInplace() {
204204
for (int i = 0; i < this.size / 2; i++) {
205-
boolean temp = this.elements[i];
205+
final boolean temp = this.elements[i];
206206
this.elements[i] = this.elements[this.size - i - 1];
207207
this.elements[this.size() - i - 1] = temp;
208208
}

src/main/java/org/logicng/collections/LNGByteVector.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public LNGByteVector() {
5555
* Creates a vector with a given capacity.
5656
* @param size the capacity of the vector.
5757
*/
58-
public LNGByteVector(int size) {
58+
public LNGByteVector(final int size) {
5959
this.elements = new byte[size];
6060
}
6161

@@ -64,7 +64,7 @@ public LNGByteVector(int size) {
6464
* @param size the capacity of the vector
6565
* @param pad the initial element
6666
*/
67-
public LNGByteVector(int size, byte pad) {
67+
public LNGByteVector(final int size, final byte pad) {
6868
this.elements = new byte[size];
6969
Arrays.fill(this.elements, pad);
7070
this.size = size;
@@ -117,7 +117,7 @@ public int back() {
117117
* @param element the element to push
118118
*/
119119
public void push(final byte element) {
120-
int newSize = this.size + 1;
120+
final int newSize = this.size + 1;
121121
this.ensure(newSize);
122122
this.elements[this.size++] = element;
123123
}
@@ -137,7 +137,7 @@ public void unsafePush(final byte element) {
137137
* @return the element at the position
138138
* @throws ArrayIndexOutOfBoundsException if the position is not found in the vector
139139
*/
140-
public byte get(int position) {
140+
public byte get(final int position) {
141141
return this.elements[position];
142142
}
143143

@@ -147,7 +147,7 @@ public byte get(int position) {
147147
* @param element the element
148148
* @throws ArrayIndexOutOfBoundsException if the position is not found in the vector
149149
*/
150-
public void set(int position, byte element) {
150+
public void set(final int position, final byte element) {
151151
this.elements[position] = element;
152152
}
153153

@@ -159,11 +159,11 @@ public void pop() {
159159
}
160160

161161
/**
162-
* Shrinks the vector to a given size if the new size is less then the current size. Otherwise the size remains
162+
* Shrinks the vector to a given size if the new size is less than the current size. Otherwise, the size remains
163163
* the same.
164164
* @param newSize the new size
165165
*/
166-
public void shrinkTo(int newSize) {
166+
public void shrinkTo(final int newSize) {
167167
if (newSize < this.size) {
168168
this.size = newSize;
169169
}
@@ -174,7 +174,7 @@ public void shrinkTo(int newSize) {
174174
* @param size the new size
175175
* @param pad the value for new elements
176176
*/
177-
public void growTo(int size, byte pad) {
177+
public void growTo(final int size, final byte pad) {
178178
if (this.size >= size) {
179179
return;
180180
}
@@ -190,7 +190,7 @@ public void growTo(int size, byte pad) {
190190
* @param num the number of elements to remove.
191191
* @throws ArrayIndexOutOfBoundsException if the number of elements to remove is larger than the size of the vector
192192
*/
193-
public void removeElements(int num) {
193+
public void removeElements(final int num) {
194194
int count = num;
195195
while (count-- > 0) {
196196
this.elements[--this.size] = -1;
@@ -217,7 +217,7 @@ public void sort() {
217217
public void sortReverse() {
218218
Arrays.sort(this.elements, 0, this.size);
219219
for (int i = 0; i < this.size / 2; i++) {
220-
byte temp = this.elements[i];
220+
final byte temp = this.elements[i];
221221
this.elements[i] = this.elements[this.size - i - 1];
222222
this.elements[this.size - i - 1] = temp;
223223
}

src/main/java/org/logicng/collections/LNGDoublePriorityQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public void rescore(final double factor) {
222222
}
223223

224224
/**
225-
* Compares two elements by their priority and returns whether the first element's priority is less then the second
225+
* Compares two elements by their priority and returns whether the first element's priority is less than the second
226226
* element's priority.
227227
* @param e1 the first element
228228
* @param e2 the second element

0 commit comments

Comments
 (0)