akiellor / z3go

A Golang wrapper for the Z3 SMT solver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

z3go: A Z3 wrapper for Golang

Build Status

z3go is a wrapper library for the Z3 SMT-solver. It uses SWIG.

Installation

Make sure that you have Z3 installed. (On mac brew install z3)

# Set the include and library path if needed
# For macOS and Z3 installed using homebrew
export CGO_CPPFLAGS="-I/usr/local/Cellar/z3/4.5.0/include"
export CGO_LDFLAGS="-L/usr/local/Cellar/z3/4.5.0/lib"

go install github.com/akreuzer/z3go

Documentation

z3go is a wrapper of the C++ interface of Z3. We started translation the examples for the Z3 C++ interface to to Go. The can be found in the examples/ folder.

We renamed operator that clashed with the Go-Syntax.

C++ Name z3go
! Not
|| Or
&& And
== Equals
!= NotEquals
< Less
<= LessEq
> Greater
>= GreaterEq
+ Add
- Subtract
* Mult
/ Div
model[i] model.Get(i)
f(x) f.ApplyFct(x)
^ BXor (Bitwise xor)
| BOr
& BAnd
~ BComp (Bitwise complement)
& (Tactics) TacticAnd
| (Tactics) TacticOr
&&, ||, <,... (Probe) ProbeAnd, ProbeOr, ProbeLess, ...

Hacking

Edit z3++.h and then use go generate to call SWIG.

About

A Golang wrapper for the Z3 SMT solver

License:Other


Languages

Language:C++ 59.6%Language:Go 40.4%