added support for starting multiple queries in the same Prolog engine