3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 23:26:30 +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

@ -70,3 +70,17 @@ func (c *Context) MkArrayExt(a1, a2 *Expr) *Expr {
func (c *Context) MkAsArray(f *FuncDecl) *Expr {
return newExpr(c, C.Z3_mk_as_array(c.ptr, f.ptr))
}
// MkMap applies a function to the elements of one or more arrays, returning a new array.
// The function f is applied element-wise to the given arrays.
func (c *Context) MkMap(f *FuncDecl, arrays ...*Expr) *Expr {
cArrays := make([]C.Z3_ast, len(arrays))
for i, a := range arrays {
cArrays[i] = a.ptr
}
var cArraysPtr *C.Z3_ast
if len(cArrays) > 0 {
cArraysPtr = &cArrays[0]
}
return newExpr(c, C.Z3_mk_map(c.ptr, f.ptr, C.uint(len(arrays)), cArraysPtr))
}