code: def truncate_repeated_single_step_traversals_in_sub_queries(compound_match_query):
      
      lowered_match_queries = []
      for match_query in compound_match_query.match_queries:
          new_match_query = truncate_repeated_single_step_traversals(match_query)
          lowered_match_queries.append(new_match_query)
  
      return compound_match_query._replace(match_queries=lowered_match_queries)
docs: For each sub-query, remove one-step traversals that overlap a previous traversal location.