Skip to content

Commit b5b80b7

Browse files
Merge pull request #1 from conp-solutions/fixes
Fixes
2 parents cc4a9d3 + 6ea7de5 commit b5b80b7

File tree

10 files changed

+35
-11
lines changed

10 files changed

+35
-11
lines changed

.travis.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: cpp
2+
dist: trusty
3+
compiler: g++
4+
sudo: required
5+
6+
before_install:
7+
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
8+
- sudo apt-get update -q
9+
- sudo apt-get remove gcc g++
10+
- sudo apt-get install g++-7 gcc-7 -y
11+
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
12+
- sudo update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 60
13+
- sudo update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7 60
14+
- sudo update-alternatives --install /usr/bin/x86_64-linux-gnu-gcc x86_64-linux-gnu-gcc /usr/bin/x86_64-linux-gnu-gcc-7 60 --slave /usr/bin/x86_64-linux-gnu-g++ x86_64-linux-gnu-g++ /usr/bin/x86_64-linux-gnu-g++-7
15+
16+
# run the typical ci checks, for now, compile
17+
script:
18+
- make pcassod pcassoRS -j $(nproc)

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const float solverVersion = 4.27;
1+
const float solverVersion = 7.9;

core/Dimacs.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static void parse_DIMACS_main(B& in, Solver& S)
6666
// if (clauses > 4000000)
6767
// S.eliminate(true);
6868
} else {
69+
assert(false && "This should not happen");
6970
printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3);
7071
}
7172
} else if (*in == 'c' || *in == 'p') {

license.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
22
Copyright (c) 2007-2010 Niklas Sorensson
33
Glucose -- Copyright (c) 2009-2012, Gilles Audemard, Laurent Simon
44
Riss3g -- Copyright (c) 2012-2014, Norbert Manthey
5-
Pcasso -- Copyright (c) 2014, Ahmed Irfan, Davide Lanti, Norbert Manthey
5+
Pcasso -- Copyright (c) 2014-2018, Ahmed Irfan, Davide Lanti, Norbert Manthey
66

77
Permission is hereby granted, free of charge, to use this software for
88
evaluation and research purposes.

mtl/template.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LINKSCOBJS = $(filter-out */Main.os, $(LIBSCOBJS))
2121

2222

2323
CXX ?= g++ -std=c++11
24-
CFLAGS ?= -Wall -Wno-parentheses
24+
CFLAGS ?= -Wall -Wextra -Wno-parentheses -Wno-reorder
2525
LFLAGS ?= -Wall
2626

2727
COPTIMIZE ?= -O3

pcasso-src/Master.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ Master::parseFormula(string filename)
12671267
// if (clauses > 4000000)
12681268
// S.eliminate(true);
12691269
} else {
1270+
assert(false && "This should not happen");
12701271
fprintf(stderr, "PARSE ERROR! Unexpected char: %c\n", *stream), exit(3);
12711272
}
12721273
} else if (*stream == 'c' || *stream == 'p') {

pcasso-src/Master.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Master
105105
Master* master; // handle to the master class, for backward communication (e.g. wakeup)
106106
Master::state s; // state of the thread
107107
SplitterSolver* solver; // The most recent solver
108-
ThreadData() : id(-1), result(0), timeout(-1), conflicts(-1), handle((pthread_t)0), s(idle), solver(NULL) {}
108+
ThreadData() : nodeToSolve(0), id(-1), result(0), timeout(-1), conflicts(-1), handle((pthread_t)0), master(0), s(idle), solver(NULL) {}
109109
};
110110

111111
// to maintain the original formula

pcasso-src/SolverPT.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Var SolverPT::newVar(bool sign, bool dvar, char type)
199199
{
200200
assert(varPT.size() == nVars());
201201
varPT.push(0);//adding PT level of the new variable
202-
int v = nVars();
202+
Var v = nVars();
203203
watches .init(mkLit(v, false));
204204
watches .init(mkLit(v, true));
205205

@@ -222,6 +222,8 @@ Var SolverPT::newVar(bool sign, bool dvar, char type)
222222
permDiff .resize(v + 1); // add space for the next variable
223223
trail .capacity(v + 1);
224224
setDecisionVar(v, dvar);
225+
226+
return v;
225227
}
226228

227229
void SolverPT::setLiteralPTLevel(const Lit& l, unsigned pt)
@@ -1128,7 +1130,7 @@ lbool SolverPT::search(int nof_conflicts)
11281130
pull_learnts(starts);
11291131
if (!ok) { return l_False; }
11301132
if (!simplify()) {
1131-
printf("c last restart ## conflicts : %d %d \n", conflictC, decisionLevel());
1133+
// fprintf(stderr, "c last restart ## conflicts : %d %d \n", conflictC, decisionLevel());
11321134
return l_False;
11331135
}
11341136
}
@@ -1165,7 +1167,7 @@ lbool SolverPT::search(int nof_conflicts)
11651167

11661168
if (next == lit_Undef) {
11671169

1168-
printf("c last restart ## conflicts : %d %d \n", conflictC, decisionLevel());
1170+
// fprintf("c last restart ## conflicts : %d %d \n", conflictC, decisionLevel());
11691171
// Model found:
11701172
return l_True;
11711173
}

scripts/pcasso.sh

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fi
5555

5656

5757
# some temporary files
58+
mkdir -p $tmpDir
5859
undo=$tmpDir/undo_$$ # path to temporary file that stores cp3 undo information
5960
tmpCNF=$tmpDir/tmpCNF_$$ # path to temporary file that stores cp3 simplified formula
6061
model=$tmpDir/model_$$ # path to temporary file that model of the preprocessor (stdout)

utils/ParseUtils.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
2121
#ifndef Minisat_ParseUtils_h
2222
#define Minisat_ParseUtils_h
2323

24+
#include <assert.h>
2425
#include <stdlib.h>
2526
#include <stdio.h>
2627
#include <math.h>
@@ -102,17 +103,17 @@ static double parseDouble(B& in) // only in the form X.XXXXXe-XX
102103
if (*in == EOF) { return 0; }
103104
if (*in == '-') { neg = true, ++in; }
104105
else if (*in == '+') { ++in; }
105-
if (*in < '1' || *in > '9') { printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
106+
if (*in < '1' || *in > '9') { assert(false && "This should not happen"); printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
106107
accu = (double)(*in - '0');
107108
++in;
108-
if (*in != '.') { printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
109+
if (*in != '.') { assert(false && "This should not happen"); printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
109110
++in; // skip dot
110111
currentExponent = 0.1;
111112
while (*in >= '0' && *in <= '9')
112113
accu = accu + currentExponent * ((double)(*in - '0')),
113114
currentExponent /= 10,
114115
++in;
115-
if (*in != 'e') { printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
116+
if (*in != 'e') { assert(false && "This should not happen"); printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
116117
++in; // skip dot
117118
exponent = parseInt(in); // read exponent
118119
accu *= pow(10, exponent);
@@ -128,7 +129,7 @@ static int64_t parseInt(B& in)
128129
skipWhitespace(in);
129130
if (*in == '-') { neg = true, ++in; }
130131
else if (*in == '+') { ++in; }
131-
if (*in < '0' || *in > '9') { fprintf(stderr, "PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
132+
if (*in < '0' || *in > '9') { assert(false && "This should not happen"); fprintf(stderr, "PARSE ERROR! Unexpected char: %c\n", *in), exit(3); }
132133
while (*in >= '0' && *in <= '9')
133134
val = val * 10 + (*in - '0'),
134135
++in;

0 commit comments

Comments
 (0)