Move helper functions from simplify.cc to the AST files.

* src/ltlvisit/simplify.cc (spot::ltl::is_And, spot::ltl::is_F,
spot::ltl::is_FG, spot::ltl::is_G, spot::ltl::is_GF, spot::ltl::is_M,
spot::ltl::is_Or, spot::ltl::is_R, spot::ltl::is_U, spot::ltl::is_W,
spot::ltl::is_X, spot::ltl::is_binop, spot::ltl::is_constant,
spot::ltl::is_multop, spot::ltl::is_unop): Move ...
* src/ltlast/binop.hh, src/ltlast/constant.hh, src/ltlast/multop.hh
src/ltlast/unop.hh: ... here, as appropriate.
This commit is contained in:
Alexandre Duret-Lutz 2012-02-16 19:05:20 +01:00
parent aa4b68fcfc
commit 5e7c0add49
5 changed files with 254 additions and 147 deletions

View file

@ -1,5 +1,5 @@
// Copyright (C) 2009, 2010 Laboratoire de Recherche et D<>veloppement
// de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
//
// This file is part of Spot, a model checking library.
@ -68,6 +68,19 @@ namespace spot
// formula::formula() constructor.
};
/// \brief Cast \a f into a constant.
///
/// Cast \a f into a constant iff it is a constant instance.
/// Return 0 otherwise. This is faster than \c dynamic_cast.
inline
constant*
is_constant(formula* f)
{
if (f->kind() != formula::Constant)
return 0;
return static_cast<constant*>(f);
}
}
}