Git Product home page Git Product logo

riss's Introduction

Riss tool collection. 2010-2017, Norbert Manthey, LGPL v2, see LICENSE

You can receive the latest copy of the Riss and Coprocessor tool collection from http://tools.computational-logic.org

Please send bug reports to [email protected]

All tools in this package are highly configurable. For a simple comparison, most techniques are disabled by default. Hence, you should specify options to use. For both Riss and Coprocessor, using -config=Riss427 is a fair starting point.

Getting Started

For a quick example on how to retrieve, build and use the solver on a Linux machine, have a look at doc/TUTORIAL.md!

Components

This software package contains the SAT solver Riss, and might contain related tools:

Tool Description
Coprocessor CNF simplifier
Priss simple portfolio SAT solver

Building

The tool box uses CMake as build tool chain. In-source builds are not recommended. It is better to build the different build types (release, debug) in a separate directory.

Dependencies

To compile the project, libz is required, which can be installed for example with

sudo apt-get install zlib1g-dev

To test the ipasir package, curl is required, which can be installed for example with

sudo apt-get install curl

Building an example configuration

# Create a directory for the build
mkdir debug
cd debug/

# Create a debug build configuration
cmake -D CMAKE_BUILD_TYPE=Debug ..

# Create release build Intel compiler
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_COMPILER=icpc ..

# If you want DRAT proof support, configure cmake the following
cmake -D DRATPROOF=ON ..

# You get a list of all targets with
make help

# Two different configurations of the riss solver
# (with and without simplification enabled)
make riss-simp
make riss-core

# Copy all scripts to the bin/ directory
make scripts

Options

To configure your build, pass the described options to cmake like this

cmake -D OPTION_NAME=value ..
Option Description Default
CMAKE_BUILD_TYPE "Debug" or "Release" Release
CMAKE_CXX_COMPILER C++ compiler that should be used g++
STATIC_BINARIES Build fully statically linked binaries ON
WARNINGS Set verbose warning flags OFF
QUIET Disable Wcpp OFF

Incremental Solving

Riss supports two different C interfaces, where one is the IPASIR interface, which has been set up for incremental track of the SAT Race in 2015. The actual interface of Riss supports a few more routines. Furthermore, Coprocessor's simplification can be used via a C interface.

Build the solver for the IPASIR interface

After running cmake (see above), build the following library:

make riss-coprocessor-lib-static

Then, include the header file "riss/ipasir.h" into your project, and link against the library.

Common Usage

The available parameters can be listed for each tool by calling:

bin/<tool> --help

Due to the large number of parameters, a more helpful alternative is:

bin/<tool> --help -helpLevel=0 --help-verb

The configuration specification can be written to a pcs file automatically. Before using this file with an automated configuration framework, please check that only necessary parameters appear in the file. The procedure will include all parameters, also the cpu or memory limit parameters, and is currently considered experimental.

bin/ -pcs-file=

Using Riss to solve a formula <input.cnf> use

bin/riss <input.cnf> [solution] [solverOptions]

Using Riss to solve a formula <input.cnf> and generating a DRUP proof, the following call can be used. Depending on the proof verification tool the option -no-proofFormat should be specified. Note, not all formula simplification techniques support generating a DRAT proof.

bin/riss <input.cnf> -proof=input.proof -no-proofFormat [solution] [solverOptions]

The script cp.sh provides a simple setup for using Coprocessor as a formula simplification tool and afterwards running a SAT solver. The used SAT solver can be exchanged by changing the variable satsolver in the head of the script.

bin/cp.sh <input.cnf> [coprocessorOptions]

The parallel portfolio solver priss uses incarnations of riss and executes them in parallel. To obtain a version that executes exact copies of the solver, issue the following call, and add the CNF formula as well. Furthermore, you might want to specify the number of used threads by adding "-threads=X"

bin/priss -ppconfig= -no-addSetup -no-pr -no-ps -psetup=PLAIN -pAllSetup=-independent

riss's People

Contributors

conp-solutions avatar msoos avatar nmanthey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

riss's Issues

coprocessor_for_modelcounting.sh changes model count

The script for the model count preserving version of Coprocessor does not actually always preserve the model count.
For example, on the instances track1_004 and track1_005 from the 2020 model counting competition, the model count increases by some orders of magnitude. I verified the model counts using sharpsat-td and d4, which both agree.
The log10 model count of 004 changes from roughly 411.8 to 427.3. As far as I can see, the model counts only ever increase through preprocessing.

Memory error crash, reproducible

File included at the bottom (gzipped, because .cnf is not supported by GitHub). Valgrind spits out a bunch of nonsense, so I can't give you more detailed information about the issue. But it's certainly 100% reproducible and the CNF is 100% valid. I'm running latest Arch Linux, compiled with gcc (GCC) 11.1.0

soos@tiresias:ccanr-cscc$ ./coprocessor stuff.cnf model_193741 -enabled_cp3 -cp3_undo=cp3_undo_193741 -dimacs=cp3_tmpCNF_193741 -enabled_cp3 -cp3_stats -up -subsimp -bve -no-bve_gates -no-bve_strength -bve_red_lits=1 -cp3_bve_heap=1 -bve_heap_updates=1 -bve_totalG -bve_cgrow_t=1000 -bve_cgrow=10
c ====================[ Coprocessor 7.1.0  satcomp-2020-11-g4be9296-dirty ]================================
c | Norbert Manthey. The use of the tool is limited to research only!                                     |
c | Contributors:                                                                                         |
c |     Kilian Gebhard                                                                                    |
c |     Lucas Kahlert, Franziska Krüger, Aaron Stephan                                                    |
c ============================[ Problem Statistics ]=======================================================
c |                                                                                                       |
c |  Number of variables:        161280                                                                  |
c |  Number of clauses:          604800                                                                   |
c |  Parse time:                   0.07 s                                                                 |
c [STAT] CP3 2.08749 s-ppTime, 0 s-ipTime, 2.1455 s-ppwTime, 0 s-ipwTime, 148.23 MB, ok 0.079133 s-ohTime, 
c [STAT] CP3(2) 605760 cls, 0 learnts, -1010 rem-cls, 0 rem-learnts, 
c [STAT] UP 1.5e-05 s, 0 units, 0 cls, 7 lits
c [STAT] SuSi(1) 0.040444 s, 0 cls,  with 0 lits, 0 strengthed 
c [STAT] SuSi(2) 3393526 subs-steps, 4232935 strenght-steps, 0 increases, 0.070528s strengthening 
c [STAT] EE 0.513001 s, 0 steps 0 ee-lits 0 removedCls, 0 removedSubCls,
c [STAT] EE-gate 0.068885 s, 0 steps, 0.372971 extractGateTime, 
c [STAT] BVE(1) 0.054383 s, 0.000386 s spent on subsimp, 161939 vars tested, 161936 anticipations, 2258 vars skipped, 1145787 checks, 
c [STAT] BVE(2) 5934 rem cls, with 18266 lits, 0 learnts rem, with 0 lits, 6944 new cls, with 31994 lits, 0 new learnts, with 0 lits, 
c [STAT] BVE(3) 447 vars eliminated, 0 units enqueued, 0 BC removed, with 0 lits, 0 blocked learnts removed, with 0 lits, 
c [STAT] BVE(4) 0 gateDefs, 0 usedGates, 0 gateSeconds, 
c [STAT] BVE(5) 50 incElims, 0 keepElims, 397 decElims, 1010 totalAdds,
c [STAT] UNHIDE 0.649535 s, 0 cls, 0 totalLits, 0 lits 
c [STAT] UNHIDE(2) 0 prSecs, 0 prSteps, 0 L1units, 0 L2units, 0 L3units, 0 L4units, 0 L5units, 
c [STAT] UNHIDE(3) 0 EE-checks, 0 EE-cands, 0 EEs 
c [STAT] XOR 0.075353s, 0.067971 parse-s, 0.006614 reason-s, 
c [STAT] XOR(2) 0 xors, 0 subXors, 0 resXors, 0 clauses, 0 resClauses, 0 resTauts, 0 resStrength, 1210502 findChecks, 
c [STAT] XOR(3) 0 steps, 322560 empties, 0 listUnits, 0 useLists, 0 xorUnits, 0 eqs, 
c [STAT] XOR(4) 605755 participating, 0.990291 ratio, 0 simDecisions, 0 xorProps, 0 clsProps, 
c [STAT] BCE 0.285556 seconds, 2610300 steps, 643294 testLits, 0 remBCE, 0 BCMs, 0 BCMcands, 0 BCMlits, 
c [STAT] CLE 0 remCLE, 0 cleUnits, 
c [STAT] BCE-CLA 0 seconds, 0 steps, 0 testLits, 0 extClss, 0 extLits, 0 possibles, 
c [STAT] FM 0.307754 s, 0.1546 amo-s, 1.34608 fm-s, 0.024457 amt-s, 1 amos, 0 amts, 0 sameUnits, 0 deducedUnits, 0 propUnits, 0 cls, 0 steps, 12000012 searchSteps, 0 addDups, 
c [STAT] FM(2) 0 irregulars, 0 pureAmoLits, 0 diff, 0 discards, 0 addedCs, 0 removedCs, 0 newAmos, 0 discardedNewAmos, 
c [STAT] FM(3) 0 newAmoBinCls, 0 newCls, 0 newAlos, 0 newAlks, 0 duplicates, 0 garbageCollecst, 
c [STAT] FM(4) 0.000579 2PrdTime, 0 2PrAmos, 0 2PrLits, 2e-06 dedAloTime, 0 dedAlos, 
c [STAT] FM(5) time: 0.115298 s,steps: 1805765 cards: 0 failed: 1341 extLits: 0 redDegree: 0 probes: 2682 conflictProbes: 0 savedPreCls: 0 savedPostCls: 0 units: 8032
c [STAT] DENSE 455 gaps
c |  Simplification time:          2.10 s                                                                 |
c |                                                                                                       |
c ==============================[ Writing DIMACS ]=========================================================
double free or corruption (!prev)
Aborted (core dumped)

The cmake ran like this: (note that there is completely unrelated bug here somewhere about git HEAD not working):

soos@tiresias:build$ cmake -D CMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
fatal: ambiguous argument 'v7.1.0..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
-- Build type Release
-- Static binaries ON
-- Verbose warnings ON
-- Compile with -fpic OFF
-- Compile for gprof profiling OFF
-- Quiet OFF
-- DRAT proofs OFF
-- Found Git: /usr/bin/git (found version "2.32.0") 
-- enable verbose compiler warnings
-- Performing Test HAVE_FLAG_-Wno-delete-non-virtual-dtor
-- Performing Test HAVE_FLAG_-Wno-delete-non-virtual-dtor - Success
-- Performing Test HAVE_FLAG_-Wno-unused-but-set-variable
-- Performing Test HAVE_FLAG_-Wno-unused-but-set-variable - Success
-- Performing Test HAVE_FLAG_-Wno-class-memaccess
-- Performing Test HAVE_FLAG_-Wno-class-memaccess - Success
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Libs: /usr/lib/libz.so /usr/lib/librt.so -lpthread
-- Generating signature riss-version from git
-- Generating signature coprocessor-version from git
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen dot 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/soos/development/sat_solvers/riss/build

stuff.cnf.gz

riss (7.1) outputs blank line before s UNSATISFIABLE

Hi,

(echo "p cnf 0 1" && echo "0"  ) | riss
...
c CPU time              : 0.000156 s

s UNSATISFIABLE

the blank line was confusing my parser. I thought that each line should start with c, s or v.

(I have riss (core) 7.1.0 v7.1.0-dirty, built from source in 2019.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.