Skip to content

Commit 4dd7905

Browse files
committed
Update readme & authors
1 parent d66353c commit 4dd7905

File tree

2 files changed

+141
-20
lines changed

2 files changed

+141
-20
lines changed

AUTHORS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
This codebase has many authors. All authors licensed their works with MIT.
1+
This codebase has many authors. All authors licensed their works with MIT except BreakID, which is licensed with GPL.
2+
3+
The authors are:
24
* GANAK-specific code by: Mate Soos, Kuldeep S. Meel, Subhajit Roy, Shubham Sharma
35
* CryptoMiniSat maintained by Mate Soos, see CryptoMiniSat's AUTHORS file for list of authors
6+
* Arjun preprocessor by Mate Soos and Kuldeep S. Meel.
47
* Top-down search idea by Davis, Putnam, Logemann, and Loveland
58
* Decomposition d-dNNF idea by Adnan Darwiche
69
* TD idea&code by Korhonen and Jarvisalo
10+
* Oracle code and idea by Tuukka Korhonen and Matti Jaervisalo
11+
* Graph library by Tuukka Korhonen and Matti Jaervisalo
712
* TD search code by Ben Strasser. BSD2 license
813
* Modifications to flow_cutter & 'GPMC' heuristic by Kenji Hashimoto
914
* LBD idea by Simon and Audemard
1015
* clhash by Daniel Lemire and Owen Kaser, fixes by Alfons Laarman
1116
* VSIDS idea by Moskewicz, Zhao, Zhang, and Malik
17+
* VSADS by Tian Sang, Paul Beame, and Henry Kautz
18+
* CCAnr by Shaowei Cai, Chuan Luo, Kaile Su
1219
* Based on SharpSAT by Marc Thurley

README.md

Lines changed: 133 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,73 @@
1-
# GANAK- A Probabilistic Exact Model Counter
2-
GANAK takes in a CNF formula `F` and a confidence `delta` as input and returns `count` such that `count` is the number of solutions of `F` with confidence at least `1 - delta`. GANAK supports projected model counting (see below).
1+
# Ganak2 -- A Probabilistic Exact Model Counter
2+
Ganak takes in a CNF formula and returns `count` such that `count` is the
3+
number of solutions of `F` with confidence at least `1 - delta`. Delta is fixed to
4+
approx 2^-40.
35

4-
To read more about Ganak-specific ideas, please refer to [our paper](https://www.comp.nus.edu.sg/~meel/Papers/ijcai19srsm.pdf). Note that Ganak employs many ideas by many people. See AUTHORS for a list.
6+
To read more about Ganak-specific ideas, please refer to [our
7+
paper](https://www.comp.nus.edu.sg/~meel/Papers/ijcai19srsm.pdf). Note that
8+
Ganak employs many ideas by many people. See AUTHORS for a list.
59

6-
## Compiling in Linux
10+
## Building
711

8-
To build ganak, you first need to build [CryptoMiniSat](github.com/msoos/cryptominisat). Then issue:
12+
Use of the [release binaries](https://github.com/meelgroup/ganak/releases) is
13+
strongly encouraged, as Ganak requires a specific set of libraries to be
14+
installed. The second best thing to use is Nix. Simply [install
15+
nix](https://nixos.org/download/) and then:
916

10-
```bash
11-
sudo apt-get install libgmp-dev
12-
sudo apt-get install libmpfr-dev
13-
sudo apt-get install libmpc-dev
14-
mkdir build && cd build
15-
cmake ..
16-
make
17+
```plaintext
18+
git clone https://github.com/meelgroup/ganak
19+
nix-shell
1720
```
21+
If this is somehow not what you want, you can also build it. See the GitHub
22+
Action for the specific set of steps. At the end of this README you can
23+
find a detailed set of instructions.
1824

1925
## Usage
20-
Ganak takes a CNF in DIMACS form as an input:
26+
Ganak takes a CNF in a special, DIMACS-like format as specified by the
27+
model counting competition [guidelines](https://mccompetition.org/assets/files/mccomp_format_24.pdf).
28+
Basically, the format is as follows:
2129

22-
```bash
23-
./ganak myfile.cnf
30+
```plaintext
31+
c t pwmc
32+
p cnf 3 2
33+
c p weight 1 0.3 0
34+
c p weight -1 0.8 0
35+
1 2 3 0
36+
-1 2 0
37+
c p show 1 2 0
2438
```
39+
The first line says it's a projected weighted model counting instance. The
40+
second line says it has 3 variables and 2 clauses. The third and fourth lines
41+
specify the weights of the variables 1. The weight of the literal 1 is 0.3 and
42+
the weight of the literal -1 is 0.8. The weight of all unspecified variables is
43+
1 for both positive and negative literals.
44+
45+
The last line says that the projection set of the counter is only variables 1
46+
and 2. If no projection set is given, then the counter does an unprojected
47+
count, i.e. all variables are assumed to be in the projection set.
48+
49+
Beware to ALWAYS give the weight of both the literal and its negation or
50+
different counters may give different results.
51+
52+
We can now count the number of solutions of the above formula using Ganak:
53+
```plaintext
54+
./ganak --verb 0 --mode 1 a.cnf
55+
c o Total time [Arjun+GANAK]: 0.00
56+
s SATISFIABLE
57+
c s exact arb float 1.8999e+00
58+
c o exact arb 19/10
59+
```
60+
61+
We need to pass `--mode 1` because it's a weighted model counting instance. The count
62+
is presented both in a floating point format and as a fraction. The fraction is
63+
always precise.
2564

2665
## Benchmarks
27-
Few toy benchmarks are given in benchmarks directory. Full list of benchmarks used for our experiments is available [here](https://drive.google.com/file/d/15dUJI55drFH_0-4-qWjoF_YR0amb3xnK/view?usp=sharing)
66+
Model Counting Competition benchmarks are available on the [Model Counting
67+
Competition website](http://https://mccompetition.org/).
2868

69+
Our benchmarks are available
70+
[here](https://drive.google.com/file/d/15dUJI55drFH_0-4-qWjoF_YR0amb3xnK/view?usp=sharing)
2971

3072
## How to Cite
3173
```
@@ -38,7 +80,79 @@ year={2019}
3880
}
3981
```
4082

41-
## Copyright, contributors
42-
GANAK licensed under MIT. Flow Cutter licensed under BSD2-style license. Binary built contains both (they are compatible with each other).
83+
## Building from source
84+
85+
```bash
86+
sudo apt-get install -yq libgmp-dev libmpfr-dev
87+
88+
git clone https://github.com/meelgroup/cadical
89+
cd cadical
90+
git checkout add_dynamic_lib
91+
./configure
92+
make
93+
cd ..
94+
95+
git clone https://github.com/meelgroup/cadiback
96+
cd cadiback
97+
git checkout synthesis
98+
./configure
99+
make
100+
cd ..
101+
102+
git clone https://github.com/msoos/cryptominisat
103+
cd cryptominisat
104+
git checkout synthesis
105+
mkdir build && cd build
106+
cmake ..
107+
make
108+
cd ../..
109+
110+
git clone https://github.com/meelgroup/sbva
111+
cd sbva
112+
mkdir build && cd build
113+
cmake ..
114+
make
115+
cd ../..
116+
117+
git clone https://github.com/meelgroup/breakid
118+
cd breakid
119+
mkdir build && cd build
120+
cmake ..
121+
make
122+
cd ../..
123+
124+
git clone https://github.com/meelgroup/approxmc
125+
cd approxmc
126+
mkdir build && cd build
127+
git checkout synthesis
128+
cmake ..
129+
make
130+
cd ../..
131+
132+
git clone https://github.com/meelgroup/ganak
133+
cd ganak
134+
mkdir build && cd build
135+
cmake ..
136+
make
137+
```
138+
139+
if you also need to have the system run on older or different machines, you
140+
need to have it compile for Sandybridge architecture. To do this, you need to
141+
recompile GMP and MPFR with the right flags. Here is how to do it:
43142

44-
See AUTHORS for full list. Ganak-specific contributions by, in alphabetical order: Kuldeep S. Meel, Subhajit Roy, Shubham Sharma, Mate Soos. However, MANY people's ideas contributed to Ganak. It's easy to list everyone from Stockmayer (e.g. probing) to Donald Knuth (e.g. memops).
143+
```bash
144+
wget https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
145+
tar xvf gmp-6.3.0.tar.xz
146+
cd gmp-6.3.0
147+
CFLAGS="-march=sandybridge" ./configure --enable-cxx
148+
make -j12
149+
sudo make install
150+
cd ..
151+
wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz
152+
tar xvf mpfr-4.1.0.tar.xz
153+
cd mpfr-4.1.0
154+
CFLAGS="-march=sandybridge" ./configure
155+
make -j12
156+
sudo make install
157+
cd ..
158+
```

0 commit comments

Comments
 (0)