diff --git a/ChangeLog b/ChangeLog index a542aa8ab..d55ca8cc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,21 @@ 2003-08-01 Alexandre Duret-Lutz + * src/ltlvisit/lunabbrev.cc, src/ltlvisit/lunabbrev.hh: Merge the + two unabbreviate_logic definitions (const and non-const) into a + function that takes a const formula* and return a non-const + formula*. Since formula* is convertible to const formula*, and + the const version of the function just called the non-onst one, it + makes no sense to keep both. Also, it confused Swig. + * src/ltlvisit/nenoform.cc, src/ltlvisit/nenoform.hh: Likewise + for negative_normal_form. + * src/ltlvisit/tunabbrev.cc, src/ltlvisit/tunabbrev.hh: Likewise + for unabbreviate_ltl. + * src/ltlvisit/clone.cc, src/ltlvisit/clone.hh: Likewise for clone. + * src/ltlvisit/destroy.cc, src/ltlvisit/destroy.hh: Likewise + for destroy. + * configure.ac: Bump version to 0.0g. - + * configure.ac, NEWS: Bump version to 0.0f. * iface/gspn/simple.test, iface/gspn/dcswave.test, diff --git a/src/ltlvisit/clone.cc b/src/ltlvisit/clone.cc index 8b3a04507..3eed5e1d9 100644 --- a/src/ltlvisit/clone.cc +++ b/src/ltlvisit/clone.cc @@ -62,18 +62,12 @@ namespace spot return clone(f); } - formula* - clone(formula* f) - { - clone_visitor v; - f->accept(v); - return v.result(); - } - formula* clone(const formula* f) { - return clone(const_cast(f)); + clone_visitor v; + const_cast(f)->accept(v); + return v.result(); } } } diff --git a/src/ltlvisit/clone.hh b/src/ltlvisit/clone.hh index fc29d2125..51458f3c2 100644 --- a/src/ltlvisit/clone.hh +++ b/src/ltlvisit/clone.hh @@ -34,8 +34,6 @@ namespace spot formula* result_; }; - /// \brief Clone a formula. - formula* clone(formula* f); /// \brief Clone a formula. formula* clone(const formula* f); } diff --git a/src/ltlvisit/destroy.cc b/src/ltlvisit/destroy.cc index b5f0f253e..e3e930ada 100644 --- a/src/ltlvisit/destroy.cc +++ b/src/ltlvisit/destroy.cc @@ -15,17 +15,11 @@ namespace spot } }; - void - destroy(formula* f) - { - destroy_visitor v; - f->accept(v); - } - void destroy(const formula* f) { - destroy(const_cast(f)); + destroy_visitor v; + const_cast(f)->accept(v); } } } diff --git a/src/ltlvisit/destroy.hh b/src/ltlvisit/destroy.hh index ed236bf13..4d61f1fc9 100644 --- a/src/ltlvisit/destroy.hh +++ b/src/ltlvisit/destroy.hh @@ -7,8 +7,6 @@ namespace spot { namespace ltl { - /// \brief Destroys a formula - void destroy(formula *f); /// \brief Destroys a formula void destroy(const formula *f); } diff --git a/src/ltlvisit/lunabbrev.cc b/src/ltlvisit/lunabbrev.cc index 0a8252229..efadb2fe3 100644 --- a/src/ltlvisit/lunabbrev.cc +++ b/src/ltlvisit/lunabbrev.cc @@ -66,17 +66,11 @@ namespace spot } formula* - unabbreviate_logic(formula* f) - { - unabbreviate_logic_visitor v; - f->accept(v); - return v.result(); - } - - const formula* unabbreviate_logic(const formula* f) { - return unabbreviate_logic(const_cast(f)); + unabbreviate_logic_visitor v; + const_cast(f)->accept(v); + return v.result(); } } } diff --git a/src/ltlvisit/lunabbrev.hh b/src/ltlvisit/lunabbrev.hh index 3ce95eb7c..c5215e52e 100644 --- a/src/ltlvisit/lunabbrev.hh +++ b/src/ltlvisit/lunabbrev.hh @@ -31,16 +31,13 @@ namespace spot virtual formula* recurse(formula* f); }; - /// \brief Clone rewrite a formula to remove most of the abbreviated + /// \brief Clone and rewrite a formula to remove most of the abbreviated /// logical operators. /// /// This will rewrite binary operators such as binop::Implies, /// binop::Equals, and binop::Xor, using only unop::Not, multop::Or, /// and multop::And. - formula* unabbreviate_logic(formula* f); - /// \brief Clone rewrite a formula to remove most of the abbreviated - /// logical operators. - const formula* unabbreviate_logic(const formula* f); + formula* unabbreviate_logic(const formula* f); } } diff --git a/src/ltlvisit/nenoform.cc b/src/ltlvisit/nenoform.cc index 5d02bb33f..5965aec40 100644 --- a/src/ltlvisit/nenoform.cc +++ b/src/ltlvisit/nenoform.cc @@ -168,17 +168,12 @@ namespace spot }; formula* - negative_normal_form(formula* f, bool negated) + negative_normal_form(const formula* f, bool negated) { negative_normal_form_visitor v(negated); - f->accept(v); + const_cast(f)->accept(v); return v.result(); } - const formula* - negative_normal_form(const formula* f) - { - return negative_normal_form(const_cast(f)); - } } } diff --git a/src/ltlvisit/nenoform.hh b/src/ltlvisit/nenoform.hh index b35743a31..613a812c4 100644 --- a/src/ltlvisit/nenoform.hh +++ b/src/ltlvisit/nenoform.hh @@ -22,9 +22,7 @@ namespace spot /// or spot::ltl::unabbreviate_ltl first. (Calling these functions /// after spot::ltl::negative_normal_form would likely produce a /// formula which is not in negative normal form.) - formula* negative_normal_form(formula* f, bool negated = false); - /// \brief Build the negative normal form of \a f. - const formula* negative_normal_form(const formula* f); + formula* negative_normal_form(const formula* f, bool negated = false); } } diff --git a/src/ltlvisit/tunabbrev.cc b/src/ltlvisit/tunabbrev.cc index eec8a0db8..242e789d9 100644 --- a/src/ltlvisit/tunabbrev.cc +++ b/src/ltlvisit/tunabbrev.cc @@ -42,17 +42,11 @@ namespace spot } formula* - unabbreviate_ltl(formula* f) - { - unabbreviate_ltl_visitor v; - f->accept(v); - return v.result(); - } - - const formula* unabbreviate_ltl(const formula* f) { - return unabbreviate_ltl(const_cast(f)); + unabbreviate_ltl_visitor v; + const_cast(f)->accept(v); + return v.result(); } } diff --git a/src/ltlvisit/tunabbrev.hh b/src/ltlvisit/tunabbrev.hh index 813077180..61a9d0c76 100644 --- a/src/ltlvisit/tunabbrev.hh +++ b/src/ltlvisit/tunabbrev.hh @@ -41,10 +41,7 @@ namespace spot /// /// This will also rewrite unary operators such as unop::F, /// and unop::G, using only binop::U, and binop::R. - formula* unabbreviate_ltl(formula* f); - /// \brief Clone and rewrite a formula to remove most of the - /// abbreviated LTL and logical operators. - const formula* unabbreviate_ltl(const formula* f); + formula* unabbreviate_ltl(const formula* f); } }