@@ -405,30 +405,17 @@ static obligationst property_obligations_rec(
405405 {
406406 // we expand: p R q <=> q ∧ (p ∨ X(p R q))
407407 auto &R_expr = to_R_expr (property_expr);
408- auto tmp_q =
409- property_obligations_rec (R_expr.rhs (), solver, current, no_timeframes, ns)
410- .conjunction ()
411- .second ;
408+ auto &p = R_expr.lhs ();
409+ auto &q = R_expr.rhs ();
412410
413- auto tmp_p =
414- property_obligations_rec (R_expr.lhs (), solver, current, no_timeframes, ns)
415- .conjunction ()
416- .second ;
411+ // Once we reach the end of the unwinding, we replace X(p R q) by
412+ // true, and hence the expansion becomes "q" only.
413+ exprt expansion = (current + 1 ) < no_timeframes
414+ ? and_exprt{q, or_exprt{p, X_exprt{property_expr}}}
415+ : q;
417416
418- const auto next = current + 1 ;
419- exprt expansion;
420-
421- if (next < no_timeframes)
422- {
423- auto obligations_rec = property_obligations_rec (
424- property_expr, solver, next, no_timeframes, ns);
425- expansion = or_exprt{tmp_p, obligations_rec.conjunction ().second };
426- }
427- else
428- expansion = tmp_p;
429-
430- DATA_INVARIANT (no_timeframes != 0 , " must have timeframe" );
431- return obligationst{no_timeframes - 1 , and_exprt{tmp_q, expansion}};
417+ return property_obligations_rec (
418+ expansion, solver, current, no_timeframes, ns);
432419 }
433420 else if (
434421 property_expr.id () == ID_sva_until_with ||
0 commit comments