السلام عليكم
أنا أحاول ربط بين برنامج C# ولغة الذكاء الصنعي الـ prolog
استعنت بالرابط التالي :
وقمت بقراءة الـ 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!");
}
}
}
}طبعا أول شي قمت بتضمين الملف SwiPlCs.dll
ولكن هناك خطأ دائما يواجهني هو التالي :
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
حاولت القراءة عنه في الموقع فوجدت قد كتب عنه التالي :
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)
قمت بما قالو ونسخت الملف libswipl.dll إلى مجلد الـ debug الموجود داخل مجلد الـ bin الخاص بمشروعي ولكن أيضا دون فائدة
هل يستطيع أحد مساعدتي ؟
شكرا