adt/cnf-evaluator

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

This package is auto-updated.

Last update: 2020-07-26 00:23:50 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();