* 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.
This commit is contained in:
Alexandre Duret-Lutz 2003-08-01 13:04:25 +00:00
parent d33ad6d6bf
commit f1f81fbfef
11 changed files with 32 additions and 59 deletions

View file

@ -1,7 +1,21 @@
2003-08-01 Alexandre Duret-Lutz <aduret@src.lip6.fr> 2003-08-01 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* 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: Bump version to 0.0g.
* configure.ac, NEWS: Bump version to 0.0f. * configure.ac, NEWS: Bump version to 0.0f.
* iface/gspn/simple.test, iface/gspn/dcswave.test, * iface/gspn/simple.test, iface/gspn/dcswave.test,

View file

@ -62,18 +62,12 @@ namespace spot
return clone(f); return clone(f);
} }
formula*
clone(formula* f)
{
clone_visitor v;
f->accept(v);
return v.result();
}
formula* formula*
clone(const formula* f) clone(const formula* f)
{ {
return clone(const_cast<formula*>(f)); clone_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();
} }
} }
} }

View file

@ -34,8 +34,6 @@ namespace spot
formula* result_; formula* result_;
}; };
/// \brief Clone a formula.
formula* clone(formula* f);
/// \brief Clone a formula. /// \brief Clone a formula.
formula* clone(const formula* f); formula* clone(const formula* f);
} }

View file

@ -15,17 +15,11 @@ namespace spot
} }
}; };
void
destroy(formula* f)
{
destroy_visitor v;
f->accept(v);
}
void void
destroy(const formula* f) destroy(const formula* f)
{ {
destroy(const_cast<formula*>(f)); destroy_visitor v;
const_cast<formula*>(f)->accept(v);
} }
} }
} }

View file

@ -7,8 +7,6 @@ namespace spot
{ {
namespace ltl namespace ltl
{ {
/// \brief Destroys a formula
void destroy(formula *f);
/// \brief Destroys a formula /// \brief Destroys a formula
void destroy(const formula *f); void destroy(const formula *f);
} }

View file

@ -66,17 +66,11 @@ namespace spot
} }
formula* formula*
unabbreviate_logic(formula* f)
{
unabbreviate_logic_visitor v;
f->accept(v);
return v.result();
}
const formula*
unabbreviate_logic(const formula* f) unabbreviate_logic(const formula* f)
{ {
return unabbreviate_logic(const_cast<formula*>(f)); unabbreviate_logic_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();
} }
} }
} }

View file

@ -31,16 +31,13 @@ namespace spot
virtual formula* recurse(formula* f); 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. /// logical operators.
/// ///
/// This will rewrite binary operators such as binop::Implies, /// This will rewrite binary operators such as binop::Implies,
/// binop::Equals, and binop::Xor, using only unop::Not, multop::Or, /// binop::Equals, and binop::Xor, using only unop::Not, multop::Or,
/// and multop::And. /// and multop::And.
formula* unabbreviate_logic(formula* f); formula* unabbreviate_logic(const formula* f);
/// \brief Clone rewrite a formula to remove most of the abbreviated
/// logical operators.
const formula* unabbreviate_logic(const formula* f);
} }
} }

View file

@ -168,17 +168,12 @@ namespace spot
}; };
formula* formula*
negative_normal_form(formula* f, bool negated) negative_normal_form(const formula* f, bool negated)
{ {
negative_normal_form_visitor v(negated); negative_normal_form_visitor v(negated);
f->accept(v); const_cast<formula*>(f)->accept(v);
return v.result(); return v.result();
} }
const formula*
negative_normal_form(const formula* f)
{
return negative_normal_form(const_cast<formula*>(f));
}
} }
} }

View file

@ -22,9 +22,7 @@ namespace spot
/// or spot::ltl::unabbreviate_ltl first. (Calling these functions /// or spot::ltl::unabbreviate_ltl first. (Calling these functions
/// after spot::ltl::negative_normal_form would likely produce a /// after spot::ltl::negative_normal_form would likely produce a
/// formula which is not in negative normal form.) /// formula which is not in negative normal form.)
formula* negative_normal_form(formula* f, bool negated = false); formula* negative_normal_form(const formula* f, bool negated = false);
/// \brief Build the negative normal form of \a f.
const formula* negative_normal_form(const formula* f);
} }
} }

View file

@ -42,17 +42,11 @@ namespace spot
} }
formula* formula*
unabbreviate_ltl(formula* f)
{
unabbreviate_ltl_visitor v;
f->accept(v);
return v.result();
}
const formula*
unabbreviate_ltl(const formula* f) unabbreviate_ltl(const formula* f)
{ {
return unabbreviate_ltl(const_cast<formula*>(f)); unabbreviate_ltl_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();
} }
} }

View file

@ -41,10 +41,7 @@ namespace spot
/// ///
/// This will also rewrite unary operators such as unop::F, /// This will also rewrite unary operators such as unop::F,
/// and unop::G, using only binop::U, and binop::R. /// and unop::G, using only binop::U, and binop::R.
formula* unabbreviate_ltl(formula* f); formula* unabbreviate_ltl(const 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);
} }
} }