This file contains information about compiling MiniSat and linking it
with NuSMV. 

******************************************************************************
*                          (0) NuSMV and MiniSat                             *
******************************************************************************

Since version 2.2.2, NuSMV is able to use the propositional solver "MiniSat" 
(in addition to "Z-Chaff") to deal with the SAT instances generated
during a Bounded-Model-Checking session. Further information about MiniSat
can be found in the paper entitled "An Extensible SAT-solver", by Niklas Een
and Niklas Sorensson.

However, the NuSMV source distribution *DOES NOT INCLUDE* the MiniSat solver.
Moreover, the default behavior of NuSMV's "configure/make" facility is to 
ignore MiniSat while linking.

In order to exploit MiniSat from within NuSMV, you have to proceed as follows.


******************************************************************************
*                          (1) Obtain MiniSat                                *
******************************************************************************

This can be done by downloading the source archive:

     MiniSat_(version)_src.zip

from the MiniSat home page: 
 <http://www.cs.chalmers.se/Cs/Research/FormalMethods/MiniSat/>
   
    
NuSMV has been successfully integrated with versions 1.12 and 1.14.
THe current version of NuSMV is linked to MiniSat-1.14. 

If version 1.12 is used, please note the following: 

****************************************************************
***     MiniSat 1.12 is for non-commercial purposes only.    ***
***                                                          ***
***     NO COMMERCIAL USE OF MINISAT IS ALLOWED WITHOUT      ***
***     WRITTEN PERMISSION FROM THE AUTHORS OF MINISAT.      ***
***                                                          ***
***      Please contact Niklas Een or Niklas Sorensson       ***
***          {een,nik}@cs.chalmers.se for details.           ***
****************************************************************


Instead version 1.14 can be freely used, when respecting the license:

*******************************************************************************
*** MiniSat -- Copyright (c) 2003-2005, Niklas Een, Niklas Sorensson        ***
***                                                                         ***
***  Permission is hereby granted, free of charge, to any person            ***
***  obtaining a copy of this software and associated documentation         ***
***  files (the "Software"), to deal in the Software without                ***
***  restriction, including without limitation the rights to use, copy,     ***
***  modify, merge, publish, distribute, sublicense, and/or sell copies     ***
***  of the Software, and to permit persons to whom the Software is         ***
***  furnished to do so, subject to the following conditions:               ***
***                                                                         ***
***  The above copyright notice and this permission notice shall be         ***
***  included in all copies or substantial portions of the Software.        ***
***                                                                         ***
*** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ***
*** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF              ***
*** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND                   ***
*** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE  ***
*** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION  ***
*** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION   ***
*** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.         ***
*******************************************************************************



******************************************************************************
*                    (2) Compiling MiniSat for NuSMV                         *
******************************************************************************
In the following, we assume that the archive is saved in the NuSMV root 
directory. So, you should have:

    [YOUR_PATH_TO_NUSMV]/nusmv/
    [YOUR_PATH_TO_NUSMV]/cudd-2.3.0.1/
    [YOUR_PATH_TO_NUSMV]/MiniSat/MiniSat.src.1.14.zip

You can unpack, patch and build the MiniSat library by issuing the command:
    
    $> cd  [YOUR_PATH_TO_NUSMV]/MiniSat/
    $> ./build.sh

which will create a link to the MiniSat library and header file into
the directory:

    [YOUR_PATH_TO_NUSMV]/

In this step it is assumed that version 1.14 has been downloaded. If
needed, it is be possible to use a different version of MiniSat by
editing the file [YOUR_PATH_TO_NUSMV]/MiniSat/minisat-default
accordingly (you may copy it from minisat-default.in)



******************************************************************************
*                     (3) Link minisat within NuSMV                          *
******************************************************************************

Since NuSMV version 2.3.1, a call to configure with no options will
make NuSMV try linking MiniSat to be the default SAT solver. Since
version 2.5.0, the previusly default SAT solver "SIM" is no longer
available. If MiniSat is not found, ZChaff will be the default SAT
solver if ZChaff is enabled at compile time, or else no SAT solvers
will be available, and engines using SAT solvers like Bounded Model
Checking BMC will be not available.

After compiling MiniSat and CUDD, go to NuSMV's source directory and
configure it:

    $> cd [YOUR_PATH_TO_NUSMV]/nusmv
    $> ./configure 
    
The default settings for "configure" work fine in our sample installation.
However, if you have MiniSat somewhere else, then you may have to manually
adjust a couple of options to make "configure" work. Type "configure --help"
and take a look at the "--with-minisat-incdir" and "--with-minisat-libdir"
options. These options tell the compiler where to find the MiniSat header
and object files, respectively.

If everything goes fine, at the end of the configuration step you should see
a message like this:

------------------------------------------------------------------
The MINISAT library will be embedded into the NuSMV executable.
------------------------------------------------------------------
 
At this point, just execute make to obtain a version of NuSMV statically 
linked with MiniSat.


******************************************************************************
*                     (4) Instruct NuSMV to use MiniSat                      *
******************************************************************************

If NuSMV has been successfully linked to MiniSat, MiniSat will be used
by default. 

