I've decided to replace P# with a great C# SWI-Prolog Interface , written by Uwe Lesta (I changed it a bit. See attachment.) The main reason for this decision was performance . P# was considerably slower, and the project had to meet certain standards. Unfortunately, the C# interface does not work...