diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
commit | 320c429bc46728c1faddfc561c166810aa134a04 (patch) | |
tree | c773cc96431cd38ae35484dae7d7d17a79671ac2 /src/sat | |
parent | f65983c2c0810cfb933f696952325a81d2378987 (diff) | |
download | abc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2 abc-320c429bc46728c1faddfc561c166810aa134a04.zip |
Version abc80301
Diffstat (limited to 'src/sat')
-rw-r--r-- | src/sat/bsat/satSolver.c | 9 | ||||
-rw-r--r-- | src/sat/fraig/fraig.h | 8 | ||||
-rw-r--r-- | src/sat/fraig/fraigInt.h | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/sat/bsat/satSolver.c b/src/sat/bsat/satSolver.c index 8a13d203..a04921c9 100644 --- a/src/sat/bsat/satSolver.c +++ b/src/sat/bsat/satSolver.c @@ -25,6 +25,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include <math.h> #include "satSolver.h" +#include "port_type.h" //#define SAT_USE_SYSTEM_MEMORY_MANAGEMENT @@ -90,9 +91,9 @@ static inline void clause_setactivity(clause* c, float a) { *((float*)&c->lits[ //================================================================================================= // Encode literals in clause pointers: -static inline clause* clause_from_lit (lit l) { return (clause*)((unsigned long)l + (unsigned long)l + 1); } -static inline bool clause_is_lit (clause* c) { return ((unsigned long)c & 1); } -static inline lit clause_read_lit (clause* c) { return (lit)((unsigned long)c >> 1); } +static inline clause* clause_from_lit (lit l) { return (clause*)((PORT_PTRUINT_T)l + (PORT_PTRUINT_T)l + 1); } +static inline bool clause_is_lit (clause* c) { return ((PORT_PTRUINT_T)c & 1); } +static inline lit clause_read_lit (clause* c) { return (lit)((PORT_PTRUINT_T)c >> 1); } //================================================================================================= // Simple helpers: @@ -285,7 +286,7 @@ static clause* clause_new(sat_solver* s, lit* begin, lit* end, int learnt) #endif c->size_learnt = (size << 1) | learnt; - assert(((unsigned long)c & 1) == 0); + assert(((PORT_PTRUINT_T)c & 1) == 0); for (i = 0; i < size; i++) c->lits[i] = begin[i]; diff --git a/src/sat/fraig/fraig.h b/src/sat/fraig/fraig.h index 1dad21e2..c08e7e3a 100644 --- a/src/sat/fraig/fraig.h +++ b/src/sat/fraig/fraig.h @@ -113,10 +113,10 @@ struct Prove_ParamsStruct_t_ //////////////////////////////////////////////////////////////////////// // macros working with complemented attributes of the nodes -#define Fraig_IsComplement(p) (((int)((unsigned long) (p) & 01))) -#define Fraig_Regular(p) ((Fraig_Node_t *)((unsigned long)(p) & ~01)) -#define Fraig_Not(p) ((Fraig_Node_t *)((unsigned long)(p) ^ 01)) -#define Fraig_NotCond(p,c) ((Fraig_Node_t *)((unsigned long)(p) ^ (c))) +#define Fraig_IsComplement(p) (((int)((PORT_PTRUINT_T) (p) & 01))) +#define Fraig_Regular(p) ((Fraig_Node_t *)((PORT_PTRUINT_T)(p) & ~01)) +#define Fraig_Not(p) ((Fraig_Node_t *)((PORT_PTRUINT_T)(p) ^ 01)) +#define Fraig_NotCond(p,c) ((Fraig_Node_t *)((PORT_PTRUINT_T)(p) ^ (c))) // these are currently not used #define Fraig_Ref(p) diff --git a/src/sat/fraig/fraigInt.h b/src/sat/fraig/fraigInt.h index 9c6e0d47..dc7bc815 100644 --- a/src/sat/fraig/fraigInt.h +++ b/src/sat/fraig/fraigInt.h @@ -32,6 +32,7 @@ #include "fraig.h" #include "msat.h" +#include "port_type.h" //////////////////////////////////////////////////////////////////////// /// PARAMETERS /// |