1.0.2 • Published 7 years ago

reduced-dnf v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

Reduced Disjunctive Normal Form

This module allows to find a reduced DNF.

Install

To install this module you need to use NPM

npm install reduced-dnf

Usage

f(x1,x2,x3,x4)|_1=U(0,1,2,3,4,5,7,13,15)

If you've got a function of 4 arguments and points {0,1,2,3,4,5,7,13,15} where the function takes true-defined value (meaning 1), then you can get a reduced DNF function using this:

let dnf = require("reduced-dnf");
let data = dnf(["x_1","x_2","x_3","x_4"], [0,1,2,3,4,5,7,13,15]);

data.columns.forEach((column, i) => {
  console.log("Column no." + (i + 1));
  column.forEach(v => console.log(v));
});

console.log("Function F =", data.F);
console.log("Сomplexity L =", data.L);

As a result, you get function itself (F), its complexity (L) and templates for points (columns).