3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-22 08:30:28 +00:00
z3/src/api/go/relations.go
Copilot 1c6943c2cb
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>
2026-05-04 09:29:47 -07:00

38 lines
1.5 KiB
Go

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))
}