Skip to content

Commit 4cddd64

Browse files
committed
SVA-to-Buechi: if
This adds support for if-expressions to the SVA-to-Buechi translation.
1 parent 1ef4ad1 commit 4cddd64

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/temporal-logic/ltl_sva_to_string.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,14 @@ ltl_sva_to_stringt::rec(const exprt &expr, modet mode)
393393
PRECONDITION(mode == SVA_SEQUENCE);
394394
return suffix("[+]", expr, mode);
395395
}
396+
else if(expr.id() == ID_if)
397+
{
398+
// c ? x : y ---> (c∧x)∨(¬c∧y)
399+
auto &if_expr = to_if_expr(expr);
400+
auto a1 = and_exprt{if_expr.cond(), if_expr.true_case()};
401+
auto a2 = and_exprt{not_exprt{if_expr.cond()}, if_expr.false_case()};
402+
return rec(or_exprt{a1, a2}, mode);
403+
}
396404
else if(!is_temporal_operator(expr))
397405
{
398406
auto number = atoms.number(expr);

0 commit comments

Comments
 (0)