Line data Source code
1 : // Author(s): Wieger Wesselink 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/pbes/detail/has_propositional_variables.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_PBES_DETAIL_HAS_PROPOSITIONAL_VARIABLES_H 13 : #define MCRL2_PBES_DETAIL_HAS_PROPOSITIONAL_VARIABLES_H 14 : 15 : #include "mcrl2/pbes/traverser.h" 16 : 17 : namespace mcrl2 { 18 : 19 : namespace pbes_system { 20 : 21 : namespace detail { 22 : 23 : struct has_propositional_variables_traverser: public pbes_expression_traverser<has_propositional_variables_traverser> 24 : { 25 : typedef pbes_expression_traverser<has_propositional_variables_traverser> super; 26 : using super::enter; 27 : using super::leave; 28 : using super::apply; 29 : 30 : bool result; 31 : 32 0 : has_propositional_variables_traverser() 33 0 : : result(false) 34 0 : {} 35 : 36 0 : void enter(const propositional_variable_instantiation&) 37 : { 38 0 : result = true; 39 0 : } 40 : }; 41 : 42 : inline 43 0 : bool has_propositional_variables(const pbes_expression& x) 44 : { 45 0 : has_propositional_variables_traverser f; 46 0 : f.apply(x); 47 0 : return f.result; 48 : } 49 : 50 : } // namespace detail 51 : 52 : } // namespace pbes_system 53 : 54 : } // namespace mcrl2 55 : 56 : #endif // MCRL2_PBES_DETAIL_HAS_PROPOSITIONAL_VARIABLES_H