MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / clause

Method clause

code/other/dpll.cpp:8–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 SAT() : n(0) { }
7 int var() { return ++n; }
8 void clause(vi vars) {
9 set<int> seen; iter(it,vars) {
10 if (seen.find(IDX(*it)^1) != seen.end()) return;
11 seen.insert(IDX(*it)); }
12 head.push_back(cl.size());
13 iter(it,seen) cl.push_back(*it);
14 tail.push_back((int)cl.size() - 2); }
15 bool assume(int x) {
16 if (val[x^1]) return false;
17 if (val[x]) return true;

Callers 1

iterFunction · 0.80

Calls 3

push_backMethod · 0.80
iterFunction · 0.70
sizeMethod · 0.45

Tested by 1

iterFunction · 0.64