* src/ltlvisit/dump.hh (dump): Take a formula* as argument,

not a formula&.  This is more homogeneous.
* src/ltlvisit/dump.cc (dump): Likewise.
* src/ltlvisit/dotty.hh (dotty): Likewise.
* src/ltlvisit/dotty.cc (dotty): Likewise.
* src/ltlvisit/tostring.hh (to_string): Likewise.
* src/ltlvisit/tostring.cc (to_string): Likewise.
* src/ltltest/readltl.cc, src/ltltest/equals.cc,
src/ltltest/tostring.cc: Adjust usage.
This commit is contained in:
Alexandre Duret-Lutz 2003-05-16 08:10:58 +00:00
parent 35f77be6c7
commit 7685d3a5b8
10 changed files with 70 additions and 63 deletions

View file

@ -1,5 +1,15 @@
2003-05-16 Alexandre Duret-Lutz <aduret@src.lip6.fr> 2003-05-16 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* src/ltlvisit/dump.hh (dump): Take a formula* as argument,
not a formula&. This is more homogeneous.
* src/ltlvisit/dump.cc (dump): Likewise.
* src/ltlvisit/dotty.hh (dotty): Likewise.
* src/ltlvisit/dotty.cc (dotty): Likewise.
* src/ltlvisit/tostring.hh (to_string): Likewise.
* src/ltlvisit/tostring.cc (to_string): Likewise.
* src/ltltest/readltl.cc, src/ltltest/equals.cc,
src/ltltest/tostring.cc: Adjust usage.
Check trivial multop equality at build time. The makes the Check trivial multop equality at build time. The makes the
equal visitor useless, since two equals formulae will now equal visitor useless, since two equals formulae will now
share the same address. share the same address.

View file

@ -38,26 +38,23 @@ main(int argc, char** argv)
#endif #endif
#ifdef LUNABBREV #ifdef LUNABBREV
tmp = f1; tmp = f1;
std::cout << spot::ltl::atomic_prop::instance_count() << std::endl;
f1 = spot::ltl::unabbreviate_logic(f1); f1 = spot::ltl::unabbreviate_logic(f1);
std::cout << spot::ltl::atomic_prop::instance_count() << std::endl;
spot::ltl::destroy(tmp); spot::ltl::destroy(tmp);
std::cout << spot::ltl::atomic_prop::instance_count() << std::endl; spot::ltl::dump(f1, std::cout);
spot::ltl::dump(*f1, std::cout);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
#ifdef TUNABBREV #ifdef TUNABBREV
tmp = f1; tmp = f1;
f1 = spot::ltl::unabbreviate_ltl(f1); f1 = spot::ltl::unabbreviate_ltl(f1);
spot::ltl::destroy(tmp); spot::ltl::destroy(tmp);
spot::ltl::dump(*f1, std::cout); spot::ltl::dump(f1, std::cout);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
#ifdef NENOFORM #ifdef NENOFORM
tmp = f1; tmp = f1;
f1 = spot::ltl::negative_normal_form(f1); f1 = spot::ltl::negative_normal_form(f1);
spot::ltl::destroy(tmp); spot::ltl::destroy(tmp);
spot::ltl::dump(*f1, std::cout); spot::ltl::dump(f1, std::cout);
std::cout << std::endl; std::cout << std::endl;
#endif #endif

View file

@ -43,9 +43,9 @@ main(int argc, char** argv)
if (f) if (f)
{ {
#ifdef DOTTY #ifdef DOTTY
spot::ltl::dotty(*f, std::cout); spot::ltl::dotty(f, std::cout);
#else #else
spot::ltl::dump(*f, std::cout); spot::ltl::dump(f, std::cout);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
spot::ltl::destroy(f); spot::ltl::destroy(f);

View file

@ -26,7 +26,7 @@ main(int argc, char **argv)
// The string generated from an abstract tree should be parsable // The string generated from an abstract tree should be parsable
// again. // again.
std::string f1s = spot::ltl::to_string(*f1); std::string f1s = spot::ltl::to_string(f1);
std::cout << f1s << std::endl; std::cout << f1s << std::endl;
spot::ltl::formula* f2 = spot::ltl::parse(f1s, p1); spot::ltl::formula* f2 = spot::ltl::parse(f1s, p1);
@ -41,7 +41,7 @@ main(int argc, char **argv)
// It should also map to the same string. // It should also map to the same string.
std::string f2s = spot::ltl::to_string(*f2); std::string f2s = spot::ltl::to_string(f2);
std::cout << f2s << std::endl; std::cout << f2s << std::endl;
if (f2s != f1s) if (f2s != f1s)

View file

@ -95,11 +95,11 @@ namespace spot
}; };
void void
dotty(const formula& f, std::ostream& os) dotty(const formula* f, std::ostream& os)
{ {
dotty_visitor v(os); dotty_visitor v(os);
os << "digraph G {" << std::endl; os << "digraph G {" << std::endl;
f.accept(v); f->accept(v);
os << "}" << std::endl; os << "}" << std::endl;
} }

View file

@ -14,7 +14,7 @@ namespace spot
/// ///
/// \c dot is part of the GraphViz package /// \c dot is part of the GraphViz package
/// http://www.research.att.com/sw/tools/graphviz/ /// http://www.research.att.com/sw/tools/graphviz/
void dotty(const formula& f, std::ostream& os); void dotty(const formula* f, std::ostream& os);
} }
} }

View file

@ -69,10 +69,10 @@ namespace spot
}; };
void void
dump(const formula& f, std::ostream& os) dump(const formula* f, std::ostream& os)
{ {
dump_visitor v(os); dump_visitor v(os);
f.accept(v); f->accept(v);
} }
} }

View file

@ -13,7 +13,7 @@ namespace spot
/// \param os The stream where it should be output. /// \param os The stream where it should be output.
/// ///
/// This is useful to display a formula when debugging. /// This is useful to display a formula when debugging.
void dump(const formula& f, std::ostream& os); void dump(const formula* f, std::ostream& os);
} }
} }

View file

@ -115,14 +115,14 @@ namespace spot
}; };
void void
to_string(const formula& f, std::ostream& os) to_string(const formula* f, std::ostream& os)
{ {
to_string_visitor v(os); to_string_visitor v(os);
f.accept(v); f->accept(v);
} }
std::string std::string
to_string(const formula& f) to_string(const formula* f)
{ {
std::ostringstream os; std::ostringstream os;
to_string(f, os); to_string(f, os);

View file

@ -8,8 +8,8 @@ namespace spot
{ {
namespace ltl namespace ltl
{ {
void to_string(const formula& f, std::ostream& os); void to_string(const formula* f, std::ostream& os);
std::string to_string(const formula& f); std::string to_string(const formula* f);
} }
} }