Ruled-based reasoning system