CSFLOC rewrite

Signed-off-by: gothictomato <gothictomato@pm.me>
This commit is contained in:
gothictomato
2022-09-04 10:52:28 -04:00
parent e2b633c802
commit 53a580d0ec
9 changed files with 761 additions and 228 deletions

View File

@@ -1,31 +1,9 @@
#pragma once
#include "types.h"
typedef struct {
u32 varcnt;
u32 clausecnt;
u32* clauseinds;
u32* clausevals;
u32* watchlist;
} cpusolver;
void cpusolve() {
cpusolver s;
#include "ncnf.h"
}
/*
* 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
*/
i32 cpusolve(cnf* c);
void debugsolve(char* path);