A Logic and Adaptive Approach for Efficient Diagnosis Systems using CBR