Remove Prolog from MacOS
You say you installed it using MacPorts but you tried to uninstall it using Homebrew? Homebrew has no knowledge that you installed it using MacPorts. Use MacPorts to uninstall:

port uninstall gprolog


If that's not the case, you can manually remove the following files instead: