Knowledge-based expert system