File tree Expand file tree Collapse file tree 1 file changed +18
-21
lines changed Expand file tree Collapse file tree 1 file changed +18
-21
lines changed Original file line number Diff line number Diff line change @@ -910,28 +910,25 @@ void smt2_convt::convert_expr(const exprt &expr)
910
910
" given expression should have at least two operands" ,
911
911
expr.id_string ());
912
912
913
- out << " (" ;
914
-
915
- if (expr.id ()==ID_concatenation)
916
- out << " concat" ;
917
- else if (expr.id ()==ID_bitand)
918
- out << " bvand" ;
919
- else if (expr.id ()==ID_bitor)
920
- out << " bvor" ;
921
- else if (expr.id ()==ID_bitxor)
922
- out << " bvxor" ;
923
- else if (expr.id ()==ID_bitnand)
924
- out << " bvnand" ;
925
- else if (expr.id ()==ID_bitnor)
926
- out << " bvnor" ;
927
-
928
- forall_operands (it, expr)
929
- {
930
- out << " " ;
931
- flatten2bv (*it);
932
- }
913
+ auto node = make_shared_tree ([&]{
914
+ if (expr.id ()==ID_concatenation)
915
+ return " concat" ;
916
+ else if (expr.id ()==ID_bitand)
917
+ return " bvand" ;
918
+ else if (expr.id ()==ID_bitor)
919
+ return " bvor" ;
920
+ else if (expr.id ()==ID_bitxor)
921
+ return " bvxor" ;
922
+ else if (expr.id ()==ID_bitnand)
923
+ return " bvnand" ;
924
+ else if (expr.id ()==ID_bitnor)
925
+ return " bvnor" ;
926
+ UNREACHABLE;
927
+ }());
933
928
934
- out << " )" ;
929
+ for (const exprt &e : expr.operands ())
930
+ node->add_child (flatten2bv (e));
931
+ print (node, out);
935
932
}
936
933
else if (expr.id ()==ID_bitnot)
937
934
{
You can’t perform that action at this time.
0 commit comments