i try to interface C# with prolog i have used this link : enter link description here
i have added the SwiPlCs.dll as a reference to my project,then use the first code in the documentation
using System;
using SbsSW.SwiPlCs;
namespace HelloWorldDemo
{
class Program
{
static void Main(string[] args)
{
//Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"the_PATH_to_boot32.prc");
if (!PlEngine.IsInitialized)
{
String[] param = { "-q" }; // suppressing informational and banner messages
PlEngine.Initialize(param);
PlQuery.PlCall("assert(father(martin, inka))");
PlQuery.PlCall("assert(father(uwe, gloria))");
PlQuery.PlCall("assert(father(uwe, melanie))");
PlQuery.PlCall("assert(father(uwe, ayala))");
using (PlQuery q = new PlQuery("father(P, C), atomic_list_concat([P,' is_father_of ',C], L)"))
{
foreach (PlQueryVariables v in q.SolutionVariables)
Console.WriteLine(v["L"].ToString());
Console.WriteLine("all child's from uwe:");
q.Variables["P"].Unify("uwe");
foreach (PlQueryVariables v in q.SolutionVariables)
Console.WriteLine(v["C"].ToString());
}
PlEngine.PlCleanup();
Console.WriteLine("finshed!");
}
}
}
}
but an exception always goes .. it's say that :
The specified module could not be found. (Exception from HRESULT: 0x8007007E
in the SWI-prolog they have say about this error:
If libswipl.dll or one of its dependencies could not found you will recive an error like System.IO.FileNotFoundException: Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)
i have copied the libswipl.dll from the program bin to my bin/debug folder in my project but it still the same problem .
what i have to do ?? Thanks