An introduction to logic programming through Prolog