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: