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 @@ -928,28 +928,25 @@ void smt2_convt::convert_expr(const exprt &expr)
928
928
" given expression should have at least two operands" ,
929
929
expr.id_string ());
930
930
931
- out << " (" ;
932
-
933
- if (expr.id ()==ID_concatenation)
934
- out << " concat" ;
935
- else if (expr.id ()==ID_bitand)
936
- out << " bvand" ;
937
- else if (expr.id ()==ID_bitor)
938
- out << " bvor" ;
939
- else if (expr.id ()==ID_bitxor)
940
- out << " bvxor" ;
941
- else if (expr.id ()==ID_bitnand)
942
- out << " bvnand" ;
943
- else if (expr.id ()==ID_bitnor)
944
- out << " bvnor" ;
945
-
946
- forall_operands (it, expr)
947
- {
948
- out << " " ;
949
- flatten2bv (*it);
950
- }
931
+ auto node = make_shared_tree ([&]{
932
+ if (expr.id ()==ID_concatenation)
933
+ return " concat" ;
934
+ else if (expr.id ()==ID_bitand)
935
+ return " bvand" ;
936
+ else if (expr.id ()==ID_bitor)
937
+ return " bvor" ;
938
+ else if (expr.id ()==ID_bitxor)
939
+ return " bvxor" ;
940
+ else if (expr.id ()==ID_bitnand)
941
+ return " bvnand" ;
942
+ else if (expr.id ()==ID_bitnor)
943
+ return " bvnor" ;
944
+ UNREACHABLE;
945
+ }());
951
946
952
- out << " )" ;
947
+ for (const exprt &e : expr.operands ())
948
+ node->add_child (flatten2bv (e));
949
+ print (node, out);
953
950
}
954
951
else if (expr.id ()==ID_bitnot)
955
952
{
You can’t perform that action at this time.
0 commit comments