File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change 22
22
#include < util/invariant.h>
23
23
#include < util/mathematical_expr.h>
24
24
#include < util/pointer_offset_size.h>
25
+ #include < util/range.h>
25
26
#include < util/std_expr.h>
26
27
#include < util/std_types.h>
27
28
#include < util/string2int.h>
@@ -1855,11 +1856,28 @@ void smt2_convt::convert_expr(const exprt &expr)
1855
1856
else if (expr.id ()==ID_let)
1856
1857
{
1857
1858
const let_exprt &let_expr=to_let_expr (expr);
1858
- out << " (let ((" ;
1859
- convert_expr (let_expr.symbol ());
1860
- out << ' ' ;
1861
- convert_expr (let_expr.value ());
1862
- out << " )) " ;
1859
+ const auto &variables = let_expr.variables ();
1860
+ const auto &values = let_expr.values ();
1861
+
1862
+ out << " (let (" ;
1863
+ bool first = true ;
1864
+
1865
+ for (auto &binding : make_range (variables).zip (values))
1866
+ {
1867
+ if (first)
1868
+ first = false ;
1869
+ else
1870
+ out << ' ' ;
1871
+
1872
+ out << ' (' ;
1873
+ convert_expr (binding.first );
1874
+ out << ' ' ;
1875
+ convert_expr (binding.second );
1876
+ out << ' )' ;
1877
+ }
1878
+
1879
+ out << " ) " ; // bindings
1880
+
1863
1881
convert_expr (let_expr.where ());
1864
1882
out << ' )' ; // let
1865
1883
}
You can’t perform that action at this time.
0 commit comments