summaryrefslogtreecommitdiffstats
path: root/src/sat/bsat/satVec.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-11-25 18:06:36 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2011-11-25 18:06:36 -0800
commit9726d5a85e132e117cbc5caf7a3d8b6cd2f9e4fc (patch)
tree5eb399f32c6f4ab4dcb6e44fddfe9e5de799ab03 /src/sat/bsat/satVec.h
parent7a0a4d4d7917290168450c2296f1504f06b34b88 (diff)
downloadabc-9726d5a85e132e117cbc5caf7a3d8b6cd2f9e4fc.tar.gz
abc-9726d5a85e132e117cbc5caf7a3d8b6cd2f9e4fc.tar.bz2
abc-9726d5a85e132e117cbc5caf7a3d8b6cd2f9e4fc.zip
Improvement to the SAT solver (skipping binary clauses).
Diffstat (limited to 'src/sat/bsat/satVec.h')
-rw-r--r--src/sat/bsat/satVec.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/sat/bsat/satVec.h b/src/sat/bsat/satVec.h
index 6e604d36..4eedbdd0 100644
--- a/src/sat/bsat/satVec.h
+++ b/src/sat/bsat/satVec.h
@@ -86,6 +86,44 @@ static inline void vecp_push (vecp* v, void* e)
+//=================================================================================================
+// Simple types:
+
+#ifndef __cplusplus
+#ifndef false
+# define false 0
+#endif
+#ifndef true
+# define true 1
+#endif
+#endif
+
+typedef int lit;
+typedef char lbool;
+
+static const int var_Undef = -1;
+static const lit lit_Undef = -2;
+
+static const lbool l_Undef = 0;
+static const lbool l_True = 1;
+static const lbool l_False = -1;
+
+static inline lit toLit (int v) { return v + v; }
+static inline lit toLitCond(int v, int c) { return v + v + (c != 0); }
+static inline lit lit_neg (lit l) { return l ^ 1; }
+static inline int lit_var (lit l) { return l >> 1; }
+static inline int lit_sign (lit l) { return l & 1; }
+static inline int lit_print(lit l) { return lit_sign(l)? -lit_var(l)-1 : lit_var(l)+1; }
+static inline lit lit_read (int s) { return s > 0 ? toLit(s-1) : lit_neg(toLit(-s-1)); }
+static inline int lit_check(lit l, int n) { return l >= 0 && lit_var(l) < n; }
+
+struct stats_t
+{
+ ABC_INT64_T starts, decisions, propagations, inspects, conflicts;
+ ABC_INT64_T clauses, clauses_literals, learnts, learnts_literals, max_literals, tot_literals;
+};
+typedef struct stats_t stats_t;
+
ABC_NAMESPACE_HEADER_END