* src/tgba/bddprint.hh, src/tgba/bddprint.cc: New files.
* src/tgba/Makefile.am (libtgba_la_SOURCES): Add them. * src/tgba/public.hh: Include bddprint.hh.
This commit is contained in:
parent
885143309a
commit
16c6219988
5 changed files with 107 additions and 1 deletions
|
|
@ -1,12 +1,16 @@
|
|||
2003-05-26 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
||||
|
||||
* src/tgba/bddprint.hh, src/tgba/bddprint.cc: New files.
|
||||
* src/tgba/Makefile.am (libtgba_la_SOURCES): Add them.
|
||||
* src/tgba/public.hh: Include bddprint.hh.
|
||||
|
||||
* src/tgba/tgba.hh: Rename as ...
|
||||
* src/tgba/public.hh: .. this.
|
||||
* src/tgba/tgba.hh: New file.
|
||||
* src/tgba/Makefile.am (libtgba_la_SOURCES): Add public.hh.
|
||||
* src/tgba/tgbabddconcrete.hh (tgba_bdd_concrete): Inherit from tgba.
|
||||
(tgba_bdd_concrete::init_iter): Delete.
|
||||
(tgba_bdd_concrete::succ_iter): Take a state_bdd as argument,
|
||||
(tgba_bdd_concrete::succ_iter): Take a state_bdd as argument,
|
||||
not a bdd.
|
||||
* src/tgba/tgbabddconcrete.cc: Likewise.
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ noinst_LTLIBRARIES = libtgba.la
|
|||
libtgba_la_SOURCES = \
|
||||
bddfactory.cc \
|
||||
bddfactory.hh \
|
||||
bddprint.cc \
|
||||
bddprint.hh \
|
||||
dictunion.cc \
|
||||
dictunion.hh \
|
||||
ltl2tgba.cc \
|
||||
|
|
|
|||
77
src/tgba/bddprint.cc
Normal file
77
src/tgba/bddprint.cc
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#include "bddprint.hh"
|
||||
#include "ltlvisit/tostring.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
||||
const tgba_bdd_dict* dict;
|
||||
|
||||
static void
|
||||
print_handler(std::ostream& o, int var)
|
||||
{
|
||||
tgba_bdd_dict::vf_map::const_iterator isi =
|
||||
dict->var_formula_map.find(var);
|
||||
if (isi != dict->var_formula_map.end())
|
||||
to_string(isi->second, o);
|
||||
else
|
||||
{
|
||||
isi = dict->prom_formula_map.find(var);
|
||||
if (isi != dict->prom_formula_map.end())
|
||||
{
|
||||
o << "Prom["; to_string(isi->second, o) << "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
isi = dict->now_formula_map.find(var);
|
||||
if (isi != dict->now_formula_map.end())
|
||||
{
|
||||
o << "Now["; to_string(isi->second, o) << "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
isi = dict->now_formula_map.find(var - 1);
|
||||
if (isi != dict->now_formula_map.end())
|
||||
{
|
||||
o << "Next["; to_string(isi->second, o) << "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
o << "?" << var;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::ostream&
|
||||
bdd_print_set(std::ostream& os, const tgba_bdd_dict& d, bdd b)
|
||||
{
|
||||
dict = &d;
|
||||
bdd_strm_hook(print_handler);
|
||||
os << bddset << b;
|
||||
bdd_strm_hook(0);
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
bdd_print_dot(std::ostream& os, const tgba_bdd_dict& d, bdd b)
|
||||
{
|
||||
dict = &d;
|
||||
bdd_strm_hook(print_handler);
|
||||
os << bdddot << b;
|
||||
bdd_strm_hook(0);
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
bdd_print_table(std::ostream& os, const tgba_bdd_dict& d, bdd b)
|
||||
{
|
||||
dict = &d;
|
||||
bdd_strm_hook(print_handler);
|
||||
os << bddtable << b;
|
||||
bdd_strm_hook(0);
|
||||
return os;
|
||||
}
|
||||
|
||||
}
|
||||
22
src/tgba/bddprint.hh
Normal file
22
src/tgba/bddprint.hh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef SPOT_TGBA_BDDPRINT_HH
|
||||
# define SPOT_TGBA_BDDPRINT_HH
|
||||
|
||||
#include <iostream>
|
||||
#include "tgbabdddict.hh"
|
||||
#include <bdd.h>
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
||||
std::ostream& bdd_print_set(std::ostream& os,
|
||||
const tgba_bdd_dict& dict, bdd b);
|
||||
|
||||
std::ostream& bdd_print_dot(std::ostream& os,
|
||||
const tgba_bdd_dict& dict, bdd b);
|
||||
|
||||
std::ostream& bdd_print_table(std::ostream& os,
|
||||
const tgba_bdd_dict& dict, bdd b);
|
||||
|
||||
}
|
||||
|
||||
#endif // SPOT_TGBA_BDDPRINT_HH
|
||||
|
|
@ -5,5 +5,6 @@
|
|||
# include "tgbabddconcrete.hh"
|
||||
# include "tgbabddconcreteproduct.hh"
|
||||
# include "ltl2tgba.hh"
|
||||
# include "bddprint.hh"
|
||||
|
||||
#endif // SPOT_TGBA_PUBLIC_HH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue