Yices 2 SMT solver binding for OCaml
  • C 67.1%
  • PostScript 17.6%
  • SMT 10.4%
  • Shell 2.7%
  • TeX 1.2%
  • Other 1%
Find a file
polazarus 25d4a4126c Merge pull request #4 from maelvalais/master
Revamp libyices buildsystem to make it work for Windows builds
2017-06-11 03:37:53 +02:00
autoconf ocamlyices2: only build the static stub using static libgmp.a. 2017-05-05 16:18:46 +02:00
doc Add doc generation Makefile target 2014-09-25 23:18:11 +02:00
examples ocamlyices2: fixed examples/ (the API had apparently changed) 2017-05-05 16:17:17 +02:00
ext libyices: re-add LT_STATIC_CFLAGS and LT_SHARED_CFLAGS in ltmain.sh 2017-05-07 12:10:24 +02:00
int Fix names in errors.h generator 2014-09-20 21:23:16 +02:00
src ocamlyices2: ssize_t defined in <unistd.h> on opensuze/alpine 2017-05-05 16:19:27 +02:00
tests ocamlyices2: checkoverflow test: fixed the the 'is_long_int' test on 32bit arch 2017-05-05 16:18:46 +02:00
.gitignore ocamlyices2: renamed 'ocamlyices2' to 'yices2', use ocamlmklib, add oUnit 2017-05-05 16:17:03 +02:00
.merlin ocamlyices2: renamed 'ocamlyices2' to 'yices2', use ocamlmklib, add oUnit 2017-05-05 16:17:03 +02:00
.travis-install.sh appveyor/travis-ci: add osx+win build and upload sha256 on release 2017-05-05 16:19:28 +02:00
.travis-script.sh travis,appveyor: remove installed yices2 in case previous build failed 2017-05-07 12:09:47 +02:00
.travis.yml appveyor: upload tarball with libgmp.a and gmp.h (mingw32) 2017-05-07 12:10:24 +02:00
appveyor-script.sh appveyor: upload tarball with libgmp.a and gmp.h (mingw32) 2017-05-07 12:10:24 +02:00
appveyor.yml appveyor: upload tarball with libgmp.a and gmp.h (mingw32) 2017-05-07 12:10:24 +02:00
configure ocamlyices2: bump to version v0.0.3 2017-05-07 12:10:24 +02:00
configure.ac ocamlyices2: bump to version v0.0.3 2017-05-07 12:10:24 +02:00
descr opam: changed dev-repo to the fork's repo 2017-05-07 12:10:24 +02:00
install-yices.sh ocamlyices2: only build the static stub using static libgmp.a. 2017-05-05 16:18:46 +02:00
LICENSE Complete overhaul 2014-09-20 10:44:09 +02:00
LICENSE_yices Clarifications about license terms 2014-09-22 08:03:36 +02:00
Makefile ocamlyices2: also install .cmx (warning on ocaml >= 4.03.0) 2017-05-05 16:19:27 +02:00
Makefile.config.in ocamlyices2: only build the static stub using static libgmp.a. 2017-05-05 16:18:46 +02:00
META.in ocamlyices2: build system: use @PACKAGE_NAME@ in META and opam 2017-05-05 16:17:18 +02:00
opam ocamlyices2: bump to version v0.0.3 2017-05-07 12:10:24 +02:00
opam.in opam: changed dev-repo to the fork's repo 2017-05-07 12:10:24 +02:00
README.markdown ocamlyices2: updated README with appveyor badge and binary instructions 2017-05-05 16:19:27 +02:00

Ocamlyices2: Yices 2 SMT solver binding for OCaml

Mickaël Delahaye, 2014

Linux, Mac Windows
trv-img apvy-img

BEWARE: highly unstable API, see the to-do list.

Yices 2 is an efficient SMT solver developed at SRI International. Ocamlyices2 lets you use this SMT solver inside your own program in OCaml.

N.B: Yices is only available freely for non-commercial use. See Yices' license terms. So, although Ocamlyices2's own code (the binding) is freely available, Ocamlyices2 is only usable under the same restrictions.

You might also be interested in Ocamlyices, a binding for Yices 1 SMT solver.

To do

  • Cleanup API name convention (mostly done)
  • Add some examples
  • Documentation

Requirements

  • OCaml 3.12 or later

  • Findlib (ocamlfind), also available through OPAM

  • Zarith OCaml library, also available through OPAM

  • GMP with header file (gmp.h), needed to handle big integer and rational values (as Z.t and Q.t from Zarith), available on most systems (for instance, in the package libgmp-dev on Debian and Ubuntu).

Build and install

Build the Ocamlyices2 library (for ocamlopt and ocamlc):

./configure
make

Install the library on the system using Findlib:

make install

By default, a static version of libgmp will be used. To force the use of the shared gmp library for zarith and libyices, you can use:

./configure --with-shared-gmp

You can also force the use of your own static version of libgmp with

./configure --with-static-gmp=libgmp.a

For cross-compiling the library for native windows (using the mingw compiler) from cygwin, use the --host= argument:

./configure --host=i686-w64-mingw32

Binaries

Yices2 may be somewhat painful to build. To ease the process, you can simply pick the binaries. These are linked to static gmp libraries to avoid any shared library problem. For example, for windows, you would do:

curl -L https://github.com/maelvalais/ocamlyices2/releases/download/v0.0.2/ocamlyices2-v0.0.2-i686-w64-mingw32.tar.gz | tar xz
ocamlfind install yices2 ocamlyices2-*/*

Usage

With Ocamlfind:

ocamlfind ocamlc/ocamlopt -package yices2 …

When linking (i.e, actually making an executable), add the -linkpkg flag.

Without, well… it depends of your actual setup of OCaml. To compile your program, add the directory of Ocamlyices2 and of Zarith in the search path with the flag -I of ocamlc/ocamlopt (run ocamlfind query yices2 to find out). And when linking, add the library yices2.cma/.cmxa to the command.

License

Copyright (c) 2014, Mickaël Delahaye.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.