docs: private static void updateFixedCostSubsReachableByIndex(ImmutableMap<NodeId, Node> allNodes,
                                                              Map<Node, Double> nodesWithFixedCost,
                                                              Set<Fragment> fragments) {
  
          Set<Fragment> validSubFragments = fragments.stream().filter(fragment -> {
              if (fragment instanceof InSubFragment) {
                  Node superType = allNodes.get(NodeId.of(NodeId.NodeType.VAR, fragment.start()));
                  if (nodesWithFixedCost.containsKey(superType) && nodesWithFixedCost.get(superType) > 0D) {
                      Node subType = allNodes.get(NodeId.of(NodeId.NodeType.VAR, fragment.end()));
                      return !nodesWithFixedCost.containsKey(subType);
                  }
              }
              return false;
          }).collect(Collectors.toSet());
  
          if (!validSubFragments.isEmpty()) {
              validSubFragments.forEach(fragment -> {
                  // TODO: should decrease the weight of sub type after each level
                  nodesWithFixedCost.put(allNodes.get(NodeId.of(NodeId.NodeType.VAR, fragment.end())),
                          nodesWithFixedCost.get(allNodes.get(NodeId.of(NodeId.NodeType.VAR, fragment.start()))));
              });
              // recursively process all the sub fragments
              updateFixedCostSubsReachableByIndex(allNodes, nodesWithFixedCost, fragments);
          }
      }