我在C++程序中有一些邏輯,它不僅非常複雜,而且需要Prolog理想的多種解決方案。它有點像防火牆配置腳本,檢查輸入的動作,但有時需要更多的動作。Linux g ++在C++中嵌入Prolog邏輯引擎
我要的是這樣的:
class PrologEngine
{
LoadLogic(const char* filename) throw PrologException; // Load a file of prolog rules, predicates facts etc in textual format. Must be callable multiple times to load AND COMPILE (for speed) prolog rule files.
std::vector<std::string> Evaluate(const char* predicate_in_string_form = "execute(input, Result)") throw PrologException; Returns a vector of matching predicates in text form.
};
它需要沒有能力再打成C++。
AMI Prolog似乎得到它,但它在Linux上不可用。我正在嘗試使用SWI-Prolog,只能找到2個例子和令人難以置信的拜占庭API(我的觀點)
任何人都可以指出一個接近我所尋找的例子嗎?
這個博客文章有一個小例子,你想做什麼機智的swi-prolog:http://electricbacon.wordpress.com/2010/09/08/calc-example-using-swi-prolog-and-c/ – HaskellElephant 2012-02-15 16:46:00
爲什麼不使用CLIPS而不是prolog? http://clipsrules.sourceforge.net/WhatIsCLIPS.html – devil 2012-12-03 02:16:26