26#include <adiar/bdd/bdd.h>
27#include <adiar/bool_op.h>
28#include <adiar/exec_policy.h>
29#include <adiar/functional.h>
30#include <adiar/types.h>
31#include <adiar/zdd/zdd.h>
196 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
254 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
315 template <
typename ForwardIt>
818 template <
typename ForwardIt>
829 template <
typename ForwardIt>
831 bdd_restrict(
const exec_policy& ep,
const bdd& f, ForwardIt begin, ForwardIt end)
1068 template <
typename ForwardIt>
1084 template <
typename ForwardIt>
1086 bdd_exists(bdd&& f, ForwardIt begin, ForwardIt end)
1097 template <
typename ForwardIt>
1099 bdd_exists(__bdd&& f, ForwardIt begin, ForwardIt end)
1107 template <
typename ForwardIt>
1109 bdd_exists(
const exec_policy& ep,
const bdd& f, ForwardIt begin, ForwardIt end)
1121 template <
typename ForwardIt>
1123 bdd_exists(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1134 template <
typename ForwardIt>
1136 bdd_exists(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1330 template <
typename ForwardIt>
1346 template <
typename ForwardIt>
1348 bdd_forall(bdd&& f, ForwardIt begin, ForwardIt end)
1359 template <
typename ForwardIt>
1361 bdd_forall(__bdd&& f, ForwardIt begin, ForwardIt end)
1369 template <
typename ForwardIt>
1371 bdd_forall(
const exec_policy& ep,
const bdd& f, ForwardIt begin, ForwardIt end)
1383 template <
typename ForwardIt>
1385 bdd_forall(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1396 template <
typename ForwardIt>
1398 bdd_forall(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1526 const bdd& relation,
1555 const bdd& relation,
1566 const bdd& relation,
1601 const bdd& relation,
1658 const bdd& relation,
1669 const bdd& relation,
1704 const bdd& relation,
2028 template <
typename OutputIt,
2029 typename = enable_if<!is_convertible<OutputIt, consumer<bdd::label_type>>>>
2108 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2157 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2215 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2264 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2383 template <
typename ForwardIt>
2447 template <
typename ForwardIt>
2459 template <
typename ForwardIt>
A (possibly) unreduced Binary Decision Diagram.
Definition bdd.h:22
A reduced Binary Decision Diagram.
Definition bdd.h:58
Settings to dictate the execution of Adiar's algorithms.
Definition exec_policy.h:35
static constexpr label_type max_label
The maximal possible value for a unique identifier's label.
Definition dd.h:302
node_type::label_type label_type
Type of this node's variable label.
Definition dd.h:292
Reduced Ordered Zero-suppressed Decision Diagram.
Definition zdd.h:67
__bdd operator|(const bdd &lhs, const bdd &rhs)
__bdd bdd_diff(const bdd &f, const bdd &g)
Logical 'difference' operator.
__bdd bdd_nor(const bdd &f, const bdd &g)
Logical 'nor' operator.
bdd operator+(const bdd &f)
__bdd operator&(const bdd &lhs, const bdd &rhs)
__bdd bdd_invimp(const bdd &f, const bdd &g)
Logical 'inverse implication' operator.
__bdd bdd_apply(const bdd &f, const bdd &g, const predicate< bool, bool > &op)
Apply a binary operator between two BDDs.
__bdd bdd_xor(const bdd &f, const bdd &g)
Logical 'xor' operator.
__bdd operator*(const bdd &lhs, const bdd &rhs)
__bdd bdd_low(const bdd &f)
Restrict the root to false, i.e. follow its low edge.
__bdd bdd_ite(const bdd &f, const bdd &g, const bdd &h)
If-Then-Else operator.
bdd bdd_not(const bdd &f)
Negation of a BDD.
__bdd bdd_imp(const bdd &f, const bdd &g)
Logical 'implication' operator.
__bdd bdd_high(const bdd &f)
Restrict the root to true, i.e. follow its high edge.
__bdd bdd_xnor(const bdd &f, const bdd &g)
Logical 'xnor' operator.
__bdd bdd_equiv(const bdd &f, const bdd &g)
Logical 'equivalence' operator.
bdd operator~(const bdd &f)
__bdd bdd_exists(const bdd &f, bdd::label_type var)
Existential quantification of a single variable.
__bdd operator^(const bdd &lhs, const bdd &rhs)
__bdd bdd_less(const bdd &f, const bdd &g)
Logical 'less than' operator.
__bdd bdd_nand(const bdd &f, const bdd &g)
Logical 'nand' operator.
bdd operator-(const bdd &f)
__bdd bdd_forall(const bdd &f, bdd::label_type var)
Forall quantification of a single variable.
__bdd bdd_restrict(const bdd &f, bdd::label_type var, bool val)
Restrict a single variable to a constant value.
bdd bdd_nithvar(bdd::label_type var)
The BDD representing the negation of the i'th variable.
bdd bdd_terminal(bool value)
The BDD representing the given constant value.
bdd bdd_const(bool value)
The BDD representing the given constant value.
bdd bdd_ithvar(bdd::label_type var)
The BDD representing the i'th variable.
bdd bdd_true()
The BDD representing the constant true.
bdd bdd_cube(const generator< int > &vars)
The BDD representing the cube of all the given variables.
bdd bdd_top()
The top of the powerset lattice.
Definition bdd.h:112
bdd bdd_bot()
The bottom of the powerset lattice.
Definition bdd.h:91
bdd bdd_or(const generator< int > &vars)
The BDD representing the logical 'or' of all the given variables, i.e. a clause of variables.
bdd bdd_and(const generator< int > &vars)
The BDD representing the logical 'and' of all the given variables, i.e. a term of variables.
bdd bdd_false()
The BDD representing the constant false.
__bdd bdd_from(const zdd &A, const generator< bdd::label_type > &dom)
Obtains the BDD that represents the same function/set as the given ZDD within the given domain.
size_t bdd_nodecount(const bdd &f)
The number of (internal) nodes used to represent the function.
uint64_t bdd_satcount(const bdd &f, bdd::label_type varcount)
Count the number of assignments x that make f(x) true.
bdd::label_type bdd_varcount(const bdd &f)
The number of variables that influence the outcome of the Boolean function, i.e. the number of levels...
uint64_t bdd_pathcount(const bdd &f)
Count all unique (but not necessarily disjoint) paths to the true terminal.
void bdd_printdot(const bdd &f, std::ostream &out=std::cout, bool include_id=false)
Output a DOT drawing of a BDD to the given output stream.
bool bdd_iscanonical(const bdd &f)
Check whether a BDD is canonical.
bool bdd_unequal(const bdd &f, const bdd &g)
Whether the two BDDs represent different functions.
bool bdd_isithvar(const bdd &f)
Whether a BDD is the function of a single positive variable.
bool bdd_istrue(const bdd &f)
Whether a BDD is the constant true.
bool bdd_isvar(const bdd &f)
Whether a BDD is a function dependent on a single variable, i.e. is a literal.
bool bdd_isfalse(const bdd &f)
Whether a BDD is the constant false.
bool operator!=(const bdd &f, const bdd &g)
bool bdd_iscube(const bdd &f)
Whether a BDD represents a cube.
bool bdd_isconst(const bdd &f)
Whether a BDD is a constant.
bool operator==(const bdd &f, const bdd &g)
bool bdd_equal(const bdd &f, const bdd &g)
Whether the two BDDs represent the same function.
bool bdd_isterminal(const bdd &f)
Whether a BDD is a constant (terminal).
bool bdd_isnithvar(const bdd &f)
Whether a BDD is the function of a single negative variable.
bdd bdd_relnext(const bdd &states, const bdd &relation, const function< optional< bdd::label_type >(bdd::label_type)> &m, replace_type m_type=replace_type::Auto)
Forwards step with the Relational Product, including relabelling.
bdd bdd_relprod(const bdd &states, const bdd &relation, const predicate< bdd::label_type > &pred)
Relational Product of states and a relation.
bdd bdd_relprev(const bdd &states, const bdd &relation, const function< optional< bdd::label_type >(bdd::label_type)> &m, replace_type m_type=replace_type::Auto)
Backwards step with the Relational Product, including relabelling.
__bdd bdd_replace(const bdd &f, const function< bdd::label_type(bdd::label_type)> &m, replace_type m_type=replace_type::Auto)
Replace variables in f according to the mapping in m.
function< optional< RetType >()> generator
Generator function that produces a new value of RetType for each call.
Definition functional.h:170
function< double(VarType)> cost
Cost function that assigns a cost to each variable.
Definition functional.h:156
function< void(Arg)> consumer
Consumer function of value of type Arg.
Definition functional.h:64
generator< typename std::remove_reference_t< ForwardIt >::value_type > make_generator(ForwardIt &&begin, ForwardIt &&end)
Wrap a begin and end iterator pair into a generator function.
Definition functional.h:177
std::function< TypeSignature > function
General-purpose polymorphic function wrapper.
Definition functional.h:41
function< bool(Args...)> predicate
Predicate function given value(s) of type(s) Args.
Definition functional.h:51
consumer< ValueType > make_consumer(OutputIt &&iter)
Wrap an iterator into a consumer function.
Definition functional.h:71
Core types.
Definition adiar.h:40
std::pair< T1, T2 > pair
A pair of values.
Definition types.h:75
replace_type
Possible guarantees of a variable permutation/remapping m of type int -> int.
Definition types.h:32
std::optional< T > optional
An optional value, i.e. a possibly existent value.
Definition types.h:103