Commit ad8d2422 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

buddy: rename libbdd to libbddx

* buddy/src/bdd.h, buddy/src/bvec.h, buddy/src/fdd.h: Rename as...
* buddy/src/bddx.h, buddy/src/bvecx.h, buddy/src/fddx.h: ... these.
* buddy/src/Makefile.am: Build libbddx.la instead of libbdd.la.
* buddy/examples/Makefile.def: Use it.
* Makefile.am, buddy/src/bddtest.cxx, buddy/src/bvec.c,
buddy/src/cppext.cxx, buddy/src/fdd.c, buddy/src/imatrix.h,
buddy/src/kernel.h, buddy/examples/adder/adder.cxx,
buddy/examples/bddcalc/parser_.h, buddy/examples/bddtest/bddtest.cxx,
buddy/examples/cmilner/cmilner.c, buddy/examples/fdd/fdd.cxx,
buddy/examples/milner/milner.cxx, buddy/examples/money/money.cxx,
buddy/examples/queen/queen.cxx, buddy/examples/solitare/solitare.cxx,
m4/buddy.m4, src/ltlvisit/apcollect.hh, src/ltlvisit/simplify.hh,
src/misc/bddlt.hh, src/misc/bddop.hh, src/misc/minato.hh,
src/priv/acccompl.hh, src/priv/accconv.hh, src/priv/accmap.hh,
src/priv/bddalloc.cc, src/tgba/bdddict.hh, src/tgba/bddprint.hh,
src/tgba/tgbamask.hh, src/tgba/tgbasafracomplement.cc,
src/tgbaalgos/emptiness.hh, src/tgbaalgos/gtec/sccstack.hh,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/powerset.cc,
src/tgbaalgos/sccfilter.hh, src/tgbaalgos/sccinfo.hh,
src/tgbaalgos/weight.hh, wrap/python/buddy.i: Adjust.
* NEWS, README: Document it.
parent f35be908
## -*- coding: utf-8 -*- ## -*- coding: utf-8 -*-
## Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et Développement ## Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et Développement
## de l'Epita (LRDE). ## de l'Epita (LRDE).
## Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), ## Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre ## département Systèmes Répartis Coopératifs (SRC), Université Pierre
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
## You should have received a copy of the GNU General Public License ## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
if WITH_INCLUDED_BUDDY
MAYBE_BUDDY = buddy
endif WITH_INCLUDED_BUDDY
if NEVER if NEVER
# For Automake a conditional directory # For Automake a conditional directory
# is conditionally built, but unconditionally distributed. # is conditionally built, but unconditionally distributed.
...@@ -31,7 +28,7 @@ if NEVER ...@@ -31,7 +28,7 @@ if NEVER
NEVER_BENCH = bench NEVER_BENCH = bench
endif endif
SUBDIRS = $(MAYBE_BUDDY) $(NEVER_BENCH) lib src wrap ltdl iface doc SUBDIRS = buddy lib src wrap ltdl iface doc $(NEVER_BENCH)
UTF8 = utf8/doc/ReleaseNotes utf8/doc/utf8cpp.html utf8/utf8.h \ UTF8 = utf8/doc/ReleaseNotes utf8/doc/utf8cpp.html utf8/utf8.h \
utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h
......
...@@ -2,6 +2,10 @@ New in spot 1.99a (not yet released) ...@@ -2,6 +2,10 @@ New in spot 1.99a (not yet released)
* Major changes (including backward incompatible changes): * Major changes (including backward incompatible changes):
- The curstomized version of BuDDy (libbdd) used by Spot has be
renamed as (libbddx) to avoid issues with copies of BuDDy
already installed on the system.
- ltlgrind is a new tool that mutates LTL or PSL formulas. If you - ltlgrind is a new tool that mutates LTL or PSL formulas. If you
have a tool that is bogus on some formula that is tool large to have a tool that is bogus on some formula that is tool large to
debug, you can use ltlgrind to generate smaller derived formulas debug, you can use ltlgrind to generate smaller derived formulas
......
...@@ -28,18 +28,21 @@ Installation ...@@ -28,18 +28,21 @@ Installation
Requirements Requirements
------------ ------------
Spot requires a complete installation of Python (version 2.0 or Spot requires a C++11-compliant compiler.
later). Especially, Python's headers files should be installed. If
you don't have Python installed, you should run configure with
the --disable-python option (see below).
Spot expects a complete installation of Python (version 2.0 or later).
Especially, Python's headers files should be installed. If you don't
have Python installed, and do NOT want to install it, you should run
configure with the --disable-python option (see below).
Third-party dependencies Optional third-party dependencies
------------------------ ----------------------------------
Spot also uses a modified version of BuDDy (a binary decision diagram
library), that is already included in the buddy/ directory. So you
do not need to install it yourself. If the SAT-solver glucose is found on your system, it will
be used by our test suite to test our SAT-based minimization
algorithm.
Spot used to distribute a modified version of LBTT (an LTL to Büchi Spot used to distribute a modified version of LBTT (an LTL to Büchi
test bench), mostly fixing errors reported by recent compilers. test bench), mostly fixing errors reported by recent compilers.
...@@ -61,15 +64,6 @@ should read the file INSTALL for generic instructions. ...@@ -61,15 +64,6 @@ should read the file INSTALL for generic instructions.
In addition to its usual options, ./configure will accept some In addition to its usual options, ./configure will accept some
flags specific to Spot: flags specific to Spot:
--with-included-buddy
After you have installed Spot the first time, a modified version
of BuDDy will be installed. The next time you reconfigure Spot,
configure will detect that this version is already installed, and
will attempt to use it directly (this is in case you had to modify
one of these yourself for another purpose). This option will
*force* the use, build, and installation of the included version
of BuDDy, even when a compatible version is already installed.
--disable-python --disable-python
Turn off the compilation of Python bindings. These bindings are Turn off the compilation of Python bindings. These bindings are
currently used to run a couple of tests, and to build the CGI currently used to run a couple of tests, and to build the CGI
...@@ -190,7 +184,7 @@ iface/ Interfaces to other libraries. ...@@ -190,7 +184,7 @@ iface/ Interfaces to other libraries.
Third party software Third party software
-------------------- --------------------
buddy/ A patched version of BuDDy 2.3 (a BDD library). buddy/ A customized version of BuDDy 2.3 (a BDD library).
ltdl/ Libtool's portable dlopen() wrapper library. ltdl/ Libtool's portable dlopen() wrapper library.
lib/ Gnulib's portability modules. lib/ Gnulib's portability modules.
utf8/ Nemanja Trifunovic's utf-8 routines. utf8/ Nemanja Trifunovic's utf-8 routines.
......
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
LDADD = $(top_builddir)/src/libbdd.la LDADD = $(top_builddir)/src/libbddx.la
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <iostream> #include <iostream>
#include "bdd.h" #include "bddx.h"
using namespace std; using namespace std;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define _PARSER_H #define _PARSER_H
#include <stdio.h> #include <stdio.h>
#include "bdd.h" #include "bddx.h"
#define MAXIDLEN 32 /* Max. number of allowed characters in an identifier */ #define MAXIDLEN 32 /* Max. number of allowed characters in an identifier */
......
#include <iomanip> #include <iomanip>
#include <stdlib.h> #include <stdlib.h>
#include <bdd.h> #include <bddx.h>
static const int varnum = 5; static const int varnum = 5;
...@@ -47,9 +47,9 @@ void test1_check(bdd x) ...@@ -47,9 +47,9 @@ void test1_check(bdd x)
{ {
using namespace std ; using namespace std ;
double anum = bdd_satcount(x); double anum = bdd_satcount(x);
cout << "Checking bdd with " << setw(4) << anum << " assignments: "; cout << "Checking bdd with " << setw(4) << anum << " assignments: ";
allsatBDD = x; allsatBDD = x;
allsatSumBDD = bddfalse; allsatSumBDD = bddfalse;
...@@ -107,7 +107,7 @@ void test1() ...@@ -107,7 +107,7 @@ void test1()
int v = rand() % varnum; int v = rand() % varnum;
int s = rand() % 2; int s = rand() % 2;
int o = rand() % 2; int o = rand() % 2;
if (o == 0) if (o == 0)
{ {
if (s == 0) if (s == 0)
...@@ -136,10 +136,10 @@ int main() ...@@ -136,10 +136,10 @@ int main()
{ {
bdd_init(1000,1000); bdd_init(1000,1000);
bdd_setvarnum(varnum); bdd_setvarnum(varnum);
test1(); test1();
bdd_done(); bdd_done();
return 0; return 0;
} }
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "bdd.h" #include "bddx.h"
int N; /* Number of cyclers */ int N; /* Number of cyclers */
int *normvar; /* Current state variables */ int *normvar; /* Current state variables */
...@@ -289,4 +289,3 @@ int main(int argc, char** argv) ...@@ -289,4 +289,3 @@ int main(int argc, char** argv)
return 0; return 0;
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> -> 7 -> 0 * 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> -> 7 -> 0
*/ */
#include "fdd.h" #include "fddx.h"
/* Use the transition relation "transRel" to iterate through the statespace /* Use the transition relation "transRel" to iterate through the statespace
*/ */
...@@ -63,7 +63,7 @@ int main() { ...@@ -63,7 +63,7 @@ int main() {
{ {
/* Set the current state to be state 'i' */ /* Set the current state to be state 'i' */
bdd current = fdd_ithvar(0,i); bdd current = fdd_ithvar(0,i);
/* Set the next state to be state 'i+1' */ /* Set the next state to be state 'i+1' */
bdd next = fdd_ithvar(1, (i+1) % 8); bdd next = fdd_ithvar(1, (i+1) % 8);
......
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "bdd.h" #include "bddx.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -17,11 +17,11 @@ bdd A(bdd* x, bdd* y, int z) ...@@ -17,11 +17,11 @@ bdd A(bdd* x, bdd* y, int z)
{ {
bdd res = bddtrue; bdd res = bddtrue;
int i; int i;
for(i=0 ; i<N ; i++) for(i=0 ; i<N ; i++)
if(i != z) if(i != z)
res &= bdd_apply(x[i],y[i],bddop_biimp); res &= bdd_apply(x[i],y[i],bddop_biimp);
return res; return res;
} }
...@@ -35,19 +35,19 @@ bdd transitions(bdd* t, bdd* tp, bdd* h, bdd* hp, bdd* c, bdd* cp) ...@@ -35,19 +35,19 @@ bdd transitions(bdd* t, bdd* tp, bdd* h, bdd* hp, bdd* c, bdd* cp)
bdd P; // Cycler i's handling of the token bdd P; // Cycler i's handling of the token
bdd E; // Cycler i's handling of it's task bdd E; // Cycler i's handling of it's task
bdd T = bddfalse; // The monolithic transition relation bdd T = bddfalse; // The monolithic transition relation
for(i=0 ; i<N ; i++) for(i=0 ; i<N ; i++)
{ {
P = ((c[i]>cp[i]) & (tp[i]>t[i]) & hp[i] & A(c,cp,i) P = ((c[i]>cp[i]) & (tp[i]>t[i]) & hp[i] & A(c,cp,i)
& A(t,tp,i) & A(h,hp,i)) & A(t,tp,i) & A(h,hp,i))
| ((h[i]>hp[i]) & cp[(i+1)%N] & A(c,cp,(i+1)%N) & A(h,hp,i) | ((h[i]>hp[i]) & cp[(i+1)%N] & A(c,cp,(i+1)%N) & A(h,hp,i)
& A(t,tp,N)); & A(t,tp,N));
E = t[i] & !tp[i] & A(t,tp,i) & A(h,hp,N) & A(c,cp,N); E = t[i] & !tp[i] & A(t,tp,i) & A(h,hp,N) & A(c,cp,N);
T |= P | E; T |= P | E;
} }
return T; return T;
} }
...@@ -58,10 +58,10 @@ bdd initial_state(bdd* t, bdd* h, bdd* c) ...@@ -58,10 +58,10 @@ bdd initial_state(bdd* t, bdd* h, bdd* c)
{ {
int i; int i;
bdd I = c[0] & !h[0] & !t[0]; bdd I = c[0] & !h[0] & !t[0];
for(i=1; i<N; i++) for(i=1; i<N; i++)
I &= !c[i] & !h[i] & !t[i]; I &= !c[i] & !h[i] & !t[i];
return I; return I;
} }
...@@ -90,7 +90,7 @@ bdd reachable_states(bdd I, bdd T) ...@@ -90,7 +90,7 @@ bdd reachable_states(bdd I, bdd T)
R |= tmp; R |= tmp;
} }
while(prevR != R); while(prevR != R);
return R; return R;
} }
...@@ -105,38 +105,38 @@ int main(int argc, char** argv) ...@@ -105,38 +105,38 @@ int main(int argc, char** argv)
cerr << " N number of cyclers\n"; cerr << " N number of cyclers\n";
exit(1); exit(1);
} }
N = atoi(argv[1]); N = atoi(argv[1]);
if (N <= 0) if (N <= 0)
{ {
cerr << "The number of cyclers must be more than zero\n"; cerr << "The number of cyclers must be more than zero\n";
exit(2); exit(2);
} }
bdd_init(500000, 50000); bdd_init(500000, 50000);
bdd_setvarnum(N*6); bdd_setvarnum(N*6);
bdd* c = new bdd[N]; bdd* c = new bdd[N];
bdd* cp = new bdd[N]; bdd* cp = new bdd[N];
bdd* t = new bdd[N]; bdd* t = new bdd[N];
bdd* tp = new bdd[N]; bdd* tp = new bdd[N];
bdd* h = new bdd[N]; bdd* h = new bdd[N];
bdd* hp = new bdd[N]; bdd* hp = new bdd[N];
int *nvar = new int[N*3]; int *nvar = new int[N*3];
int *pvar = new int[N*3]; int *pvar = new int[N*3];
for (n=0 ; n<N*3 ; n++) for (n=0 ; n<N*3 ; n++)
{ {
nvar[n] = n*2; nvar[n] = n*2;
pvar[n] = n*2+1; pvar[n] = n*2+1;
} }
normvar = bdd_makeset(nvar, N*3); normvar = bdd_makeset(nvar, N*3);
primvar = bdd_makeset(pvar, N*3); primvar = bdd_makeset(pvar, N*3);
renamepair = bdd_newpair(); renamepair = bdd_newpair();
bdd_setpairs(renamepair, pvar, nvar, N*3); bdd_setpairs(renamepair, pvar, nvar, N*3);
for (n=0 ; n<N ; n++) for (n=0 ; n<N ; n++)
{ {
c[n] = bdd_ithvar(n*6); c[n] = bdd_ithvar(n*6);
...@@ -161,7 +161,7 @@ int main(int argc, char** argv) ...@@ -161,7 +161,7 @@ int main(int argc, char** argv)
bdd I = initial_state(t,h,c); bdd I = initial_state(t,h,c);
bdd T = transitions(t,tp,h,hp,c,cp); bdd T = transitions(t,tp,h,hp,c,cp);
bdd R = reachable_states(I,T); bdd R = reachable_states(I,T);
bddStat s; bddStat s;
bdd_stats(&s); bdd_stats(&s);
...@@ -176,4 +176,3 @@ int main(int argc, char** argv) ...@@ -176,4 +176,3 @@ int main(int argc, char** argv)
bdd_done(); bdd_done();
return 0; return 0;
} }
#include "bvec.h" #include "bvecx.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -16,15 +16,15 @@ using namespace std; ...@@ -16,15 +16,15 @@ using namespace std;
int main(void) int main(void)
{ {
using namespace std ; using namespace std ;
// Allocate 11 domains with room for up to 3*10 // Allocate 11 domains with room for up to 3*10
static int dom[11] = {30,30,30,30,30,30,30,30,30,30,30}; static int dom[11] = {30,30,30,30,30,30,30,30,30,30,30};
bdd_init(10000,10000); bdd_init(10000,10000);
fdd_extdomain(dom,11); fdd_extdomain(dom,11);
// Assign binary vectors (expressions) to the digits // Assign binary vectors (expressions) to the digits
bvec s = bvec_varfdd(0); // The 's' digit bvec s = bvec_varfdd(0); // The 's' digit
bvec e = bvec_varfdd(1); // The 'e' digit bvec e = bvec_varfdd(1); // The 'e' digit
bvec n = bvec_varfdd(2); // ... bvec n = bvec_varfdd(2); // ...
...@@ -50,7 +50,7 @@ int main(void) ...@@ -50,7 +50,7 @@ int main(void)
// The use of "m1*10" instead of "m1*c10" avoids a bitnum mismatch since // The use of "m1*10" instead of "m1*c10" avoids a bitnum mismatch since
// "m1*10" results in 5 bits but "m1*c10" results in 10 bits! // "m1*10" results in 5 bits but "m1*c10" results in 10 bits!
// And so on ... // And so on ...
bdd t2 = (n + r + m1 == e + m2*10) & n<c10 & r<c10 & m2<c2; bdd t2 = (n + r + m1 == e + m2*10) & n<c10 & r<c10 & m2<c2;
bdd t3 = (e + o + m2 == n + m3*10) & o<c10 & m3<c2; bdd t3 = (e + o + m2 == n + m3*10) & o<c10 & m3<c2;
...@@ -71,6 +71,6 @@ int main(void) ...@@ -71,6 +71,6 @@ int main(void)
// Print result // Print result
cout << fddset << t << endl; cout << fddset << t << endl;
return 0; return 0;
} }
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
. . . X . . . X
X . . . X . . .
. . X . . . X .
**************************************************************************/ **************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
#include "bdd.h" #include "bddx.h"
using namespace std; using namespace std;
int N; /* Size of the chess board */ int N; /* Size of the chess board */
...@@ -41,7 +41,7 @@ void build(int i, int j) ...@@ -41,7 +41,7 @@ void build(int i, int j)
{ {
bdd a=bddtrue, b=bddtrue, c=bddtrue, d=bddtrue; bdd a=bddtrue, b=bddtrue, c=bddtrue, d=bddtrue;
int k,l; int k,l;
/* No one in the same column */ /* No one in the same column */
for (l=0 ; l<N ; l++) for (l=0 ; l<N ; l++)
if (l != j) if (l != j)
...@@ -78,7 +78,7 @@ int main(int ac, char **av) ...@@ -78,7 +78,7 @@ int main(int ac, char **av)
{ {
using namespace std ; using namespace std ;
int n,i,j; int n,i,j;
if (ac != 2) if (ac != 2)
{ {
fprintf(stderr, "USAGE: queen N\n"); fprintf(stderr, "USAGE: queen N\n");
...@@ -97,7 +97,7 @@ int main(int ac, char **av) ...@@ -97,7 +97,7 @@ int main(int ac, char **av)
bdd_setvarnum(N*N); bdd_setvarnum(N*N);
queen = bddtrue; queen = bddtrue;
/* Build variable array */ /* Build variable array */
X = new bdd*[N]; X = new bdd*[N];
for (n=0 ; n<N ; n++) for (n=0 ; n<N ; n++)
...@@ -115,7 +115,7 @@ int main(int ac, char **av) ...@@ -115,7 +115,7 @@ int main(int ac, char **av)
e |= X[i][j]; e |= X[i][j];
queen &= e; queen &= e;
} }
/* Build requirements for each variable(field) */ /* Build requirements for each variable(field) */
for (i=0 ; i<N ; i++) for (i=0 ; i<N ; i++)
for (j=0 ; j<N ; j++) for (j=0 ; j<N ; j++)
...@@ -131,6 +131,6 @@ int main(int ac, char **av) ...@@ -131,6 +131,6 @@ int main(int ac, char **av)
cout << bddset << solution << endl; cout << bddset << solution << endl;
bdd_done(); bdd_done();
return 0; return 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
#include "bdd.h" #include "bddx.h"
using std::cout; using std::cout;
using std::endl; using std::endl;
using std::flush; using std::flush;
...@@ -23,7 +23,7 @@ bddPair *pair; // Renaming pair ...@@ -23,7 +23,7 @@ bddPair *pair; // Renaming pair
// All the possible moves. Note that the numbering starts from '1'