From cf08cdff9c62b8db2805dbd9c4935ccb9569f08d Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 3 Jan 2022 08:54:54 -0800 Subject: [PATCH] #5747 --- src/api/python/z3/z3.py | 4 ++++ src/sat/smt/arith_solver.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/api/python/z3/z3.py b/src/api/python/z3/z3.py index a11061970..2b0286608 100644 --- a/src/api/python/z3/z3.py +++ b/src/api/python/z3/z3.py @@ -8789,6 +8789,10 @@ def Product(*args): _args, sz = _to_ast_array(args) return ArithRef(Z3_mk_mul(ctx.ref(), sz, _args), ctx) +def Abs(arg): + """Create the absolute value of an arithmetic expression""" + return If(arg > 0, arg, -arg) + def AtMost(*args): """Create an at-most Pseudo-Boolean k constraint. diff --git a/src/sat/smt/arith_solver.cpp b/src/sat/smt/arith_solver.cpp index 1fa0606c2..80dea338a 100644 --- a/src/sat/smt/arith_solver.cpp +++ b/src/sat/smt/arith_solver.cpp @@ -1489,6 +1489,7 @@ namespace arith { case OP_MOD: case OP_REM: case OP_DIV: + case OP_IDIV: case OP_POWER: case OP_IS_INT: case OP_TO_INT: