Implemented in SWI-Prolog