To make it clear with an example: if IN1 is a dependency of LIST1 and LIST2 as well and it's found for both functors (once for LIST1 and once for LIST2) during the longest matching semantic rule calculation then it's cumulated and in is_longest_match_for_semantic_rules_found() shows up as having been found twice! Currently, a fix takes care of avoiding that for the functor being the argument of the first call of the recursive method find_dependencies_for_node() but that logic should be extended to all levels of recursion. Fixing that has the corollary that the algorithm to calculate the longest match needs to be adjusted as well.
To make it clear with an example: if IN1 is a dependency of LIST1 and LIST2 as well and it's found for both functors (once for LIST1 and once for LIST2) during the longest matching semantic rule calculation then it's cumulated and in is_longest_match_for_semantic_rules_found() shows up as having been found twice! Currently, a fix takes care of avoiding that for the functor being the argument of the first call of the recursive method find_dependencies_for_node() but that logic should be extended to all levels of recursion. Fixing that has the corollary that the algorithm to calculate the longest match needs to be adjusted as well.