-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic.wrap.go
141 lines (128 loc) · 3.31 KB
/
logic.wrap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Generated by genwrap.go. DO NOT EDIT
package z3
import "runtime"
/*
#cgo LDFLAGS: -lz3
#include <z3.h>
#include <stdlib.h>
*/
import "C"
// Eq returns a Value that is true if l and r are equal.
func (l Bool) Eq(r Bool) Bool {
ctx := l.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_eq(ctx.c, l.c, r.c)
})
runtime.KeepAlive(l)
runtime.KeepAlive(r)
return Bool(val)
}
// NE returns a Value that is true if l and r are not equal.
func (l Bool) NE(r Bool) Bool {
return l.ctx.Distinct(l, r)
}
// Distinct returns a Value that is true if no two vals are equal.
//
// All Values must have the same sort.
func (ctx *Context) Distinct(vals ...Value) Bool {
// Generated from logic.go:68.
cargs := make([]C.Z3_ast, len(vals)+0)
for i, arg := range vals {
cargs[i+0] = arg.impl().c
}
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_distinct(ctx.c, C.uint(len(cargs)), &cargs[0])
})
runtime.KeepAlive(&cargs[0])
return Bool(val)
}
// Not returns the boolean negation of l.
func (l Bool) Not() Bool {
// Generated from logic.go:72.
ctx := l.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_not(ctx.c, l.c)
})
runtime.KeepAlive(l)
return Bool(val)
}
// IfThenElse returns a Value equal to cons if cond is true, otherwise
// alt.
//
// cons and alt must have the same sort. The result will have the same
// sort as cons and alt.
func (cond Bool) IfThenElse(cons Value, alt Value) Value {
// Generated from logic.go:80.
ctx := cond.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_ite(ctx.c, cond.c, cons.impl().c, alt.impl().c)
})
runtime.KeepAlive(cond)
runtime.KeepAlive(cons)
runtime.KeepAlive(alt)
return val.lift(KindUnknown)
}
// Iff returns a Value that is true if l and r are equal (l
// if-and-only-if r).
func (l Bool) Iff(r Bool) Bool {
// Generated from logic.go:85.
ctx := l.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_iff(ctx.c, l.c, r.c)
})
runtime.KeepAlive(l)
runtime.KeepAlive(r)
return Bool(val)
}
// Implies returns a Value that is true if l implies r.
func (l Bool) Implies(r Bool) Bool {
// Generated from logic.go:89.
ctx := l.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_implies(ctx.c, l.c, r.c)
})
runtime.KeepAlive(l)
runtime.KeepAlive(r)
return Bool(val)
}
// Xor returns a Value that is true if l xor r.
func (l Bool) Xor(r Bool) Bool {
// Generated from logic.go:93.
ctx := l.ctx
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_xor(ctx.c, l.c, r.c)
})
runtime.KeepAlive(l)
runtime.KeepAlive(r)
return Bool(val)
}
// And returns a Value that is true if l and all arguments are true.
func (l Bool) And(r ...Bool) Bool {
// Generated from logic.go:97.
ctx := l.ctx
cargs := make([]C.Z3_ast, len(r)+1)
cargs[0] = l.c
for i, arg := range r {
cargs[i+1] = arg.c
}
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_and(ctx.c, C.uint(len(cargs)), &cargs[0])
})
runtime.KeepAlive(&cargs[0])
return Bool(val)
}
// Or returns a Value that is true if l or any argument is true.
func (l Bool) Or(r ...Bool) Bool {
// Generated from logic.go:101.
ctx := l.ctx
cargs := make([]C.Z3_ast, len(r)+1)
cargs[0] = l.c
for i, arg := range r {
cargs[i+1] = arg.c
}
val := wrapValue(ctx, func() C.Z3_ast {
return C.Z3_mk_or(ctx.c, C.uint(len(cargs)), &cargs[0])
})
runtime.KeepAlive(&cargs[0])
return Bool(val)
}