Skip to content

Commit 370d4c6

Browse files
Convert /* */ comments into //
1 parent 1abbf1e commit 370d4c6

File tree

1 file changed

+39
-56
lines changed

1 file changed

+39
-56
lines changed

src/goto-instrument/cover_instrument_mcdc.cpp

+39-56
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,9 @@ void collect_mcdc_controlling_rec(
120120
}
121121
else
122122
{
123-
/**
124-
* It may happen that ''is_condition(src)'' is valid,
125-
* but we ignore this case here as it can be handled
126-
* by the routine decision/condition detection.
127-
**/
123+
// It may happen that ''is_condition(src)'' is valid,
124+
// but we ignore this case here as it can be handled
125+
// by the routine decision/condition detection.
128126
}
129127
}
130128

@@ -174,11 +172,10 @@ collect_mcdc_controlling_nested(const std::set<exprt> &decisions)
174172
for(auto &src : controlling)
175173
{
176174
std::set<exprt> s1, s2;
177-
/**
178-
* The final controlling conditions resulted from ''src''
179-
* will be stored in ''s1''; ''s2'' is usd to hold the
180-
* temporary expansion.
181-
**/
175+
176+
// The final controlling conditions resulted from ''src''
177+
// will be stored in ''s1''; ''s2'' is usd to hold the
178+
// temporary expansion.
182179
s1.insert(src);
183180

184181
// dual-loop structure to eliminate complex
@@ -204,11 +201,9 @@ collect_mcdc_controlling_nested(const std::set<exprt> &decisions)
204201
for(std::size_t i = 0; i < operands.size(); i++)
205202
{
206203
std::set<exprt> res;
207-
/**
208-
* To expand an operand if it is not atomic,
209-
* and label the ''changed'' flag; the resulted
210-
* expansion of such an operand is stored in ''res''.
211-
**/
204+
// To expand an operand if it is not atomic,
205+
// and label the ''changed'' flag; the resulted
206+
// expansion of such an operand is stored in ''res''.
212207
if(operands[i].id() == ID_not)
213208
{
214209
exprt no = operands[i].op0();
@@ -281,9 +276,7 @@ std::set<signed> sign_of_expr(const exprt &e, const exprt &E)
281276
}
282277
}
283278

284-
/**
285-
* In the general case, we analyze each operand of ''E''.
286-
**/
279+
// In the general case, we analyze each operand of ''E''.
287280
std::vector<exprt> ops;
288281
collect_operands(E, ops);
289282
for(auto &x : ops)
@@ -348,12 +341,10 @@ void remove_repetition(std::set<exprt> &exprs)
348341
for(auto &x : exprs)
349342
{
350343
bool red = false;
351-
/**
352-
* To check if ''x'' is identical with some
353-
* expr in ''new_exprs''. Two exprs ''x''
354-
* and ''y'' are identical iff they have the
355-
* same sign for every atomic condition ''c''.
356-
**/
344+
// To check if ''x'' is identical with some
345+
// expr in ''new_exprs''. Two exprs ''x''
346+
// and ''y'' are identical iff they have the
347+
// same sign for every atomic condition ''c''.
357348
for(auto &y : new_exprs)
358349
{
359350
bool iden = true;
@@ -380,11 +371,9 @@ void remove_repetition(std::set<exprt> &exprs)
380371
}
381372
}
382373
}
383-
/**
384-
* If ''x'' is found identical w.r.t some
385-
* expr in ''new_conditions, we label it
386-
* and break.
387-
**/
374+
// If ''x'' is found identical w.r.t some
375+
// expr in ''new_conditions, we label it
376+
// and break.
388377
if(iden)
389378
{
390379
red = true;
@@ -509,12 +498,10 @@ bool is_mcdc_pair(
509498
eval_expr(atomic_exprs_e2, decision))
510499
return false;
511500

512-
/**
513-
* A mcdc pair of controlling exprs regarding ''c''
514-
* can have different values for only one atomic
515-
* expr, i.e., ''c''. Otherwise, they are not
516-
* a mcdc pair.
517-
**/
501+
// A mcdc pair of controlling exprs regarding ''c''
502+
// can have different values for only one atomic
503+
// expr, i.e., ''c''. Otherwise, they are not
504+
// a mcdc pair.
518505
int diff_count = 0;
519506
auto e1_it = atomic_exprs_e1.begin();
520507
auto e2_it = atomic_exprs_e2.begin();
@@ -577,22 +564,20 @@ void minimize_mcdc_controlling(
577564
{
578565
std::set<exprt> new_controlling;
579566
bool ctrl_update = false;
580-
/**
581-
* Iteratively, we test that after removing an item ''x''
582-
* from the ''controlling'', can a complete mcdc coverage
583-
* over ''decision'' still be reserved?
584-
*
585-
* If yes, we update ''controlling'' with the
586-
* ''new_controlling'' without ''x''; otherwise, we should
587-
* keep ''x'' within ''controlling''.
588-
*
589-
* If in the end all elements ''x'' in ''controlling'' are
590-
* reserved, this means that current ''controlling'' set is
591-
* minimum and the ''while'' loop should be broken out of.
592-
*
593-
* Note: implementation here for the above procedure is
594-
* not (meant to be) optimal.
595-
**/
567+
// Iteratively, we test that after removing an item ''x''
568+
// from the ''controlling'', can a complete mcdc coverage
569+
// over ''decision'' still be reserved?
570+
//
571+
// If yes, we update ''controlling'' with the
572+
// ''new_controlling'' without ''x''; otherwise, we should
573+
// keep ''x'' within ''controlling''.
574+
//
575+
// If in the end all elements ''x'' in ''controlling'' are
576+
// reserved, this means that current ''controlling'' set is
577+
// minimum and the ''while'' loop should be broken out of.
578+
//
579+
// Note: implementation here for the above procedure is
580+
// not (meant to be) optimal.
596581
for(auto &x : controlling)
597582
{
598583
// To create a new ''controlling'' set without ''x''
@@ -607,11 +592,9 @@ void minimize_mcdc_controlling(
607592
for(auto &c : conditions)
608593
{
609594
bool cOK = has_mcdc_pair(c, new_controlling, conditions, decision);
610-
/**
611-
* If there is no mcdc pair for an atomic condition ''c'',
612-
* then ''x'' should not be removed from the original
613-
* ''controlling'' set
614-
**/
595+
// If there is no mcdc pair for an atomic condition ''c'',
596+
// then ''x'' should not be removed from the original
597+
// ''controlling'' set
615598
if(!cOK)
616599
{
617600
removing_x = false;

0 commit comments

Comments
 (0)