Applying logic inference techniques for gaining flexibility and adaptivity in tutoring systems