Commit graph

71 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
cee552689a [buddy] Probe for -fvisibility and -fvisibility-inlines-hidden.
* configure.ac: Check gcc and g++ for -fvisibility and
-fvisibility-inlines-hidden.  Add these options to
CFLAGS and CXXFLAGS.
* m4/ax_check_compile_flag.m4: New file.
* src/Makefile.am: Build BuDDy as a single library, reverting part of
the changes introduced in my previous patch to this file.  Since
the options are set in CFLAGS/CXXFLAGS, there is no possibility
for -fvisibility-inlines-hidden to be passed to the C compiler.
2013-07-29 01:14:36 +02:00
Alexandre Duret-Lutz
b5710663f4 [buddy] Restrict the number of exported symbols.
* src/bdd.h, src/bvec.h, src/fdd.h: Declare all exported
symbols using BUDDY_API, a new macro that sets visibility=default.
* src/Makefile.am: Compile with -fvisibility=hidden by default,
and compile the C++ part with -fvisibility-inlines-hidden as well.
2013-07-29 01:12:12 +02:00
Alexandre Duret-Lutz
15c9b72f13 [buddy]
* src/bdd.h: Make all inplace operators return a reference.
2012-12-24 13:14:23 +01:00
Alexandre Duret-Lutz
af639e58c7 more files to ignore 2012-11-28 16:45:04 +01:00
Alexandre Duret-Lutz
8cb68d76b5 * NEWS, buddy/src/bddop.c, m4/valgrind.m4: s/wether/whether/. 2012-08-22 13:53:59 +02:00
Alexandre Duret-Lutz
bc5a4ba416 [buddy] Fix the recent Automake workaround for VPATH builds.
* examples/bddcalc/Makefile.am (ACLOCAL_AMFLAGS): Add -I. for
parse.c.  Reported by Pierre Parutto.
2012-06-20 20:56:03 +02:00
Alexandre Duret-Lutz
a814b97543 [buddy] Add a function bdd_implies to decide implications between BDDs.
* src/bdd.h (bdd_implies): New function.
* src/bddop.c (bdd_implies): Implement it.
(CACHEID_IMPLIES, IMPLIES_HASH): New helper macros.
2012-06-19 21:52:03 +02:00
Alexandre Duret-Lutz
e7a46e10e2 [buddy] Reduce the size of bddNode to improve cache efficiency.
The unicity table was mixed with the bddNode table for now
apparent reason.  After the hash of some node is computed,
bddnodes[hash] did only contain some random node (not the one
looked for) whose .hash member would point to the actual node with
this hash.  So that's a two step lookup.  With this patch, we sill
have a two step lookup, but the .hash member have been moved to a
separate array.  A consequence is that bddNode is now 16-byte long
(instead of 20) so it will never span across two cache lines.

* src/kernel.h (bddNode): Remove the hash member, and move it...
(bddhash): ... as this new separate table.
* src/kernel.c, src/reorder.c: Adjust all code.
2012-06-19 21:52:03 +02:00
Alexandre Duret-Lutz
b98c47246c [buddy] Adjust parser construction to support Automake 1.11 and 1.12.
* examples/bddcalc/parser.yxx: Rename as ...
* examples/bddcalc/parser.y: ... this.
* examples/bddcalc/parser_.cxx: New file that includes parser.c.
* examples/bddcalc/Makefile.am: Adjust.
* examples/bddcalc/parser.hxx: Delete this unused file.
2012-06-19 17:03:34 +02:00
Alexandre Duret-Lutz
b6702fc23a [buddy] Speedup hash functions.
* src/kernel.h (PAIR, TRIPLE): Redefine these hash functions
using something that is simpler to compute.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
92ef9d6e07 * examples/adder/adder.cxx (test_vector): Add parentheses to
remove a clang++-2.9 warning.
2011-08-28 10:37:42 +02:00
Alexandre Duret-Lutz
24be6076f6 * src/bddop.c (bdd_support): Speedup using a cache. 2011-08-28 10:37:42 +02:00
Alexandre Duret-Lutz
fb3edb47e0 [buddy] * src/bddop.c (apply_rec, appquant_rec): Improve caching by
reordering operands of commutative operators.
2011-06-14 09:51:32 +02:00
Alexandre Duret-Lutz
d3ccaa7cb9 [buddy] Remove some valgrind warnings about uninitialized memory when
BddCache_lookup return an entry from a Not operation.

* src/bddop.c (apply_rec, simplify_rec): When checking the cache
entry, always check entry->a and entry->c before checking
entry->b, because the "not_rec()" function does not initialize
the latter.
2011-06-09 11:56:02 +02:00
Alexandre Duret-Lutz
b535741a90 [buddy] * examples/cmilner/cmilner.c (A, transitions, initial_state)
(reachable_states, has_deadlocks): Declare as static functions,
to suppress a GCC warning.
2011-06-07 14:52:35 +02:00
Alexandre Duret-Lutz
1d1872ab90 [buddy] Inline the "is bdd constant" check performed in copies/constructors.
This avoids a library call to bdd_addref or bdd_delref.

* src/kernel.c (bdd_delref_nc, bdd_addref_nc): New function,
that work only on BDD that are not constant.
* src/cpext.cxx (bdd::operator=): Move...
* src/bdd.hh (bdd::operator=): ... here.
(bdd::bdd, bdd::~bdd, bdd::operator=): Inline the "is bdd constant"
check and call bdd_delref_nc/bdd_addref_nc only otherwise.
2011-04-30 13:37:53 +02:00
Alexandre Duret-Lutz
2b58fb90c4 [buddy] Hint gcc about likely/unlikely branches.
* src/bdd.h (__likely, __unlikely): Introduce these two macros.
* src/bddop.c, src/kerner.c: Use them in many situations.
2011-04-30 13:30:13 +02:00
Alexandre Duret-Lutz
24054605da [buddy] * src/pairs.c (bdd_pairalloc): Fix prototype. 2011-04-30 13:22:27 +02:00
Alexandre Duret-Lutz
e5f35dea48 [buddy]
Fix some warnings reported by gcc.

* buddy/src/kernel.c (errorstrings): Mark these as const.
* buddy/src/reorder.c (reorder_gbc): Fix prototype.
(siftTestCmp): Add missing const in cast.
(bdd_reorder_auto): Actually call bdd_reorder_ready().
2011-04-10 22:12:25 +02:00
Alexandre Duret-Lutz
35de7e9008 [buddy]
Add support for --enable-devel and similar macros.

* m4/debug.m4: Rename to ...
* m4/bdebug.m4: ... this.
* m4/debug.m4, m4/devel.m4, m4/gccoptim.m4, m4/ndebug.m4: New file.
* m4/gccwarns.m4: Fix usage of cache variable.  Fix shell
syntax.  Do not check for -Waggregate-return.  Update CFLAGS.
* configure.ac: Adjust to handle --enable-devel and similar macros
in the same way as Spot.
2011-04-10 22:12:25 +02:00
Alexandre Duret-Lutz
5fdfe28689 [buddy]
Tag functions with attributes pure, const, or noreturn.

* src/bdd.h (__purefn, __constfn, __noreturnfn): Define
new macros.
* src/bdd.h, src/bddio.c, src/bvec.h, src/imatrix.h: Use them
to tag many functions as suggested by -Wsuggest-attribute=pure,
-Wsuggest-attribute=const, -Wsuggest-attribute=noreturn.
2011-04-05 09:29:03 +02:00
Alexandre Duret-Lutz
61d9e721a0 [buddy]
Remove more sanity checks when NDEBUG is set.

* src/kernel.h (CHECKnc): New macro.
* src/kernel.c (bdd_var, bdd_low, bdd_high, bdd_ithvar,
bdd_nithvar): Use it.
2011-04-04 19:10:06 +02:00
Alexandre Duret-Lutz
30f00584d4 [buddy]
* src/kernel.h (CHECK, CHECKa, CHECKn): Disable if NDEBUG is set.
2011-04-03 14:28:45 +02:00
Alexandre Duret-Lutz
44aed5cda6 [buddy]
Fix declaration of bddproduced.

* src/reorder.c (bddproduced): Declare a longint, to match
the definition in kerner.c.
2011-04-03 13:54:01 +02:00
Alexandre Duret-Lutz
197019ea62 [buddy]
* buddy/src/kernel.c (bdd_addref, bdd_delref): Disable sanity
checks when compiled with NDEBUG.
2011-04-03 10:49:35 +02:00
Alexandre Duret-Lutz
8f5ecc14bf [buddy]
* examples/cmilner/Makefile.am (cmilner_LDADD): Link with -lm, to
find the pow() function.
2011-02-27 15:24:22 +01:00
Alexandre Duret-Lutz
4034b7f87f [buddy]
* src/bddop.c (bdd_setxor): New function.
* src/bdd.h (bdd_setxor): New function.
2010-11-07 11:15:45 +01:00
Alexandre Duret-Lutz
0fe5403956 Revert inlining of bdd_addref() and bdd_delref().
This reverts commit d462f50b59.

Conflicts:

	buddy/ChangeLog
2010-01-22 15:55:08 +01:00
Alexandre Duret-Lutz
e828783f47 [buddy]
Get rid of some "deprecated conversion from string constant to
`char*'" warnings.

* examples/bddcalc/parser_.h (yyerror): Declare the format
as a "const char*".
* examples/bddcalc/parser.yxx (yyerror): Likewise.
2010-01-22 11:14:10 +01:00
Alexandre Duret-Lutz
e20ba143bb [buddy]
* src/bddio.c (bdd_load): Check the return value of fscanf() to
kill a warning.
2010-01-21 15:51:23 +01:00
Alexandre Duret-Lutz
d462f50b59 [buddy]
Inline bdd_addref() and bdd_delref() to speedup BDD operations.

* src/kernel.c, src/kernel.h (bdd_addref, bdd_delref): Move these
functions and there associated global variables...
* src/bdd.c (bdd_error): ... and this function ...
* src/bdd.h (bdd_addref, bdd_delref, bdd_error): ...here so that
they can be inlined.
2009-12-09 14:05:54 +01:00
Alexandre Duret-Lutz
253ee35030 [buddy]
Introduce bdd_satprefix, to speedup spot::minato().

* src/bdd.h (bdd_satprefix): New function.
* src/bddop.c (bdd_satprefix, bdd_sat_prefixrec): New functions.
2009-11-23 21:40:26 +01:00
Alexandre Duret-Lutz
b7db0c3085 [buddy] Fix the previous patch in reorder.c 2009-10-01 13:33:36 +02:00
Alexandre Duret-Lutz
ada681d813 [buddy] Fix some issues reported by LLVM/Clang's static analyser. 2009-09-08 11:05:45 +02:00
Alexandre Duret-Lutz
43ba3f8378 [buddy] configure.ac: Switch from Libtool 1.5.x to Libtool 2.x, and add an AC_CONFIG_MACRO_DIR call. 2009-09-02 10:41:18 +02:00
Guillaume Sadegh
afeaf287e9 * m4/intel.m4: Fix to support the cache. 2009-07-09 21:29:50 +02:00
Guillaume Sadegh
bf925aaeeb [buddy] Adjust to support the Intel compiler (icc).
* configure.ac: Adjust to call...
    * m4/intel.m4: ...this new macro.
2009-06-12 16:37:21 +02:00
Guillaume Sadegh
7817f325eb More files to ignore. 2009-06-10 03:34:08 +02:00
Alexandre Duret-Lutz
f217ff374c * src/bddtest.cxx: Include <cstdlib> to compile with g++-4.3. 2008-03-14 16:59:40 +01:00
Alexandre Duret-Lutz
5ef7084b61 Add .gitignore files 2008-03-14 16:59:32 +01:00
Alexandre Duret-Lutz
894c864fd5 * src/kernel.c (bdd_default_gbchandler): Log garbage collection to
stderr, not stdout.  Reported by Kristin Yvonne Rozier
<kyrozier@cs.rice.edu>.
2008-02-25 14:37:54 +01:00
Alexandre Duret-Lutz
3b693c5ca7 * configure.ac: Call AC_LIBTOOL_WIN32_DLL
* src/Makefile.am (libbdd_la_LDFLAGS): Add -no-undefined.
2004-07-23 09:07:49 +00:00
Alexandre Duret-Lutz
89db9aa512 * src/Makefile.am (libbdd_la_LDFLAGS): Add -no-undefined. 2004-07-23 09:06:54 +00:00
Alexandre Duret-Lutz
7abc2604f3 * examples/bddcalc/parser.yxx (actionSeq, varlist): Rewrite as
left-recursive rules.
2004-07-12 14:03:53 +00:00
Alexandre Duret-Lutz
f1c3af808f Merge BuDDy 2.3.
* examples/calculator/, examples/internal/: Were renamed as ...
* examples/bddcalc/, examples/bddtest/: ... these.
* configure.ac: Adjust version and output Makefiles.
* examples/Makefile.am (SUBDIRS): Adjust subdir renaming.
* examples/cmilner/milner.c, examples/fdd/statespace.cxx: Were
renamed as ...
* examples/cmilner/cmilner.c, examples/fdd/fdd.cxx: ... these.
* examples/cmilner/Makefile.am, examples/fdd/Makefile.am: Adjust
accordingly.
* src/Makefile.am (AM_CPPFLAGS): Define VERSION.
2004-07-06 17:39:37 +00:00
Alexandre Duret-Lutz
aa4a582f1b Merge BuDDy 2.3.
* examples/calculator/, examples/internal/: Were renamed as ...
* examples/bddcalc/, examples/bddtest/: ... these.
* configure.ac: Adjust version and output Makefiles.
* examples/Makefile.am (SUBDIRS): Adjust subdir renaming.
* examples/cmilner/milner.c, examples/fdd/statespace.cxx: Were
renamed as ...
* examples/cmilner/cmilner.c, examples/fdd/fdd.cxx: ... these.
* examples/cmilner/Makefile.am, examples/fdd/Makefile.am: Adjust
accordingly.
* src/Makefile.am (AM_CPPFLAGS): Define VERSION.
2004-06-28 15:22:11 +00:00
Alexandre Duret-Lutz
805b6fb70b Initial revision 2004-06-28 14:19:59 +00:00
Alexandre Duret-Lutz
b9b3c1ca25 * configure.ac, NEWS: Bump version to 0.0r. 2004-03-08 22:23:04 +00:00
Alexandre Duret-Lutz
7aecf4ad09 * src/bddop.c (bdd_support): Free supportSet if it needs to be
reallocated.  This fixes a memory leak reported by
Souheib.Baarir@lip6.fr.
2004-01-07 16:05:21 +00:00
Alexandre Duret-Lutz
51ff9f8dda * examples/Makefile.def (AM_CPPFLAGS): Add -I$(srcdir). 2003-11-14 12:26:13 +00:00