def delta(p, q):
 features = R(p, q)
 total = 0
 for f in features:
  total += (diff(p, q, f) * salience[f])
 return total

def delta ( p , q ) : features = R ( p , q ) total = 0 for f in features : total += ( diff ( p , q , f ) * salience [ f ] ) return total
returns 1 if i == j .