@@ -49,24 +49,24 @@ DisjunctionConstraint::DisjunctionConstraint( const String &serializedDisjunctio
4949 ( 5 , serializedDisjunction.length () - 5 );
5050 List<String> values = serializedValues.tokenize ( " ," );
5151 auto val = values.begin ();
52- unsigned numDisjuncts = atoi (val->ascii ());
52+ unsigned numDisjuncts = atoi ( val->ascii () );
5353 ++val;
5454 for ( unsigned i = 0 ; i < numDisjuncts; ++i )
5555 {
5656 PiecewiseLinearCaseSplit split;
57- unsigned numBounds = atoi (val->ascii ());
57+ unsigned numBounds = atoi ( val->ascii () );
5858 ++val;
5959 for ( unsigned bi = 0 ; bi < numBounds; ++bi )
6060 {
61- Tightening::BoundType type = ( *val == " l" ) ? Tightening::LB : Tightening::UB;
61+ Tightening::BoundType type = ( *val == " l" ) ? Tightening::LB : Tightening::UB;
6262 ++val;
63- unsigned var = atoi (val->ascii ());
63+ unsigned var = atoi ( val->ascii () );
6464 ++val;
65- double bd = atof (val->ascii ());
65+ double bd = atof ( val->ascii () );
6666 ++val;
67- split.storeBoundTightening ( Tightening (var, bd, type) );
67+ split.storeBoundTightening ( Tightening ( var, bd, type ) );
6868 }
69- unsigned numEquations = atoi (val->ascii ());
69+ unsigned numEquations = atoi ( val->ascii () );
7070
7171 ++val;
7272 for ( unsigned ei = 0 ; ei < numEquations; ++ei )
@@ -78,29 +78,29 @@ DisjunctionConstraint::DisjunctionConstraint( const String &serializedDisjunctio
7878 type = Equation::GE;
7979 else
8080 {
81- ASSERT ( *val == " e" );
81+ ASSERT ( *val == " e" );
8282 }
83- Equation eq (type);
83+ Equation eq ( type );
8484 ++val;
85- unsigned numAddends = atoi (val->ascii ());
85+ unsigned numAddends = atoi ( val->ascii () );
8686 ++val;
8787 for ( unsigned ai = 0 ; ai < numAddends; ++ai )
8888 {
89- double coef = atof (val->ascii ());
89+ double coef = atof ( val->ascii () );
9090 ++val;
91- unsigned var = atoi (val->ascii ());
91+ unsigned var = atoi ( val->ascii () );
9292 ++val;
9393 eq.addAddend ( coef, var );
9494 }
95- eq.setScalar (atof (val->ascii ()) );
95+ eq.setScalar ( atof ( val->ascii () ) );
9696 ++val;
97- split.addEquation (eq );
97+ split.addEquation ( eq );
9898 }
99- disjuncts.append (split);
99+ disjuncts.append ( split );
100100 }
101101 _disjuncts = disjuncts;
102102
103- for ( unsigned ind = 0 ; ind < disjuncts.size (); ++ind )
103+ for ( unsigned ind = 0 ; ind < disjuncts.size (); ++ind )
104104 _feasibleDisjuncts.append ( ind );
105105
106106 extractParticipatingVariables ();
@@ -151,11 +151,11 @@ void DisjunctionConstraint::notifyLowerBound( unsigned variable, double bound )
151151
152152 if ( _boundManager == nullptr && existsLowerBound ( variable ) &&
153153 !FloatUtils::gt ( bound, getLowerBound ( variable ) ) )
154- return ;
154+ return ;
155155
156156 setLowerBound ( variable, bound );
157157
158- // TODO: Maintain a mapping from variables to disjuncts and only check relevant
158+ // TODO: Maintain a mapping from variables to disjuncts and only check relevant
159159 // disjuncts for feasibility
160160 updateFeasibleDisjuncts ();
161161}
@@ -167,11 +167,11 @@ void DisjunctionConstraint::notifyUpperBound( unsigned variable, double bound )
167167
168168 if ( _boundManager == nullptr && existsUpperBound ( variable ) &&
169169 !FloatUtils::lt ( bound, getUpperBound ( variable ) ) )
170- return ;
170+ return ;
171171
172172 setUpperBound ( variable, bound );
173173
174- // TODO: Maintain a mapping from variables to disjuncts and only check relevant
174+ // TODO: Maintain a mapping from variables to disjuncts and only check relevant
175175 // disjuncts for feasibility
176176 updateFeasibleDisjuncts ();
177177}
@@ -207,7 +207,7 @@ List<PiecewiseLinearConstraint::Fix> DisjunctionConstraint::getPossibleFixes() c
207207 return List<PiecewiseLinearConstraint::Fix>();
208208}
209209
210- List<PiecewiseLinearConstraint::Fix> DisjunctionConstraint::getSmartFixes ( ITableau */* tableau */ ) const
210+ List<PiecewiseLinearConstraint::Fix> DisjunctionConstraint::getSmartFixes ( ITableau * /* tableau */ ) const
211211{
212212 // Reluplex does not currently work with Gurobi.
213213 ASSERT ( _gurobi == NULL );
@@ -230,29 +230,28 @@ List<PhaseStatus> DisjunctionConstraint::getAllCases() const
230230
231231PiecewiseLinearCaseSplit DisjunctionConstraint::getCaseSplit ( PhaseStatus phase ) const
232232{
233- ASSERT ( phase != PHASE_NOT_FIXED );
234- return _disjuncts.get ( phaseStatusToInd ( phase ) );
233+ ASSERT ( phase != PHASE_NOT_FIXED );
234+ return _disjuncts.get ( phaseStatusToInd ( phase ) );
235235}
236236
237237PhaseStatus DisjunctionConstraint::getPhaseStatus () const
238238{
239- ASSERT ( phaseFixed () );
239+ ASSERT ( phaseFixed () );
240240 return indToPhaseStatus ( *_feasibleDisjuncts.begin () );
241241}
242242
243243PiecewiseLinearCaseSplit DisjunctionConstraint::getImpliedCaseSplit () const
244244{
245- ASSERT ( isImplication () );
246- return _disjuncts.get ( phaseStatusToInd ( getImpliedCase () ) );
245+ ASSERT ( isImplication () );
246+ return _disjuncts.get ( phaseStatusToInd ( getImpliedCase () ) );
247247}
248248
249249PiecewiseLinearCaseSplit DisjunctionConstraint::getValidCaseSplit () const
250250{
251251 return getImpliedCaseSplit ();
252252}
253253
254- void DisjunctionConstraint::transformToUseAuxVariables ( InputQuery
255- &inputQuery )
254+ void DisjunctionConstraint::transformToUseAuxVariables ( InputQuery &inputQuery )
256255{
257256 Vector<PiecewiseLinearCaseSplit> newDisjuncts;
258257 for ( const auto &disjunct : _disjuncts )
@@ -390,39 +389,39 @@ bool DisjunctionConstraint::constraintObsolete() const
390389 return false ; // A Disjunction is obsolete only when a literal is always true.
391390}
392391
393- void DisjunctionConstraint::getEntailedTightenings ( List<Tightening> &/* tightenings */ ) const
392+ void DisjunctionConstraint::getEntailedTightenings ( List<Tightening> & /* tightenings */ ) const
394393{
395394}
396395
397396String DisjunctionConstraint::serializeToString () const
398397{
399398 String s = " disj," ;
400- s += Stringf (" %u," , _disjuncts.size ());
399+ s += Stringf ( " %u," , _disjuncts.size () );
401400 for ( const auto &disjunct : _disjuncts )
402401 {
403- s += Stringf (" %u," , disjunct.getBoundTightenings ().size ());
402+ s += Stringf ( " %u," , disjunct.getBoundTightenings ().size () );
404403 for ( const auto &bound : disjunct.getBoundTightenings () )
405404 {
406405 if ( bound._type == Tightening::LB )
407- s += Stringf (" l,%u,%f," , bound._variable , bound._value );
406+ s += Stringf ( " l,%u,%f," , bound._variable , bound._value );
408407 else if ( bound._type == Tightening::UB )
409- s += Stringf (" u,%u,%f," , bound._variable , bound._value );
408+ s += Stringf ( " u,%u,%f," , bound._variable , bound._value );
410409 }
411- s += Stringf (" %u," , disjunct.getEquations ().size ());
410+ s += Stringf ( " %u," , disjunct.getEquations ().size () );
412411 for ( const auto &equation : disjunct.getEquations () )
413412 {
414413 if ( equation._type == Equation::LE )
415- s += Stringf (" l," );
414+ s += Stringf ( " l," );
416415 else if ( equation._type == Equation::GE )
417- s += Stringf (" g," );
416+ s += Stringf ( " g," );
418417 else
419- s += Stringf (" e," );
420- s += Stringf (" %u," , equation._addends .size ());
418+ s += Stringf ( " e," );
419+ s += Stringf ( " %u," , equation._addends .size () );
421420 for ( const auto &addend : equation._addends )
422421 {
423- s += Stringf (" %f,%u," , addend._coefficient , addend._variable );
422+ s += Stringf ( " %f,%u," , addend._coefficient , addend._variable );
424423 }
425- s += Stringf (" %f," , equation._scalar );
424+ s += Stringf ( " %f," , equation._scalar );
426425 }
427426 }
428427 return s;
@@ -495,7 +494,7 @@ void DisjunctionConstraint::updateFeasibleDisjuncts()
495494
496495 for ( unsigned ind = 0 ; ind < _disjuncts.size (); ++ind )
497496 {
498- if ( caseSplitIsFeasible ( _disjuncts.get ( ind ) ) )
497+ if ( caseSplitIsFeasible ( _disjuncts.get ( ind ) ) )
499498 _feasibleDisjuncts.append ( ind );
500499 }
501500 }
0 commit comments