Constraint programming libraries tend to be written in C/C++ for speed reasons, you can very easily create problems that are very costly to solve. Your best bets are:
Find a C/C++ library that has an existing PHP wrapper (a quick Google doesn't turn up anything)
Create your own wrapper around any of the libraries mentioned here
Use a "black box" external program such as Minion which you interact with via the command line and text files
Alternatively take the Python code from the above example and call it from PHP.
发布评论
评论(2)
出于速度原因,约束编程库往往用 C/C++ 编写,您可以很容易地创建解决起来成本非常高的问题。您最好的选择是:
或者从上面的示例中获取 Python 代码并从 PHP 调用它。
Constraint programming libraries tend to be written in C/C++ for speed reasons, you can very easily create problems that are very costly to solve. Your best bets are:
Alternatively take the Python code from the above example and call it from PHP.
一阶谓词逻辑库可以在这里找到: http://www.phpclasses.org/package/1344-PHP-Manipulate-analyze-and-prove-logic-propositions.html
First-order predicate logic library can be found here: http://www.phpclasses.org/package/1344-PHP-Manipulate-analyze-and-prove-logic-propositions.html