Z3
 
Loading...
Searching...
No Matches
relations.go
Go to the documentation of this file.
1package z3
2
3/*
4#include "z3.h"
5*/
6import "C"
7
8// Special relation constructors
9
10// MkLinearOrder creates a linear (total) order relation over the given sort.
11// The id parameter distinguishes multiple linear orders over the same sort.
12func (c *Context) MkLinearOrder(s *Sort, id uint) *FuncDecl {
13 return newFuncDecl(c, C.Z3_mk_linear_order(c.ptr, s.ptr, C.uint(id)))
14}
15
16// MkPartialOrder creates a partial order relation over the given sort.
17// The id parameter distinguishes multiple partial orders over the same sort.
18func (c *Context) MkPartialOrder(s *Sort, id uint) *FuncDecl {
19 return newFuncDecl(c, C.Z3_mk_partial_order(c.ptr, s.ptr, C.uint(id)))
20}
21
22// MkPiecewiseLinearOrder creates a piecewise linear order relation over the given sort.
23// The id parameter distinguishes multiple piecewise linear orders over the same sort.
24func (c *Context) MkPiecewiseLinearOrder(s *Sort, id uint) *FuncDecl {
25 return newFuncDecl(c, C.Z3_mk_piecewise_linear_order(c.ptr, s.ptr, C.uint(id)))
26}
27
28// MkTreeOrder creates a tree order relation over the given sort.
29// The id parameter distinguishes multiple tree orders over the same sort.
30func (c *Context) MkTreeOrder(s *Sort, id uint) *FuncDecl {
31 return newFuncDecl(c, C.Z3_mk_tree_order(c.ptr, s.ptr, C.uint(id)))
32}
33
34// MkTransitiveClosure creates the transitive closure of a binary relation.
35// The resulting relation is recursive.
36func (c *Context) MkTransitiveClosure(f *FuncDecl) *FuncDecl {
37 return newFuncDecl(c, C.Z3_mk_transitive_closure(c.ptr, f.ptr))
38}