Knowledge-based systems for formulation optimization