def scope_match_tokens(gold_inst, system_inst):
    """Given a gold NegationInstance and matched system NegationInstance, count the number of matching
    scope tokens between them.

    Args:
        gold_inst: The gold NegationInstance.
        system_inst: The system NegationInstance.

    Returns: A triple consisting of
      1) the number of tokens in the gold scope;
      2) the number of tokens in the system scope;
      3) the number of tokens that match up between the two.
    """
    # Count tokens that match up between scopes
    num_matched_tokens = 0
    for token1 in gold_inst.scope:
        for token2 in system_inst.scope:
            if token1 == token2: # matching by position and word form
                num_matched_tokens += 1

    return len(gold_inst.scope), len(system_inst.scope), num_matched_tokens,