diff --git a/plansys2_problem_expert/src/plansys2_problem_expert/ProblemExpert.cpp b/plansys2_problem_expert/src/plansys2_problem_expert/ProblemExpert.cpp index 80e83d31..c50a5076 100644 --- a/plansys2_problem_expert/src/plansys2_problem_expert/ProblemExpert.cpp +++ b/plansys2_problem_expert/src/plansys2_problem_expert/ProblemExpert.cpp @@ -448,6 +448,20 @@ ProblemExpert::existPredicate(const plansys2::Predicate & predicate) i++; } + if (!found) + { + std::vector parameters_names; + std::for_each (predicate.parameters.begin(), predicate.parameters.end(), + [&](auto p){parameters_names.push_back(p.name);}); + auto derived_predicates = domain_expert_->getDerivedPredicate(predicate.name, parameters_names); + for(auto derived : derived_predicates){ + if(check(derived.preconditions, predicates_, functions_)){ + found = true; + break; + } + } + } + return found; }