cana.canalization.cboolean_canalization module
(Cythonized) Boolean Canalization
Functions to compute the Quine-McCluskey algorithm in cython for increaed computation speed.
- cana.canalization.cboolean_canalization.binary_density(binstate)
Find the density (number of 1s) for a term with possible wildcards.
- cana.canalization.cboolean_canalization.expand_wildcard_schemata(schemata)
Expand a wildcard schemata to list all binary states it covers.
- Parameters:
schemata (string) – the wildcard shemata
- Returns:
list of all binary states covered by the schemata
- Return type:
binary_states (list)
- cana.canalization.cboolean_canalization.find_implicants_qm(input_binstates, verbose=False)
Finds the prime implicants (PI) using the Quine-McCluskey algorithm [Qui55].
- Parameters:
input_binstates (list / set) – A the binstates to condense.
- Returns:
a set of prime implicants.
- Return type:
PI (set)
# Authors: Alex Gates
- cana.canalization.cboolean_canalization.find_wildcards(binstate1, binstate2)
Compare two binary states and replace any differing bits by a wildcard. :param binstate1: the two binary states to be compared :param binstate2: the two binary states to be compared
- Returns:
a list of comparisons
- Return type:
c (list, bool)
- cana.canalization.cboolean_canalization.input_wildcard_coverage(pi_coverage)
Computes the binary states coverage by Prime Implicant schematas.
- Parameters:
pi_coverage (dict) – a dict mapping binary states to their prime implicants. This is returned by return_pi_coverage.
- Returns:
a dictionary of coverage where keys are inputs and values are lists of wither a WildCard covers that input.
- Return type:
input_wildcard_coverage (dict)
- cana.canalization.cboolean_canalization.make_density_groups(input_binstates)
- cana.canalization.cboolean_canalization.replace_wildcard(binstate, idx)
Return the binary state with a wildcard at the idx position.
- cana.canalization.cboolean_canalization.return_pi_coverage(prime_implicants)
Computes the binary states coverage by Prime Implicant schematas.
- Parameters:
prime_implicants (set) – a set of prime implicants. This is returned by find_implicants_qm.
- Returns:
a dictionary of coverage where keys are input states and values are lists of the Prime Implicants covering that input.
- Return type:
pi_coverage (dict)