dep-software-0.1.0.0
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Dep.Algorithm.Synthesis

Description

This module defines functions to generate a sum-of-products or a product-of-sums with the given function specified by a Three.

Synopsis

Synthesize a Three

synthesis Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> SumOfProducts

The sum of products that work with the function defined in the Three.

Create a SumOfProducts object based on the given Three of ThreeValues. This function acts as an alias for the synthesisSOP function.

synthesis' Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> SumOfProducts'

The sum of products that work with the function defined in the Three.

Create a sum-of-products for the given function of ThreeValue. This function is an alias of the synthesisSOP function.

synthesisSOP Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> SumOfProducts

The sum of products that work with the function defined in the Three.

Create a SumOfProducts object based on the given Three of ThreeValues.

synthesisSOP' Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> SumOfProducts'

The sum of products that work with the function defined in the Three.

Create a sum-of-products for the given function of ThreeValue.

synthesisPOS Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> ProductOfSums

The product of sums that work with the function defined in the Three.

Create a ProductOfSums object based on the given Three of ThreeValues.

synthesisPOS' Source #

Arguments

:: Three ThreeValue

The Three of ThreeValues for which we want to make a logical formula.

-> ProductOfSums'

The sum of products that work with the function defined in the Three.

Create a sum-of-products for the given function of ThreeValue.

Weigthed variants of the product and sum

type WeightedProduct = (Int, Product') Source #

A 2-tuple where the first item is the "weight" of the product, and the second one the corresponding Product'.

type WeightedSum = (Int, Sum') Source #

A 2-tuple where the first item is the "weight" of the sum, and the second one the corresponding Sum'.

Create an upper and lowerbound Three

upperbound Source #

Arguments

:: Three ThreeValue

The given Three of ThreeValues where we calculate the upperbound from.

-> Three Bool

The corresponding upperbound.

Create a simplified Three where the DontCare and One map to True; and Zero maps to False.

lowerbound Source #

Arguments

:: Three ThreeValue

The given Three of ThreeValues where we calculate the lowerbound from.

-> Three Bool

The corresponding lowerbound.

Create a simplified Three where the DontCare and Zero map to False; and One maps to True.

Extract products and sums

extractProduct Source #

Arguments

:: Int

The maximum depth of the Three.

-> Three Bool

A Three of Bools that specifies if One can be assigned to it (so either One or DontCare).

-> Three ThreeValue

The Three of ThreeValues where we try to search for an item.

-> Maybe WeightedProduct

A 2-tuple that contains the path to the leaf and the number of Zeros and Ones in the path that measure the "weight" of the AND gate of the product.

Obtain a Product' together with the number of inputs for the AND gate if the Three contains at least one One.

extractSum Source #

Arguments

:: Int

The maximum depth of the Three.

-> Three Bool

A Three of Bools that specifies if Zero can be assigned to it (so either Zero or DontCare).

-> Three ThreeValue

The Three of ThreeValues where we try to search for an item.

-> Maybe WeightedSum

A 2-tuple that contains the path to the leaf and the number of Zeros and Ones in the path that measure the "weight" of the OR gate of the product.

Obtain a Sum' together with the number of inputs for the OR gates if the Three contains at least one Zero.

Processing a Three

wipeout Source #

Arguments

:: Product'

The product that specifies the path of the element(s) to set to DontCare.

-> Three ThreeValue

The original Three of ThreeValues where we want to convert parts to DontCare.

-> Three ThreeValue

The resulting Three of ThreeValues where items that match the path are wiped out.

Convert the items that are accessed by the Product' to a DontCare, and simplify the Three. After wiping out values, the Three is simplified.

wipeout' Source #

Arguments

:: Product'

The product that specifies the path of the element(s) to set to DontCare.

-> Three ThreeValue

The original Three of ThreeValues where we want to convert parts to DontCare.

-> Three ThreeValue

The resulting Three of ThreeValues where items that match the path are wiped out.

Convert the items that are accessed by the Product' to a DontCare, and simplify the Three.