diff options
author | Bruno Schmitt <bruno@oschmitt.com> | 2017-02-06 19:50:57 -0800 |
---|---|---|
committer | Bruno Schmitt <bruno@oschmitt.com> | 2017-02-06 19:50:57 -0800 |
commit | 0fb4442a8208ccc36067db034c12a840095c0911 (patch) | |
tree | 7fb02a5678455845c04689976de230cad2d96f1c | |
parent | cac3967b52ae44fae3962ee9eba456221e0efda3 (diff) | |
download | abc-0fb4442a8208ccc36067db034c12a840095c0911.tar.gz abc-0fb4442a8208ccc36067db034c12a840095c0911.tar.bz2 abc-0fb4442a8208ccc36067db034c12a840095c0911.zip |
Small changes to support old compilers.
-rw-r--r-- | src/base/abci/abc.c | 2 | ||||
-rw-r--r-- | src/sat/satoko/satoko.h | 4 | ||||
-rw-r--r-- | src/sat/satoko/solver.c | 4 | ||||
-rw-r--r-- | src/sat/satoko/solver.h | 36 | ||||
-rw-r--r-- | src/sat/satoko/solver_api.c | 12 | ||||
-rw-r--r-- | src/sat/satoko/utils/b_queue.h | 4 | ||||
-rwxr-xr-x | src/sat/satoko/utils/misc.h | 2 | ||||
-rw-r--r-- | src/sat/satoko/utils/vec/vec_char.h | 3 | ||||
-rw-r--r-- | src/sat/satoko/watch_list.h | 3 |
9 files changed, 35 insertions, 35 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index efb82fcc..65974acb 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -23357,7 +23357,7 @@ int Abc_CommandSatoko( Abc_Frame_t * pAbc, int argc, char ** argv ) int status; satoko_parse_dimacs( pFileName, &p ); - satoko_configure(p, &opts); + satoko_configure(p, &opts); clk = Abc_Clock(); status = satoko_solve( p ); diff --git a/src/sat/satoko/satoko.h b/src/sat/satoko/satoko.h index 49c7837e..55790714 100644 --- a/src/sat/satoko/satoko.h +++ b/src/sat/satoko/satoko.h @@ -30,8 +30,8 @@ typedef struct solver_t_ satoko_t; typedef struct satoko_opts satoko_opts_t; struct satoko_opts { /* Limits */ - long long conf_limit; /* Limit on the n.of conflicts */ - long long prop_limit; /* Limit on the n.of implications */ + long conf_limit; /* Limit on the n.of conflicts */ + long prop_limit; /* Limit on the n.of implications */ /* Constants used for restart heuristic */ double f_rst; /* Used to force a restart */ diff --git a/src/sat/satoko/solver.c b/src/sat/satoko/solver.c index b2861bad..8c06bbe8 100644 --- a/src/sat/satoko/solver.c +++ b/src/sat/satoko/solver.c @@ -325,14 +325,14 @@ static inline void solver_analyze(solver_t *s, unsigned cref, vec_uint_t *learnt static inline int solver_rst(solver_t *s) { return b_queue_is_valid(s->bq_lbd) && - (((long long)b_queue_avg(s->bq_lbd) * s->opts.f_rst) > (s->sum_lbd / s->stats.n_conflicts)); + (((long)b_queue_avg(s->bq_lbd) * s->opts.f_rst) > (s->sum_lbd / s->stats.n_conflicts)); } static inline int solver_block_rst(solver_t *s) { return s->stats.n_conflicts > s->opts.fst_block_rst && b_queue_is_valid(s->bq_lbd) && - (vec_uint_size(s->trail) > (s->opts.b_rst * (long long)b_queue_avg(s->bq_trail))); + ((long)vec_uint_size(s->trail) > (s->opts.b_rst * (long)b_queue_avg(s->bq_trail))); } static inline void solver_handle_conflict(solver_t *s, unsigned confl_cref) diff --git a/src/sat/satoko/solver.h b/src/sat/satoko/solver.h index 65b86c68..fe1d1ef5 100644 --- a/src/sat/satoko/solver.h +++ b/src/sat/satoko/solver.h @@ -42,13 +42,13 @@ struct satoko_stats { unsigned n_starts; unsigned n_reduce_db; - long long n_decisions; - long long n_propagations; - long long n_inspects; - long long n_conflicts; + long n_decisions; + long n_propagations; + long n_inspects; + long n_conflicts; - long long n_original_lits; - long long n_learnt_lits; + long n_original_lits; + long n_learnt_lits; }; typedef struct solver_t_ solver_t; @@ -82,17 +82,9 @@ struct solver_t_ { unsigned i_qhead; /* Head of propagation queue (as index into the trail). */ unsigned n_assigns_simplify; /* Number of top-level assignments since last execution of 'simplify()'. */ - long long n_props_simplify; /* Remaining number of propagations that - must be made before next execution of - 'simplify()'. */ - - /* Temporary data used by Search method */ - b_queue_t *bq_trail; - b_queue_t *bq_lbd; - long RC1; - long RC2; - unsigned n_confl_bfr_reduce; - float sum_lbd; + long n_props_simplify; /* Remaining number of propagations that + must be made before next execution of + 'simplify()'. */ /* Temporary data used by Analyze */ vec_uint_t *temp_lits; @@ -101,10 +93,18 @@ struct solver_t_ { vec_uint_t *stack; vec_uint_t *last_dlevel; + /* Temporary data used by Search method */ + b_queue_t *bq_trail; + b_queue_t *bq_lbd; + long RC1; + long RC2; + long n_confl_bfr_reduce; + float sum_lbd; + /* Misc temporary */ + unsigned cur_stamp; /* Used for marking literals and levels of interest */ vec_uint_t *stamps; /* Multipurpose stamp used to calculate LBD and * clauses minimization with binary resolution */ - unsigned cur_stamp; /* Used for marking literals and levels of interest */ struct satoko_stats stats; struct satoko_opts opts; diff --git a/src/sat/satoko/solver_api.c b/src/sat/satoko/solver_api.c index db9a267b..e041cc62 100644 --- a/src/sat/satoko/solver_api.c +++ b/src/sat/satoko/solver_api.c @@ -68,9 +68,9 @@ static inline void print_opts(solver_t *s) static inline void print_stats(solver_t *s) { printf("starts : %10d\n", s->stats.n_starts); - printf("conflicts : %10lld\n", s->stats.n_conflicts); - printf("decisions : %10lld\n", s->stats.n_decisions); - printf("propagations : %10lld\n", s->stats.n_propagations); + printf("conflicts : %10ld\n", s->stats.n_conflicts); + printf("decisions : %10ld\n", s->stats.n_decisions); + printf("propagations : %10ld\n", s->stats.n_propagations); } //===------------------------------------------------------------------------=== @@ -166,13 +166,13 @@ void satoko_default_opts(satoko_opts_t *opts) opts->inc_special_reduce = 1000; opts->lbd_freeze_clause = 30; /* VSIDS heuristic */ - opts->var_decay = 0.95; - opts->clause_decay = 0.995; + opts->var_decay = (act_t) 0.95; + opts->clause_decay = (clause_act_t) 0.995; /* Binary resolution */ opts->clause_max_sz_bin_resol = 30; opts->clause_min_lbd_bin_resol = 6; - opts->garbage_max_ratio = 0.3; + opts->garbage_max_ratio = (float) 0.3; } /** diff --git a/src/sat/satoko/utils/b_queue.h b/src/sat/satoko/utils/b_queue.h index 926edf29..b9b62676 100644 --- a/src/sat/satoko/utils/b_queue.h +++ b/src/sat/satoko/utils/b_queue.h @@ -21,7 +21,7 @@ struct b_queue_t_ { unsigned cap; unsigned i_first; unsigned i_empty; - unsigned long long sum; + unsigned long sum; unsigned *data; }; @@ -61,7 +61,7 @@ static inline void b_queue_push(b_queue_t *p, unsigned Value) static inline unsigned b_queue_avg(b_queue_t *p) { - return (unsigned)(p->sum / ((unsigned long long) p->size)); + return (unsigned)(p->sum / ((unsigned long) p->size)); } static inline unsigned b_queue_is_valid(b_queue_t *p) diff --git a/src/sat/satoko/utils/misc.h b/src/sat/satoko/utils/misc.h index aa8bcb8c..481e23b7 100755 --- a/src/sat/satoko/utils/misc.h +++ b/src/sat/satoko/utils/misc.h @@ -9,8 +9,6 @@ #ifndef satoko__utils__misc_h #define satoko__utils__misc_h -#include <stdint.h> - #include "misc/util/abc_global.h" ABC_NAMESPACE_HEADER_START diff --git a/src/sat/satoko/utils/vec/vec_char.h b/src/sat/satoko/utils/vec/vec_char.h index fe88797a..7d5732ec 100644 --- a/src/sat/satoko/utils/vec/vec_char.h +++ b/src/sat/satoko/utils/vec/vec_char.h @@ -248,9 +248,10 @@ static inline long vec_char_memory(vec_char_t *p) static inline void vec_char_print(vec_char_t* p) { + unsigned i; assert(p != NULL); fprintf(stdout, "Vector has %u(%u) entries: {", p->size, p->cap); - for (unsigned i = 0; i < p->size; i++) + for (i = 0; i < p->size; i++) fprintf(stdout, " %d", p->data[i]); fprintf(stdout, " }\n"); } diff --git a/src/sat/satoko/watch_list.h b/src/sat/satoko/watch_list.h index f492904a..ef1c1a07 100644 --- a/src/sat/satoko/watch_list.h +++ b/src/sat/satoko/watch_list.h @@ -113,7 +113,8 @@ static inline vec_wl_t *vec_wl_alloc(unsigned cap) static inline void vec_wl_free(vec_wl_t *vec_wl) { - for (unsigned i = 0; i < vec_wl->size; i++) + unsigned i; + for (i = 0; i < vec_wl->size; i++) watch_list_free(vec_wl->watch_lists + i); satoko_free(vec_wl->watch_lists); satoko_free(vec_wl); |