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

* 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.
parent 88514330
2003-05-26 Alexandre Duret-Lutz <aduret@src.lip6.fr> 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/tgba.hh: Rename as ...
* src/tgba/public.hh: .. this. * src/tgba/public.hh: .. this.
* src/tgba/tgba.hh: New file. * src/tgba/tgba.hh: New file.
* src/tgba/Makefile.am (libtgba_la_SOURCES): Add public.hh. * src/tgba/Makefile.am (libtgba_la_SOURCES): Add public.hh.
* src/tgba/tgbabddconcrete.hh (tgba_bdd_concrete): Inherit from tgba. * src/tgba/tgbabddconcrete.hh (tgba_bdd_concrete): Inherit from tgba.
(tgba_bdd_concrete::init_iter): Delete. (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. not a bdd.
* src/tgba/tgbabddconcrete.cc: Likewise. * src/tgba/tgbabddconcrete.cc: Likewise.
......
...@@ -5,6 +5,8 @@ noinst_LTLIBRARIES = libtgba.la ...@@ -5,6 +5,8 @@ noinst_LTLIBRARIES = libtgba.la
libtgba_la_SOURCES = \ libtgba_la_SOURCES = \
bddfactory.cc \ bddfactory.cc \
bddfactory.hh \ bddfactory.hh \
bddprint.cc \
bddprint.hh \
dictunion.cc \ dictunion.cc \
dictunion.hh \ dictunion.hh \
ltl2tgba.cc \ ltl2tgba.cc \
......
#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;
}
}
#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 @@ ...@@ -5,5 +5,6 @@
# include "tgbabddconcrete.hh" # include "tgbabddconcrete.hh"
# include "tgbabddconcreteproduct.hh" # include "tgbabddconcreteproduct.hh"
# include "ltl2tgba.hh" # include "ltl2tgba.hh"
# include "bddprint.hh"
#endif // SPOT_TGBA_PUBLIC_HH #endif // SPOT_TGBA_PUBLIC_HH
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment