mitchellh / go-z3 Goto Github PK
View Code? Open in Web Editor NEWGo (golang) bindings to the Z3 SMT Solver
License: MIT License
Go (golang) bindings to the Z3 SMT Solver
License: MIT License
...
Checking code with gofmt..
gofmt -s *.go >/dev/null
go test -v
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ./libz3.a(hwf.o): undefined reference to symbol 'fesetround@@GLIBC_2.2.5'
/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
FAIL _/home/vyrus/src/go-z3 [build failed]
make: *** [Makefile:25: test] Error 2
Linux 4.9.18-hardened #13 SMP Wed Apr 5 15:04:14 PDT 2017 x86_64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz GenuineIntel GNU/Linux
go version devel +03c3bb5f84 Sat Sep 2 21:00:08 2017 +0000 linux/amd64
I built the projekt with make
on Mac Os 11.1 BigSur. It builds fine but when testing I get the following error:
=== RUN TestContextErrorHandler
error_test.go:29: should call error handler
--- FAIL: TestContextErrorHandler (0.00s)
=== RUN TestModelAssignments
model_test.go:20:
AST:
(= (+ x 4) 16)
model_test.go:38:
Model:
x -> 12
model_test.go:43: Assignment: 12
--- PASS: TestModelAssignments (0.02s)
=== RUN TestModelEval
model_test.go:62:
AST:
(= (+ x 4) 16)
model_test.go:80:
Model:
x -> 12
model_test.go:84: Assignment: 12
--- PASS: TestModelEval (0.02s)
=== RUN TestSolver
solver_test.go:20:
AST:
(xor x y)
solver_test.go:38:
Model:
y -> false
x -> true
--- PASS: TestSolver (0.02s)
=== RUN TestSymbol
--- PASS: TestSymbol (0.00s)
=== RUN ExampleBasicMath
--- PASS: ExampleBasicMath (0.02s)
=== RUN ExampleDemorgan
--- PASS: ExampleDemorgan (0.02s)
=== RUN ExampleFindModel2
--- FAIL: ExampleFindModel2 (0.02s)
got:
Solving part 1
x = 0
y = 1
Solving part 2
x = (- 1)
y = 0
want:
Solving part 1
x = 0
y = 1
Solving part 2
x = 0
y = 1
FAIL
exit status 1
FAIL github.com/mitchellh/go-z3 0.501s
Following the instruction, I build Z3 first and then go get this project. However, there is an error saying:
mitchellh\[email protected]\ast.go:4:
./go-z3.h:11:10: fatal error: z3.h: No such file or directory
#include <z3.h>
^~~~~~
Thanks a lot for answering.
Problem 1
$ go build
# _/.../go-z3
./error.go:53:20: could not determine kind of name for C.Z3_get_error_msg_ex
Solution: rename C.Z3_get_error_msg_ex
to C.Z3_get_error_msg
Problem 2
$ go build
# _/.../go-z3
/usr/bin/ld: ./libz3.a(hwf.o): référence au symbole non défini « fma@@GLIBC_2.2.5 »
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO manquant dans la ligne de commande
collect2: error: ld returned 1 exit status
Solution:
$ ln -s vendor/z3/build/libz3.so ./
$ cat z3.go.patch
-// #cgo LDFLAGS: ${SRCDIR}/libz3.a -lstdc++
+// #cgo LDFLAGS: ${SRCDIR}/libz3.so -lstdc++
Problem 3
$ go build
# _/.../go-z3-fork
./model.go:37:101: cannot convert _Ciconst_Z3_TRUE (type untyped number) to type _Ctype__Bool
./model.go:37:101: invalid operation: (func literal)() != _Ciconst_Z3_TRUE (mismatched types _Ctype__Bool and int)
./model.go:37:57: cannot use _Ciconst_Z3_TRUE (type int) as type _Ctype__Bool in assignment
./optimize.go:73:34: not enough arguments in call to _Cfunc_Z3_optimize_check
have (_Ctype_Z3_context, _Ctype_Z3_optimize)
want (*_Ctype_struct__Z3_context, *_Ctype_struct__Z3_optimize, _Ctype_uint, *_Ctype_Z3_ast)
Solution: don't know 😕
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.