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