for learning prolog