adt / cnf-evaluator
v1.0
2018-12-30 21:47 UTC
This package is auto-updated.
Last update: 2024-09-26 08:48:12 UTC
README
Cnf = 合取范式。
用于评估合取范式的组件。它会遍历真实值数组以及各个回调的布尔值数组,如果数组相同,则执行回调。
安装
最佳安装方式是使用 Composer
$ composer require adt/cnf-evaluator
使用方法
$cnf = new CnfEvaluator(); $cnf->addCallback(function() { ... }, [ "condition1" => TRUE, "condition2" => TRUE, "condition4" => FALSE, ]); $cnf->addCallback(function() { ... }, [ "condition1" => TRUE, "condition2" => TRUE, "condition4" => FALSE, ]); $cnf->setRealValues([ "condition1" => TRUE, "condition2" => FALSE, "condition3" => TRUE, "condition4" => FALSE, ]); $cnf->process();