<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cvc4.stanford.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Noetzli</id>
		<title>CVC4 - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cvc4.stanford.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Noetzli"/>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/wiki/Special:Contributions/Noetzli"/>
		<updated>2026-04-06T00:59:28Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=Building_CVC4_from_source&amp;diff=5740</id>
		<title>Building CVC4 from source</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=Building_CVC4_from_source&amp;diff=5740"/>
				<updated>2019-01-26T18:00:55Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''IMPORTANT: The following instructions only apply to CVC4 1.6 and older. For newer versions, refer to INSTALL.md included with the source.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
To compile CVC4 from a source package you must do the following:&lt;br /&gt;
# Install antlr&lt;br /&gt;
# Configure cvc4&lt;br /&gt;
# Compile cvc4&lt;br /&gt;
# Install cvc4 [optional]&lt;br /&gt;
&lt;br /&gt;
To do so run the following commands in the CVC4 directory:&lt;br /&gt;
&lt;br /&gt;
    cd contrib&lt;br /&gt;
    ./get-antlr-3.4&lt;br /&gt;
    cd ..&lt;br /&gt;
    ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
    make&lt;br /&gt;
    make check   [recommended]&lt;br /&gt;
    make install [optional]&lt;br /&gt;
&lt;br /&gt;
Below are more details instructions about the various dependencies and options. &lt;br /&gt;
&lt;br /&gt;
=Common make Options=&lt;br /&gt;
* &amp;quot;''make install''&amp;quot; will install into the &amp;quot;--prefix&amp;quot; option you gave to&lt;br /&gt;
the configure script (''/usr/local'' by default).&lt;br /&gt;
    ./configure --prefix=~/install_targets/cvc4 ...&lt;br /&gt;
    make install&lt;br /&gt;
* '''You should run &amp;quot;''make check''&amp;quot;''' before installation to ensure that CVC4 has been&lt;br /&gt;
built correctly.  In particular, GCC version 4.5.1 seems to have a&lt;br /&gt;
bug in the optimizer that results in incorrect behavior (and wrong&lt;br /&gt;
results) in many builds.  This is a known problem for Minisat, and&lt;br /&gt;
since Minisat is at the core of CVC4, a problem for CVC4.  &amp;quot;''make check''&amp;quot;&lt;br /&gt;
easily detects this problem (by showing a number of FAILed test cases).&lt;br /&gt;
It is ok if the unit tests aren't run as part of &amp;quot;''make check''&amp;quot;, but all&lt;br /&gt;
system tests and regression tests should pass without incident.&lt;br /&gt;
* To build API documentation, use &amp;quot;''make doc''&amp;quot;.  Documentation is produced&lt;br /&gt;
under ''builds/doc/'' but is not installed by &amp;quot;''make install''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Examples and tutorials are not installed with &amp;quot;''make install''.&amp;quot;  See [[#Examples_and_tutorials_are_not_built_or_installed|below]].&lt;br /&gt;
&lt;br /&gt;
For more information about the build system itself (probably not&lt;br /&gt;
necessary for casual users), see the [[#Appendix:_Build_architecture|Appendix]] at the bottom of this&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
=Common configure Options=&lt;br /&gt;
*'''--prefix=PREFIX''' install architecture-independent files in PREFIX (by default /usr/local)&lt;br /&gt;
*'''--with-build={production,debug,default,competition}''' &lt;br /&gt;
*'''--with-antlr-dir=PATH'''&lt;br /&gt;
*'''--with-cln'''/'''--with-gmp''' selects the numbers package to use by default ([[#Optional requirements]])&lt;br /&gt;
*'''--enable-static-binary''' build a fully statically-linked binary. (This is recommended for Mac OS X users that want to be able to use gdb.)&lt;br /&gt;
*'''ANTLR=PATH''' location of the antlr3 script&lt;br /&gt;
*'''--with-boost=DIR''' installation location of the boost libraries (most users will not need this)&lt;br /&gt;
&lt;br /&gt;
See '''./configure --help''' for more.&lt;br /&gt;
&lt;br /&gt;
=Build dependencies=&lt;br /&gt;
&lt;br /&gt;
The following tools and libraries are required to run CVC4. Versions&lt;br /&gt;
given are minimum versions; more recent versions should be compatible.&lt;br /&gt;
&lt;br /&gt;
*'''GNU C and C++''' (gcc and g++), reasonably recent versions&lt;br /&gt;
*'''GNU Make'''&lt;br /&gt;
*'''GNU Bash'''&lt;br /&gt;
*'''GMP v4.2''' (GNU Multi-Precision arithmetic library)&lt;br /&gt;
*'''libantlr3c v3.2 or v3.4''' (ANTLR parser generator C support library)&lt;br /&gt;
*'''The Boost C++ base libraries'''&lt;br /&gt;
*'''MacPorts'''   [highly recommended if on a Mac; see [[#MacPorts]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The hardest to obtain and install is the libantlr3c requirement, and&lt;br /&gt;
is explained [[#Installing libantlr3c: ANTLR parser generator C support library|next]].&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;make&amp;quot; is non-GNU on your system, make sure to invoke &amp;quot;gmake&amp;quot; (or&lt;br /&gt;
whatever GNU Make is installed as).  If your usual shell is not Bash,&lt;br /&gt;
the configure script should auto-correct this.  If it does not, you'll&lt;br /&gt;
see strange shell syntax errors, and you may need to explicitly set&lt;br /&gt;
SHELL or CONFIG_SHELL to the location of bash on your system.&lt;br /&gt;
&lt;br /&gt;
==Installing libantlr3c: ANTLR parser generator C support library==&lt;br /&gt;
&lt;br /&gt;
For libantlr3c, you can use the convenience script in&lt;br /&gt;
''contrib/get-antlr-3.4'' in the source distribution---this will download, patch, compile and install&lt;br /&gt;
libantlr3c into your cvc4 directory as ''cvc4/antlr-3.4/''.&lt;br /&gt;
  cd contrib&lt;br /&gt;
  ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
CVC4 must be configured with the antlr library installation directory, '''--with-antlr-dir''', and an antlr executable script file, '''ANTLR'''.  If libantlr3c was installed via get-antlr-3.4, the following configure line should suffice for CVC44&lt;br /&gt;
  ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
&lt;br /&gt;
For 64 bit machines, libantlr3c needs to be configured with 64 bit explicitly&lt;br /&gt;
  ./configure --enable-64bit ...&lt;br /&gt;
The get-antlr-3.4 script makes a guess at whether the machine is 64 bit and adds the appropriate flag.&lt;br /&gt;
To force the script to compile 32 bit:&lt;br /&gt;
  MACHINE_TYPE=&amp;quot;x86&amp;quot; ./get-antlr-3.4&lt;br /&gt;
To force the script to compile 64 bit:&lt;br /&gt;
  MACHINE_TYPE=&amp;quot;x86_64&amp;quot; ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
For a longer discussion, instructions for manual installation, and more in depth troubleshooting, see [[Developer's Guide#ANTLR3]].&lt;br /&gt;
&lt;br /&gt;
==MacPorts==&lt;br /&gt;
&lt;br /&gt;
On a Mac, it is '''highly''' recommended that you use MacPorts (see&lt;br /&gt;
http://www.macports.org/).  Doing so is easy.  Then, simply run the&lt;br /&gt;
script ''contrib/mac-build'', which installs a few ports from the MacPorts&lt;br /&gt;
repository, then compiles and installs antlr3c using the ''get-antlr-3.4''&lt;br /&gt;
script.  The mac-build script should set you up&lt;br /&gt;
with all requirements, and will tell you how to configure CVC4 when it&lt;br /&gt;
completes successfully.&lt;br /&gt;
&lt;br /&gt;
==Installing the Boost C++ base libraries==&lt;br /&gt;
&lt;br /&gt;
A Boost package is available on most Linux distributions; check yours&lt;br /&gt;
for a package named something like libboost-dev or boost-devel.  There&lt;br /&gt;
are a number of additional Boost packages in some distributions, but&lt;br /&gt;
this &amp;quot;basic&amp;quot; one should be sufficient for building CVC4.&lt;br /&gt;
&lt;br /&gt;
Should you want to install Boost manually, or to learn more about the&lt;br /&gt;
Boost project, please visit http://www.boost.org/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building on FreeBSD==&lt;br /&gt;
CVC4's build process currently makes extensive use of bash, sed, and other common *nix tools. It has recently come to our attention by Kostas Oikonomou that some of these are problematic outside of the GNU toolkit. Users of systems that do not assume GNU implementation like FreeBSD may experience issues building CVC4. Until we have a more permanent solution, here are Kostas Oikonomou's notes on how to modify CVC4's source to get it to compile on such systems:&lt;br /&gt;
&lt;br /&gt;
    0. export CONFIG_SHELL=/usr/local/bin/bash&lt;br /&gt;
       Edit 'configure' to set # !/usr/local/bin/bash&lt;br /&gt;
    &lt;br /&gt;
    1. configure --prefix=/opt/cvc4 --enable-gpl --with-readline CC=clang CXX=clang++ LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include&lt;br /&gt;
    &lt;br /&gt;
    2a. Edit src/mksubdirs, src/theory/{mkrewriter,mktheorytraits} to change&lt;br /&gt;
       !#/bin/bash to !#/usr/local/bin/bash&lt;br /&gt;
       Similarly for src/base/{mktags,mktagheaders}, src/expr/{mkexpr,mkkind,mkmetakind}.&lt;br /&gt;
    &lt;br /&gt;
    2b. src/options/mkoptions: same as above, plus all occurrences of expr -&amp;gt; gexpr.&lt;br /&gt;
   &lt;br /&gt;
    3. Edit src/main/util.cpp:&lt;br /&gt;
    &lt;br /&gt;
      stack_t ss;&lt;br /&gt;
      ss.ss_sp = (char *) malloc(SIGSTKSZ);&lt;br /&gt;
    &lt;br /&gt;
    4. make -j2&lt;br /&gt;
    &lt;br /&gt;
    5. Edit test/regress/run_regression to fix the bash business.&lt;br /&gt;
    &lt;br /&gt;
    6. make check&lt;br /&gt;
    &lt;br /&gt;
    7. sudo gmake install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Optional requirements=&lt;br /&gt;
&lt;br /&gt;
None of these is required, but can improve CVC4 as described below:&lt;br /&gt;
&lt;br /&gt;
*'''Optional: SWIG 2.0.x''' (Simplified Wrapper and Interface Generator)&lt;br /&gt;
*'''Optional: CLN v1.3 or newer''' (Class Library for Numbers)&lt;br /&gt;
*'''Optional: CUDD v2.4.2 or newer''' (Colorado University Decision Diagram package)&lt;br /&gt;
*'''Optional: GNU Readline library''' (for an improved interactive experience)&lt;br /&gt;
*'''Optional: The Boost C++ threading library''' (libboost_thread)&lt;br /&gt;
*'''Optional: CxxTest unit testing framework'''&lt;br /&gt;
&lt;br /&gt;
SWIG is necessary to build the Java API (and of course a JDK is&lt;br /&gt;
necessary, too).  SWIG 1.x won't work; you'll need 2.0, and the more&lt;br /&gt;
recent the better.  On Mac, we've seen SWIG segfault when generating&lt;br /&gt;
CVC4 language bindings; version 2.0.8 or higher is recommended to&lt;br /&gt;
avoid this.  See [[#Language_bindings|Language bindings]] below for build instructions.&lt;br /&gt;
&lt;br /&gt;
CLN is an alternative multiprecision arithmetic package that can offer&lt;br /&gt;
better performance and memory footprint than GMP.  CLN is covered by&lt;br /&gt;
the GNU General Public License, version 3; so if you choose to use&lt;br /&gt;
CVC4 with CLN support, you are licensing CVC4 under that same license.&lt;br /&gt;
(Usually CVC4's license is more permissive than GPL is; see the file&lt;br /&gt;
COPYING in the CVC4 source distribution for details.)  Please visit&lt;br /&gt;
http://www.ginac.de/CLN/ for more details about CLN.&lt;br /&gt;
&lt;br /&gt;
CUDD is a decision diagram package that changes the behavior of the&lt;br /&gt;
CVC4 arithmetic solver in some cases; it may or may not improve the&lt;br /&gt;
arithmetic solver's performance.  See [[#Building_with_CUDD_(optional)|below]] for instructions on&lt;br /&gt;
obtaining and building CUDD.&lt;br /&gt;
&lt;br /&gt;
The GNU Readline library is optionally used to provide command&lt;br /&gt;
editing, tab completion, and history functionality at the CVC prompt&lt;br /&gt;
(when running in interactive mode).  Check your distribution for a&lt;br /&gt;
package named &amp;quot;libreadline-dev&amp;quot; or &amp;quot;readline-devel&amp;quot; or similar.&lt;br /&gt;
&lt;br /&gt;
The Boost C++ threading library (often packaged independently of the&lt;br /&gt;
Boost base library) is needed to run CVC4 in &amp;quot;portfolio&amp;quot;&lt;br /&gt;
(multithreaded) mode.  Check your distribution for a package named&lt;br /&gt;
&amp;quot;libboost-thread-dev&amp;quot; or similar.&lt;br /&gt;
&lt;br /&gt;
CxxTest is necessary to run CVC4's unit tests (included with the&lt;br /&gt;
distribution).  Running these is not really required for users of&lt;br /&gt;
CVC4; &amp;quot;make check&amp;quot; will skip unit tests if CxxTest isn't available,&lt;br /&gt;
and go on to run the extensive system- and regression-tests in the&lt;br /&gt;
source tree.  However, if you're interested, you can download CxxTest&lt;br /&gt;
at http://cxxtest.com/ .&lt;br /&gt;
&lt;br /&gt;
==Building with custom CLN installations (optional)==&lt;br /&gt;
&lt;br /&gt;
One option for compiling against a custom CLN installation is to provide the CLN_LIBS and CLN_CFLAGS arguments at configuration. Supposing you installed cln into CLN_DIR the following provides the necessary locations of the header and linking information.&lt;br /&gt;
    ./configure &amp;lt;other arguments&amp;gt; --with-cln CLN_LIBS=&amp;quot;-L&amp;lt;CLN_DIR&amp;gt;/lib -lcln&amp;quot; \&lt;br /&gt;
     CLN_CFLAGS=&amp;quot;-I&amp;lt;CLN_DIR&amp;gt;/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building with CUDD (optional)==&lt;br /&gt;
&lt;br /&gt;
CUDD, if desired, must be installed delicately.  The CVC4 configure&lt;br /&gt;
script attempts to auto-detect the locations and names of CUDD headers&lt;br /&gt;
and libraries the way that the Fedora RPMs install them, the way that&lt;br /&gt;
our NYU-provided Debian packages install them, and the way they exist&lt;br /&gt;
when you download and build the CUDD sources directly.  If you install&lt;br /&gt;
from Fedora RPMs or our Debian packages, the process should be&lt;br /&gt;
completely automatic, since the libraries and headers are installed in&lt;br /&gt;
a standard location.  If you download the sources yourself, you need&lt;br /&gt;
to build them in a special way.  Fortunately, the&lt;br /&gt;
&amp;quot;contrib/build-cudd-2.4.2-with-libtool.sh&amp;quot; script in the CVC4 source&lt;br /&gt;
tree does exactly what you need: it patches the CUDD makefiles to use&lt;br /&gt;
libtool, builds the libtool libraries, then reverses the patch to&lt;br /&gt;
leave the makefiles as they were.  Once you run this script on an&lt;br /&gt;
unpacked CUDD 2.4.2 source distribution, then CVC4's configure script&lt;br /&gt;
should pick up the libraries if you provide&lt;br /&gt;
--with-cudd-dir=/PATH/TO/CUDD/SOURCES.&lt;br /&gt;
&lt;br /&gt;
If you want to force linking to CUDD, provide --with-cudd to the&lt;br /&gt;
configure script; this makes it a hard requirement rather than an&lt;br /&gt;
optional add-on.&lt;br /&gt;
&lt;br /&gt;
The NYU-provided Debian packaging of CUDD 2.4.2 and CUDD 2.5.0 are&lt;br /&gt;
here (along with the CVC4 Debian packages):&lt;br /&gt;
&lt;br /&gt;
  deb http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
&lt;br /&gt;
On Debian (and Debian-derived distributions like Ubuntu), you only&lt;br /&gt;
need to drop that one line in your /etc/apt/sources.list file, then install with your favorite package manager.&lt;br /&gt;
&lt;br /&gt;
The Debian source package &amp;quot;cudd&amp;quot;, available from the same repository,&lt;br /&gt;
includes a diff of all changes made to cudd makefiles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Language bindings=&lt;br /&gt;
&lt;br /&gt;
There are several options available for using CVC4 from the API.&lt;br /&gt;
&lt;br /&gt;
First, CVC4 offers a complete and flexible API for manipulating&lt;br /&gt;
expressions, maintaining a stack of assertions, and checking&lt;br /&gt;
satisfiability, and related things.  The C++ libraries (libcvc4.so and&lt;br /&gt;
libcvc4parser.so) and required headers are installed normally via a&lt;br /&gt;
&amp;quot;make install&amp;quot;.  This API is also available from Java (via CVC4.jar&lt;br /&gt;
and libcvc4jni.so) by configuring with --enable-language-bindings=java.&lt;br /&gt;
You'll also need SWIG 2.0 installed (and you might need to help&lt;br /&gt;
configure find it if you installed it in a nonstandard place with&lt;br /&gt;
--with-swig-dir=/path/to/swig/installation).  You may also need to&lt;br /&gt;
give the configure script the path to your Java headers (in&lt;br /&gt;
particular, jni.h).  You might do so with (for example):&lt;br /&gt;
&lt;br /&gt;
  ./configure --enable-language-bindings=java \&lt;br /&gt;
      JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-openjdk-amd64/include&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;quot;C++ compatibility API&amp;quot; (''#include &amp;lt;cvc4/cvc3_compat.h&amp;gt;''&lt;br /&gt;
and link against libcvc4compat.so) that attempts to maintain&lt;br /&gt;
source-level backwards-compatibility with the CVC3 C++ API.  The&lt;br /&gt;
compatibility library is built by default, and&lt;br /&gt;
''--enable-language-bindings=java'' enables the Java compatibility library&lt;br /&gt;
(CVC4compat.jar and libcvc4compatjni.so).&lt;br /&gt;
''--enable-language-bindings=c'' enables the C compatibility library&lt;br /&gt;
(''#include &amp;lt;cvc4/bindings/compat/c/c_interface.h&amp;gt;'' and link against&lt;br /&gt;
libcvc4bindings_c_compat.so), and if you want both C and Java&lt;br /&gt;
bindings, use ''--enable-language-bindings=c,java''.  These compatibility&lt;br /&gt;
language bindings do NOT require SWIG.&lt;br /&gt;
&lt;br /&gt;
The ''examples/'' directory in the source distribution includes some basic examples (the &amp;quot;simple vc&amp;quot;&lt;br /&gt;
and &amp;quot;simple vc compat&amp;quot; family of examples) of all these interfaces.&lt;br /&gt;
&lt;br /&gt;
In principle, since we use SWIG to generate the native Java API, we&lt;br /&gt;
could support other languages as well.  However, using CVC4 from other&lt;br /&gt;
languages is not supported, nor expected to work, at this time.  If&lt;br /&gt;
you're interested in helping to develop, maintain, and test a language&lt;br /&gt;
binding, please contact us via the users' mailing list at&lt;br /&gt;
cvc-users@cs.nyu.edu.&lt;br /&gt;
&lt;br /&gt;
=Building CVC4 from a repository checkout=&lt;br /&gt;
&lt;br /&gt;
The following tools and libraries are additionally required to build&lt;br /&gt;
CVC4 from from a repository checkout rather than from a prepared&lt;br /&gt;
source tarball.&lt;br /&gt;
&lt;br /&gt;
*'''Automake v1.11'''&lt;br /&gt;
*'''Autoconf v2.61'''&lt;br /&gt;
*'''Libtool v2.2'''&lt;br /&gt;
*'''ANTLR3 v3.2 or v3.4'''&lt;br /&gt;
*'''Java Development Kit''' ([http://www.antlr.org/wiki/pages/viewpage.action?pageId=728 required for ANTLR3])&lt;br /&gt;
&lt;br /&gt;
First, use &amp;quot;''./autogen.sh''&amp;quot; to create the configure script.  Then&lt;br /&gt;
proceed as normal for any distribution tarball.  The parsers are&lt;br /&gt;
pre-generated for the tarballs, but don't exist in the repository; hence the extra ANTLR3 and JDK requirements to&lt;br /&gt;
generate the source code for the parsers, when building from the&lt;br /&gt;
repository.&lt;br /&gt;
&lt;br /&gt;
=Examples and tutorials are not built or installed=&lt;br /&gt;
&lt;br /&gt;
Examples are not built by &amp;quot;''make''&amp;quot; or &amp;quot;''make install''&amp;quot;.  See&lt;br /&gt;
''examples/README'' in the source distribution for information on what to find in the ''examples/''&lt;br /&gt;
directory, as well as information about building and installing them.&lt;br /&gt;
&lt;br /&gt;
=Appendix: Build architecture=&lt;br /&gt;
&lt;br /&gt;
The build system is generated by automake, libtool, and autoconf.  It&lt;br /&gt;
is somewhat nonstandard, though, which (for one thing) requires that&lt;br /&gt;
GNU Make be used.  If you ./configure in the top-level source&lt;br /&gt;
directory, the objects will actually all appear in&lt;br /&gt;
builds/${arch}/${build_id}.  This is to allow multiple, separate&lt;br /&gt;
builds in the same place (e.g., an assertions-enabled debugging build&lt;br /&gt;
alongside a production build), without changing directories at the&lt;br /&gt;
shell.  The &amp;quot;current&amp;quot; build is maintained, and you can still use&lt;br /&gt;
(e.g.) &amp;quot;make -C src/main&amp;quot; to rebuild objects in just one subdirectory.&lt;br /&gt;
&lt;br /&gt;
You can also create your own build directory inside or outside of the&lt;br /&gt;
source tree and configure from there.  All objects will then be built&lt;br /&gt;
in that directory, and you'll ultimately find the &amp;quot;cvc4&amp;quot; binary in&lt;br /&gt;
src/main/, and the libraries under src/ and src/parser/.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=Building_CVC4_from_source&amp;diff=5739</id>
		<title>Building CVC4 from source</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=Building_CVC4_from_source&amp;diff=5739"/>
				<updated>2019-01-26T18:00:21Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''IMPORTANT: These instructions only apply to CVC4 1.6 and older. For newer versions, refer to INSTALL.md included with the source.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
To compile CVC4 from a source package you must do the following:&lt;br /&gt;
# Install antlr&lt;br /&gt;
# Configure cvc4&lt;br /&gt;
# Compile cvc4&lt;br /&gt;
# Install cvc4 [optional]&lt;br /&gt;
&lt;br /&gt;
To do so run the following commands in the CVC4 directory:&lt;br /&gt;
&lt;br /&gt;
    cd contrib&lt;br /&gt;
    ./get-antlr-3.4&lt;br /&gt;
    cd ..&lt;br /&gt;
    ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
    make&lt;br /&gt;
    make check   [recommended]&lt;br /&gt;
    make install [optional]&lt;br /&gt;
&lt;br /&gt;
Below are more details instructions about the various dependencies and options. &lt;br /&gt;
&lt;br /&gt;
=Common make Options=&lt;br /&gt;
* &amp;quot;''make install''&amp;quot; will install into the &amp;quot;--prefix&amp;quot; option you gave to&lt;br /&gt;
the configure script (''/usr/local'' by default).&lt;br /&gt;
    ./configure --prefix=~/install_targets/cvc4 ...&lt;br /&gt;
    make install&lt;br /&gt;
* '''You should run &amp;quot;''make check''&amp;quot;''' before installation to ensure that CVC4 has been&lt;br /&gt;
built correctly.  In particular, GCC version 4.5.1 seems to have a&lt;br /&gt;
bug in the optimizer that results in incorrect behavior (and wrong&lt;br /&gt;
results) in many builds.  This is a known problem for Minisat, and&lt;br /&gt;
since Minisat is at the core of CVC4, a problem for CVC4.  &amp;quot;''make check''&amp;quot;&lt;br /&gt;
easily detects this problem (by showing a number of FAILed test cases).&lt;br /&gt;
It is ok if the unit tests aren't run as part of &amp;quot;''make check''&amp;quot;, but all&lt;br /&gt;
system tests and regression tests should pass without incident.&lt;br /&gt;
* To build API documentation, use &amp;quot;''make doc''&amp;quot;.  Documentation is produced&lt;br /&gt;
under ''builds/doc/'' but is not installed by &amp;quot;''make install''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Examples and tutorials are not installed with &amp;quot;''make install''.&amp;quot;  See [[#Examples_and_tutorials_are_not_built_or_installed|below]].&lt;br /&gt;
&lt;br /&gt;
For more information about the build system itself (probably not&lt;br /&gt;
necessary for casual users), see the [[#Appendix:_Build_architecture|Appendix]] at the bottom of this&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
=Common configure Options=&lt;br /&gt;
*'''--prefix=PREFIX''' install architecture-independent files in PREFIX (by default /usr/local)&lt;br /&gt;
*'''--with-build={production,debug,default,competition}''' &lt;br /&gt;
*'''--with-antlr-dir=PATH'''&lt;br /&gt;
*'''--with-cln'''/'''--with-gmp''' selects the numbers package to use by default ([[#Optional requirements]])&lt;br /&gt;
*'''--enable-static-binary''' build a fully statically-linked binary. (This is recommended for Mac OS X users that want to be able to use gdb.)&lt;br /&gt;
*'''ANTLR=PATH''' location of the antlr3 script&lt;br /&gt;
*'''--with-boost=DIR''' installation location of the boost libraries (most users will not need this)&lt;br /&gt;
&lt;br /&gt;
See '''./configure --help''' for more.&lt;br /&gt;
&lt;br /&gt;
=Build dependencies=&lt;br /&gt;
&lt;br /&gt;
The following tools and libraries are required to run CVC4. Versions&lt;br /&gt;
given are minimum versions; more recent versions should be compatible.&lt;br /&gt;
&lt;br /&gt;
*'''GNU C and C++''' (gcc and g++), reasonably recent versions&lt;br /&gt;
*'''GNU Make'''&lt;br /&gt;
*'''GNU Bash'''&lt;br /&gt;
*'''GMP v4.2''' (GNU Multi-Precision arithmetic library)&lt;br /&gt;
*'''libantlr3c v3.2 or v3.4''' (ANTLR parser generator C support library)&lt;br /&gt;
*'''The Boost C++ base libraries'''&lt;br /&gt;
*'''MacPorts'''   [highly recommended if on a Mac; see [[#MacPorts]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The hardest to obtain and install is the libantlr3c requirement, and&lt;br /&gt;
is explained [[#Installing libantlr3c: ANTLR parser generator C support library|next]].&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;make&amp;quot; is non-GNU on your system, make sure to invoke &amp;quot;gmake&amp;quot; (or&lt;br /&gt;
whatever GNU Make is installed as).  If your usual shell is not Bash,&lt;br /&gt;
the configure script should auto-correct this.  If it does not, you'll&lt;br /&gt;
see strange shell syntax errors, and you may need to explicitly set&lt;br /&gt;
SHELL or CONFIG_SHELL to the location of bash on your system.&lt;br /&gt;
&lt;br /&gt;
==Installing libantlr3c: ANTLR parser generator C support library==&lt;br /&gt;
&lt;br /&gt;
For libantlr3c, you can use the convenience script in&lt;br /&gt;
''contrib/get-antlr-3.4'' in the source distribution---this will download, patch, compile and install&lt;br /&gt;
libantlr3c into your cvc4 directory as ''cvc4/antlr-3.4/''.&lt;br /&gt;
  cd contrib&lt;br /&gt;
  ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
CVC4 must be configured with the antlr library installation directory, '''--with-antlr-dir''', and an antlr executable script file, '''ANTLR'''.  If libantlr3c was installed via get-antlr-3.4, the following configure line should suffice for CVC44&lt;br /&gt;
  ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
&lt;br /&gt;
For 64 bit machines, libantlr3c needs to be configured with 64 bit explicitly&lt;br /&gt;
  ./configure --enable-64bit ...&lt;br /&gt;
The get-antlr-3.4 script makes a guess at whether the machine is 64 bit and adds the appropriate flag.&lt;br /&gt;
To force the script to compile 32 bit:&lt;br /&gt;
  MACHINE_TYPE=&amp;quot;x86&amp;quot; ./get-antlr-3.4&lt;br /&gt;
To force the script to compile 64 bit:&lt;br /&gt;
  MACHINE_TYPE=&amp;quot;x86_64&amp;quot; ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
For a longer discussion, instructions for manual installation, and more in depth troubleshooting, see [[Developer's Guide#ANTLR3]].&lt;br /&gt;
&lt;br /&gt;
==MacPorts==&lt;br /&gt;
&lt;br /&gt;
On a Mac, it is '''highly''' recommended that you use MacPorts (see&lt;br /&gt;
http://www.macports.org/).  Doing so is easy.  Then, simply run the&lt;br /&gt;
script ''contrib/mac-build'', which installs a few ports from the MacPorts&lt;br /&gt;
repository, then compiles and installs antlr3c using the ''get-antlr-3.4''&lt;br /&gt;
script.  The mac-build script should set you up&lt;br /&gt;
with all requirements, and will tell you how to configure CVC4 when it&lt;br /&gt;
completes successfully.&lt;br /&gt;
&lt;br /&gt;
==Installing the Boost C++ base libraries==&lt;br /&gt;
&lt;br /&gt;
A Boost package is available on most Linux distributions; check yours&lt;br /&gt;
for a package named something like libboost-dev or boost-devel.  There&lt;br /&gt;
are a number of additional Boost packages in some distributions, but&lt;br /&gt;
this &amp;quot;basic&amp;quot; one should be sufficient for building CVC4.&lt;br /&gt;
&lt;br /&gt;
Should you want to install Boost manually, or to learn more about the&lt;br /&gt;
Boost project, please visit http://www.boost.org/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building on FreeBSD==&lt;br /&gt;
CVC4's build process currently makes extensive use of bash, sed, and other common *nix tools. It has recently come to our attention by Kostas Oikonomou that some of these are problematic outside of the GNU toolkit. Users of systems that do not assume GNU implementation like FreeBSD may experience issues building CVC4. Until we have a more permanent solution, here are Kostas Oikonomou's notes on how to modify CVC4's source to get it to compile on such systems:&lt;br /&gt;
&lt;br /&gt;
    0. export CONFIG_SHELL=/usr/local/bin/bash&lt;br /&gt;
       Edit 'configure' to set # !/usr/local/bin/bash&lt;br /&gt;
    &lt;br /&gt;
    1. configure --prefix=/opt/cvc4 --enable-gpl --with-readline CC=clang CXX=clang++ LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include&lt;br /&gt;
    &lt;br /&gt;
    2a. Edit src/mksubdirs, src/theory/{mkrewriter,mktheorytraits} to change&lt;br /&gt;
       !#/bin/bash to !#/usr/local/bin/bash&lt;br /&gt;
       Similarly for src/base/{mktags,mktagheaders}, src/expr/{mkexpr,mkkind,mkmetakind}.&lt;br /&gt;
    &lt;br /&gt;
    2b. src/options/mkoptions: same as above, plus all occurrences of expr -&amp;gt; gexpr.&lt;br /&gt;
   &lt;br /&gt;
    3. Edit src/main/util.cpp:&lt;br /&gt;
    &lt;br /&gt;
      stack_t ss;&lt;br /&gt;
      ss.ss_sp = (char *) malloc(SIGSTKSZ);&lt;br /&gt;
    &lt;br /&gt;
    4. make -j2&lt;br /&gt;
    &lt;br /&gt;
    5. Edit test/regress/run_regression to fix the bash business.&lt;br /&gt;
    &lt;br /&gt;
    6. make check&lt;br /&gt;
    &lt;br /&gt;
    7. sudo gmake install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Optional requirements=&lt;br /&gt;
&lt;br /&gt;
None of these is required, but can improve CVC4 as described below:&lt;br /&gt;
&lt;br /&gt;
*'''Optional: SWIG 2.0.x''' (Simplified Wrapper and Interface Generator)&lt;br /&gt;
*'''Optional: CLN v1.3 or newer''' (Class Library for Numbers)&lt;br /&gt;
*'''Optional: CUDD v2.4.2 or newer''' (Colorado University Decision Diagram package)&lt;br /&gt;
*'''Optional: GNU Readline library''' (for an improved interactive experience)&lt;br /&gt;
*'''Optional: The Boost C++ threading library''' (libboost_thread)&lt;br /&gt;
*'''Optional: CxxTest unit testing framework'''&lt;br /&gt;
&lt;br /&gt;
SWIG is necessary to build the Java API (and of course a JDK is&lt;br /&gt;
necessary, too).  SWIG 1.x won't work; you'll need 2.0, and the more&lt;br /&gt;
recent the better.  On Mac, we've seen SWIG segfault when generating&lt;br /&gt;
CVC4 language bindings; version 2.0.8 or higher is recommended to&lt;br /&gt;
avoid this.  See [[#Language_bindings|Language bindings]] below for build instructions.&lt;br /&gt;
&lt;br /&gt;
CLN is an alternative multiprecision arithmetic package that can offer&lt;br /&gt;
better performance and memory footprint than GMP.  CLN is covered by&lt;br /&gt;
the GNU General Public License, version 3; so if you choose to use&lt;br /&gt;
CVC4 with CLN support, you are licensing CVC4 under that same license.&lt;br /&gt;
(Usually CVC4's license is more permissive than GPL is; see the file&lt;br /&gt;
COPYING in the CVC4 source distribution for details.)  Please visit&lt;br /&gt;
http://www.ginac.de/CLN/ for more details about CLN.&lt;br /&gt;
&lt;br /&gt;
CUDD is a decision diagram package that changes the behavior of the&lt;br /&gt;
CVC4 arithmetic solver in some cases; it may or may not improve the&lt;br /&gt;
arithmetic solver's performance.  See [[#Building_with_CUDD_(optional)|below]] for instructions on&lt;br /&gt;
obtaining and building CUDD.&lt;br /&gt;
&lt;br /&gt;
The GNU Readline library is optionally used to provide command&lt;br /&gt;
editing, tab completion, and history functionality at the CVC prompt&lt;br /&gt;
(when running in interactive mode).  Check your distribution for a&lt;br /&gt;
package named &amp;quot;libreadline-dev&amp;quot; or &amp;quot;readline-devel&amp;quot; or similar.&lt;br /&gt;
&lt;br /&gt;
The Boost C++ threading library (often packaged independently of the&lt;br /&gt;
Boost base library) is needed to run CVC4 in &amp;quot;portfolio&amp;quot;&lt;br /&gt;
(multithreaded) mode.  Check your distribution for a package named&lt;br /&gt;
&amp;quot;libboost-thread-dev&amp;quot; or similar.&lt;br /&gt;
&lt;br /&gt;
CxxTest is necessary to run CVC4's unit tests (included with the&lt;br /&gt;
distribution).  Running these is not really required for users of&lt;br /&gt;
CVC4; &amp;quot;make check&amp;quot; will skip unit tests if CxxTest isn't available,&lt;br /&gt;
and go on to run the extensive system- and regression-tests in the&lt;br /&gt;
source tree.  However, if you're interested, you can download CxxTest&lt;br /&gt;
at http://cxxtest.com/ .&lt;br /&gt;
&lt;br /&gt;
==Building with custom CLN installations (optional)==&lt;br /&gt;
&lt;br /&gt;
One option for compiling against a custom CLN installation is to provide the CLN_LIBS and CLN_CFLAGS arguments at configuration. Supposing you installed cln into CLN_DIR the following provides the necessary locations of the header and linking information.&lt;br /&gt;
    ./configure &amp;lt;other arguments&amp;gt; --with-cln CLN_LIBS=&amp;quot;-L&amp;lt;CLN_DIR&amp;gt;/lib -lcln&amp;quot; \&lt;br /&gt;
     CLN_CFLAGS=&amp;quot;-I&amp;lt;CLN_DIR&amp;gt;/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Building with CUDD (optional)==&lt;br /&gt;
&lt;br /&gt;
CUDD, if desired, must be installed delicately.  The CVC4 configure&lt;br /&gt;
script attempts to auto-detect the locations and names of CUDD headers&lt;br /&gt;
and libraries the way that the Fedora RPMs install them, the way that&lt;br /&gt;
our NYU-provided Debian packages install them, and the way they exist&lt;br /&gt;
when you download and build the CUDD sources directly.  If you install&lt;br /&gt;
from Fedora RPMs or our Debian packages, the process should be&lt;br /&gt;
completely automatic, since the libraries and headers are installed in&lt;br /&gt;
a standard location.  If you download the sources yourself, you need&lt;br /&gt;
to build them in a special way.  Fortunately, the&lt;br /&gt;
&amp;quot;contrib/build-cudd-2.4.2-with-libtool.sh&amp;quot; script in the CVC4 source&lt;br /&gt;
tree does exactly what you need: it patches the CUDD makefiles to use&lt;br /&gt;
libtool, builds the libtool libraries, then reverses the patch to&lt;br /&gt;
leave the makefiles as they were.  Once you run this script on an&lt;br /&gt;
unpacked CUDD 2.4.2 source distribution, then CVC4's configure script&lt;br /&gt;
should pick up the libraries if you provide&lt;br /&gt;
--with-cudd-dir=/PATH/TO/CUDD/SOURCES.&lt;br /&gt;
&lt;br /&gt;
If you want to force linking to CUDD, provide --with-cudd to the&lt;br /&gt;
configure script; this makes it a hard requirement rather than an&lt;br /&gt;
optional add-on.&lt;br /&gt;
&lt;br /&gt;
The NYU-provided Debian packaging of CUDD 2.4.2 and CUDD 2.5.0 are&lt;br /&gt;
here (along with the CVC4 Debian packages):&lt;br /&gt;
&lt;br /&gt;
  deb http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
&lt;br /&gt;
On Debian (and Debian-derived distributions like Ubuntu), you only&lt;br /&gt;
need to drop that one line in your /etc/apt/sources.list file, then install with your favorite package manager.&lt;br /&gt;
&lt;br /&gt;
The Debian source package &amp;quot;cudd&amp;quot;, available from the same repository,&lt;br /&gt;
includes a diff of all changes made to cudd makefiles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Language bindings=&lt;br /&gt;
&lt;br /&gt;
There are several options available for using CVC4 from the API.&lt;br /&gt;
&lt;br /&gt;
First, CVC4 offers a complete and flexible API for manipulating&lt;br /&gt;
expressions, maintaining a stack of assertions, and checking&lt;br /&gt;
satisfiability, and related things.  The C++ libraries (libcvc4.so and&lt;br /&gt;
libcvc4parser.so) and required headers are installed normally via a&lt;br /&gt;
&amp;quot;make install&amp;quot;.  This API is also available from Java (via CVC4.jar&lt;br /&gt;
and libcvc4jni.so) by configuring with --enable-language-bindings=java.&lt;br /&gt;
You'll also need SWIG 2.0 installed (and you might need to help&lt;br /&gt;
configure find it if you installed it in a nonstandard place with&lt;br /&gt;
--with-swig-dir=/path/to/swig/installation).  You may also need to&lt;br /&gt;
give the configure script the path to your Java headers (in&lt;br /&gt;
particular, jni.h).  You might do so with (for example):&lt;br /&gt;
&lt;br /&gt;
  ./configure --enable-language-bindings=java \&lt;br /&gt;
      JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-openjdk-amd64/include&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;quot;C++ compatibility API&amp;quot; (''#include &amp;lt;cvc4/cvc3_compat.h&amp;gt;''&lt;br /&gt;
and link against libcvc4compat.so) that attempts to maintain&lt;br /&gt;
source-level backwards-compatibility with the CVC3 C++ API.  The&lt;br /&gt;
compatibility library is built by default, and&lt;br /&gt;
''--enable-language-bindings=java'' enables the Java compatibility library&lt;br /&gt;
(CVC4compat.jar and libcvc4compatjni.so).&lt;br /&gt;
''--enable-language-bindings=c'' enables the C compatibility library&lt;br /&gt;
(''#include &amp;lt;cvc4/bindings/compat/c/c_interface.h&amp;gt;'' and link against&lt;br /&gt;
libcvc4bindings_c_compat.so), and if you want both C and Java&lt;br /&gt;
bindings, use ''--enable-language-bindings=c,java''.  These compatibility&lt;br /&gt;
language bindings do NOT require SWIG.&lt;br /&gt;
&lt;br /&gt;
The ''examples/'' directory in the source distribution includes some basic examples (the &amp;quot;simple vc&amp;quot;&lt;br /&gt;
and &amp;quot;simple vc compat&amp;quot; family of examples) of all these interfaces.&lt;br /&gt;
&lt;br /&gt;
In principle, since we use SWIG to generate the native Java API, we&lt;br /&gt;
could support other languages as well.  However, using CVC4 from other&lt;br /&gt;
languages is not supported, nor expected to work, at this time.  If&lt;br /&gt;
you're interested in helping to develop, maintain, and test a language&lt;br /&gt;
binding, please contact us via the users' mailing list at&lt;br /&gt;
cvc-users@cs.nyu.edu.&lt;br /&gt;
&lt;br /&gt;
=Building CVC4 from a repository checkout=&lt;br /&gt;
&lt;br /&gt;
The following tools and libraries are additionally required to build&lt;br /&gt;
CVC4 from from a repository checkout rather than from a prepared&lt;br /&gt;
source tarball.&lt;br /&gt;
&lt;br /&gt;
*'''Automake v1.11'''&lt;br /&gt;
*'''Autoconf v2.61'''&lt;br /&gt;
*'''Libtool v2.2'''&lt;br /&gt;
*'''ANTLR3 v3.2 or v3.4'''&lt;br /&gt;
*'''Java Development Kit''' ([http://www.antlr.org/wiki/pages/viewpage.action?pageId=728 required for ANTLR3])&lt;br /&gt;
&lt;br /&gt;
First, use &amp;quot;''./autogen.sh''&amp;quot; to create the configure script.  Then&lt;br /&gt;
proceed as normal for any distribution tarball.  The parsers are&lt;br /&gt;
pre-generated for the tarballs, but don't exist in the repository; hence the extra ANTLR3 and JDK requirements to&lt;br /&gt;
generate the source code for the parsers, when building from the&lt;br /&gt;
repository.&lt;br /&gt;
&lt;br /&gt;
=Examples and tutorials are not built or installed=&lt;br /&gt;
&lt;br /&gt;
Examples are not built by &amp;quot;''make''&amp;quot; or &amp;quot;''make install''&amp;quot;.  See&lt;br /&gt;
''examples/README'' in the source distribution for information on what to find in the ''examples/''&lt;br /&gt;
directory, as well as information about building and installing them.&lt;br /&gt;
&lt;br /&gt;
=Appendix: Build architecture=&lt;br /&gt;
&lt;br /&gt;
The build system is generated by automake, libtool, and autoconf.  It&lt;br /&gt;
is somewhat nonstandard, though, which (for one thing) requires that&lt;br /&gt;
GNU Make be used.  If you ./configure in the top-level source&lt;br /&gt;
directory, the objects will actually all appear in&lt;br /&gt;
builds/${arch}/${build_id}.  This is to allow multiple, separate&lt;br /&gt;
builds in the same place (e.g., an assertions-enabled debugging build&lt;br /&gt;
alongside a production build), without changing directories at the&lt;br /&gt;
shell.  The &amp;quot;current&amp;quot; build is maintained, and you can still use&lt;br /&gt;
(e.g.) &amp;quot;make -C src/main&amp;quot; to rebuild objects in just one subdirectory.&lt;br /&gt;
&lt;br /&gt;
You can also create your own build directory inside or outside of the&lt;br /&gt;
source tree and configure from there.  All objects will then be built&lt;br /&gt;
in that directory, and you'll ultimately find the &amp;quot;cvc4&amp;quot; binary in&lt;br /&gt;
src/main/, and the libraries under src/ and src/parser/.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5738</id>
		<title>User Manual</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5738"/>
				<updated>2019-01-26T17:31:50Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: /* Building CVC4 from source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This manual includes information on installing and using CVC4. It is a work in progress. &lt;br /&gt;
&lt;br /&gt;
=Getting CVC4=&lt;br /&gt;
&lt;br /&gt;
Both pre-compiled binaries and the source code for CVC4 are available for download from [http://cvc4.cs.stanford.edu/downloads/builds/ http://cvc4.cs.stanford.edu/downloads/builds/]. &lt;br /&gt;
&lt;br /&gt;
==Getting CVC4 binaries==&lt;br /&gt;
The most recent binaries can be downloaded from our Nightly Builds pages: &lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-dbg/ Debug] binaries (statically linked)&lt;br /&gt;
&lt;br /&gt;
==Building CVC4 from source==&lt;br /&gt;
[http://cvc4.cs.stanford.edu/downloads/builds/src/ Sources are available] from the same site as the binaries. The source-code is also available in the [https://github.com/CVC4/CVC4 CVC4 source repository]. &lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of dependencies and more detailed build instructions see [[Building CVC4 from source]].&lt;br /&gt;
&lt;br /&gt;
=Using the CVC4 binary=&lt;br /&gt;
&lt;br /&gt;
Once installed, the CVC4 driver binary (&amp;quot;cvc4&amp;quot;) can be executed to directly enter into interactive mode:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then enter commands into CVC4 interactively:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;incremental&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;produce-models&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; TRANSFORM 25*25;&lt;br /&gt;
 625&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example shows two useful options, ''incremental'' and ''produce-models.''&lt;br /&gt;
&lt;br /&gt;
* The ''incremental'' option allows you to issue multiple QUERY (or CHECKSAT) commands, and allows the use of the PUSH and POP commands.  Without this option, CVC4 optimizes itself for a single QUERY or CHECKSAT command (though you may issue any number of ASSERT commands).  The ''incremental'' option may also be given by passing the ''-i'' command line option to CVC4.&lt;br /&gt;
* The ''produce-models'' option allows you to query the model (here, with the COUNTERMODEL command) after an &amp;quot;invalid&amp;quot; QUERY (or &amp;quot;satisfiable&amp;quot; CHECK-SAT).  Without it, CVC4 doesn't do the bookkeeping necessary to support model generation.  The ''produce-models'' option may also be given by passing the ''-m'' command line option to CVC4.&lt;br /&gt;
&lt;br /&gt;
So, if you invoke CVC4 with ''-im'', you don't need to pass those options at all:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -im&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, CVC4 operates in [[#CVC4's native input language|CVC-language mode]].  If you enter something that looks like SMT-LIB, it will suggest that you use the &amp;quot;''--lang smt''&amp;quot; command-line option for SMT-LIB mode:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (declare-fun x () Int)&lt;br /&gt;
 Parse Error: &amp;lt;shell&amp;gt;:1.7: In CVC4 presentation language mode, but SMT-LIB format detected.  Use --lang smt for SMT-LIB support.&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verbosity==&lt;br /&gt;
&lt;br /&gt;
CVC4 has various levels of verbosity.  By default, CVC4 is pretty quiet, only reporting serious warnings and notices.  If you're curious about what it's doing, you can pass CVC4 the ''-v'' option:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -v file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
For even more verbosity, you can pass CVC4 an ''additional'' ''-v'':&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -vv file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
 expanding definitions...&lt;br /&gt;
 constraining subtypes...&lt;br /&gt;
 applying substitutions...&lt;br /&gt;
 simplifying assertions...&lt;br /&gt;
 doing static learning...&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
Internally, verbosity is just an integer value.  It starts at 0, and with every ''-v'' on the command line it is incremented; with every ''-q'', decremented.  It can also be set directly.  From CVC language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;verbosity&amp;quot; 2;&lt;br /&gt;
&lt;br /&gt;
Or from SMT-LIB language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (set-option :verbosity 2)&lt;br /&gt;
&lt;br /&gt;
==Getting statistics==&lt;br /&gt;
&lt;br /&gt;
Statistics can be dumped on exit (both normal and abnormal exits) with the ''--statistics'' command line option.&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 --statistics foo.smt2&lt;br /&gt;
 sat&lt;br /&gt;
 sat::decisions, 0&lt;br /&gt;
 sat::propagations, 3&lt;br /&gt;
 sat::starts, 1&lt;br /&gt;
 theory::uf::TheoryUF::functionTermsCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::mergesCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::termsCount, 6&lt;br /&gt;
 theory&amp;lt;THEORY_UF&amp;gt;::propagations, 1 &lt;br /&gt;
 driver::filename, foo.smt2&lt;br /&gt;
 driver::sat/unsat, sat&lt;br /&gt;
 driver::totalTime, 0.02015373&lt;br /&gt;
 ''[many others]''&lt;br /&gt;
&lt;br /&gt;
Many statistics name-value pairs follow, one comma-separated pair per line.&lt;br /&gt;
&lt;br /&gt;
==Exit status==&lt;br /&gt;
&lt;br /&gt;
Successful exit is marked by the exit code 0.  Most &amp;quot;normal errors&amp;quot; return a 1 as the exit code, but out of memory conditions, terminating signals, and other conditions can produce different (nonzero) exit codes.  In interactive mode, parse errors are ignored and the next line read; so in interactive mode, you may see an exit code of 0 even in the presence of such an error.&lt;br /&gt;
&lt;br /&gt;
''Note on previous versions:'' Up to version 1.2 of CVC4, exit status depended on the result (&amp;quot;sat&amp;quot; results caused an exit code of 10, &amp;quot;unsat&amp;quot; of 20).  This behavior was deemed nonstandard and is no longer the case; successful exits are always 0 in version 1.3 and later.&lt;br /&gt;
&lt;br /&gt;
=CVC4's input languages=&lt;br /&gt;
&lt;br /&gt;
When not used in interactive mode, CVC4 can read its input from an external file. It accepts the following input languages: &lt;br /&gt;
&lt;br /&gt;
* [[CVC4's native language | CVC4's native language]]&lt;br /&gt;
* SMT-LIB 2.0  (see [http://www.grammatech.com/resources/smt/SMTLIBTutorial.pdf David Cok's SMT-LIB tutorial])&lt;br /&gt;
* SMT-LIB 1.0&lt;br /&gt;
&lt;br /&gt;
CVC4 tries to automatically recognize the input language based on the file's extension: .cvc for CVC4's native language, .smt2 for SMT-LIB 2.0 and .smt for SMT-LIB 1.0. If the file extension does not match one of the previously mentioned ones you can specify the input language via the command line flag --lang. To see all language options type:&lt;br /&gt;
 $ cvc4 --lang help&lt;br /&gt;
&lt;br /&gt;
Every effort has been made to make CVC4 compliant with the SMT-LIB 2.0&lt;br /&gt;
standard (http://smtlib.org/).  However, when parsing SMT-LIB input,&lt;br /&gt;
certain default settings don't match what is stated in the official&lt;br /&gt;
standard.  To make CVC4 adhere more strictly to the standard, use the&lt;br /&gt;
&amp;quot;--smtlib&amp;quot; command-line option.  Even with this setting, CVC4 is&lt;br /&gt;
somewhat lenient; some non-conforming input may still be parsed and&lt;br /&gt;
processed.&lt;br /&gt;
&lt;br /&gt;
=Supported Theories=&lt;br /&gt;
The following theories are currently fully supported&lt;br /&gt;
* Booleans&lt;br /&gt;
* Uninterpreted functions&lt;br /&gt;
* Arrays [with extensionality]&lt;br /&gt;
* Inductive datatypes&lt;br /&gt;
* Tuples and record types&lt;br /&gt;
* Fixed width bitvectors&lt;br /&gt;
* Linear mixed real integer arithmetic&lt;br /&gt;
** Integer division and modulus by integer constants is supported by the &amp;quot;--rewrite-divk&amp;quot; flag&lt;br /&gt;
* [[sets|Finite sets]]&lt;br /&gt;
CVC4 supports first-order quantification and theory combinations of the above theories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following theories are currently partially supported and are undergoing development:&lt;br /&gt;
* Strings&lt;br /&gt;
&lt;br /&gt;
Theories with '''highly limited''' support:&lt;br /&gt;
* CVC4's non-linear real and non-linear integer arithmetic support is currently unlikely to satisfy a user's needs.  The current support is for parsing, rewrites, and a very limited class of proofs of unsatisifiability. The class of proofs is what is provable by linear arithmetic where each monomial (e.g. &amp;quot;xxy&amp;quot;) is treated as a unique variable.&lt;br /&gt;
&lt;br /&gt;
=The CVC4 library interface (API)=&lt;br /&gt;
&lt;br /&gt;
There are a number of examples of using CVC4 as a library distributed with the source code of the project. There are given in the &amp;quot;/examples&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 in a C++ project==&lt;br /&gt;
&lt;br /&gt;
A basic C++ example for using cvc4 is given in the file [https://github.com/CVC4/CVC4/blob/master/examples/simple_vc_cxx.cpp /examples/simple_vc_cxx.cpp].&lt;br /&gt;
The file goes through the examples for the basic interaction with CVC4:&lt;br /&gt;
# Constructing an ExprManager em&lt;br /&gt;
# Constructing an SmtEngine w.r.t. em.&lt;br /&gt;
# Getting a copy of the Type for mathematical integers from em, em.integerType().&lt;br /&gt;
# Constructing new Expressions&lt;br /&gt;
## Integer variables x and y: Expr x = em.mkVar(&amp;quot;x&amp;quot;, integer);&lt;br /&gt;
## The rational constant 0: em.mkConst(Rational(0));&lt;br /&gt;
## Constructing new expressions existing expressions: em.mkExpr(kind::GT, x, zero);&lt;br /&gt;
# Querying the SmtEngine whether or not a formula is valid. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information on the interfaces for Expr, Type, ExprManager and SmtEngine can be found in their respective header files.&lt;br /&gt;
&lt;br /&gt;
To compile simple_vc_cxx.cpp, there are different build instructions for whether or not you are compiling against a version of CVC4 in a local build directory or one installed via &amp;quot;make install&amp;quot; into a directory $PREFIX.&lt;br /&gt;
&lt;br /&gt;
* Local Build Directory: If you have build cvc4 via the &amp;quot;make&amp;quot; command before, you can compile simple_vc_cxx.cpp via &amp;quot;make examples&amp;quot;. The executable will then be &amp;quot;./builds/examples/simple_vc_cxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    $ make examples&lt;br /&gt;
    [...]&lt;br /&gt;
    $ ./builds/examples/simple_vc_cxx &lt;br /&gt;
    Checking validity of formula ((x &amp;gt; 0) AND (y &amp;gt; 0)) =&amp;gt; (((2 * x) + y) &amp;gt;= 3) with CVC4.&lt;br /&gt;
    CVC4 should report VALID.&lt;br /&gt;
    Result from CVC4 is: valid&lt;br /&gt;
* Installed Copy: If you have installed CVC4 via &amp;quot;make install&amp;quot; into the directory $PREFIX (which you can configure via &amp;quot;./configure --prefix=$PREFIX&amp;quot; you will need to modify lines 21-22.&lt;br /&gt;
    //#include &amp;lt;cvc4/cvc4.h&amp;gt; // use this after CVC4 is properly installed&lt;br /&gt;
    #include &amp;quot;smt/smt_engine.h&amp;quot;&lt;br /&gt;
:First, uncomment line 21 and comment out line 22. You may now &lt;br /&gt;
You can now compile and run by executing&lt;br /&gt;
    g++ -I$PREFIX/include -L$PREFIX/lib -lcvc4 examples/simple_vc_cxx.cpp -o simple_vc_cxx&lt;br /&gt;
    ./simple_vc_cxx&lt;br /&gt;
:You may need to add $PREFIX/lib is LD_LIBRARY_PATH or the equivalent.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 from Java==&lt;br /&gt;
==The compatibility interface==&lt;br /&gt;
&lt;br /&gt;
=Upgrading from CVC3 to CVC4=&lt;br /&gt;
&lt;br /&gt;
==Features not supported by CVC4 (yet)==&lt;br /&gt;
&lt;br /&gt;
===Type Correctness Conditions (TCCs)===&lt;br /&gt;
&lt;br /&gt;
Type Correctness Conditions (TCCs), and the checking of such, are not&lt;br /&gt;
supported by CVC4 1.0.  Thus, a function defined only on integers can be&lt;br /&gt;
applied to REAL (as INT is a subtype of REAL), and CVC4 will not complain,&lt;br /&gt;
but may produce strange results.  For example:&lt;br /&gt;
&lt;br /&gt;
  f : INT -&amp;gt; INT;&lt;br /&gt;
  ASSERT f(1/3) = 0;&lt;br /&gt;
  ASSERT f(2/3) = 1;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  COUNTEREXAMPLE;&lt;br /&gt;
  % f : (INT) -&amp;gt; INT = LAMBDA(x1:INT) : 0;&lt;br /&gt;
&lt;br /&gt;
CVC3 can be used to produce TCCs for this input (with the +dump-tcc option).&lt;br /&gt;
The TCC can be checked by CVC3 or another solver.  (CVC3 can also check&lt;br /&gt;
TCCs while solving with +tcc.)&lt;br /&gt;
&lt;br /&gt;
==If you were using the text interfaces of CVC3==&lt;br /&gt;
&lt;br /&gt;
The native language of all solvers in the CVC family, referred to as the&lt;br /&gt;
&amp;quot;presentation language,&amp;quot; has undergone some revisions for CVC4.  The&lt;br /&gt;
most notable is that CVC4 does _not_ add counterexample assertions to&lt;br /&gt;
the current assertion set after a SAT/INVALID result.  For example:&lt;br /&gt;
&lt;br /&gt;
  x, y : INT;&lt;br /&gt;
  ASSERT x = 1 OR x = 2;&lt;br /&gt;
  ASSERT y = 1 OR y = 2;&lt;br /&gt;
  ASSERT x /= y;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  QUERY x = 1;&lt;br /&gt;
  % invalid&lt;br /&gt;
  QUERY x = 2;&lt;br /&gt;
  % invalid&lt;br /&gt;
&lt;br /&gt;
Here, CVC4 responds &amp;quot;invalid&amp;quot; to the second and third queries, because&lt;br /&gt;
each has a counterexample (x=2 is a counterexample to the first, and&lt;br /&gt;
x=1 is a counterexample to the second).  However, CVC3 will respond&lt;br /&gt;
with &amp;quot;valid&amp;quot; to one of these two, as the first query (the CHECKSAT)&lt;br /&gt;
had the side-effect of locking CVC3 into one of the two cases; the&lt;br /&gt;
later queries are effectively querying the counterexample that was&lt;br /&gt;
found by the first.  CVC4 removes this side-effect of the CHECKSAT and&lt;br /&gt;
QUERY commands.&lt;br /&gt;
&lt;br /&gt;
CVC4 supports rational literals (of type REAL) in decimal; CVC3 did not&lt;br /&gt;
support decimals.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not have support for the IS_INTEGER predicate.&lt;br /&gt;
&lt;br /&gt;
==If you were using the library (&amp;quot;in-memory&amp;quot;) interface of CVC3==&lt;br /&gt;
===If you were using CVC3 from C===&lt;br /&gt;
===If you were using CVC3 from Java===&lt;br /&gt;
&lt;br /&gt;
=Advanced features=&lt;br /&gt;
&lt;br /&gt;
This section describes some features of CVC4 of interest to developers and advanced users. &lt;br /&gt;
&lt;br /&gt;
==Resource limits==&lt;br /&gt;
&lt;br /&gt;
CVC4 can be made to self-timeout after a given number of milliseconds.&lt;br /&gt;
Use the --tlimit command line option to limit the entire run of&lt;br /&gt;
CVC4, or use --tlimit-per to limit each individual query separately.&lt;br /&gt;
Preprocessing time is not counted by the time limit, so for some large&lt;br /&gt;
inputs which require aggressive preprocessing, you may notice that&lt;br /&gt;
--tlimit does not work very well.  If you suspect this might be the&lt;br /&gt;
case, you can use &amp;quot;-vv&amp;quot; (double verbosity) to see what CVC4 is doing.&lt;br /&gt;
&lt;br /&gt;
Time-limited runs are not deterministic; two consecutive runs with the&lt;br /&gt;
same time limit might produce different results (i.e., one may time out&lt;br /&gt;
and responds with &amp;quot;unknown&amp;quot;, while the other completes and provides an&lt;br /&gt;
answer).  To ensure that results are reproducible, use --rlimit or&lt;br /&gt;
--rlimit-per.  These options take a &amp;quot;resource count&amp;quot; (presently, based on&lt;br /&gt;
the number of SAT conflicts) that limits the search time.  A word of&lt;br /&gt;
caution, though: there is no guarantee that runs of different versions of&lt;br /&gt;
CVC4 or of different builds of CVC4 (e.g., two CVC4 binaries with different&lt;br /&gt;
features enabled, or for different architectures) will interpret the resource&lt;br /&gt;
count in the same manner.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not presently have a way to limit its memory use; you may opt&lt;br /&gt;
to run it from a shell after using &amp;quot;ulimit&amp;quot; to limit the size of the&lt;br /&gt;
heap.&lt;br /&gt;
&lt;br /&gt;
==Dumping API calls or preprocessed output==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Changing the output language==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Proof support==&lt;br /&gt;
&lt;br /&gt;
CVC4 1.0 has limited support for proofs, and they are disabled by default.&lt;br /&gt;
(Run the configure script with --enable-proof to enable proofs).  Proofs&lt;br /&gt;
are exported in LFSC format and are limited to the propositional backbone&lt;br /&gt;
of the discovered proof (theory lemmas are stated without proof in this&lt;br /&gt;
release).&lt;br /&gt;
&lt;br /&gt;
==Parallel solving==&lt;br /&gt;
&lt;br /&gt;
'''[Builds not ported to Stanford yet]''' The most recent binaries with support for parallel solving can be downloaded from our Nightly Builds pages:&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-dbg/ Debug] binaries (statically linked) &lt;br /&gt;
&lt;br /&gt;
If enabled at configure-time (./configure --with-portfolio), a second&lt;br /&gt;
CVC4 binary will be produced (&amp;quot;pcvc4&amp;quot;).  This binary has support for&lt;br /&gt;
running multiple instances of CVC4 in different threads.  Use --threads=N&lt;br /&gt;
to specify the number of threads, and use --thread0=&amp;quot;options for thread 0&amp;quot;&lt;br /&gt;
--thread1=&amp;quot;options for thread 1&amp;quot;, etc., to specify a configuration for the&lt;br /&gt;
threads.  Lemmas are *not* shared between the threads by default; to adjust&lt;br /&gt;
this, use the --filter-lemma-length=N option to share lemmas of N literals&lt;br /&gt;
(or smaller).  (Some lemmas are ineligible for sharing because they include&lt;br /&gt;
literals that are &amp;quot;local&amp;quot; to one thread.)&lt;br /&gt;
&lt;br /&gt;
Currently, the portfolio **does not work** with the theory of inductive&lt;br /&gt;
datatypes. This limitation will be addressed in a future release.&lt;br /&gt;
&lt;br /&gt;
See more details and examples in the [[Tutorials#Parallel_Solving|tutorial]].&lt;br /&gt;
&lt;br /&gt;
==Emacs support==&lt;br /&gt;
&lt;br /&gt;
For a suggestion of editing CVC4 source code with emacs, see the file&lt;br /&gt;
contrib/editing-with-emacs.  For a CVC language mode (the native input&lt;br /&gt;
language for CVC4), see contrib/cvc-mode.el.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5737</id>
		<title>User Manual</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5737"/>
				<updated>2019-01-26T04:34:09Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: /* Getting CVC4 binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This manual includes information on installing and using CVC4. It is a work in progress. &lt;br /&gt;
&lt;br /&gt;
=Getting CVC4=&lt;br /&gt;
&lt;br /&gt;
Both pre-compiled binaries and the source code for CVC4 are available for download from [http://cvc4.cs.stanford.edu/downloads/builds/ http://cvc4.cs.stanford.edu/downloads/builds/]. &lt;br /&gt;
&lt;br /&gt;
==Getting CVC4 binaries==&lt;br /&gt;
The most recent binaries can be downloaded from our Nightly Builds pages: &lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-dbg/ Debug] binaries (statically linked)&lt;br /&gt;
&lt;br /&gt;
==Building CVC4 from source==&lt;br /&gt;
[http://cvc4.cs.stanford.edu/downloads/builds/src/ Sources are available] from the same site as the binaries. The source-code is also available in the [https://github.com/CVC4/CVC4 CVC4 source repository]. &lt;br /&gt;
&lt;br /&gt;
To build CVC4 from source the following steps are required. After downloading the source files first install antlr by running the following script in the CVC4 contrib directory:&lt;br /&gt;
    cd contrib&lt;br /&gt;
    ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
The next step is to configure CVC4:&lt;br /&gt;
    cd ..&lt;br /&gt;
    ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
&lt;br /&gt;
And then finally compile it:&lt;br /&gt;
    make&lt;br /&gt;
    make check   [recommended]&lt;br /&gt;
    make install [optional]&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of dependencies and more detailed build instructions see [[Building CVC4 from source]].&lt;br /&gt;
&lt;br /&gt;
=Using the CVC4 binary=&lt;br /&gt;
&lt;br /&gt;
Once installed, the CVC4 driver binary (&amp;quot;cvc4&amp;quot;) can be executed to directly enter into interactive mode:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then enter commands into CVC4 interactively:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;incremental&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;produce-models&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; TRANSFORM 25*25;&lt;br /&gt;
 625&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example shows two useful options, ''incremental'' and ''produce-models.''&lt;br /&gt;
&lt;br /&gt;
* The ''incremental'' option allows you to issue multiple QUERY (or CHECKSAT) commands, and allows the use of the PUSH and POP commands.  Without this option, CVC4 optimizes itself for a single QUERY or CHECKSAT command (though you may issue any number of ASSERT commands).  The ''incremental'' option may also be given by passing the ''-i'' command line option to CVC4.&lt;br /&gt;
* The ''produce-models'' option allows you to query the model (here, with the COUNTERMODEL command) after an &amp;quot;invalid&amp;quot; QUERY (or &amp;quot;satisfiable&amp;quot; CHECK-SAT).  Without it, CVC4 doesn't do the bookkeeping necessary to support model generation.  The ''produce-models'' option may also be given by passing the ''-m'' command line option to CVC4.&lt;br /&gt;
&lt;br /&gt;
So, if you invoke CVC4 with ''-im'', you don't need to pass those options at all:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -im&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, CVC4 operates in [[#CVC4's native input language|CVC-language mode]].  If you enter something that looks like SMT-LIB, it will suggest that you use the &amp;quot;''--lang smt''&amp;quot; command-line option for SMT-LIB mode:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (declare-fun x () Int)&lt;br /&gt;
 Parse Error: &amp;lt;shell&amp;gt;:1.7: In CVC4 presentation language mode, but SMT-LIB format detected.  Use --lang smt for SMT-LIB support.&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verbosity==&lt;br /&gt;
&lt;br /&gt;
CVC4 has various levels of verbosity.  By default, CVC4 is pretty quiet, only reporting serious warnings and notices.  If you're curious about what it's doing, you can pass CVC4 the ''-v'' option:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -v file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
For even more verbosity, you can pass CVC4 an ''additional'' ''-v'':&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -vv file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
 expanding definitions...&lt;br /&gt;
 constraining subtypes...&lt;br /&gt;
 applying substitutions...&lt;br /&gt;
 simplifying assertions...&lt;br /&gt;
 doing static learning...&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
Internally, verbosity is just an integer value.  It starts at 0, and with every ''-v'' on the command line it is incremented; with every ''-q'', decremented.  It can also be set directly.  From CVC language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;verbosity&amp;quot; 2;&lt;br /&gt;
&lt;br /&gt;
Or from SMT-LIB language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (set-option :verbosity 2)&lt;br /&gt;
&lt;br /&gt;
==Getting statistics==&lt;br /&gt;
&lt;br /&gt;
Statistics can be dumped on exit (both normal and abnormal exits) with the ''--statistics'' command line option.&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 --statistics foo.smt2&lt;br /&gt;
 sat&lt;br /&gt;
 sat::decisions, 0&lt;br /&gt;
 sat::propagations, 3&lt;br /&gt;
 sat::starts, 1&lt;br /&gt;
 theory::uf::TheoryUF::functionTermsCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::mergesCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::termsCount, 6&lt;br /&gt;
 theory&amp;lt;THEORY_UF&amp;gt;::propagations, 1 &lt;br /&gt;
 driver::filename, foo.smt2&lt;br /&gt;
 driver::sat/unsat, sat&lt;br /&gt;
 driver::totalTime, 0.02015373&lt;br /&gt;
 ''[many others]''&lt;br /&gt;
&lt;br /&gt;
Many statistics name-value pairs follow, one comma-separated pair per line.&lt;br /&gt;
&lt;br /&gt;
==Exit status==&lt;br /&gt;
&lt;br /&gt;
Successful exit is marked by the exit code 0.  Most &amp;quot;normal errors&amp;quot; return a 1 as the exit code, but out of memory conditions, terminating signals, and other conditions can produce different (nonzero) exit codes.  In interactive mode, parse errors are ignored and the next line read; so in interactive mode, you may see an exit code of 0 even in the presence of such an error.&lt;br /&gt;
&lt;br /&gt;
''Note on previous versions:'' Up to version 1.2 of CVC4, exit status depended on the result (&amp;quot;sat&amp;quot; results caused an exit code of 10, &amp;quot;unsat&amp;quot; of 20).  This behavior was deemed nonstandard and is no longer the case; successful exits are always 0 in version 1.3 and later.&lt;br /&gt;
&lt;br /&gt;
=CVC4's input languages=&lt;br /&gt;
&lt;br /&gt;
When not used in interactive mode, CVC4 can read its input from an external file. It accepts the following input languages: &lt;br /&gt;
&lt;br /&gt;
* [[CVC4's native language | CVC4's native language]]&lt;br /&gt;
* SMT-LIB 2.0  (see [http://www.grammatech.com/resources/smt/SMTLIBTutorial.pdf David Cok's SMT-LIB tutorial])&lt;br /&gt;
* SMT-LIB 1.0&lt;br /&gt;
&lt;br /&gt;
CVC4 tries to automatically recognize the input language based on the file's extension: .cvc for CVC4's native language, .smt2 for SMT-LIB 2.0 and .smt for SMT-LIB 1.0. If the file extension does not match one of the previously mentioned ones you can specify the input language via the command line flag --lang. To see all language options type:&lt;br /&gt;
 $ cvc4 --lang help&lt;br /&gt;
&lt;br /&gt;
Every effort has been made to make CVC4 compliant with the SMT-LIB 2.0&lt;br /&gt;
standard (http://smtlib.org/).  However, when parsing SMT-LIB input,&lt;br /&gt;
certain default settings don't match what is stated in the official&lt;br /&gt;
standard.  To make CVC4 adhere more strictly to the standard, use the&lt;br /&gt;
&amp;quot;--smtlib&amp;quot; command-line option.  Even with this setting, CVC4 is&lt;br /&gt;
somewhat lenient; some non-conforming input may still be parsed and&lt;br /&gt;
processed.&lt;br /&gt;
&lt;br /&gt;
=Supported Theories=&lt;br /&gt;
The following theories are currently fully supported&lt;br /&gt;
* Booleans&lt;br /&gt;
* Uninterpreted functions&lt;br /&gt;
* Arrays [with extensionality]&lt;br /&gt;
* Inductive datatypes&lt;br /&gt;
* Tuples and record types&lt;br /&gt;
* Fixed width bitvectors&lt;br /&gt;
* Linear mixed real integer arithmetic&lt;br /&gt;
** Integer division and modulus by integer constants is supported by the &amp;quot;--rewrite-divk&amp;quot; flag&lt;br /&gt;
* [[sets|Finite sets]]&lt;br /&gt;
CVC4 supports first-order quantification and theory combinations of the above theories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following theories are currently partially supported and are undergoing development:&lt;br /&gt;
* Strings&lt;br /&gt;
&lt;br /&gt;
Theories with '''highly limited''' support:&lt;br /&gt;
* CVC4's non-linear real and non-linear integer arithmetic support is currently unlikely to satisfy a user's needs.  The current support is for parsing, rewrites, and a very limited class of proofs of unsatisifiability. The class of proofs is what is provable by linear arithmetic where each monomial (e.g. &amp;quot;xxy&amp;quot;) is treated as a unique variable.&lt;br /&gt;
&lt;br /&gt;
=The CVC4 library interface (API)=&lt;br /&gt;
&lt;br /&gt;
There are a number of examples of using CVC4 as a library distributed with the source code of the project. There are given in the &amp;quot;/examples&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 in a C++ project==&lt;br /&gt;
&lt;br /&gt;
A basic C++ example for using cvc4 is given in the file [https://github.com/CVC4/CVC4/blob/master/examples/simple_vc_cxx.cpp /examples/simple_vc_cxx.cpp].&lt;br /&gt;
The file goes through the examples for the basic interaction with CVC4:&lt;br /&gt;
# Constructing an ExprManager em&lt;br /&gt;
# Constructing an SmtEngine w.r.t. em.&lt;br /&gt;
# Getting a copy of the Type for mathematical integers from em, em.integerType().&lt;br /&gt;
# Constructing new Expressions&lt;br /&gt;
## Integer variables x and y: Expr x = em.mkVar(&amp;quot;x&amp;quot;, integer);&lt;br /&gt;
## The rational constant 0: em.mkConst(Rational(0));&lt;br /&gt;
## Constructing new expressions existing expressions: em.mkExpr(kind::GT, x, zero);&lt;br /&gt;
# Querying the SmtEngine whether or not a formula is valid. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information on the interfaces for Expr, Type, ExprManager and SmtEngine can be found in their respective header files.&lt;br /&gt;
&lt;br /&gt;
To compile simple_vc_cxx.cpp, there are different build instructions for whether or not you are compiling against a version of CVC4 in a local build directory or one installed via &amp;quot;make install&amp;quot; into a directory $PREFIX.&lt;br /&gt;
&lt;br /&gt;
* Local Build Directory: If you have build cvc4 via the &amp;quot;make&amp;quot; command before, you can compile simple_vc_cxx.cpp via &amp;quot;make examples&amp;quot;. The executable will then be &amp;quot;./builds/examples/simple_vc_cxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    $ make examples&lt;br /&gt;
    [...]&lt;br /&gt;
    $ ./builds/examples/simple_vc_cxx &lt;br /&gt;
    Checking validity of formula ((x &amp;gt; 0) AND (y &amp;gt; 0)) =&amp;gt; (((2 * x) + y) &amp;gt;= 3) with CVC4.&lt;br /&gt;
    CVC4 should report VALID.&lt;br /&gt;
    Result from CVC4 is: valid&lt;br /&gt;
* Installed Copy: If you have installed CVC4 via &amp;quot;make install&amp;quot; into the directory $PREFIX (which you can configure via &amp;quot;./configure --prefix=$PREFIX&amp;quot; you will need to modify lines 21-22.&lt;br /&gt;
    //#include &amp;lt;cvc4/cvc4.h&amp;gt; // use this after CVC4 is properly installed&lt;br /&gt;
    #include &amp;quot;smt/smt_engine.h&amp;quot;&lt;br /&gt;
:First, uncomment line 21 and comment out line 22. You may now &lt;br /&gt;
You can now compile and run by executing&lt;br /&gt;
    g++ -I$PREFIX/include -L$PREFIX/lib -lcvc4 examples/simple_vc_cxx.cpp -o simple_vc_cxx&lt;br /&gt;
    ./simple_vc_cxx&lt;br /&gt;
:You may need to add $PREFIX/lib is LD_LIBRARY_PATH or the equivalent.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 from Java==&lt;br /&gt;
==The compatibility interface==&lt;br /&gt;
&lt;br /&gt;
=Upgrading from CVC3 to CVC4=&lt;br /&gt;
&lt;br /&gt;
==Features not supported by CVC4 (yet)==&lt;br /&gt;
&lt;br /&gt;
===Type Correctness Conditions (TCCs)===&lt;br /&gt;
&lt;br /&gt;
Type Correctness Conditions (TCCs), and the checking of such, are not&lt;br /&gt;
supported by CVC4 1.0.  Thus, a function defined only on integers can be&lt;br /&gt;
applied to REAL (as INT is a subtype of REAL), and CVC4 will not complain,&lt;br /&gt;
but may produce strange results.  For example:&lt;br /&gt;
&lt;br /&gt;
  f : INT -&amp;gt; INT;&lt;br /&gt;
  ASSERT f(1/3) = 0;&lt;br /&gt;
  ASSERT f(2/3) = 1;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  COUNTEREXAMPLE;&lt;br /&gt;
  % f : (INT) -&amp;gt; INT = LAMBDA(x1:INT) : 0;&lt;br /&gt;
&lt;br /&gt;
CVC3 can be used to produce TCCs for this input (with the +dump-tcc option).&lt;br /&gt;
The TCC can be checked by CVC3 or another solver.  (CVC3 can also check&lt;br /&gt;
TCCs while solving with +tcc.)&lt;br /&gt;
&lt;br /&gt;
==If you were using the text interfaces of CVC3==&lt;br /&gt;
&lt;br /&gt;
The native language of all solvers in the CVC family, referred to as the&lt;br /&gt;
&amp;quot;presentation language,&amp;quot; has undergone some revisions for CVC4.  The&lt;br /&gt;
most notable is that CVC4 does _not_ add counterexample assertions to&lt;br /&gt;
the current assertion set after a SAT/INVALID result.  For example:&lt;br /&gt;
&lt;br /&gt;
  x, y : INT;&lt;br /&gt;
  ASSERT x = 1 OR x = 2;&lt;br /&gt;
  ASSERT y = 1 OR y = 2;&lt;br /&gt;
  ASSERT x /= y;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  QUERY x = 1;&lt;br /&gt;
  % invalid&lt;br /&gt;
  QUERY x = 2;&lt;br /&gt;
  % invalid&lt;br /&gt;
&lt;br /&gt;
Here, CVC4 responds &amp;quot;invalid&amp;quot; to the second and third queries, because&lt;br /&gt;
each has a counterexample (x=2 is a counterexample to the first, and&lt;br /&gt;
x=1 is a counterexample to the second).  However, CVC3 will respond&lt;br /&gt;
with &amp;quot;valid&amp;quot; to one of these two, as the first query (the CHECKSAT)&lt;br /&gt;
had the side-effect of locking CVC3 into one of the two cases; the&lt;br /&gt;
later queries are effectively querying the counterexample that was&lt;br /&gt;
found by the first.  CVC4 removes this side-effect of the CHECKSAT and&lt;br /&gt;
QUERY commands.&lt;br /&gt;
&lt;br /&gt;
CVC4 supports rational literals (of type REAL) in decimal; CVC3 did not&lt;br /&gt;
support decimals.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not have support for the IS_INTEGER predicate.&lt;br /&gt;
&lt;br /&gt;
==If you were using the library (&amp;quot;in-memory&amp;quot;) interface of CVC3==&lt;br /&gt;
===If you were using CVC3 from C===&lt;br /&gt;
===If you were using CVC3 from Java===&lt;br /&gt;
&lt;br /&gt;
=Advanced features=&lt;br /&gt;
&lt;br /&gt;
This section describes some features of CVC4 of interest to developers and advanced users. &lt;br /&gt;
&lt;br /&gt;
==Resource limits==&lt;br /&gt;
&lt;br /&gt;
CVC4 can be made to self-timeout after a given number of milliseconds.&lt;br /&gt;
Use the --tlimit command line option to limit the entire run of&lt;br /&gt;
CVC4, or use --tlimit-per to limit each individual query separately.&lt;br /&gt;
Preprocessing time is not counted by the time limit, so for some large&lt;br /&gt;
inputs which require aggressive preprocessing, you may notice that&lt;br /&gt;
--tlimit does not work very well.  If you suspect this might be the&lt;br /&gt;
case, you can use &amp;quot;-vv&amp;quot; (double verbosity) to see what CVC4 is doing.&lt;br /&gt;
&lt;br /&gt;
Time-limited runs are not deterministic; two consecutive runs with the&lt;br /&gt;
same time limit might produce different results (i.e., one may time out&lt;br /&gt;
and responds with &amp;quot;unknown&amp;quot;, while the other completes and provides an&lt;br /&gt;
answer).  To ensure that results are reproducible, use --rlimit or&lt;br /&gt;
--rlimit-per.  These options take a &amp;quot;resource count&amp;quot; (presently, based on&lt;br /&gt;
the number of SAT conflicts) that limits the search time.  A word of&lt;br /&gt;
caution, though: there is no guarantee that runs of different versions of&lt;br /&gt;
CVC4 or of different builds of CVC4 (e.g., two CVC4 binaries with different&lt;br /&gt;
features enabled, or for different architectures) will interpret the resource&lt;br /&gt;
count in the same manner.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not presently have a way to limit its memory use; you may opt&lt;br /&gt;
to run it from a shell after using &amp;quot;ulimit&amp;quot; to limit the size of the&lt;br /&gt;
heap.&lt;br /&gt;
&lt;br /&gt;
==Dumping API calls or preprocessed output==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Changing the output language==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Proof support==&lt;br /&gt;
&lt;br /&gt;
CVC4 1.0 has limited support for proofs, and they are disabled by default.&lt;br /&gt;
(Run the configure script with --enable-proof to enable proofs).  Proofs&lt;br /&gt;
are exported in LFSC format and are limited to the propositional backbone&lt;br /&gt;
of the discovered proof (theory lemmas are stated without proof in this&lt;br /&gt;
release).&lt;br /&gt;
&lt;br /&gt;
==Parallel solving==&lt;br /&gt;
&lt;br /&gt;
'''[Builds not ported to Stanford yet]''' The most recent binaries with support for parallel solving can be downloaded from our Nightly Builds pages:&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-dbg/ Debug] binaries (statically linked) &lt;br /&gt;
&lt;br /&gt;
If enabled at configure-time (./configure --with-portfolio), a second&lt;br /&gt;
CVC4 binary will be produced (&amp;quot;pcvc4&amp;quot;).  This binary has support for&lt;br /&gt;
running multiple instances of CVC4 in different threads.  Use --threads=N&lt;br /&gt;
to specify the number of threads, and use --thread0=&amp;quot;options for thread 0&amp;quot;&lt;br /&gt;
--thread1=&amp;quot;options for thread 1&amp;quot;, etc., to specify a configuration for the&lt;br /&gt;
threads.  Lemmas are *not* shared between the threads by default; to adjust&lt;br /&gt;
this, use the --filter-lemma-length=N option to share lemmas of N literals&lt;br /&gt;
(or smaller).  (Some lemmas are ineligible for sharing because they include&lt;br /&gt;
literals that are &amp;quot;local&amp;quot; to one thread.)&lt;br /&gt;
&lt;br /&gt;
Currently, the portfolio **does not work** with the theory of inductive&lt;br /&gt;
datatypes. This limitation will be addressed in a future release.&lt;br /&gt;
&lt;br /&gt;
See more details and examples in the [[Tutorials#Parallel_Solving|tutorial]].&lt;br /&gt;
&lt;br /&gt;
==Emacs support==&lt;br /&gt;
&lt;br /&gt;
For a suggestion of editing CVC4 source code with emacs, see the file&lt;br /&gt;
contrib/editing-with-emacs.  For a CVC language mode (the native input&lt;br /&gt;
language for CVC4), see contrib/cvc-mode.el.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5736</id>
		<title>User Manual</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5736"/>
				<updated>2019-01-26T04:33:27Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: /* Getting CVC4 binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This manual includes information on installing and using CVC4. It is a work in progress. &lt;br /&gt;
&lt;br /&gt;
=Getting CVC4=&lt;br /&gt;
&lt;br /&gt;
Both pre-compiled binaries and the source code for CVC4 are available for download from [http://cvc4.cs.stanford.edu/downloads/builds/ http://cvc4.cs.stanford.edu/downloads/builds/]. &lt;br /&gt;
&lt;br /&gt;
==Getting CVC4 binaries==&lt;br /&gt;
The most recent binaries can be downloaded from our Nightly Builds pages: &lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-dbg/ Debug] binaries (statically linked)&lt;br /&gt;
&lt;br /&gt;
'''[Not ported to Stanford yet]''' To install CVC4 on an Ubuntu Machine follow the instructions below. First add the CVC4 repository to /etc/apt/sources.list by inserting the following two lines at the end of the file:&lt;br /&gt;
  # CVC4 repository&lt;br /&gt;
  deb http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
  deb-src http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
&lt;br /&gt;
To run CVC4 as a binary you only need the first line but to use the library API you will also need the source package. &lt;br /&gt;
Make sure to update the respository list by running:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
Now you can simply install CVC4 as you would any other piece of sofware using the command:&lt;br /&gt;
  sudo apt-get install cvc4&lt;br /&gt;
&lt;br /&gt;
If you want to use CVC4 as a library also install the following packages: libcvc4-dev, and libcvc4-parser-dev.&lt;br /&gt;
&lt;br /&gt;
==Building CVC4 from source==&lt;br /&gt;
[http://cvc4.cs.stanford.edu/downloads/builds/src/ Sources are available] from the same site as the binaries. The source-code is also available in the [https://github.com/CVC4/CVC4 CVC4 source repository]. &lt;br /&gt;
&lt;br /&gt;
To build CVC4 from source the following steps are required. After downloading the source files first install antlr by running the following script in the CVC4 contrib directory:&lt;br /&gt;
    cd contrib&lt;br /&gt;
    ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
The next step is to configure CVC4:&lt;br /&gt;
    cd ..&lt;br /&gt;
    ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
&lt;br /&gt;
And then finally compile it:&lt;br /&gt;
    make&lt;br /&gt;
    make check   [recommended]&lt;br /&gt;
    make install [optional]&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of dependencies and more detailed build instructions see [[Building CVC4 from source]].&lt;br /&gt;
&lt;br /&gt;
=Using the CVC4 binary=&lt;br /&gt;
&lt;br /&gt;
Once installed, the CVC4 driver binary (&amp;quot;cvc4&amp;quot;) can be executed to directly enter into interactive mode:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then enter commands into CVC4 interactively:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;incremental&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;produce-models&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; TRANSFORM 25*25;&lt;br /&gt;
 625&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example shows two useful options, ''incremental'' and ''produce-models.''&lt;br /&gt;
&lt;br /&gt;
* The ''incremental'' option allows you to issue multiple QUERY (or CHECKSAT) commands, and allows the use of the PUSH and POP commands.  Without this option, CVC4 optimizes itself for a single QUERY or CHECKSAT command (though you may issue any number of ASSERT commands).  The ''incremental'' option may also be given by passing the ''-i'' command line option to CVC4.&lt;br /&gt;
* The ''produce-models'' option allows you to query the model (here, with the COUNTERMODEL command) after an &amp;quot;invalid&amp;quot; QUERY (or &amp;quot;satisfiable&amp;quot; CHECK-SAT).  Without it, CVC4 doesn't do the bookkeeping necessary to support model generation.  The ''produce-models'' option may also be given by passing the ''-m'' command line option to CVC4.&lt;br /&gt;
&lt;br /&gt;
So, if you invoke CVC4 with ''-im'', you don't need to pass those options at all:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -im&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, CVC4 operates in [[#CVC4's native input language|CVC-language mode]].  If you enter something that looks like SMT-LIB, it will suggest that you use the &amp;quot;''--lang smt''&amp;quot; command-line option for SMT-LIB mode:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (declare-fun x () Int)&lt;br /&gt;
 Parse Error: &amp;lt;shell&amp;gt;:1.7: In CVC4 presentation language mode, but SMT-LIB format detected.  Use --lang smt for SMT-LIB support.&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verbosity==&lt;br /&gt;
&lt;br /&gt;
CVC4 has various levels of verbosity.  By default, CVC4 is pretty quiet, only reporting serious warnings and notices.  If you're curious about what it's doing, you can pass CVC4 the ''-v'' option:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -v file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
For even more verbosity, you can pass CVC4 an ''additional'' ''-v'':&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -vv file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
 expanding definitions...&lt;br /&gt;
 constraining subtypes...&lt;br /&gt;
 applying substitutions...&lt;br /&gt;
 simplifying assertions...&lt;br /&gt;
 doing static learning...&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
Internally, verbosity is just an integer value.  It starts at 0, and with every ''-v'' on the command line it is incremented; with every ''-q'', decremented.  It can also be set directly.  From CVC language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;verbosity&amp;quot; 2;&lt;br /&gt;
&lt;br /&gt;
Or from SMT-LIB language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (set-option :verbosity 2)&lt;br /&gt;
&lt;br /&gt;
==Getting statistics==&lt;br /&gt;
&lt;br /&gt;
Statistics can be dumped on exit (both normal and abnormal exits) with the ''--statistics'' command line option.&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 --statistics foo.smt2&lt;br /&gt;
 sat&lt;br /&gt;
 sat::decisions, 0&lt;br /&gt;
 sat::propagations, 3&lt;br /&gt;
 sat::starts, 1&lt;br /&gt;
 theory::uf::TheoryUF::functionTermsCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::mergesCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::termsCount, 6&lt;br /&gt;
 theory&amp;lt;THEORY_UF&amp;gt;::propagations, 1 &lt;br /&gt;
 driver::filename, foo.smt2&lt;br /&gt;
 driver::sat/unsat, sat&lt;br /&gt;
 driver::totalTime, 0.02015373&lt;br /&gt;
 ''[many others]''&lt;br /&gt;
&lt;br /&gt;
Many statistics name-value pairs follow, one comma-separated pair per line.&lt;br /&gt;
&lt;br /&gt;
==Exit status==&lt;br /&gt;
&lt;br /&gt;
Successful exit is marked by the exit code 0.  Most &amp;quot;normal errors&amp;quot; return a 1 as the exit code, but out of memory conditions, terminating signals, and other conditions can produce different (nonzero) exit codes.  In interactive mode, parse errors are ignored and the next line read; so in interactive mode, you may see an exit code of 0 even in the presence of such an error.&lt;br /&gt;
&lt;br /&gt;
''Note on previous versions:'' Up to version 1.2 of CVC4, exit status depended on the result (&amp;quot;sat&amp;quot; results caused an exit code of 10, &amp;quot;unsat&amp;quot; of 20).  This behavior was deemed nonstandard and is no longer the case; successful exits are always 0 in version 1.3 and later.&lt;br /&gt;
&lt;br /&gt;
=CVC4's input languages=&lt;br /&gt;
&lt;br /&gt;
When not used in interactive mode, CVC4 can read its input from an external file. It accepts the following input languages: &lt;br /&gt;
&lt;br /&gt;
* [[CVC4's native language | CVC4's native language]]&lt;br /&gt;
* SMT-LIB 2.0  (see [http://www.grammatech.com/resources/smt/SMTLIBTutorial.pdf David Cok's SMT-LIB tutorial])&lt;br /&gt;
* SMT-LIB 1.0&lt;br /&gt;
&lt;br /&gt;
CVC4 tries to automatically recognize the input language based on the file's extension: .cvc for CVC4's native language, .smt2 for SMT-LIB 2.0 and .smt for SMT-LIB 1.0. If the file extension does not match one of the previously mentioned ones you can specify the input language via the command line flag --lang. To see all language options type:&lt;br /&gt;
 $ cvc4 --lang help&lt;br /&gt;
&lt;br /&gt;
Every effort has been made to make CVC4 compliant with the SMT-LIB 2.0&lt;br /&gt;
standard (http://smtlib.org/).  However, when parsing SMT-LIB input,&lt;br /&gt;
certain default settings don't match what is stated in the official&lt;br /&gt;
standard.  To make CVC4 adhere more strictly to the standard, use the&lt;br /&gt;
&amp;quot;--smtlib&amp;quot; command-line option.  Even with this setting, CVC4 is&lt;br /&gt;
somewhat lenient; some non-conforming input may still be parsed and&lt;br /&gt;
processed.&lt;br /&gt;
&lt;br /&gt;
=Supported Theories=&lt;br /&gt;
The following theories are currently fully supported&lt;br /&gt;
* Booleans&lt;br /&gt;
* Uninterpreted functions&lt;br /&gt;
* Arrays [with extensionality]&lt;br /&gt;
* Inductive datatypes&lt;br /&gt;
* Tuples and record types&lt;br /&gt;
* Fixed width bitvectors&lt;br /&gt;
* Linear mixed real integer arithmetic&lt;br /&gt;
** Integer division and modulus by integer constants is supported by the &amp;quot;--rewrite-divk&amp;quot; flag&lt;br /&gt;
* [[sets|Finite sets]]&lt;br /&gt;
CVC4 supports first-order quantification and theory combinations of the above theories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following theories are currently partially supported and are undergoing development:&lt;br /&gt;
* Strings&lt;br /&gt;
&lt;br /&gt;
Theories with '''highly limited''' support:&lt;br /&gt;
* CVC4's non-linear real and non-linear integer arithmetic support is currently unlikely to satisfy a user's needs.  The current support is for parsing, rewrites, and a very limited class of proofs of unsatisifiability. The class of proofs is what is provable by linear arithmetic where each monomial (e.g. &amp;quot;xxy&amp;quot;) is treated as a unique variable.&lt;br /&gt;
&lt;br /&gt;
=The CVC4 library interface (API)=&lt;br /&gt;
&lt;br /&gt;
There are a number of examples of using CVC4 as a library distributed with the source code of the project. There are given in the &amp;quot;/examples&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 in a C++ project==&lt;br /&gt;
&lt;br /&gt;
A basic C++ example for using cvc4 is given in the file [https://github.com/CVC4/CVC4/blob/master/examples/simple_vc_cxx.cpp /examples/simple_vc_cxx.cpp].&lt;br /&gt;
The file goes through the examples for the basic interaction with CVC4:&lt;br /&gt;
# Constructing an ExprManager em&lt;br /&gt;
# Constructing an SmtEngine w.r.t. em.&lt;br /&gt;
# Getting a copy of the Type for mathematical integers from em, em.integerType().&lt;br /&gt;
# Constructing new Expressions&lt;br /&gt;
## Integer variables x and y: Expr x = em.mkVar(&amp;quot;x&amp;quot;, integer);&lt;br /&gt;
## The rational constant 0: em.mkConst(Rational(0));&lt;br /&gt;
## Constructing new expressions existing expressions: em.mkExpr(kind::GT, x, zero);&lt;br /&gt;
# Querying the SmtEngine whether or not a formula is valid. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information on the interfaces for Expr, Type, ExprManager and SmtEngine can be found in their respective header files.&lt;br /&gt;
&lt;br /&gt;
To compile simple_vc_cxx.cpp, there are different build instructions for whether or not you are compiling against a version of CVC4 in a local build directory or one installed via &amp;quot;make install&amp;quot; into a directory $PREFIX.&lt;br /&gt;
&lt;br /&gt;
* Local Build Directory: If you have build cvc4 via the &amp;quot;make&amp;quot; command before, you can compile simple_vc_cxx.cpp via &amp;quot;make examples&amp;quot;. The executable will then be &amp;quot;./builds/examples/simple_vc_cxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    $ make examples&lt;br /&gt;
    [...]&lt;br /&gt;
    $ ./builds/examples/simple_vc_cxx &lt;br /&gt;
    Checking validity of formula ((x &amp;gt; 0) AND (y &amp;gt; 0)) =&amp;gt; (((2 * x) + y) &amp;gt;= 3) with CVC4.&lt;br /&gt;
    CVC4 should report VALID.&lt;br /&gt;
    Result from CVC4 is: valid&lt;br /&gt;
* Installed Copy: If you have installed CVC4 via &amp;quot;make install&amp;quot; into the directory $PREFIX (which you can configure via &amp;quot;./configure --prefix=$PREFIX&amp;quot; you will need to modify lines 21-22.&lt;br /&gt;
    //#include &amp;lt;cvc4/cvc4.h&amp;gt; // use this after CVC4 is properly installed&lt;br /&gt;
    #include &amp;quot;smt/smt_engine.h&amp;quot;&lt;br /&gt;
:First, uncomment line 21 and comment out line 22. You may now &lt;br /&gt;
You can now compile and run by executing&lt;br /&gt;
    g++ -I$PREFIX/include -L$PREFIX/lib -lcvc4 examples/simple_vc_cxx.cpp -o simple_vc_cxx&lt;br /&gt;
    ./simple_vc_cxx&lt;br /&gt;
:You may need to add $PREFIX/lib is LD_LIBRARY_PATH or the equivalent.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 from Java==&lt;br /&gt;
==The compatibility interface==&lt;br /&gt;
&lt;br /&gt;
=Upgrading from CVC3 to CVC4=&lt;br /&gt;
&lt;br /&gt;
==Features not supported by CVC4 (yet)==&lt;br /&gt;
&lt;br /&gt;
===Type Correctness Conditions (TCCs)===&lt;br /&gt;
&lt;br /&gt;
Type Correctness Conditions (TCCs), and the checking of such, are not&lt;br /&gt;
supported by CVC4 1.0.  Thus, a function defined only on integers can be&lt;br /&gt;
applied to REAL (as INT is a subtype of REAL), and CVC4 will not complain,&lt;br /&gt;
but may produce strange results.  For example:&lt;br /&gt;
&lt;br /&gt;
  f : INT -&amp;gt; INT;&lt;br /&gt;
  ASSERT f(1/3) = 0;&lt;br /&gt;
  ASSERT f(2/3) = 1;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  COUNTEREXAMPLE;&lt;br /&gt;
  % f : (INT) -&amp;gt; INT = LAMBDA(x1:INT) : 0;&lt;br /&gt;
&lt;br /&gt;
CVC3 can be used to produce TCCs for this input (with the +dump-tcc option).&lt;br /&gt;
The TCC can be checked by CVC3 or another solver.  (CVC3 can also check&lt;br /&gt;
TCCs while solving with +tcc.)&lt;br /&gt;
&lt;br /&gt;
==If you were using the text interfaces of CVC3==&lt;br /&gt;
&lt;br /&gt;
The native language of all solvers in the CVC family, referred to as the&lt;br /&gt;
&amp;quot;presentation language,&amp;quot; has undergone some revisions for CVC4.  The&lt;br /&gt;
most notable is that CVC4 does _not_ add counterexample assertions to&lt;br /&gt;
the current assertion set after a SAT/INVALID result.  For example:&lt;br /&gt;
&lt;br /&gt;
  x, y : INT;&lt;br /&gt;
  ASSERT x = 1 OR x = 2;&lt;br /&gt;
  ASSERT y = 1 OR y = 2;&lt;br /&gt;
  ASSERT x /= y;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  QUERY x = 1;&lt;br /&gt;
  % invalid&lt;br /&gt;
  QUERY x = 2;&lt;br /&gt;
  % invalid&lt;br /&gt;
&lt;br /&gt;
Here, CVC4 responds &amp;quot;invalid&amp;quot; to the second and third queries, because&lt;br /&gt;
each has a counterexample (x=2 is a counterexample to the first, and&lt;br /&gt;
x=1 is a counterexample to the second).  However, CVC3 will respond&lt;br /&gt;
with &amp;quot;valid&amp;quot; to one of these two, as the first query (the CHECKSAT)&lt;br /&gt;
had the side-effect of locking CVC3 into one of the two cases; the&lt;br /&gt;
later queries are effectively querying the counterexample that was&lt;br /&gt;
found by the first.  CVC4 removes this side-effect of the CHECKSAT and&lt;br /&gt;
QUERY commands.&lt;br /&gt;
&lt;br /&gt;
CVC4 supports rational literals (of type REAL) in decimal; CVC3 did not&lt;br /&gt;
support decimals.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not have support for the IS_INTEGER predicate.&lt;br /&gt;
&lt;br /&gt;
==If you were using the library (&amp;quot;in-memory&amp;quot;) interface of CVC3==&lt;br /&gt;
===If you were using CVC3 from C===&lt;br /&gt;
===If you were using CVC3 from Java===&lt;br /&gt;
&lt;br /&gt;
=Advanced features=&lt;br /&gt;
&lt;br /&gt;
This section describes some features of CVC4 of interest to developers and advanced users. &lt;br /&gt;
&lt;br /&gt;
==Resource limits==&lt;br /&gt;
&lt;br /&gt;
CVC4 can be made to self-timeout after a given number of milliseconds.&lt;br /&gt;
Use the --tlimit command line option to limit the entire run of&lt;br /&gt;
CVC4, or use --tlimit-per to limit each individual query separately.&lt;br /&gt;
Preprocessing time is not counted by the time limit, so for some large&lt;br /&gt;
inputs which require aggressive preprocessing, you may notice that&lt;br /&gt;
--tlimit does not work very well.  If you suspect this might be the&lt;br /&gt;
case, you can use &amp;quot;-vv&amp;quot; (double verbosity) to see what CVC4 is doing.&lt;br /&gt;
&lt;br /&gt;
Time-limited runs are not deterministic; two consecutive runs with the&lt;br /&gt;
same time limit might produce different results (i.e., one may time out&lt;br /&gt;
and responds with &amp;quot;unknown&amp;quot;, while the other completes and provides an&lt;br /&gt;
answer).  To ensure that results are reproducible, use --rlimit or&lt;br /&gt;
--rlimit-per.  These options take a &amp;quot;resource count&amp;quot; (presently, based on&lt;br /&gt;
the number of SAT conflicts) that limits the search time.  A word of&lt;br /&gt;
caution, though: there is no guarantee that runs of different versions of&lt;br /&gt;
CVC4 or of different builds of CVC4 (e.g., two CVC4 binaries with different&lt;br /&gt;
features enabled, or for different architectures) will interpret the resource&lt;br /&gt;
count in the same manner.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not presently have a way to limit its memory use; you may opt&lt;br /&gt;
to run it from a shell after using &amp;quot;ulimit&amp;quot; to limit the size of the&lt;br /&gt;
heap.&lt;br /&gt;
&lt;br /&gt;
==Dumping API calls or preprocessed output==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Changing the output language==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Proof support==&lt;br /&gt;
&lt;br /&gt;
CVC4 1.0 has limited support for proofs, and they are disabled by default.&lt;br /&gt;
(Run the configure script with --enable-proof to enable proofs).  Proofs&lt;br /&gt;
are exported in LFSC format and are limited to the propositional backbone&lt;br /&gt;
of the discovered proof (theory lemmas are stated without proof in this&lt;br /&gt;
release).&lt;br /&gt;
&lt;br /&gt;
==Parallel solving==&lt;br /&gt;
&lt;br /&gt;
'''[Builds not ported to Stanford yet]''' The most recent binaries with support for parallel solving can be downloaded from our Nightly Builds pages:&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-dbg/ Debug] binaries (statically linked) &lt;br /&gt;
&lt;br /&gt;
If enabled at configure-time (./configure --with-portfolio), a second&lt;br /&gt;
CVC4 binary will be produced (&amp;quot;pcvc4&amp;quot;).  This binary has support for&lt;br /&gt;
running multiple instances of CVC4 in different threads.  Use --threads=N&lt;br /&gt;
to specify the number of threads, and use --thread0=&amp;quot;options for thread 0&amp;quot;&lt;br /&gt;
--thread1=&amp;quot;options for thread 1&amp;quot;, etc., to specify a configuration for the&lt;br /&gt;
threads.  Lemmas are *not* shared between the threads by default; to adjust&lt;br /&gt;
this, use the --filter-lemma-length=N option to share lemmas of N literals&lt;br /&gt;
(or smaller).  (Some lemmas are ineligible for sharing because they include&lt;br /&gt;
literals that are &amp;quot;local&amp;quot; to one thread.)&lt;br /&gt;
&lt;br /&gt;
Currently, the portfolio **does not work** with the theory of inductive&lt;br /&gt;
datatypes. This limitation will be addressed in a future release.&lt;br /&gt;
&lt;br /&gt;
See more details and examples in the [[Tutorials#Parallel_Solving|tutorial]].&lt;br /&gt;
&lt;br /&gt;
==Emacs support==&lt;br /&gt;
&lt;br /&gt;
For a suggestion of editing CVC4 source code with emacs, see the file&lt;br /&gt;
contrib/editing-with-emacs.  For a CVC language mode (the native input&lt;br /&gt;
language for CVC4), see contrib/cvc-mode.el.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5521</id>
		<title>User Manual</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=User_Manual&amp;diff=5521"/>
				<updated>2017-02-08T18:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This manual includes information on installing and using CVC4. It is a work in progress. &lt;br /&gt;
&lt;br /&gt;
=Getting CVC4=&lt;br /&gt;
&lt;br /&gt;
Both pre-compiled binaries and the source code for CVC4 are available for download from [http://cvc4.cs.stanford.edu/downloads/builds/ http://cvc4.cs.stanford.edu/downloads/builds/]. &lt;br /&gt;
&lt;br /&gt;
==Getting CVC4 binaries==&lt;br /&gt;
The most recent binaries can be downloaded from our Nightly Builds pages: &lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-dbg/ Debug] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.stanford.edu/downloads/builds/debian/ Debian] packages&lt;br /&gt;
&lt;br /&gt;
'''[Not ported to Stanford yet]''' To install CVC4 on an Ubuntu Machine follow the instructions below. First add the CVC4 repository to /etc/apt/source.list by inserting the following two lines at the end of the file:&lt;br /&gt;
  # CVC4 repository&lt;br /&gt;
  deb http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
  deb-src http://cvc4.cs.nyu.edu/debian/ unstable/&lt;br /&gt;
&lt;br /&gt;
To run CVC4 as a binary you only need the first line but to use the library API you will also need the source package. &lt;br /&gt;
Make sure to update the respository list by running:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
Now you can simply install CVC4 as you would any other piece of sofware using the command:&lt;br /&gt;
  sudo apt-get install cvc4&lt;br /&gt;
&lt;br /&gt;
If you want to use CVC4 as a library also install the following packages: libcvc4-dev, and libcvc4-parser-dev.&lt;br /&gt;
&lt;br /&gt;
==Building CVC4 from source==&lt;br /&gt;
[http://cvc4.cs.stanford.edu/downloads/builds/src/ Sources are available] from the same site as the binaries. The source-code is also available in the [https://github.com/CVC4/CVC4 CVC4 source repository]. &lt;br /&gt;
&lt;br /&gt;
To build CVC4 from source the following steps are required. After downloading the source files first install antlr by running the following script in the CVC4 contrib directory:&lt;br /&gt;
    cd contrib&lt;br /&gt;
    ./get-antlr-3.4&lt;br /&gt;
&lt;br /&gt;
The next step is to configure CVC4:&lt;br /&gt;
    cd ..&lt;br /&gt;
    ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3&lt;br /&gt;
&lt;br /&gt;
And then finally compile it:&lt;br /&gt;
    make&lt;br /&gt;
    make check   [recommended]&lt;br /&gt;
    make install [optional]&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of dependencies and more detailed build instructions see [[Building CVC4 from source]].&lt;br /&gt;
&lt;br /&gt;
=Using the CVC4 binary=&lt;br /&gt;
&lt;br /&gt;
Once installed, the CVC4 driver binary (&amp;quot;cvc4&amp;quot;) can be executed to directly enter into interactive mode:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then enter commands into CVC4 interactively:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;incremental&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;produce-models&amp;quot;;&lt;br /&gt;
 CVC4&amp;gt; TRANSFORM 25*25;&lt;br /&gt;
 625&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example shows two useful options, ''incremental'' and ''produce-models.''&lt;br /&gt;
&lt;br /&gt;
* The ''incremental'' option allows you to issue multiple QUERY (or CHECKSAT) commands, and allows the use of the PUSH and POP commands.  Without this option, CVC4 optimizes itself for a single QUERY or CHECKSAT command (though you may issue any number of ASSERT commands).  The ''incremental'' option may also be given by passing the ''-i'' command line option to CVC4.&lt;br /&gt;
* The ''produce-models'' option allows you to query the model (here, with the COUNTERMODEL command) after an &amp;quot;invalid&amp;quot; QUERY (or &amp;quot;satisfiable&amp;quot; CHECK-SAT).  Without it, CVC4 doesn't do the bookkeeping necessary to support model generation.  The ''produce-models'' option may also be given by passing the ''-m'' command line option to CVC4.&lt;br /&gt;
&lt;br /&gt;
So, if you invoke CVC4 with ''-im'', you don't need to pass those options at all:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -im&lt;br /&gt;
 cvc4 1.0 assertions:off&lt;br /&gt;
 CVC4&amp;gt; x, y : INT;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = -1;&lt;br /&gt;
 y : INT = 0;&lt;br /&gt;
 CVC4&amp;gt; ASSERT x &amp;gt;= 0;&lt;br /&gt;
 CVC4&amp;gt; QUERY x = y;&lt;br /&gt;
 invalid&lt;br /&gt;
 CVC4&amp;gt; COUNTERMODEL;&lt;br /&gt;
 x : INT = 0;&lt;br /&gt;
 y : INT = 1;&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, CVC4 operates in [[#CVC4's native input language|CVC-language mode]].  If you enter something that looks like SMT-LIB, it will suggest that you use the &amp;quot;''--lang smt''&amp;quot; command-line option for SMT-LIB mode:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (declare-fun x () Int)&lt;br /&gt;
 Parse Error: &amp;lt;shell&amp;gt;:1.7: In CVC4 presentation language mode, but SMT-LIB format detected.  Use --lang smt for SMT-LIB support.&lt;br /&gt;
 CVC4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verbosity==&lt;br /&gt;
&lt;br /&gt;
CVC4 has various levels of verbosity.  By default, CVC4 is pretty quiet, only reporting serious warnings and notices.  If you're curious about what it's doing, you can pass CVC4 the ''-v'' option:&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -v file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
For even more verbosity, you can pass CVC4 an ''additional'' ''-v'':&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 -vv file.smt2&lt;br /&gt;
 Invoking: (set-logic AUFLIRA)&lt;br /&gt;
 Invoking: (set-info :smt-lib-version 2.000000)&lt;br /&gt;
 Invoking: (set-info :category &amp;quot;crafted&amp;quot;)&lt;br /&gt;
 Invoking: (set-info :status unsat)&lt;br /&gt;
 Invoking: (declare-fun x () Real)&lt;br /&gt;
 ''etc...''&lt;br /&gt;
 expanding definitions...&lt;br /&gt;
 constraining subtypes...&lt;br /&gt;
 applying substitutions...&lt;br /&gt;
 simplifying assertions...&lt;br /&gt;
 doing static learning...&lt;br /&gt;
 ''etc...''&lt;br /&gt;
&lt;br /&gt;
Internally, verbosity is just an integer value.  It starts at 0, and with every ''-v'' on the command line it is incremented; with every ''-q'', decremented.  It can also be set directly.  From CVC language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; OPTION &amp;quot;verbosity&amp;quot; 2;&lt;br /&gt;
&lt;br /&gt;
Or from SMT-LIB language:&lt;br /&gt;
&lt;br /&gt;
 CVC4&amp;gt; (set-option :verbosity 2)&lt;br /&gt;
&lt;br /&gt;
==Getting statistics==&lt;br /&gt;
&lt;br /&gt;
Statistics can be dumped on exit (both normal and abnormal exits) with the ''--statistics'' command line option.&lt;br /&gt;
&lt;br /&gt;
 $ cvc4 --statistics foo.smt2&lt;br /&gt;
 sat&lt;br /&gt;
 sat::decisions, 0&lt;br /&gt;
 sat::propagations, 3&lt;br /&gt;
 sat::starts, 1&lt;br /&gt;
 theory::uf::TheoryUF::functionTermsCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::mergesCount, 2&lt;br /&gt;
 theory::uf::TheoryUF::termsCount, 6&lt;br /&gt;
 theory&amp;lt;THEORY_UF&amp;gt;::propagations, 1 &lt;br /&gt;
 driver::filename, foo.smt2&lt;br /&gt;
 driver::sat/unsat, sat&lt;br /&gt;
 driver::totalTime, 0.02015373&lt;br /&gt;
 ''[many others]''&lt;br /&gt;
&lt;br /&gt;
Many statistics name-value pairs follow, one comma-separated pair per line.&lt;br /&gt;
&lt;br /&gt;
==Exit status==&lt;br /&gt;
&lt;br /&gt;
Successful exit is marked by the exit code 0.  Most &amp;quot;normal errors&amp;quot; return a 1 as the exit code, but out of memory conditions, terminating signals, and other conditions can produce different (nonzero) exit codes.  In interactive mode, parse errors are ignored and the next line read; so in interactive mode, you may see an exit code of 0 even in the presence of such an error.&lt;br /&gt;
&lt;br /&gt;
''Note on previous versions:'' Up to version 1.2 of CVC4, exit status depended on the result (&amp;quot;sat&amp;quot; results caused an exit code of 10, &amp;quot;unsat&amp;quot; of 20).  This behavior was deemed nonstandard and is no longer the case; successful exits are always 0 in version 1.3 and later.&lt;br /&gt;
&lt;br /&gt;
=CVC4's input languages=&lt;br /&gt;
&lt;br /&gt;
When not used in interactive mode, CVC4 can read its input from an external file. It accepts the following input languages: &lt;br /&gt;
&lt;br /&gt;
* [[CVC4's native language | CVC4's native language]]&lt;br /&gt;
* SMT-LIB 2.0  (see [http://www.grammatech.com/resources/smt/SMTLIBTutorial.pdf David Cok's SMT-LIB tutorial])&lt;br /&gt;
* SMT-LIB 1.0&lt;br /&gt;
&lt;br /&gt;
CVC4 tries to automatically recognize the input language based on the file's extension: .cvc for CVC4's native language, .smt2 for SMT-LIB 2.0 and .smt for SMT-LIB 1.0. If the file extension does not match one of the previously mentioned ones you can specify the input language via the command line flag --lang. To see all language options type:&lt;br /&gt;
 $ cvc4 --lang help&lt;br /&gt;
&lt;br /&gt;
Every effort has been made to make CVC4 compliant with the SMT-LIB 2.0&lt;br /&gt;
standard (http://smtlib.org/).  However, when parsing SMT-LIB input,&lt;br /&gt;
certain default settings don't match what is stated in the official&lt;br /&gt;
standard.  To make CVC4 adhere more strictly to the standard, use the&lt;br /&gt;
&amp;quot;--smtlib&amp;quot; command-line option.  Even with this setting, CVC4 is&lt;br /&gt;
somewhat lenient; some non-conforming input may still be parsed and&lt;br /&gt;
processed.&lt;br /&gt;
&lt;br /&gt;
=Supported Theories=&lt;br /&gt;
The following theories are currently fully supported&lt;br /&gt;
* Booleans&lt;br /&gt;
* Uninterpreted functions&lt;br /&gt;
* Arrays [with extensionality]&lt;br /&gt;
* Inductive datatypes&lt;br /&gt;
* Tuples and record types&lt;br /&gt;
* Fixed width bitvectors&lt;br /&gt;
* Linear mixed real integer arithmetic&lt;br /&gt;
** Integer division and modulus by integer constants is supported by the &amp;quot;--rewrite-divk&amp;quot; flag&lt;br /&gt;
* [[sets|Finite sets]]&lt;br /&gt;
CVC4 supports first-order quantification and theory combinations of the above theories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following theories are currently partially supported and are undergoing development:&lt;br /&gt;
* Strings&lt;br /&gt;
&lt;br /&gt;
Theories with '''highly limited''' support:&lt;br /&gt;
* CVC4's non-linear real and non-linear integer arithmetic support is currently unlikely to satisfy a user's needs.  The current support is for parsing, rewrites, and a very limited class of proofs of unsatisifiability. The class of proofs is what is provable by linear arithmetic where each monomial (e.g. &amp;quot;xxy&amp;quot;) is treated as a unique variable.&lt;br /&gt;
&lt;br /&gt;
=The CVC4 library interface (API)=&lt;br /&gt;
&lt;br /&gt;
There are a number of examples of using CVC4 as a library distributed with the source code of the project. There are given in the &amp;quot;/examples&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 in a C++ project==&lt;br /&gt;
&lt;br /&gt;
A basic C++ example for using cvc4 is given in the file [https://github.com/CVC4/CVC4/blob/master/examples/simple_vc_cxx.cpp /examples/simple_vc_cxx.cpp].&lt;br /&gt;
The file goes through the examples for the basic interaction with CVC4:&lt;br /&gt;
# Constructing an ExprManager em&lt;br /&gt;
# Constructing an SmtEngine w.r.t. em.&lt;br /&gt;
# Getting a copy of the Type for mathematical integers from em, em.integerType().&lt;br /&gt;
# Constructing new Expressions&lt;br /&gt;
## Integer variables x and y: Expr x = em.mkVar(&amp;quot;x&amp;quot;, integer);&lt;br /&gt;
## The rational constant 0: em.mkConst(Rational(0));&lt;br /&gt;
## Constructing new expressions existing expressions: em.mkExpr(kind::GT, x, zero);&lt;br /&gt;
# Querying the SmtEngine whether or not a formula is valid. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information on the interfaces for Expr, Type, ExprManager and SmtEngine can be found in their respective header files.&lt;br /&gt;
&lt;br /&gt;
To compile simple_vc_cxx.cpp, there are different build instructions for whether or not you are compiling against a version of CVC4 in a local build directory or one installed via &amp;quot;make install&amp;quot; into a directory $PREFIX.&lt;br /&gt;
&lt;br /&gt;
* Local Build Directory: If you have build cvc4 via the &amp;quot;make&amp;quot; command before, you can compile simple_vc_cxx.cpp via &amp;quot;make examples&amp;quot;. The executable will then be &amp;quot;./builds/examples/simple_vc_cxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    $ make examples&lt;br /&gt;
    [...]&lt;br /&gt;
    $ ./builds/examples/simple_vc_cxx &lt;br /&gt;
    Checking validity of formula ((x &amp;gt; 0) AND (y &amp;gt; 0)) =&amp;gt; (((2 * x) + y) &amp;gt;= 3) with CVC4.&lt;br /&gt;
    CVC4 should report VALID.&lt;br /&gt;
    Result from CVC4 is: valid&lt;br /&gt;
* Installed Copy: If you have installed CVC4 via &amp;quot;make install&amp;quot; into the directory $PREFIX (which you can configure via &amp;quot;./configure --prefix=$PREFIX&amp;quot; you will need to modify lines 21-22.&lt;br /&gt;
    //#include &amp;lt;cvc4/cvc4.h&amp;gt; // use this after CVC4 is properly installed&lt;br /&gt;
    #include &amp;quot;smt/smt_engine.h&amp;quot;&lt;br /&gt;
:First, uncomment line 21 and comment out line 22. You may now &lt;br /&gt;
You can now compile and run by executing&lt;br /&gt;
    g++ -I$PREFIX/include -L$PREFIX/lib -lcvc4 examples/simple_vc_cxx.cpp -o simple_vc_cxx&lt;br /&gt;
    ./simple_vc_cxx&lt;br /&gt;
:You may need to add $PREFIX/lib is LD_LIBRARY_PATH or the equivalent.&lt;br /&gt;
&lt;br /&gt;
==Using CVC4 from Java==&lt;br /&gt;
==The compatibility interface==&lt;br /&gt;
&lt;br /&gt;
=Upgrading from CVC3 to CVC4=&lt;br /&gt;
&lt;br /&gt;
==Features not supported by CVC4 (yet)==&lt;br /&gt;
&lt;br /&gt;
===Type Correctness Conditions (TCCs)===&lt;br /&gt;
&lt;br /&gt;
Type Correctness Conditions (TCCs), and the checking of such, are not&lt;br /&gt;
supported by CVC4 1.0.  Thus, a function defined only on integers can be&lt;br /&gt;
applied to REAL (as INT is a subtype of REAL), and CVC4 will not complain,&lt;br /&gt;
but may produce strange results.  For example:&lt;br /&gt;
&lt;br /&gt;
  f : INT -&amp;gt; INT;&lt;br /&gt;
  ASSERT f(1/3) = 0;&lt;br /&gt;
  ASSERT f(2/3) = 1;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  COUNTEREXAMPLE;&lt;br /&gt;
  % f : (INT) -&amp;gt; INT = LAMBDA(x1:INT) : 0;&lt;br /&gt;
&lt;br /&gt;
CVC3 can be used to produce TCCs for this input (with the +dump-tcc option).&lt;br /&gt;
The TCC can be checked by CVC3 or another solver.  (CVC3 can also check&lt;br /&gt;
TCCs while solving with +tcc.)&lt;br /&gt;
&lt;br /&gt;
==If you were using the text interfaces of CVC3==&lt;br /&gt;
&lt;br /&gt;
The native language of all solvers in the CVC family, referred to as the&lt;br /&gt;
&amp;quot;presentation language,&amp;quot; has undergone some revisions for CVC4.  The&lt;br /&gt;
most notable is that CVC4 does _not_ add counterexample assertions to&lt;br /&gt;
the current assertion set after a SAT/INVALID result.  For example:&lt;br /&gt;
&lt;br /&gt;
  x, y : INT;&lt;br /&gt;
  ASSERT x = 1 OR x = 2;&lt;br /&gt;
  ASSERT y = 1 OR y = 2;&lt;br /&gt;
  ASSERT x /= y;&lt;br /&gt;
  CHECKSAT;&lt;br /&gt;
  % sat&lt;br /&gt;
  QUERY x = 1;&lt;br /&gt;
  % invalid&lt;br /&gt;
  QUERY x = 2;&lt;br /&gt;
  % invalid&lt;br /&gt;
&lt;br /&gt;
Here, CVC4 responds &amp;quot;invalid&amp;quot; to the second and third queries, because&lt;br /&gt;
each has a counterexample (x=2 is a counterexample to the first, and&lt;br /&gt;
x=1 is a counterexample to the second).  However, CVC3 will respond&lt;br /&gt;
with &amp;quot;valid&amp;quot; to one of these two, as the first query (the CHECKSAT)&lt;br /&gt;
had the side-effect of locking CVC3 into one of the two cases; the&lt;br /&gt;
later queries are effectively querying the counterexample that was&lt;br /&gt;
found by the first.  CVC4 removes this side-effect of the CHECKSAT and&lt;br /&gt;
QUERY commands.&lt;br /&gt;
&lt;br /&gt;
CVC4 supports rational literals (of type REAL) in decimal; CVC3 did not&lt;br /&gt;
support decimals.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not have support for the IS_INTEGER predicate.&lt;br /&gt;
&lt;br /&gt;
==If you were using the library (&amp;quot;in-memory&amp;quot;) interface of CVC3==&lt;br /&gt;
===If you were using CVC3 from C===&lt;br /&gt;
===If you were using CVC3 from Java===&lt;br /&gt;
&lt;br /&gt;
=Advanced features=&lt;br /&gt;
&lt;br /&gt;
This section describes some features of CVC4 of interest to developers and advanced users. &lt;br /&gt;
&lt;br /&gt;
==Resource limits==&lt;br /&gt;
&lt;br /&gt;
CVC4 can be made to self-timeout after a given number of milliseconds.&lt;br /&gt;
Use the --tlimit command line option to limit the entire run of&lt;br /&gt;
CVC4, or use --tlimit-per to limit each individual query separately.&lt;br /&gt;
Preprocessing time is not counted by the time limit, so for some large&lt;br /&gt;
inputs which require aggressive preprocessing, you may notice that&lt;br /&gt;
--tlimit does not work very well.  If you suspect this might be the&lt;br /&gt;
case, you can use &amp;quot;-vv&amp;quot; (double verbosity) to see what CVC4 is doing.&lt;br /&gt;
&lt;br /&gt;
Time-limited runs are not deterministic; two consecutive runs with the&lt;br /&gt;
same time limit might produce different results (i.e., one may time out&lt;br /&gt;
and responds with &amp;quot;unknown&amp;quot;, while the other completes and provides an&lt;br /&gt;
answer).  To ensure that results are reproducible, use --rlimit or&lt;br /&gt;
--rlimit-per.  These options take a &amp;quot;resource count&amp;quot; (presently, based on&lt;br /&gt;
the number of SAT conflicts) that limits the search time.  A word of&lt;br /&gt;
caution, though: there is no guarantee that runs of different versions of&lt;br /&gt;
CVC4 or of different builds of CVC4 (e.g., two CVC4 binaries with different&lt;br /&gt;
features enabled, or for different architectures) will interpret the resource&lt;br /&gt;
count in the same manner.&lt;br /&gt;
&lt;br /&gt;
CVC4 does not presently have a way to limit its memory use; you may opt&lt;br /&gt;
to run it from a shell after using &amp;quot;ulimit&amp;quot; to limit the size of the&lt;br /&gt;
heap.&lt;br /&gt;
&lt;br /&gt;
==Dumping API calls or preprocessed output==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Changing the output language==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
==Proof support==&lt;br /&gt;
&lt;br /&gt;
CVC4 1.0 has limited support for proofs, and they are disabled by default.&lt;br /&gt;
(Run the configure script with --enable-proof to enable proofs).  Proofs&lt;br /&gt;
are exported in LFSC format and are limited to the propositional backbone&lt;br /&gt;
of the discovered proof (theory lemmas are stated without proof in this&lt;br /&gt;
release).&lt;br /&gt;
&lt;br /&gt;
==Parallel solving==&lt;br /&gt;
&lt;br /&gt;
'''[Builds not ported to Stanford yet]''' The most recent binaries with support for parallel solving can be downloaded from our Nightly Builds pages:&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-opt/ Optimized] binaries (statically linked)&lt;br /&gt;
* [http://cvc4.cs.nyu.edu/cvc4-builds/portfolio-x86_64-linux-dbg/ Debug] binaries (statically linked) &lt;br /&gt;
&lt;br /&gt;
If enabled at configure-time (./configure --with-portfolio), a second&lt;br /&gt;
CVC4 binary will be produced (&amp;quot;pcvc4&amp;quot;).  This binary has support for&lt;br /&gt;
running multiple instances of CVC4 in different threads.  Use --threads=N&lt;br /&gt;
to specify the number of threads, and use --thread0=&amp;quot;options for thread 0&amp;quot;&lt;br /&gt;
--thread1=&amp;quot;options for thread 1&amp;quot;, etc., to specify a configuration for the&lt;br /&gt;
threads.  Lemmas are *not* shared between the threads by default; to adjust&lt;br /&gt;
this, use the --filter-lemma-length=N option to share lemmas of N literals&lt;br /&gt;
(or smaller).  (Some lemmas are ineligible for sharing because they include&lt;br /&gt;
literals that are &amp;quot;local&amp;quot; to one thread.)&lt;br /&gt;
&lt;br /&gt;
Currently, the portfolio **does not work** with the theory of inductive&lt;br /&gt;
datatypes. This limitation will be addressed in a future release.&lt;br /&gt;
&lt;br /&gt;
See more details and examples in the [[Tutorials#Parallel_Solving|tutorial]].&lt;br /&gt;
&lt;br /&gt;
==Emacs support==&lt;br /&gt;
&lt;br /&gt;
For a suggestion of editing CVC4 source code with emacs, see the file&lt;br /&gt;
contrib/editing-with-emacs.  For a CVC language mode (the native input&lt;br /&gt;
language for CVC4), see contrib/cvc-mode.el.&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=How_do_I..._%3F&amp;diff=5510</id>
		<title>How do I... ?</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=How_do_I..._%3F&amp;diff=5510"/>
				<updated>2017-02-01T18:33:21Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: /* Dealing with the services on the Church server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a repository for questions about working with CVC4.  If you have a question, please add it here.  If you have an answer, please add the answer to the [[Developer's Guide]], or another wiki page, and then link to it from here.&lt;br /&gt;
&lt;br /&gt;
=Dealing with ANTLR3=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#ANTLR3|...get ANTLR3 to work?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the build process=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Working with multiple, concurrent build profiles|...build a different CVC4 build profile than the &amp;quot;current&amp;quot; one?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with Subversion=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...check out CVC4 from the repository?]]&lt;br /&gt;
*[[Developer's Guide#Repository access from Eclipse|...access the repository from Eclipse?]]&lt;br /&gt;
*[[Developer's Guide#Browsing the repository|...browse CVC4 sources online?]]&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...update my working copy to the newest committed version?]]&lt;br /&gt;
*[[Developer's Guide#Working with files and directories|...rename a file or directory?]]&lt;br /&gt;
*[[Developer's Guide#Reverting a file in a working directory|...revert changes in my working directory?]]&lt;br /&gt;
*[[Developer's Guide#Reverting a commit|...revert changes that have already been committed to the repository?]]&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...see what I've changed in my working copy?]]&lt;br /&gt;
*[[Developer's Guide#Resolving conflicts in a working directory|...resolve a conflict?]]&lt;br /&gt;
*[[Developer's Guide#Creating a branch|...create a branch?]]&lt;br /&gt;
*[[Developer's Guide#Merging a branch back to the trunk|...merge a branch back into the trunk?]]&lt;br /&gt;
*[[Developer's Guide#Symbolically tagging a version|...symbolically tag a version?]]&lt;br /&gt;
*[[Developer's Guide#Marking a file as executable in Subversion|...make Subversion recognize that a file should be executable?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the source tree=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Adding a new Theory|...add support for a new theory to CVC4?]]&lt;br /&gt;
*[[Developer's Guide#Adding source directories|...add a new source directory to the tree?]]&lt;br /&gt;
*[[Developer's Guide#Adding source and header files|...add a new source file to the tree?]]&lt;br /&gt;
*[[Developer's Guide#Adding copyrighted sources|...add a new source file/directory to the tree from another project (under different copyright)?]]&lt;br /&gt;
*[[Developer's Guide#update-copyright.pl|...update the copyright information at the top of each file in the tree?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with tests=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Unit testing|...add a new unit test?]]&lt;br /&gt;
*[[Developer's Guide#System testing|...add a new system regression?]]&lt;br /&gt;
*[[Developer's Guide#Regression testing|...add a new regression?]]&lt;br /&gt;
*[[Developer's Guide#Debugging unit tests|...attach a debugger to unit tests?]]&lt;br /&gt;
*[[Developer's Guide#Test rebuilding|...avoid rebuilding all tests after trivial code changes to the library?]]&lt;br /&gt;
*[[Developer's Guide#Compile-time errors in unit tests|...deal with this strange compile error on my unit test?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with code coverage=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Visualizing code coverage|...visualize code coverage?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with performance=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Profiling|...profile CVC4?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the main CVC4 driver program=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Command-line options|...add a new command-line option?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with code reviews=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Code reviews|...perform a code review?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the services on the Church server=&lt;br /&gt;
&lt;br /&gt;
'''NOTE: This information is deprecated but we might want to review it.'''&lt;br /&gt;
&lt;br /&gt;
*[[Using SSL with Church|...encrypt my communications with the Church web server?]]&lt;br /&gt;
*[[Newswire#Adding items to the newswire|...add an item to Church's CVC4 newswire?]]&lt;br /&gt;
*[[Developer Meeting Minutes#Adding meeting minutes to the wiki|...add CVC4 meeting minutes to the wiki?]]&lt;br /&gt;
*[[Developer Meeting Minutes#Adding electronic notes to meeting minutes|...add electronic notes to CVC4 meeting minutes?]]&lt;br /&gt;
*[[Running a CVC4 Meeting|...run a CVC4 meeting?]]&lt;br /&gt;
&lt;br /&gt;
= Dealing with adding a new theory =&lt;br /&gt;
For information on how to add a new theory see [[How to write a theory in CVC4]].&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	<entry>
		<id>http://cvc4.stanford.edu/w/index.php?title=How_do_I..._%3F&amp;diff=5508</id>
		<title>How do I... ?</title>
		<link rel="alternate" type="text/html" href="http://cvc4.stanford.edu/w/index.php?title=How_do_I..._%3F&amp;diff=5508"/>
				<updated>2017-02-01T18:32:58Z</updated>
		
		<summary type="html">&lt;p&gt;Noetzli: /* Dealing with the services on the Church server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a repository for questions about working with CVC4.  If you have a question, please add it here.  If you have an answer, please add the answer to the [[Developer's Guide]], or another wiki page, and then link to it from here.&lt;br /&gt;
&lt;br /&gt;
=Dealing with ANTLR3=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#ANTLR3|...get ANTLR3 to work?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the build process=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Working with multiple, concurrent build profiles|...build a different CVC4 build profile than the &amp;quot;current&amp;quot; one?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with Subversion=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...check out CVC4 from the repository?]]&lt;br /&gt;
*[[Developer's Guide#Repository access from Eclipse|...access the repository from Eclipse?]]&lt;br /&gt;
*[[Developer's Guide#Browsing the repository|...browse CVC4 sources online?]]&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...update my working copy to the newest committed version?]]&lt;br /&gt;
*[[Developer's Guide#Working with files and directories|...rename a file or directory?]]&lt;br /&gt;
*[[Developer's Guide#Reverting a file in a working directory|...revert changes in my working directory?]]&lt;br /&gt;
*[[Developer's Guide#Reverting a commit|...revert changes that have already been committed to the repository?]]&lt;br /&gt;
*[[Developer's Guide#Accessing CVC4's repository|...see what I've changed in my working copy?]]&lt;br /&gt;
*[[Developer's Guide#Resolving conflicts in a working directory|...resolve a conflict?]]&lt;br /&gt;
*[[Developer's Guide#Creating a branch|...create a branch?]]&lt;br /&gt;
*[[Developer's Guide#Merging a branch back to the trunk|...merge a branch back into the trunk?]]&lt;br /&gt;
*[[Developer's Guide#Symbolically tagging a version|...symbolically tag a version?]]&lt;br /&gt;
*[[Developer's Guide#Marking a file as executable in Subversion|...make Subversion recognize that a file should be executable?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the source tree=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Adding a new Theory|...add support for a new theory to CVC4?]]&lt;br /&gt;
*[[Developer's Guide#Adding source directories|...add a new source directory to the tree?]]&lt;br /&gt;
*[[Developer's Guide#Adding source and header files|...add a new source file to the tree?]]&lt;br /&gt;
*[[Developer's Guide#Adding copyrighted sources|...add a new source file/directory to the tree from another project (under different copyright)?]]&lt;br /&gt;
*[[Developer's Guide#update-copyright.pl|...update the copyright information at the top of each file in the tree?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with tests=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Unit testing|...add a new unit test?]]&lt;br /&gt;
*[[Developer's Guide#System testing|...add a new system regression?]]&lt;br /&gt;
*[[Developer's Guide#Regression testing|...add a new regression?]]&lt;br /&gt;
*[[Developer's Guide#Debugging unit tests|...attach a debugger to unit tests?]]&lt;br /&gt;
*[[Developer's Guide#Test rebuilding|...avoid rebuilding all tests after trivial code changes to the library?]]&lt;br /&gt;
*[[Developer's Guide#Compile-time errors in unit tests|...deal with this strange compile error on my unit test?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with code coverage=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Visualizing code coverage|...visualize code coverage?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with performance=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Profiling|...profile CVC4?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the main CVC4 driver program=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Command-line options|...add a new command-line option?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with code reviews=&lt;br /&gt;
&lt;br /&gt;
*[[Developer's Guide#Code reviews|...perform a code review?]]&lt;br /&gt;
&lt;br /&gt;
=Dealing with the services on the Church server=&lt;br /&gt;
&lt;br /&gt;
'''NOTE: This information is deprecated but we might want to review some of this information.'''&lt;br /&gt;
&lt;br /&gt;
*[[Using SSL with Church|...encrypt my communications with the Church web server?]]&lt;br /&gt;
*[[Newswire#Adding items to the newswire|...add an item to Church's CVC4 newswire?]]&lt;br /&gt;
*[[Developer Meeting Minutes#Adding meeting minutes to the wiki|...add CVC4 meeting minutes to the wiki?]]&lt;br /&gt;
*[[Developer Meeting Minutes#Adding electronic notes to meeting minutes|...add electronic notes to CVC4 meeting minutes?]]&lt;br /&gt;
*[[Running a CVC4 Meeting|...run a CVC4 meeting?]]&lt;br /&gt;
&lt;br /&gt;
= Dealing with adding a new theory =&lt;br /&gt;
For information on how to add a new theory see [[How to write a theory in CVC4]].&lt;/div&gt;</summary>
		<author><name>Noetzli</name></author>	</entry>

	</feed>