mirror of
https://github.com/Z3Prover/z3
synced 2026-06-26 18:38:47 +00:00
fix issues 1-10: add missing API bindings across Go, Julia, TypeScript, OCaml, and Java (#9432)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/b89f3b76-dfd7-47ec-97dd-8ae5e8e88a4a 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:
parent
eefb644c93
commit
1c6943c2cb
9 changed files with 356 additions and 0 deletions
38
src/api/go/relations.go
Normal file
38
src/api/go/relations.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package z3
|
||||
|
||||
/*
|
||||
#include "z3.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
// Special relation constructors
|
||||
|
||||
// MkLinearOrder creates a linear (total) order relation over the given sort.
|
||||
// The id parameter distinguishes multiple linear orders over the same sort.
|
||||
func (c *Context) MkLinearOrder(s *Sort, id uint) *FuncDecl {
|
||||
return newFuncDecl(c, C.Z3_mk_linear_order(c.ptr, s.ptr, C.uint(id)))
|
||||
}
|
||||
|
||||
// MkPartialOrder creates a partial order relation over the given sort.
|
||||
// The id parameter distinguishes multiple partial orders over the same sort.
|
||||
func (c *Context) MkPartialOrder(s *Sort, id uint) *FuncDecl {
|
||||
return newFuncDecl(c, C.Z3_mk_partial_order(c.ptr, s.ptr, C.uint(id)))
|
||||
}
|
||||
|
||||
// MkPiecewiseLinearOrder creates a piecewise linear order relation over the given sort.
|
||||
// The id parameter distinguishes multiple piecewise linear orders over the same sort.
|
||||
func (c *Context) MkPiecewiseLinearOrder(s *Sort, id uint) *FuncDecl {
|
||||
return newFuncDecl(c, C.Z3_mk_piecewise_linear_order(c.ptr, s.ptr, C.uint(id)))
|
||||
}
|
||||
|
||||
// MkTreeOrder creates a tree order relation over the given sort.
|
||||
// The id parameter distinguishes multiple tree orders over the same sort.
|
||||
func (c *Context) MkTreeOrder(s *Sort, id uint) *FuncDecl {
|
||||
return newFuncDecl(c, C.Z3_mk_tree_order(c.ptr, s.ptr, C.uint(id)))
|
||||
}
|
||||
|
||||
// MkTransitiveClosure creates the transitive closure of a binary relation.
|
||||
// The resulting relation is recursive.
|
||||
func (c *Context) MkTransitiveClosure(f *FuncDecl) *FuncDecl {
|
||||
return newFuncDecl(c, C.Z3_mk_transitive_closure(c.ptr, f.ptr))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue