knowledge-based alg