Did you know? SWI-Prolog supports PDT, the Prolog Development ToolsSearch Documentation:
SWI-Prolog owl logoPredicate flatten/2