Skip to content

Commit e492771

Browse files
author
Martin Blicha
committed
Rename method for internalizing terms in LASolver
1 parent d5e57ce commit e492771

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/tsolvers/lasolver/LASolver.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ std::unique_ptr<Tableau::Polynomial> LASolver::expressionToLVarPoly(PTRef term)
279279

280280

281281
//
282-
// Get a possibly new LAVar for a PTRef term. We may assume that the term is of one of the following forms,
283-
// where x is a real variable or ite, and p_i are products of a real variable or ite and a real constant
282+
// Registers an arithmetic Pterm (polynomial) with the solver.
283+
// We may assume that the term is of one of the following forms,
284+
// where x is a variable or ite, and p_i are products of a variable or ite and a constant
284285
//
285286
// (1) x
286287
// (2a) (* x -1)
@@ -289,7 +290,8 @@ std::unique_ptr<Tableau::Polynomial> LASolver::expressionToLVarPoly(PTRef term)
289290
// (4a) (* x -1) + p_1 + ... + p_n
290291
// (4b) (* -1 x) + p_1 + ... + p_n
291292
//
292-
LVRef LASolver::exprToLVar(PTRef expr) {
293+
// Returns internalized reference for the term
294+
LVRef LASolver::registerArithmeticTerm(PTRef expr) {
293295
LVRef x = LVRef::Undef;
294296
if (laVarMapper.hasVar(expr)){
295297
x = getVarForTerm(expr);
@@ -345,7 +347,7 @@ void LASolver::declareAtom(PTRef leq_tr)
345347
// status = INCREMENT;
346348
assert( status == SAT );
347349
PTRef term = logic.getPterm(leq_tr)[1];
348-
exprToLVar(term); // MB: We need to build the representation, but we don't actually need the result
350+
registerArithmeticTerm(term);
349351
updateBound(leq_tr);
350352
}
351353
// DEBUG check
@@ -566,7 +568,7 @@ void LASolver::initSolver()
566568
PTRef term = leq_t[1];
567569

568570
// Ensure that all variables exists, build the polynomial, and update the occurrences.
569-
exprToLVar(term); // MB: We need to build the representation, but we don't actually need the result
571+
registerArithmeticTerm(term);
570572

571573
// Assumes that the LRA variable has been already declared
572574
setBound(leq_tr);

src/tsolvers/lasolver/LASolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class LASolver: public TSolver
131131

132132
LABoundStore::BoundInfo addBound(PTRef leq_tr);
133133
void updateBound(PTRef leq_tr);
134-
LVRef exprToLVar(PTRef expr); // Ensures this term and all variables in it has corresponding LVAR. Returns the LAVar for the term.
134+
LVRef registerArithmeticTerm(PTRef expr); // Ensures this term and all variables in it has corresponding LVAR. Returns the LAVar for the term.
135135
void storeExplanation(Simplex::Explanation &&explanationBounds);
136136

137137
std::unique_ptr<Tableau::Polynomial> expressionToLVarPoly(PTRef term);

0 commit comments

Comments
 (0)