• Stars
    star
    370
  • Rank 115,405 (Top 3 %)
  • Language SMT
  • License
    GNU General Publi...
  • Created about 10 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Yices SMT Solver

License: GPL v3 CI Coverity Scan Build Status Coverage Status

Yices 2

Yices 2 is a solver for Satisfiability Modulo Theories (SMT) problems. Yices 2 can process input written in the SMT-LIB language, or in Yices' own specification language. We also provide a C API and bindings for Java, Python, Go, and OCaml.

This repository includes the source of Yices 2, documentation, tests, and examples.

Yices 2 is developed by Bruno Dutertre, Dejan Jovanovic, Stรฉphane Graham-Lengrand, and Ian A. Mason at the Computer Science Laboratory, SRI International. To contact us, or to get more information about Yices, please visit our website.

Simple Examples

Here are a few typical small examples that illustrate the use of Yices using the SMT2 language.

Linear Real Arithmetic

;; QF_LRA = Quantifier-Free Linear Real Arithmetic
(set-logic QF_LRA)
;; Declare variables x, y
(declare-fun x () Real)
(declare-fun y () Real)
;; Find solution to (x + y > 0), ((x < 0) || (y < 0))
(assert (> (+ x y) 0))
(assert (or (< x 0) (< y 0)))
;; Run a satisfiability check
(check-sat)
;; Print the model
(get-model)

Running Yices on the above problem gives a solution

> yices-smt2 lra.smt2
sat
(model
  (define-fun x () Real 2.0)
  (define-fun y () Real (- 1.0)))

Bit-Vectors

;; QF_BV = Quantifier-Free Bit-Vectors
(set-logic QF_BV)
;; Declare variables
(declare-fun x () (_ BitVec 32))
(declare-fun y () (_ BitVec 32))
;; Find solution to (signed) x > 0, y > 0, x + y < x
(assert (bvsgt x #x00000000))
(assert (bvsgt y #x00000000))
(assert (bvslt (bvadd x y) x))
;; Check
(check-sat)
;; Get the model
(get-model)

Running Yices on the above problem gives

> yices-smt2 bv.smt2
sat
(model
  (define-fun x () (_ BitVec 32) #b01000000000000000000000000000000)
  (define-fun y () (_ BitVec 32) #b01000000000000000000000000000000))

Non-Linear Arithmetic

;; QF_NRA = Quantifier-Free Nonlinear Real Arithmetic
(set-logic QF_NRA)
;; Declare variables
(declare-fun x () Real)
(declare-fun y () Real)
;; Find solution to x^2 + y^2 = 1, x = 2*y, x > 0
(assert (= (+ (* x x) (* y y)) 1))
(assert (= x (* 2 y)))
(assert (> x 0))
;; Check
(check-sat)
;; Get the model
(get-model)

Running Yices on the above problem gives

sat
(model
  (define-fun x () Real 0.894427)
  (define-fun y () Real 0.447214))

Installing Prebuilt Binaries

Currently you can install Yices either using Homebrew or Apt.

Homebrew

Installing on Darwin using homebrew can be achieved via:

brew install SRI-CSL/sri-csl/yices2

This will install the full mcsat-enabled version of Yices, including dynamic library and header files.

Apt

To install Yices on Ubuntu or Debian, do the following:

sudo add-apt-repository ppa:sri-csl/formal-methods
sudo apt-get update
sudo apt-get install yices2

This will install the executables. If you also need the Yices library and header files, replace the last step with:

sudo apt-get install yices2-dev

Building From Source

Prerequisites

To build Yices from the source, you need:

  • GCC version 4.0.x or newer (or clang 3.0 or newer)
  • gperf version 3.0 or newer
  • the GMP library version 4.1 or newer
  • other standard tools: make (gnumake is required), sed, etc.

To build the manual, you also need:

  • a latex installation
  • the latexmk tool

To build the on-line documentation, you need to install the Sphinx python package. The simplest method is:

sudo pip install sphinx

Sphinx 1.4.x or better is needed.

Quick Installation

Do this:

autoconf
./configure
make
sudo make install

This will install binaries and libraries in /usr/local/. You can change the installation location by giving option --prefix=... to the ./configure script.

For more explanations, please check doc/COMPILING.

Support for Non-Linear Arithmetic and MC-SAT

Yices supports non-linear real and integer arithmetic using a method known as Model-Constructing Satisfiability (MC-SAT), but this is not enabled by default. The MC-SAT solver also supports other theories and theory combination. We are currently extending it to handle bit-vector constraints.

If you want the MC-SAT solver, follow these instructions:

  1. Install SRI's library for polynomial manipulation. It's available on github.

  2. Install the CUDD library for binary-decision diagrams. We recommend using the github distribution: https://github.com/ivmai/cudd.

  3. After you've installed libpoly and CUDD, add option --enable-mcsat to the configure command. In details, type this in the toplevel Yices directory:

autoconf
./configure --enable-mcsat
make
sudo make install
  1. You may need to provide LDFLAGS/CPPFLAGS if ./configure fails to find the libpoly or CUDD libraries. Other options may be useful too. Try ./configure --help to see what's there.

Support for Thread Safety

The Yices library is not thread safe by default, if you need a re-entrant version:

autoconf
./configure --enable-thread-safety
make
sudo make install

If configured with --enable-thread-safety the Yices library will be thread safe in the following sense: as long as the creation and manipulation of each context and each model is restricted to a single thread, there should be no races. In particular separate threads can create their own contexts, and manipulate and check them without impeding another thread's progress.

NOTE: --enable-mcsat and --enable-thread-safety are currently incompatible.

Windows Builds

We recommend compiling using Cygwin. If you want a version that works natively on Windows (i.e., does not depend on the Cygwin DLLs), you can compile from Cygwin using the MinGW cross-compilers. This is explained in doc/COMPILING.

Documentation

To build the manual from the source, type

make doc

This will build ./doc/manual/manual.pdf.

Other documentation is in the ./doc directory:

  • doc/COMPILING explains the compilation process and options in detail.
  • doc/NOTES gives an overview of the source code.
  • doc/YICES-LANGUAGE explains the syntax of the Yices language, and describes commands, functions, and heuristic parameters.

To build the Sphinx documentation:

cd doc/sphinx
make html

This will build the documentation in build/html (within directory doc/sphinx). You can also do:

make epub

and you'll have the doc in build/epub/Yices.epub.

Getting Help and Reporting bugs

For further questions about Yices, please contact us via the Yices mailing lists [email protected]. This mailing list is moderated, but you do not need to register to post to it. You can register to this mailing list if you are interested in helping others.

Please submit bug reports through GitHub issues. Please include enough information in your bug report to enable us to reproduce and fix the problem. This is an example of a good report:

I am experiencing a segmentation fault from Yices. The following is a small test case that causes the crash. I am using Yices 2.4.1 on x86_64 statically linked against GMP on Ubuntu 12.04.

This is an example of a poor bug report:

I have just downloaded Yices. After I compile my code and link it with Yices, there is a segmentation fault when I run the executable. Can you help?

Please try to include answers to the following questions:

  • Which version of Yices are you using?
  • On which hardware and OS?
  • How can we reproduce the bug? If possible, include an input file or program fragment.

More Repositories

1

gllvm

Whole Program LLVM: wllvm ported to go
Go
300
star
2

PVS

The People's Verification System
Common Lisp
135
star
3

stegotorus

A Camouflage Proxy for the Tor Anonymity System
C++
77
star
4

sally

A model checker for infinite-state systems.
C++
68
star
5

Maude

Language based on Rewriting Logic
C++
65
star
6

llvm2smt

Experimental translation of llvm to smt.
LLVM
57
star
7

libpoly

LibPoly is a C library for manipulating polynomials
C
46
star
8

l3riscv

An executable specification of the RISCV ISA in L3.
Ruby
41
star
9

TrinityMultimodalTrojAI

Python
33
star
10

NTT

An Implementation of the Number Theoretic Transform
C
33
star
11

Bliss

BLISS: Bimodal Lattice Signature Schemes
C
25
star
12

musllvm

The start of a port of musl libc to an "x86_64 llvm bitcode" architecture.
C
24
star
13

Trinity-TrojAI

This repository contains code developed by the SRI team for the IARPA/TrojAI program.
Python
19
star
14

jumpbox

JumpBox โ€“ A Seamless Browser Proxy for Tor Pluggable Transports
C
15
star
15

bixie

Inconsistent code detection for Java.
Java
14
star
16

filia

Translate Python and JavaScript into MLIR
C++
14
star
17

AircraftVerse

Jupyter Notebook
13
star
18

ENCODERS

ENCODERS (Edge Networking with Content-Oriented Declarative Enhanced Routing and Storage) is SRIโ€™s content-based networking solution that provides network services and transport architectures required for efficient, transparent distribution of content in mobile ad hoc networks.
C
12
star
19

yices2_ocaml_bindings

OCaml
11
star
20

high-assurance-crypto

This repository contains software for projects focusing on computer-aided verification of (distributed) cryptographic protocols and algorithms.
eC
10
star
21

Wholly

Wholly!
Python
9
star
22

yices2_python_bindings

Python bindings for yices2
Python
9
star
23

f3d

f3d, a.k.a. FREEDIUS, a.k.a. the Cartographic Modeling Environment, a.k.a. the Image Understanding Environment. Lisp-based geospatial image analysis.
Common Lisp
8
star
24

arsenal-base

Python
8
star
25

imaude

Interactive Maude
NewLisp
8
star
26

homebrew-sri-csl

SRI International's Tap
Ruby
7
star
27

radler

Radler
Python
7
star
28

secure_ros

Secure ROS
Python
6
star
29

jel

JPEG Embedding Library
C
6
star
30

ALICE

Python
6
star
31

SMT.tmbundle

Linguist/TextMate support for SMT-LIB2
6
star
32

ETB

The Evidential Tool Bus
Python
6
star
33

do-like-javac

Python
6
star
34

pascali-public

Public PASCALI repo
Python
5
star
35

parsley-lang

Parsley format definition language
OCaml
5
star
36

yices2_java_bindings

Java bindings for Yices 2.
C++
4
star
37

VCPublic

Place to share snapshots of maude models
Python
4
star
38

signal-public

Public SIGNAL repo
Jupyter Notebook
4
star
39

WhollyRecipes

Recipes for the Wholly build system
Python
4
star
40

OCCAM-Benchmarks

Set of benchmarks used by the OCCAM tool.
Python
4
star
41

ICS

Integrated Canonizer and Solver
OCaml
3
star
42

PVSCodegen

3
star
43

iopc

The C infrastructure for the IOP system
C
3
star
44

DroneSim

SoftAgents drone simulation example
Python
3
star
45

pce

Probabilistic Consistency Engine
C
3
star
46

clam-prov

Provenance Tracking with Clam
C++
3
star
47

io-specialization

Specialization of IO system calls
C++
2
star
48

PVSPackrat

PVS proofs for PEG grammars and Packrat parsers.
2
star
49

PLambda

A Python version of JLambda
Python
2
star
50

sri-glibc-malloc

SRI's modification of glibc malloc that eliminates metadata in client memory.
C
2
star
51

datum

A parser for biological experiment shorthand.
Clojure
2
star
52

prism

PRISM is the stand-alone version of our SRI TA1 system developed under the DARPA RACE program during 2019-2023. This software was cleared by DARPA on September 18, 2023; Approved for Public Release, Distribution Unlimited (Distribution "A").
Python
2
star
53

SudokuSolver

A sudoku solver to illustrate the new yices python API
Python
2
star
54

latextrack

LaTeX Track Changes shows changes over time for a .tex file that has its history stored in a git or svn repository. The user can customize how to view the changes: limited to certain authors or by revision or date among other filters. An Emacs mode provides the user interface. Plug-ins for other editors (such as TeXShop or Atom) are planned.
Java
2
star
55

libfutil

The _F_unctions and _UTIL_ities library
C
2
star
56

parsley-rust

Rust infrastructure for Parsley parsing
Rust
1
star
57

HybridSal

Java
1
star
58

nodelet_core

nodelet_core is a forked version of nodelet_core for Secure ROS.
1
star
59

WrapPat

1
star
60

libpoly_ocaml_bindings

OCaml bindings for libpoly
OCaml
1
star
61

lingoboost

Project for LingoBoost "TMR Lite" Android App
Kotlin
1
star
62

fomoh

PyTorch-based library that implements nested forward AD and interfaces with PyTorch models.
Jupyter Notebook
1
star
63

evocrypt

EVOCrypt: EasyCrypt Verified OCaml Cryptographic Library
eC
1
star
64

safedocs-recognizer

DARPA SafeDocs TA1 software suite to bundle and orchestrate various format-aware tracing tools.
Python
1
star
65

tree

C
1
star
66

augmented-metitarski

An Augmented MetiTarski Dataset for Real Quantifier Elimination using Machine Learning
1
star
67

rendezvous

Abandonware or Demoware code base for rendezvous.
C
1
star
68

ACS

Address Change Signaling
Go
1
star
69

_ros_comm

ros_comm is a forked version of ros_comm for Secure ROS.
C++
1
star
70

SoftAgentsDiagnosis

Python
1
star
71

secure_ros_tools

Python
1
star
72

phosphosite

A web trawler for biological data
Python
1
star
73

clam-prov-benchmarks

Benchmarks for clam-prov
Shell
1
star
74

BlissResources

A collection of public resources related to BLISS (Bimodal Lattice Signature Schemes)
C
1
star
75

safedocs-yarn-public

Python
1
star
76

Trinity

Trinity AI for Improving Trustworthiness, Resilience and Interpretability of AI
Python
1
star
77

dnre

Code accompanying paper: Direct Amortized Likelihood Ratio Estimation
Jupyter Notebook
1
star
78

TIJO

Official Implementation of ICCV'23 paper on Multimodal Backdoor Defense Technique: TIJO (Trigger Inversion using Joint Optimization)
1
star
79

OpensDec

The Open Source Decompiler Project
1
star
80

coproof

Jupyter Notebook
1
star