Negative numbers do not have to be atoms

This commit is contained in:
Martin Blicha 2023-07-27 14:40:05 +02:00
parent 779db2d84f
commit 4b50f26834

View File

@ -499,7 +499,15 @@ std::optional<std::string> Predicate::expressionToString(smtutil::Expression con
if (smt::isNumber(*_type)) if (smt::isNumber(*_type))
{ {
solAssert(_expr.sort->kind == Kind::Int, ""); solAssert(_expr.sort->kind == Kind::Int, "");
solAssert(_expr.arguments.empty(), ""); solAssert(_expr.arguments.empty() || _expr.name == "-", "");
if (_expr.name == "-")
{
solAssert(_expr.arguments.size() == 1);
smtutil::Expression const& val = _expr.arguments[0];
solAssert(val.sort->kind == Kind::Int && val.arguments.empty());
return "(- " + val.name + ")";
}
if ( if (
_type->category() == Type::Category::Address || _type->category() == Type::Category::Address ||