* configure.ac, Makefile.am, src/Makefile.am, doc/Makefile.am,

examples/Makefile.am, examples/Makefile.def,
examples/adder/Makefile.am, examples/calculator/Makefile.am,
examples/cmilner/Makefile.am, examples/fdd/Makefile.am,
examples/internal/Makefile.am, examples/milner/Makefile.am,
examples/money/Makefile.am, examples/queen/Makefile.am,
examples/solitar/Makefile.am, m4/debug.m4, m4/gccwarns.m4,
ChangeLog, INSTALL: New files.
* config, makefile, src/makefile, doc/makefile,
examples/adder/makefile, examples/calculator/makefile
examples/cmilner/makefile, examples/fdd/makefile,
examples/internal/makefile, examples/milner/makefile,
examples/money/makefile, examples/queen/makefile,
examples/solitare/makefile : Delete.
* examples/adder/adder.cxx, examples/fdd/statespace.cxx,
examples/internal/bddtest.cxx, examples/milner/milner.cxx,
examples/money/money.cxx, examples/queen/queen.cxx,
examples/solitare/solitare.cxx: Include iostream.
* examples/calculator/parser.y: Rename as ...
* examples/calculator/parser.yxx: ... this.  Remove spurious
comas in %token, %right, and %left arguments.
* examples/calculator/parser.h: Rename as ...
* examples/calculator/parser_.h: ... this, because the bison
rule with output parser.h (not tokens.h) from parser.y.
* examples/calculator/lexer.l: Rename as ...
* examples/calculator/lexer.lxx: ... this.  Include parser.h
instead of tokens.h.
* examples/calculator/slist.h
(voidSList::voisSListElem, SList::ite): Fix friend usage.
* src/kernel.h (DEFAULT_CLOCK): Default to 60 if not already
defined.
* README: Update build instruction, and file listing.
This commit is contained in:
Alexandre Duret-Lutz 2003-05-05 13:44:49 +00:00
parent cf5dd46350
commit 605dce2aac
79 changed files with 768 additions and 669 deletions

View file

@ -0,0 +1,2 @@
Makefile.in
Makefile

View file

@ -0,0 +1,11 @@
SUBDIRS = \
adder \
calculator \
cmilner \
fdd \
internal \
milner \
money \
queen \
solitare

View file

@ -0,0 +1,2 @@
AM_CPPFLAGS = -I$(top_srcdir)/src
LDADD = $(top_builddir)/src/libbdd.la

View file

@ -0,0 +1,4 @@
Makefile.in
Makefile
adder
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = adder
adder_SOURCES = adder.cxx

View file

@ -7,8 +7,11 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iostream>
#include "bdd.h"
using namespace std;
int N;
bdd *ainp;

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for adder test example
# --------------------------------
# --- Compiler flags
CFLAGS = -g -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
adder: adder.o bddlib
$(CPP) $(CFLAGS) adder.o -o adder -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~
rm -f *.o
rm -f adder
adder.o: ../../src/bdd.h

View file

@ -0,0 +1,6 @@
Makefile.in
Makefile
lexer.cxx
parser.cxx
parser.h
.deps

View file

@ -0,0 +1,25 @@
include ../Makefile.def
EXTRA_DIST = \
readme \
example.cal \
examples/c432.cal \
examples/c499.cal \
examples/c1355.cal \
examples/c1908.cal \
examples/c2670.cal \
examples/c3540.cal \
examples/readme
AM_YFLAGS = -d
BUILT_SOURCES = parser.h
check_PROGRAMS = bddcalc
bddcalc_SOURCES = \
hashtbl.h \
hashtbl.cxx \
lexer.lxx \
parser.yxx \
parser_.h \
slist.h

View file

@ -1,5 +1,5 @@
/*************************************************************************
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/hashtbl.cxx,v 1.1 2003/05/05 10:57:55 aduret Exp $
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/hashtbl.cxx,v 1.2 2003/05/05 13:44:53 aduret Exp $
FILE: hashtbl.cc
DESCR: Compiler hash table
AUTH: Jorn Lind

View file

@ -1,5 +1,5 @@
/*************************************************************************
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/hashtbl.h,v 1.1 2003/05/05 10:57:55 aduret Exp $
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/hashtbl.h,v 1.2 2003/05/05 13:44:54 aduret Exp $
FILE: hashtbl.h
DESCR: Compiler hashtable
AUTH: Jorn Lind

View file

@ -7,8 +7,8 @@
%{
#include <string.h>
#include <stdlib.h>
#include "parser_.h"
#include "parser.h"
#include "tokens.h"
%}

View file

@ -1,48 +0,0 @@
# ---------------------------
# Makefile for BDD calculator
# ---------------------------
all: bddcalc
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- You may need to change these according to your flex and bison versions
parser.cxx: parser.h parser.y
bison -d -o parser.cxx parser.y
mv parser.cxx.h tokens.h
lexer.cxx: tokens.h parser.h lexer.l
flex -olexer.cxx lexer.l
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
bddcalc: parser.o lexer.o hashtbl.o bddlib
$(CPP) $(CFLAGS) parser.o lexer.o hashtbl.o -o bddcalc -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~ examples/*~
rm -f *.o
rm -f bddcalc parser.cxx lexer.cxx
# --- Needed for the author's Cygwin compiler
export BISONLIB=/cygnus/cygwin-b20/share/

View file

@ -1,44 +1,118 @@
/*************************************************************************
FILE: parser.h
DESCR: parser defs. for BDD calculator
AUTH: Jorn Lind
DATE: (C) may 1999
*************************************************************************/
/* A Bison parser, made by GNU Bison 1.875b. */
#ifndef _PARSER_H
#define _PARSER_H
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#include <stdio.h>
#include "bdd.h"
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
#define MAXIDLEN 32 /* Max. number of allowed characters in an identifier */
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
struct token /* BISON token data */
{
char id[MAXIDLEN+1];
char *str;
int ival;
bdd *bval;
};
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define YYSTYPE token
#define YY_SKIP_YYWRAP
#define YY_NO_UNPUT
#define yywrap() (1)
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
extern YYSTYPE yylval; /* Declare for flex user */
extern void yyerror(char *,...); /* Declare for flex and bison */
extern FILE *yyin;
extern int yylex(void); /* Declare for bison */
extern int yyparse(void); /* Declare for bison user */
extern int linenum; /* Declare for error handler */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_id = 258,
T_str = 259,
T_intval = 260,
T_true = 261,
T_false = 262,
T_initial = 263,
T_inputs = 264,
T_actions = 265,
T_size = 266,
T_dumpdot = 267,
T_autoreorder = 268,
T_reorder = 269,
T_win2 = 270,
T_win2ite = 271,
T_sift = 272,
T_siftite = 273,
T_none = 274,
T_cache = 275,
T_tautology = 276,
T_print = 277,
T_lpar = 278,
T_rpar = 279,
T_equal = 280,
T_semi = 281,
T_dot = 282,
T_forall = 283,
T_exist = 284,
T_biimp = 285,
T_imp = 286,
T_nor = 287,
T_or = 288,
T_xor = 289,
T_and = 290,
T_nand = 291,
T_not = 292
};
#endif
#define T_id 258
#define T_str 259
#define T_intval 260
#define T_true 261
#define T_false 262
#define T_initial 263
#define T_inputs 264
#define T_actions 265
#define T_size 266
#define T_dumpdot 267
#define T_autoreorder 268
#define T_reorder 269
#define T_win2 270
#define T_win2ite 271
#define T_sift 272
#define T_siftite 273
#define T_none 274
#define T_cache 275
#define T_tautology 276
#define T_print 277
#define T_lpar 278
#define T_rpar 279
#define T_equal 280
#define T_semi 281
#define T_dot 282
#define T_forall 283
#define T_exist 284
#define T_biimp 285
#define T_imp 286
#define T_nor 287
#define T_or 288
#define T_xor 289
#define T_and 290
#define T_nand 291
#define T_not 292
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
/* Use this instead of strdup() to avoid malloc() */
inline char *sdup(const char *s)
{
return strcpy(new char[strlen(s)+1], s);
}
#endif /* _PARSER_H */
/* EOF */

View file

@ -8,13 +8,15 @@
%{
#include <string.h>
#include <stdarg.h>
#include <fstream.h>
#include <fstream>
#include <getopt.h>
#define IMPLEMENTSLIST /* Special for list template handling */
#include "slist.h"
#include "hashtbl.h"
#include "parser.h"
#include "parser_.h"
using namespace std;
/* Definitions for storing and caching of identifiers */
#define inputTag 0
#define exprTag 1
@ -64,23 +66,23 @@ void actPrint(token *id);
Token definitions
*************************************************************************/
%token T_id, T_str, T_intval, T_true, T_false
%token T_id T_str T_intval T_true T_false
%token T_initial, T_inputs, T_actions
%token T_size, T_dumpdot
%token T_autoreorder, T_reorder, T_win2, T_win2ite, T_sift, T_siftite, T_none
%token T_cache, T_tautology, T_print
%token T_initial T_inputs T_actions
%token T_size T_dumpdot
%token T_autoreorder T_reorder T_win2 T_win2ite T_sift T_siftite T_none
%token T_cache T_tautology T_print
%token T_lpar, T_rpar
%token T_lpar T_rpar
%token T_equal
%token T_semi, T_dot
%token T_semi T_dot
%right T_exist, T_forall, T_dot
%right T_exist T_forall T_dot
%left T_biimp
%left T_imp
%left T_or, T_nor
%left T_or T_nor
%left T_xor
%left T_nand, T_and
%left T_nand T_and
%right T_not
/*************************************************************************

View file

@ -0,0 +1,44 @@
/*************************************************************************
FILE: parser.h
DESCR: parser defs. for BDD calculator
AUTH: Jorn Lind
DATE: (C) may 1999
*************************************************************************/
#ifndef _PARSER_H
#define _PARSER_H
#include <stdio.h>
#include "bdd.h"
#define MAXIDLEN 32 /* Max. number of allowed characters in an identifier */
struct token /* BISON token data */
{
char id[MAXIDLEN+1];
char *str;
int ival;
bdd *bval;
};
#define YYSTYPE token
#define YY_SKIP_YYWRAP
#define YY_NO_UNPUT
#define yywrap() (1)
extern YYSTYPE yylval; /* Declare for flex user */
extern void yyerror(char *,...); /* Declare for flex and bison */
extern FILE *yyin;
extern int yylex(void); /* Declare for bison */
extern int yyparse(void); /* Declare for bison user */
extern int linenum; /* Declare for error handler */
/* Use this instead of strdup() to avoid malloc() */
inline char *sdup(const char *s)
{
return strcpy(new char[strlen(s)+1], s);
}
#endif /* _PARSER_H */
/* EOF */

View file

@ -1,5 +1,5 @@
/*************************************************************************
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/slist.h,v 1.1 2003/05/05 10:57:55 aduret Exp $
$Header: /Volumes/CVS/repository/spot/spot/buddy/examples/calculator/Attic/slist.h,v 1.2 2003/05/05 13:44:55 aduret Exp $
FILE: slist.h
DESCR: Single linked list
AUTH: Jorn Lind
@ -28,7 +28,7 @@ protected:
private:
voidSListElem(void *d) { data=d; next=NULL; }
friend voidSList;
friend class voidSList;
};
public:
@ -169,7 +169,7 @@ public:
int operator==(ite x) { return x.next==next; }
private:
voidSListElem *next;
friend SList<T>;
friend class SList<T>;
};
~SList(void) { for (ite x=first() ; x.more() ; x++) delete &(*x); }

View file

@ -1,41 +0,0 @@
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#define T_id 257
#define T_str 258
#define T_intval 259
#define T_true 260
#define T_false 261
#define T_initial 262
#define T_inputs 263
#define T_actions 264
#define T_size 265
#define T_dumpdot 266
#define T_autoreorder 267
#define T_reorder 268
#define T_win2 269
#define T_win2ite 270
#define T_sift 271
#define T_siftite 272
#define T_none 273
#define T_cache 274
#define T_tautology 275
#define T_print 276
#define T_lpar 277
#define T_rpar 278
#define T_equal 279
#define T_semi 280
#define T_dot 281
#define T_exist 282
#define T_forall 283
#define T_biimp 284
#define T_imp 285
#define T_or 286
#define T_nor 287
#define T_xor 288
#define T_nand 289
#define T_and 290
#define T_not 291
extern YYSTYPE yylval;

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,4 @@
include ../Makefile.def
EXTRA_DIST = readme
check_PROGRAMS = milner
milner_SOURCES = milner.c

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for milner test example
# --------------------------------
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
milner: milner.o bddlib
$(CC) $(CFLAGS) milner.o -o milner -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~
rm -f *.o
rm -f milner
milner.o: ../../src/bdd.h

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = statespace
statespace_SOURCES = statespace.cxx

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for FDD test example
# --------------------------------
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
statespace: statespace.o bddlib
$(CPP) $(CFLAGS) statespace.o -o statespace -lbdd -lm
bddlib:
cd ../../src; make
clean:
rm -f *~
rm -f *.o
rm -f statespace
statespace.o: ../../src/fdd.h

View file

@ -6,7 +6,9 @@
* 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> -> 7 -> 0
*/
#include <iostream>
#include "fdd.h"
using namespace std;
/* Use the transition relation "transRel" to iterate through the statespace
*/

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = bddtest
bddtest_SOURCES = bddtest.cxx

View file

@ -1,6 +1,8 @@
#include <iomanip>
#include <stdlib.h>
#include <bdd.h>
#include <iostream>
using namespace std;
static const int varnum = 5;

View file

@ -1,38 +0,0 @@
# --------------------------------
# Makefile for internal tests
# --------------------------------
# --- Compiler flags
CFLAGS = -g -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
bddtest: bddtest.o bddlib
$(CPP) $(CFLAGS) bddtest.o -o bddtest -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~
rm -f *.o
rm -f bddtest
bddtest.o: ../../src/bdd.h

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,4 @@
include ../Makefile.def
EXTRA_DIST = readme
check_PROGRAMS = milner
milner_SOURCES = milner.cxx

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for milner test example
# --------------------------------
# --- Compiler flags
CFLAGS = -g -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
milner: milner.o bddlib
$(CPP) $(CFLAGS) milner.o -o milner -lbdd -lm
bddlib:
cd ../../src; make
clean:
rm -f *~
rm -f *.o
rm -f milner
milner.o: ../../src/bdd.h

View file

@ -3,6 +3,8 @@
#include <time.h>
#include <math.h>
#include "bdd.h"
#include <iostream>
using namespace std;
int N; // Number of cyclers
bdd normvar; // Current state variables

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = money
money_SOURCES = money.cxx

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for BVEC example
# --------------------------------
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
money: money.o bddlib
$(CPP) $(CFLAGS) money.o -o money -lbdd -lm
bddlib:
cd ../../src; make
clean:
rm -f *~
rm -f *.o
rm -f money
money.o: ../../src/bvec.h ../../src/fdd.h ../../src/bdd.h

View file

@ -1,4 +1,6 @@
#include "bvec.h"
#include <iostream>
using namespace std;
/* Find a solution to the send-more-money example
* The problem is to assign values for the digits s,e,n,d,m,o,r,y

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = queen
queen_SOURCES = queen.cxx

View file

@ -1,37 +0,0 @@
# ---------------------------------
# Makefile for N-queen test example
# ---------------------------------
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
queen: queen.o bddlib
$(CPP) $(CFLAGS) queen.o -o queen -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~
rm -f *.o
rm -f queen
queen.o: ../../src/bdd.h

View file

@ -26,7 +26,9 @@
**************************************************************************/
#include <stdlib.h>
#include <iostream>
#include "bdd.h"
using namespace std;
int N; /* Size of the chess board */
bdd **X; /* BDD variable array */

View file

@ -0,0 +1,3 @@
Makefile.in
Makefile
.deps

View file

@ -0,0 +1,3 @@
include ../Makefile.def
check_PROGRAMS = solitare
solitare_SOURCES = solitare.cxx

View file

@ -1,36 +0,0 @@
# --------------------------------
# Makefile for solitare test example
# --------------------------------
# --- Compiler flags
CFLAGS = -O3 -pedantic -Wall -ansi -L../../src -I../../src
# --- C++ compiler
CPP = g++
# --- C compiler
CC = gcc
# --- Do not touch ---
.SUFFIXES: .cxx .c
.cxx.o:
$(CPP) $(CFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
solitare: solitare.o bddlib
$(CPP) $(CFLAGS) solitare.o -o solitare -lbdd -lm
bddlib:
cd ../..; make
clean:
rm -f *~
rm -f *.o
rm -f solitare
milner.o: ../../src/bdd.h

View file

@ -2,7 +2,11 @@
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include "bdd.h"
using std::cout;
using std::endl;
using std::flush;
float dummyStateNum; // Use to remove the number of states defined by the
// next-state variables