All Projects → pubkey → binary-decision-diagram

pubkey / binary-decision-diagram

Licence: Apache-2.0 license
A library to create, minimize and optimize binary decision diagrams

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to binary-decision-diagram

Vanessa Automation
BDD в 1С
Stars: ✭ 203 (+915%)
Mutual labels:  bdd
Nightwatch Cucumber
[DEPRECATED] Cucumber.js plugin for Nightwatch.js.
Stars: ✭ 243 (+1115%)
Mutual labels:  bdd
e2e-testing
Formal verification of Elastic-Agent and more using BDD
Stars: ✭ 22 (+10%)
Mutual labels:  bdd
Add
Разработка с управляемым качеством на 1С
Stars: ✭ 210 (+950%)
Mutual labels:  bdd
Bandit
Human-friendly unit testing for C++11
Stars: ✭ 240 (+1100%)
Mutual labels:  bdd
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (+65%)
Mutual labels:  bdd
White Bread
🍞 Story BDD tool for elixir using gherkin
Stars: ✭ 198 (+890%)
Mutual labels:  bdd
justtestlah
Dynamic test framework for web and mobile applications
Stars: ✭ 43 (+115%)
Mutual labels:  bdd
Nspec
A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
Stars: ✭ 242 (+1110%)
Mutual labels:  bdd
codeceptjs-bdd
⭐️ ⭐️⭐️ Migrated to Salesforce Open Source Platform - https://github.com/salesforce/codeceptjs-bdd
Stars: ✭ 24 (+20%)
Mutual labels:  bdd
Gauge
Light weight cross-platform test automation
Stars: ✭ 2,622 (+13010%)
Mutual labels:  bdd
Decouplesegnets
Implementation of Our ECCV2020-work: Improving Semantic Segmentation via Decoupled Body and Edge Supervision
Stars: ✭ 232 (+1060%)
Mutual labels:  bdd
Molder
BDD steps libraries for test automation databases, web services, and WebUI
Stars: ✭ 16 (-20%)
Mutual labels:  bdd
Cucumber Rust
Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
Stars: ✭ 210 (+950%)
Mutual labels:  bdd
docs
Cucumber user documentation
Stars: ✭ 110 (+450%)
Mutual labels:  bdd
Lightbdd
BDD framework allowing to create easy to read and maintain tests.
Stars: ✭ 195 (+875%)
Mutual labels:  bdd
chai
BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
Stars: ✭ 7,842 (+39110%)
Mutual labels:  bdd
tddd-starter
Laravel TDDD Starter App
Stars: ✭ 23 (+15%)
Mutual labels:  bdd
kmtest
Kernel-mode C++ unit testing framework in BDD-style
Stars: ✭ 42 (+110%)
Mutual labels:  bdd
deveroom-visualstudio
Visual Studio extension for SpecFlow
Stars: ✭ 26 (+30%)
Mutual labels:  bdd

binary decision diagram

A library to create, minimize and optimize binary decision diagrams in JavaScript.

A binary decision diagram is a data structure that represents a set of boolean function in an efficient way. To learn more about it, follow these links:

Installation

npm install binary-decision-diagram --save

createBddFromTruthTable()

Creates a BDD from a truth table. The Truth-Table is a Map<string, number> where the string is a truth-set like 1101 and the number is the value.

const truthTable = new Map();
truthTable.add('00', 1);
truthTable.add('01', 3);
truthTable.add('10', 2);
truthTable.add('11', 1);

const bdd = createBddFromTruthTable(
    truthTable
);

minimize()

Reduces the nodes of a BDD by applying the reduction- and elimination rules.

bdd.minimize(
    false // if true, logs stuff (optional)
);

countNodes()

Returns the amount of nodes of the BDD.

bdd.countNodes(); // returns a number

removeIrrelevantLeafNodes()

Removes all irrelevant leaf-nodes with the given value.

// this will remove all leaf-nodes with the value of 5
bdd.removeIrrelevantLeafNodes(5);

resolve()

Resolves a state by calling the boolean functions through the nodes.

The resolve-functions is an object with the truth-table-value as key and a boolean function as value.

const resolvers: ResolverFunctions = {
    1: (i) => true,
    2: (i) => true,
    3: (i) => false
};
const bddValue = bdd.resolve(
    resolvers, 
    i // input that is passed to the resolvers
); // returns a value from the truth table

bddToMinimalString()

Returns a string-representation of the BDD which can be used in the client side to have a small javascript-bundle. BDDs can be very big so an effective storage format was needed.

const minimalString = bddToMinimalString(bdd)

minimalStringToSimpleBdd()

Parses the minimal string into an SimpleBdd. The SimpleBdd very small and only can resolve stuff.

const simpleBdd = minimalStringToSimpleBdd(str);

resolveWithMinimalBdd()

Resolves a value with the SimpleBdd and the ResolverFunctions.

resolveWithSimpleBdd(
    simpleBdd,
    resolvers,
    key
);

optimizeBruteForce()

Optimizes the sorting of the boolean functions to get an optimal BDD. Returns a promise with the best found BDD.

const optimizedResult = await optimizeBruteForce({
    truthTable,
    iterations: 10000,
    // hook that runs whenever a bdd is created (optional)
    afterBddCreation: (bdd: RootNode) => {
        bdd.removeIrrelevantLeafNodes(unknownValueActionId);
    },
    // hook that is triggered whenever a better bdd was found (optional)
    onBetterBdd: (res: OptimisationResult) => {
        const bddMinimalString = bddToMinimalString(res.bdd);
        console.log('new string: ' + bddMinimalString);
        console.log('value mapping:');
        console.dir(res.mapping);
    }
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].