Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove using namespace Lib from hpp files. #588

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CASC/PortfolioMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace CASC
{

using namespace Lib;
using namespace Shell;

class PortfolioMode {
Expand All @@ -54,7 +53,7 @@ class PortfolioMode {
[[noreturn]] void runSlice(Options& strategyOpt);

#if VDEBUG
DHSet<pid_t> childIds;
Lib::DHSet<pid_t> childIds;
#endif
unsigned _numWorkers;
// file that will contain a proof
Expand All @@ -66,7 +65,7 @@ class PortfolioMode {
* Note that in the current process this child object is the only one that
* will be using the problem object.
*/
ScopedPtr<Problem> _prb;
Lib::ScopedPtr<Problem> _prb;
float _slowness;
};

Expand Down
1 change: 0 additions & 1 deletion DP/DecisionProcedure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

namespace DP {

using namespace Lib;
using namespace Kernel;

/**
Expand Down
1 change: 1 addition & 0 deletions DP/ShortConflictMetaDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace DP
{

using namespace std;
using namespace Lib;

/**
* Computes number of literals in core not implied at the zero level
Expand Down
5 changes: 2 additions & 3 deletions DP/ShortConflictMetaDP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

namespace DP {

using namespace Lib;
using namespace Kernel;
using namespace SAT;

Expand Down Expand Up @@ -70,9 +69,9 @@ class ShortConflictMetaDP : public DecisionProcedure {
unsigned getCoreSize(const LiteralStack& core);


Stack<LiteralStack> _unsatCores;
Lib::Stack<LiteralStack> _unsatCores;

ScopedPtr<DecisionProcedure> _inner;
Lib::ScopedPtr<DecisionProcedure> _inner;
SAT2FO& _sat2fo;
SATSolver& _solver;
};
Expand Down
1 change: 1 addition & 0 deletions DP/SimpleCongruenceClosure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace DP
{

using namespace std;
using namespace Lib;

const unsigned SimpleCongruenceClosure::NO_SIG_SYMBOL = 0xFFFFFFFF;

Expand Down
31 changes: 15 additions & 16 deletions DP/SimpleCongruenceClosure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

namespace DP {

using namespace Lib;
using namespace Kernel;

/**
Expand Down Expand Up @@ -163,7 +162,7 @@ class SimpleCongruenceClosure : public DecisionProcedure
void propagate();

unsigned getProofDepth(unsigned c);
void collectUnifyingPath(unsigned c1, unsigned c2, Stack<unsigned>& path);
void collectUnifyingPath(unsigned c1, unsigned c2, Lib::Stack<unsigned>& path);

static const unsigned NO_SIG_SYMBOL;
struct ConstInfo
Expand Down Expand Up @@ -202,14 +201,14 @@ class SimpleCongruenceClosure : public DecisionProcedure

/** If reprConst==0, contains other constants whose representative
* this constant is */
Stack<unsigned> classList;
Lib::Stack<unsigned> classList;
/**
* If reprConst==0, contains list of pair names in whose pairs this
* constant appears as a representative of one of the arguments.
* Irregardless of the value of reprConst, also contains representatives
* of all pairs that have this very constant as one of arguments.
*/
Stack<unsigned> useList;
Lib::Stack<unsigned> useList;

// needed for getModel:
/**
Expand All @@ -219,7 +218,7 @@ class SimpleCongruenceClosure : public DecisionProcedure
/**
* Meaningful for representatives. A list of edges leaving the class "upwards".
*/
Stack<unsigned> upEdges;
Lib::Stack<unsigned> upEdges;
/**
* Meaningful for namedPairs.
*
Expand All @@ -239,7 +238,7 @@ class SimpleCongruenceClosure : public DecisionProcedure
};

struct ConstOrderingComparator;
typedef DHMap<unsigned,TermList> NFMap;
typedef Lib::DHMap<unsigned,TermList> NFMap;
void computeConstsNormalForm(unsigned c, NFMap& normalForms);

#if VDEBUG
Expand All @@ -253,7 +252,7 @@ class SimpleCongruenceClosure : public DecisionProcedure
* of constants in special cases, such as to indicate that there is
* no constant.
*/
DArray<ConstInfo> _cInfos;
Lib::DArray<ConstInfo> _cInfos;

/** Positive literals are made equivalent to this constant */
unsigned _posLitConst;
Expand All @@ -263,31 +262,31 @@ class SimpleCongruenceClosure : public DecisionProcedure
/**
* Map from signature symbols to the local constant numbers.
*/
DHMap<std::pair<unsigned,SignatureKind>,unsigned> _sigConsts;
Lib::DHMap<std::pair<unsigned,SignatureKind>,unsigned> _sigConsts;

typedef DHMap<CPair,unsigned> PairMap;
typedef Lib::DHMap<CPair,unsigned> PairMap;
/** Names of constant pairs (modulo the congruence!)*/
PairMap _pairNames;

/** Constants corresponding to terms */
DHMap<TermList,unsigned> _termNames;
Lib::DHMap<TermList,unsigned> _termNames;
/** Constants corresponding to literals */
DHMap<Literal*,unsigned> _litNames;
Lib::DHMap<Literal*,unsigned> _litNames;

/**
* Equality that caused unsatisfiability; if CEq::isInvalid(), there isn't such.
*/
Stack<CEq> _unsatEqs;
Deque<CEq> _pendingEqualities;
Stack<CEq> _negEqualities;
Lib::Stack<CEq> _unsatEqs;
Lib::Deque<CEq> _pendingEqualities;
Lib::Stack<CEq> _negEqualities;

struct DistinctEntry
{
DistinctEntry(Literal* l) : _lit(l) {}
Literal* _lit;
Stack<unsigned> _consts;
Lib::Stack<unsigned> _consts;
};
typedef Stack<DistinctEntry> DistinctStack;
typedef Lib::Stack<DistinctEntry> DistinctStack;
DistinctStack _distinctConstraints;
/** Negated distinct constraints, these can lead to an UNKNOWN satisfiability result
*
Expand Down
1 change: 1 addition & 0 deletions Debug/RuntimeStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Debug
{

using namespace std;
using namespace Lib;

void RSMultiCounter::print(ostream& out)
{
Expand Down
12 changes: 6 additions & 6 deletions Debug/RuntimeStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ square's last digit:

namespace Debug {

using namespace Lib;

class RSObject
{
Expand Down Expand Up @@ -127,21 +126,21 @@ class RSMultiCounter
void print(std::ostream& out);
void inc(size_t index) { _counters[index]++; }
private:
ZIArray<size_t> _counters;
Lib::ZIArray<size_t> _counters;
};

class RSMultiStatistic
: public RSObject
{
typedef List<int> ValList;
typedef Lib::List<int> ValList;
public:
RSMultiStatistic(const char* name) : RSObject(name) {}
~RSMultiStatistic();

void print(std::ostream& out);
void addRecord(size_t index, int value) { ValList::push(value, _values[index]); }
private:
ZIArray<ValList* > _values;
Lib::ZIArray<ValList* > _values;
};

class RuntimeStatistics
Expand All @@ -151,8 +150,9 @@ class RuntimeStatistics

struct RSObjComparator
{
static Comparison compare(const char* name, RSObject* o2)
static Lib::Comparison compare(const char* name, RSObject* o2)
{
using namespace Lib;
int res=strcmp(name, o2->name());
return (res>0) ? GREATER : ((res==0) ? EQUAL : LESS);
}
Expand All @@ -175,7 +175,7 @@ class RuntimeStatistics
RuntimeStatistics();
~RuntimeStatistics();

typedef SkipList<RSObject*,RSObjComparator> ObjSkipList;
typedef Lib::SkipList<RSObject*,RSObjComparator> ObjSkipList;
ObjSkipList _objs;
};

Expand Down
2 changes: 1 addition & 1 deletion Debug/Tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Debug::Tracer::printStack(std::ostream& str) {
str << ' ' << call_stack[sz - (i + 1)];
str << std::endl;

if (env.options->traceback()) {
if (Lib::env.options->traceback()) {
// UNIX-like systems, including BSD and Linux but not MacOS
#if defined(__unix__)
str << "invoking addr2line(1) ..." << std::endl;
Expand Down
1 change: 1 addition & 0 deletions FMB/ClauseFlattening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
namespace FMB{

using namespace std;
using namespace Lib;

bool ClauseFlattening::isShallow(Literal* lit)
{
Expand Down
18 changes: 9 additions & 9 deletions FMB/CliqueFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ namespace FMB {

class CliqueFinder {
public:
static unsigned findMaxCliqueSize(DHMap<unsigned,DHSet<unsigned>*>* Ngraph)
static unsigned findMaxCliqueSize(Lib::DHMap<unsigned,Lib::DHSet<unsigned>*>* Ngraph)
{
//std::cout << "findMaxCliqueSize with " << Ngraph->size() << std::endl;

// at least stores the number of nodes with at least index neighbours
DArray<Stack<unsigned>> atleast;
Lib::DArray<Lib::Stack<unsigned>> atleast;
atleast.ensure(Ngraph->size()+1); // the +1 is to protect against a self-loop sneaking in

DHMap<unsigned,DHSet<unsigned>*>::Iterator miter(*Ngraph);
Lib::DHMap<unsigned,Lib::DHSet<unsigned>*>::Iterator miter(*Ngraph);
while(miter.hasNext()){
unsigned c;
DHSet<unsigned>* nbs;
Lib::DHSet<unsigned>* nbs;
miter.next(c,nbs);
unsigned size = nbs->size();
//std::cout << ">> " << c << ": " << size << std::endl;

//DHSet<unsigned>::Iterator dit(*nbs);
//Lib::DHSet<unsigned>::Iterator dit(*nbs);
//while(dit.hasNext()){ std::cout << dit.next() << std::endl; }

for(;size>0;size--){
Expand All @@ -61,13 +61,13 @@ namespace FMB {
else if (atleast[i].size() > i+1){
//std::cout << "CASE 2" << std::endl;
unsigned left = atleast[i].size();
Stack<unsigned>::Iterator niter(atleast[i]);
Lib::Stack<unsigned>::Iterator niter(atleast[i]);
while(niter.hasNext() && left >= i+1){
unsigned c = niter.next();
//std::cout << ">> " << c << std::endl;
auto ns = Ngraph->get(c);
if(ns->size()==i){
Stack<unsigned> clique;
Lib::Stack<unsigned> clique;
clique.loadFromIterator(ns->iterator());
clique.push(c);
if(checkClique(Ngraph,clique)){
Expand All @@ -89,15 +89,15 @@ namespace FMB {
private:

// check if a clique is a clique
static bool checkClique(DHMap<unsigned,DHSet<unsigned>*>* Ngraph, Stack<unsigned>& clique)
static bool checkClique(Lib::DHMap<unsigned,Lib::DHSet<unsigned>*>* Ngraph, Lib::Stack<unsigned>& clique)
{
//std::cout << "CHECK "; for(unsigned j=0;j<clique.size();j++){ std::cout << clique[j] << " ";}; std::cout << std::endl;

for(unsigned i=0;i<clique.size()-1;i++){
unsigned c1 = clique[i];
auto ns = Ngraph->get(c1);
//std::cout << c1 << " neighbours: ";
//DHSet<unsigned>::Iterator pit(*ns);while(pit.hasNext()){std::cout << pit.next() << " ";};std::cout<<std::endl;
//Lib::DHSet<unsigned>::Iterator pit(*ns);while(pit.hasNext()){std::cout << pit.next() << " ";};std::cout<<std::endl;
for(unsigned j=i+1;j<clique.size();j++){
unsigned c2 = clique[j];
//std::cout << "checking " << c2 << " is a neighbour of " << c1 << std::endl;
Expand Down
Loading