3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-01 12:58:54 +00:00

Fix high and medium priority API coherence issues (Go, Java, C++, TypeScript) (#8983)

* Initial plan

* Add missing API functions to Go, Java, C++, and TypeScript bindings

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-03-14 10:46:03 -07:00 committed by GitHub
parent b8e15f2121
commit 21bfb115ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 337 additions and 0 deletions

View file

@ -124,3 +124,33 @@ func (c *Context) MkGt(lhs, rhs *Expr) *Expr {
func (c *Context) MkGe(lhs, rhs *Expr) *Expr {
return newExpr(c, C.Z3_mk_ge(c.ptr, lhs.ptr, rhs.ptr))
}
// MkPower creates an exponentiation expression (base^exp).
func (c *Context) MkPower(base, exp *Expr) *Expr {
return newExpr(c, C.Z3_mk_power(c.ptr, base.ptr, exp.ptr))
}
// MkAbs creates an absolute value expression.
func (c *Context) MkAbs(arg *Expr) *Expr {
return newExpr(c, C.Z3_mk_abs(c.ptr, arg.ptr))
}
// MkInt2Real coerces an integer expression to a real.
func (c *Context) MkInt2Real(arg *Expr) *Expr {
return newExpr(c, C.Z3_mk_int2real(c.ptr, arg.ptr))
}
// MkReal2Int converts a real expression to an integer (floor).
func (c *Context) MkReal2Int(arg *Expr) *Expr {
return newExpr(c, C.Z3_mk_real2int(c.ptr, arg.ptr))
}
// MkIsInt creates a predicate that checks whether a real expression is an integer.
func (c *Context) MkIsInt(arg *Expr) *Expr {
return newExpr(c, C.Z3_mk_is_int(c.ptr, arg.ptr))
}
// MkDivides creates an integer divisibility predicate (t1 divides t2).
func (c *Context) MkDivides(t1, t2 *Expr) *Expr {
return newExpr(c, C.Z3_mk_divides(c.ptr, t1.ptr, t2.ptr))
}