alias_specificity

Function alias_specificity 

Source
fn alias_specificity(alias: &AliasPair) -> usize
Expand description

Calculate the specificity of an alias based on total field depth

Specificity is measured as the sum of field depths on both sides. Lower values indicate more general (less specific) aliases.

Examples:

  • (0, 1): specificity = 0 + 0 = 0 (most general)
  • (0.1, 1): specificity = 1 + 0 = 1
  • (0.1, 1.1): specificity = 1 + 1 = 2
  • (1.0.0.0, 2): specificity = 3 + 0 = 3

When two aliases have a subsumption relationship, we keep the one with lower specificity (more general).