Skip to content

Commit bac5ad6

Browse files
authored
Merge pull request #1144 from diffblue/trans-word-level-sequence-condition
add `sequence_matcht::condition()`
2 parents af3fc71 + b7d2b12 commit bac5ad6

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

src/trans-word-level/property.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static obligationst property_obligations_rec(
558558
{
559559
// The sequence must not match.
560560
if(!match.empty_match())
561-
obligations.add(match.end_time, not_exprt{match.condition});
561+
obligations.add(match.end_time, not_exprt{match.condition()});
562562
}
563563

564564
return obligations;
@@ -629,7 +629,7 @@ static obligationst property_obligations_rec(
629629
for(auto &rhs_obligation : rhs_obligations_rec.map)
630630
{
631631
auto rhs_conjunction = conjunction(rhs_obligation.second);
632-
auto cond = implies_exprt{lhs_match_point.condition, rhs_conjunction};
632+
auto cond = implies_exprt{lhs_match_point.condition(), rhs_conjunction};
633633
result.add(rhs_obligation.first, cond);
634634
}
635635
}
@@ -667,7 +667,7 @@ static obligationst property_obligations_rec(
667667
{
668668
// relies on NNF
669669
t = std::max(t, no_timeframes - 1);
670-
disjuncts.push_back(match.condition);
670+
disjuncts.push_back(match.condition());
671671
}
672672
else
673673
{
@@ -676,7 +676,8 @@ static obligationst property_obligations_rec(
676676
followed_by.consequent(), property_start, no_timeframes)
677677
.conjunction();
678678

679-
disjuncts.push_back(and_exprt{match.condition, obligations_rec.second});
679+
disjuncts.push_back(
680+
and_exprt{match.condition(), obligations_rec.second});
680681
t = std::max(t, obligations_rec.first);
681682
}
682683
}
@@ -704,7 +705,7 @@ static obligationst property_obligations_rec(
704705
// empty matches are not considered
705706
if(!match.empty_match())
706707
{
707-
disjuncts.push_back(match.condition);
708+
disjuncts.push_back(match.condition());
708709
max = std::max(max, match.end_time);
709710
}
710711
}

src/trans-word-level/sequence.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ sequence_matchest instantiate_sequence(
189189

190190
for(auto &rhs_match : rhs_matches)
191191
{
192-
auto cond = and_exprt{lhs_match.condition, rhs_match.condition};
192+
auto cond = and_exprt{lhs_match.condition(), rhs_match.condition()};
193193
result.push_back({rhs_match.end_time, cond});
194194
}
195195
}
@@ -221,7 +221,7 @@ sequence_matchest instantiate_sequence(
221221
{
222222
result.emplace_back(
223223
lhs_match.end_time,
224-
and_exprt{lhs_match.condition, rhs_match.condition});
224+
and_exprt{lhs_match.condition(), rhs_match.condition()});
225225
}
226226
}
227227
}
@@ -276,7 +276,7 @@ sequence_matchest instantiate_sequence(
276276

277277
for(auto &rhs_match : rhs_matches)
278278
{
279-
exprt::operandst conjuncts = {rhs_match.condition};
279+
exprt::operandst conjuncts = {rhs_match.condition()};
280280

281281
for(mp_integer new_t = t; new_t <= rhs_match.end_time; ++new_t)
282282
{
@@ -315,7 +315,7 @@ sequence_matchest instantiate_sequence(
315315
if(match_lhs.end_time <= match_rhs.end_time)
316316
{
317317
// return the rhs end_time
318-
auto cond = and_exprt{match_lhs.condition, match_rhs.condition};
318+
auto cond = and_exprt{match_lhs.condition(), match_rhs.condition()};
319319
result.emplace_back(match_rhs.end_time, std::move(cond));
320320
}
321321
}
@@ -343,7 +343,7 @@ sequence_matchest instantiate_sequence(
343343
for(auto &match_rhs : matches_rhs)
344344
{
345345
auto end_time = std::max(match_lhs.end_time, match_rhs.end_time);
346-
auto cond = and_exprt{match_lhs.condition, match_rhs.condition};
346+
auto cond = and_exprt{match_lhs.condition(), match_rhs.condition()};
347347
result.emplace_back(std::move(end_time), std::move(cond));
348348
}
349349

src/trans-word-level/sequence.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,27 @@ class sequence_matcht
2020
public:
2121
sequence_matcht(mp_integer __end_time, exprt __condition)
2222
: _is_empty_match(false),
23-
end_time(std::move(__end_time)),
24-
condition(std::move(__condition))
23+
_condition(std::move(__condition)),
24+
end_time(std::move(__end_time))
2525
{
2626
}
2727

28+
exprt condition() const
29+
{
30+
return _condition;
31+
}
32+
2833
bool empty_match() const
2934
{
3035
return _is_empty_match;
3136
}
3237

3338
protected:
3439
bool _is_empty_match;
40+
exprt _condition;
3541

3642
public:
3743
mp_integer end_time;
38-
exprt condition;
3944

4045
static sequence_matcht empty_match(mp_integer end_time)
4146
{

0 commit comments

Comments
 (0)