31 lines
722 B
C
31 lines
722 B
C
#pragma once
|
|
#include "types.h"
|
|
|
|
typedef struct {
|
|
u32 varcnt;
|
|
u32 clausecnt;
|
|
u32* clauseinds;
|
|
u32* clausevals;
|
|
|
|
u32* watchlist;
|
|
} cpusolver;
|
|
|
|
void cpusolve() {
|
|
cpusolver s;
|
|
|
|
|
|
}
|
|
/*
|
|
* Read in DIMACs
|
|
* A clause is a list of variables and their assignments
|
|
*
|
|
* Create watchlists:
|
|
* 2 entries for each list - flag bit for if its a binary clause
|
|
*
|
|
* 2-watch:
|
|
* If one of them is marked false, remove and replace
|
|
* if there are no other literals in the clause that are true, unitprop the last literal
|
|
* if there are no literals that evaluate to true and the other watch is false, UNSAT
|
|
* if a literal is true, do nothing
|
|
* if 2 literals are unassigned, clause is unsat
|
|
*/ |