diff --git a/src/api/java/Optimize.java b/src/api/java/Optimize.java index c5a26b439..d72a28f08 100644 --- a/src/api/java/Optimize.java +++ b/src/api/java/Optimize.java @@ -173,10 +173,21 @@ public class Optimize extends Z3Object { * **/ public Handle AssertSoft(Expr constraint, int weight, String group) + { + return AssertSoft(constraint, Integer.toString(weight), group); + } + + /** + * Assert soft constraint + * + * Return an objective which associates with the group of constraints. + * + **/ + public Handle AssertSoft(Expr constraint, String weight, String group) { getContext().checkContextMatch(constraint); Symbol s = getContext().mkSymbol(group); - return new Handle<>(this, Native.optimizeAssertSoft(getContext().nCtx(), getNativeObject(), constraint.getNativeObject(), Integer.toString(weight), s.getNativeObject())); + return new Handle<>(this, Native.optimizeAssertSoft(getContext().nCtx(), getNativeObject(), constraint.getNativeObject(), weight, s.getNativeObject())); } /**