adt/cnf-evaluator

v1.0 2018-12-30 21:47 UTC

This package is auto-updated.

Last update: 2024-10-26 09:02:25 UTC


README

Cnf = Conjunctive normal form.
Komponenta na vyhodnocování konjunktní normální formy. Projde pole opravdových hodnot a pole boolean hodnot jednotlivých callbacků, pokud se jednotlivá pole shodují, provede callback.

Installation

The best way to install is using Composer:

$ composer require adt/cnf-evaluator

Usage

$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();