Logic, Programming and Prolog