From 61098693b47226f56782952d31b651d3658eabd0 Mon Sep 17 00:00:00 2001 From: Daniel Kroening Date: Sun, 1 Dec 2024 09:48:50 +0000 Subject: [PATCH] SMT2: relations on the range type The range type is encoded using binary (using an offset for negative numbers). This adds support for <, <=, >, >= over the range type to the SMT2 backend. --- src/solvers/smt2/smt2_conv.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/solvers/smt2/smt2_conv.cpp b/src/solvers/smt2/smt2_conv.cpp index 2402bb8ca92..44947aa21fc 100644 --- a/src/solvers/smt2/smt2_conv.cpp +++ b/src/solvers/smt2/smt2_conv.cpp @@ -3560,9 +3560,11 @@ void smt2_convt::convert_relation(const binary_relation_exprt &expr) { const typet &op_type=expr.op0().type(); - if(op_type.id()==ID_unsignedbv || - op_type.id()==ID_bv) + if( + op_type.id() == ID_unsignedbv || op_type.id() == ID_bv || + op_type.id() == ID_range) { + // The range type is encoded in binary out << "("; if(expr.id()==ID_le) out << "bvule";