Skip to content

Commit f181e3a

Browse files
NikolajBjornerlevnach
authored andcommitted
add comment on derivation of bound
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent dd19b38 commit f181e3a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/math/lp/bound_analyzer_on_row.h

+22
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,28 @@ namespace lp {
171171
}
172172
}
173173

174+
// total := - sum_{a_j > 0} a_j * ub(x_j) - sum_{a_j < 0} a_j * lb(x_j)
175+
//
176+
// for each a_j* x_j in row,
177+
// bound := total / a_j + ub(x_j) = (total + (a_j * ub(x_j))) / a_j if a_j > 0
178+
// bound := total / a_j + lb(x_j) = (total + (a_j * lb(x_j))) / a_j if a_j < 0
179+
180+
// example
181+
// 3x + 2y + z = 0
182+
// x <= 1, y <= 2, z <= 1
183+
// total = - (3*1 + 2*2 + 1) = -8
184+
// bound := -8/1 + 1 = -7
185+
// => z >= -7
186+
187+
// If all variables are integer (or if x_j is integer).
188+
// let K = lcm(a_j)
189+
//
190+
// totalK = K*total
191+
// sum without x_j: bound := totalK + K * a_j * ub(x_j)
192+
// K*a_j x >= bound
193+
// x >= ceil(bound / K*a_j) = ceil ((total + a_j * ub(x_j)) / a_j) = ceil ((total / a_j) + ub(x_j))
194+
//
195+
174196
void limit_all_monoids_from_below() {
175197
int strict = 0;
176198
m_total = m_rs.x;

0 commit comments

Comments
 (0)