A Distance Measure Based on Fuzzy D-implications: Application in Pattern Recognition