Namespaces | |
| namespace | detail |
Classes | |
| struct | dynamic_truth_table |
| struct | static_truth_table |
| struct | static_truth_table< NumVars, false > |
| struct | static_truth_table< NumVars, true > |
Functions | |
| template<typename TT, typename Fn> | |
| TT | unary_operation (const TT &tt, Fn &&op) |
| Perform bitwise unary operation on truth table. | |
| template<typename TT, typename Fn> | |
| TT | binary_operation (const TT &first, const TT &second, Fn &&op) |
| Perform bitwise binary operation on two truth tables. | |
| template<typename TT, typename Fn> | |
| bool | binary_predicate (const TT &first, const TT &second, Fn &&op) |
| Computes a predicate based on two truth tables. | |
| template<typename TT, typename Fn> | |
| void | assign_operation (TT &tt, Fn &&op) |
| Assign computed values to bits. | |
| template<typename TT, typename Fn> | |
| void | for_each_block (const TT &tt, Fn &&op) |
| Iterates through each block of a truth table. | |
| template<typename TT, typename Fn> | |
| void | for_each_block_reversed (const TT &tt, Fn &&op) |
| Iterates through each block of a truth table in reverse order. | |
| template<typename TT> | |
| TT | create (unsigned num_vars) |
| Creates truth table with number of variables. | |
| template<typename TT> | |
| void | create_nth_var (TT &tt, uint8_t var_index, bool complement=false) |
| Constructs projections (single-variable functions) | |
| template<typename TT> | |
| TT | unary_not_if (const TT &tt, bool cond) |
| template<typename TT> | |
| TT | unary_not (const TT &tt) |
| Inverts all bits in a truth table. | |
| template<typename TT> | |
| TT | binary_and (const TT &first, const TT &second) |
| Bitwise AND of two truth tables. | |
| template<typename TT> | |
| TT | binary_or (const TT &first, const TT &second) |
| Bitwise OR of two truth tables. | |
| template<typename TT> | |
| void | swap_inplace (TT &tt, uint8_t var_index1, uint8_t var_index2) |
| Swaps two variables in a truth table. | |
| template<uint32_t NumVars> | |
| void | swap_inplace (static_truth_table< NumVars, true > &tt, uint8_t var_index1, uint8_t var_index2) |
| template<typename TT, typename TTFrom> | |
| void | extend_to_inplace (TT &tt, const TTFrom &from) |
| Extends smaller truth table to larger one. | |
| template<uint32_t NumVars, typename TTFrom> | |
| static_truth_table< NumVars > | extend_to (const TTFrom &from) |
| Extends smaller truth table to larger static one. | |
| template<typename TT> | |
| bool | has_var (const TT &tt, uint8_t var_index) |
| Checks whether truth table depends on given variable index. | |
| template<typename TT> | |
| bool | has_var (const TT &tt, const TT &care, uint8_t var_index) |
| Checks whether truth table depends on given variable index. | |
| template<typename TT, typename TTFrom> | |
| void | shrink_to_inplace (TT &tt, const TTFrom &from) |
| Shrinks larger truth table to smaller one. | |
| template<typename TTFrom> | |
| dynamic_truth_table | shrink_to (const TTFrom &from, unsigned num_vars) |
| Shrinks larger truth table to smaller dynamic one. | |
| template<typename TT> | |
| void | print_hex (const TT &tt, std::ostream &os=std::cout) |
| Prints truth table in hexadecimal representation. | |
| dynamic_truth_table | operator~ (const dynamic_truth_table &tt) |
| Operator for unary_not. | |
| template<uint32_t NumVars> | |
| static_truth_table< NumVars > | operator~ (const static_truth_table< NumVars > &tt) |
| Operator for unary_not. | |
| dynamic_truth_table | operator& (const dynamic_truth_table &first, const dynamic_truth_table &second) |
| Operator for binary_and. | |
| template<uint32_t NumVars> | |
| static_truth_table< NumVars > | operator& (const static_truth_table< NumVars > &first, const static_truth_table< NumVars > &second) |
| Operator for binary_and. | |
| void | operator&= (dynamic_truth_table &first, const dynamic_truth_table &second) |
| Operator for binary_and and assign. | |
| template<uint32_t NumVars> | |
| void | operator&= (static_truth_table< NumVars > &first, const static_truth_table< NumVars > &second) |
| Operator for binary_and and assign. | |
| dynamic_truth_table | operator| (const dynamic_truth_table &first, const dynamic_truth_table &second) |
| Operator for binary_or. | |
| template<uint32_t NumVars> | |
| static_truth_table< NumVars > | operator| (const static_truth_table< NumVars > &first, const static_truth_table< NumVars > &second) |
| Operator for binary_or. | |
| void | operator|= (dynamic_truth_table &first, const dynamic_truth_table &second) |
| Operator for binary_or and assign. | |
| template<uint32_t NumVars> | |
| void | operator|= (static_truth_table< NumVars, true > &first, const static_truth_table< NumVars, true > &second) |
| Operator for binary_or and assign. | |
| template<uint32_t NumVars> | |
| void | operator|= (static_truth_table< NumVars, false > &first, const static_truth_table< NumVars, false > &second) |
| Operator for binary_or and assign. | |
| void kitty::assign_operation | ( | TT & | tt, |
| Fn && | op ) |
Assign computed values to bits.
The functor op computes bits which are assigned to the bits of the truth table.
| tt | Truth table |
| op | Unary operation that takes no input and returns a word (uint64_t) |
Definition at line 85 of file kitty_algorithm.hpp.
Bitwise AND of two truth tables.
Definition at line 48 of file kitty_operations.hpp.


| TT kitty::binary_operation | ( | const TT & | first, |
| const TT & | second, | ||
| Fn && | op ) |
Perform bitwise binary operation on two truth tables.
The dimensions of first and second must match. This is ensured at compile-time for static truth tables, but at run-time for dynamic truth tables.
| first | First truth table |
| second | Second truth table |
| op | Binary operation that takes as input two words (uint64_t) and returns a word |
Definition at line 46 of file kitty_algorithm.hpp.

Bitwise OR of two truth tables.
Definition at line 55 of file kitty_operations.hpp.


| bool kitty::binary_predicate | ( | const TT & | first, |
| const TT & | second, | ||
| Fn && | op ) |
Computes a predicate based on two truth tables.
The dimensions of first and second must match. This is ensured at compile-time for static truth tables, but at run-time for dynamic truth tables.
| first | First truth table |
| second | Second truth table |
| op | Binary operation that takes as input two words (uint64_t) and returns a Boolean |
Definition at line 69 of file kitty_algorithm.hpp.
|
inline |
Creates truth table with number of variables.
If some truth table instance is given, one can create a truth table with the same type by calling the construct() method on it. This function helps if only the number of variables is known and the base type and uniforms the creation of static and dynamic truth tables. Note, however, that for static truth tables num_vars must be consistent to the number of variables in the truth table type.
| num_vars | Number of variables |
Definition at line 32 of file kitty_constructors.hpp.

| void kitty::create_nth_var | ( | TT & | tt, |
| uint8_t | var_index, | ||
| bool | complement = false ) |
Constructs projections (single-variable functions)
| tt | Truth table |
| var_index | Index of the variable, must be smaller than the truth table's number of variables |
| complement | If true, realize inverse projection |
Definition at line 55 of file kitty_constructors.hpp.

|
inline |
Extends smaller truth table to larger static one.
This is an out-of-place version of extend_to_inplace that has the truth table as a return value. It only works for creating static truth tables. The template parameter NumVars must be equal or larger to the number of variables in from.
| from | Smaller truth table to copy from |
Definition at line 198 of file kitty_operations.hpp.

| void kitty::extend_to_inplace | ( | TT & | tt, |
| const TTFrom & | from ) |
Extends smaller truth table to larger one.
The most significant variables will not be in the functional support of the resulting truth table, but the method is helpful to align a truth table when being used with another one.
| tt | Larger truth table to create |
| from | Smaller truth table to copy from |
Definition at line 163 of file kitty_operations.hpp.

| void kitty::for_each_block | ( | const TT & | tt, |
| Fn && | op ) |
Iterates through each block of a truth table.
The functor op is called for every block of the truth table.
| tt | Truth table |
| op | Unary operation that takes as input a word (uint64_t) and returns void |
Definition at line 99 of file kitty_algorithm.hpp.
| void kitty::for_each_block_reversed | ( | const TT & | tt, |
| Fn && | op ) |
Iterates through each block of a truth table in reverse order.
The functor op is called for every block of the truth table in reverse order.
| tt | Truth table |
| op | Unary operation that takes as input a word (uint64_t) and returns void |
Definition at line 114 of file kitty_algorithm.hpp.

Checks whether truth table depends on given variable index.
| tt | Truth table |
| care | Care set |
| var_index | Variable index |
Definition at line 244 of file kitty_operations.hpp.
Checks whether truth table depends on given variable index.
| tt | Truth table |
| var_index | Variable index |
Definition at line 211 of file kitty_operations.hpp.
|
inline |
Operator for binary_and.
Definition at line 34 of file kitty_operators.hpp.

|
inline |
Operator for binary_and.
Definition at line 41 of file kitty_operators.hpp.

|
inline |
Operator for binary_and and assign.
Definition at line 47 of file kitty_operators.hpp.

|
inline |
Operator for binary_and and assign.
Definition at line 54 of file kitty_operators.hpp.

|
inline |
Operator for binary_or.
Definition at line 60 of file kitty_operators.hpp.

|
inline |
Operator for binary_or.
Definition at line 67 of file kitty_operators.hpp.

|
inline |
Operator for binary_or and assign.
Definition at line 73 of file kitty_operators.hpp.

|
inline |
Operator for binary_or and assign.
Definition at line 90 of file kitty_operators.hpp.
|
inline |
Operator for binary_or and assign.
Definition at line 80 of file kitty_operators.hpp.
|
inline |
Operator for unary_not.
Definition at line 21 of file kitty_operators.hpp.

|
inline |
Operator for unary_not.
Definition at line 28 of file kitty_operators.hpp.

| void kitty::print_hex | ( | const TT & | tt, |
| std::ostream & | os = std::cout ) |
Prints truth table in hexadecimal representation.
The most-significant bit will be the first character of the string.
| tt | Truth table |
| os | Output stream |
Definition at line 327 of file kitty_operations.hpp.

|
inline |
Shrinks larger truth table to smaller dynamic one.
This is an out-of-place version of shrink_to that has the truth table as a return value. It only works for creating dynamic tables. The parameter num_vars must be equal or smaller to the number of variables in from.
| from | Smaller truth table to copy from |
Definition at line 312 of file kitty_operations.hpp.

| void kitty::shrink_to_inplace | ( | TT & | tt, |
| const TTFrom & | from ) |
Shrinks larger truth table to smaller one.
The function expects that the most significant bits, which are cut off, are not in the functional support of the original function. Only then it is ensured that the resulting function is equivalent.
| tt | Smaller truth table to create |
| from | Larger truth table to copy from |
Definition at line 291 of file kitty_operations.hpp.

|
inline |
Definition at line 136 of file kitty_operations.hpp.
Swaps two variables in a truth table.
The function swaps variable var_index1 with var_index2. The function will change tt in-place. If tt should not be changed, one can use swap instead.
| tt | Truth table |
| var_index1 | First variable |
| var_index2 | Second variable |
Definition at line 71 of file kitty_operations.hpp.
|
inline |
Inverts all bits in a truth table.
Definition at line 39 of file kitty_operations.hpp.


Inverts all bits in a truth table, based on a condition
Definition at line 23 of file kitty_operations.hpp.

| TT kitty::unary_operation | ( | const TT & | tt, |
| Fn && | op ) |
Perform bitwise unary operation on truth table.
| tt | Truth table |
| op | Unary operation that takes as input a word (uint64_t) and returns a word |
Definition at line 25 of file kitty_algorithm.hpp.
