Knowledge reasoning and representation