trying to convert my prolog program to core.logyc