19#include <adiar/bdd/bdd.h>
20#include <adiar/bool_op.h>
21#include <adiar/exec_policy.h>
22#include <adiar/functional.h>
23#include <adiar/types.h>
24#include <adiar/zdd/zdd.h>
186 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
244 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
305 template <
typename ForwardIt>
769 template <
typename ForwardIt>
779 template <
typename ForwardIt>
1025 template <
typename ForwardIt>
1041 template <
typename ForwardIt>
1043 bdd_exists(bdd&& f, ForwardIt begin, ForwardIt end)
1054 template <
typename ForwardIt>
1056 bdd_exists(__bdd&& f, ForwardIt begin, ForwardIt end)
1066 template <
typename ForwardIt>
1082 template <
typename ForwardIt>
1084 bdd_exists(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1095 template <
typename ForwardIt>
1097 bdd_exists(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1303 template <
typename ForwardIt>
1319 template <
typename ForwardIt>
1321 bdd_forall(bdd&& f, ForwardIt begin, ForwardIt end)
1332 template <
typename ForwardIt>
1334 bdd_forall(__bdd&& f, ForwardIt begin, ForwardIt end)
1344 template <
typename ForwardIt>
1360 template <
typename ForwardIt>
1362 bdd_forall(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1373 template <
typename ForwardIt>
1375 bdd_forall(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1527 const bdd& relation,
1551 const bdd& relation,
1560 const bdd& relation,
1587 const bdd& relation,
1597 const bdd& relation,
1627 const bdd& relation,
1677 const bdd& relation,
1686 const bdd& relation,
1714 const bdd& relation,
1724 const bdd& relation,
1754 const bdd& relation,
2035 template <
typename OutputIt,
2036 typename = enable_if<!is_convertible<OutputIt, consumer<bdd::label_type>>>>
2112 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2158 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2210 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2256 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2371 template <
typename ForwardIt>
2425 template <
typename ForwardIt>
2436 template <
typename ForwardIt>
A (possibly) unreduced Binary Decision Diagram.
Definition bdd.h:22
A reduced Binary Decision Diagram.
Definition bdd.h:53
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:292
node_type::label_type label_type
Type of this node's variable label.
Definition dd.h:282
Reduced Ordered Zero-suppressed Decision Diagram.
Definition zdd.h:62
__bdd operator|(const bdd &lhs, const bdd &rhs)
__bdd bdd_diff(const bdd &f, const bdd &g)
Logical 'difference' operator.
size_t bdd_nodecount(const bdd &f)
The number of (internal) nodes used to represent the function.
__bdd bdd_nor(const bdd &f, const bdd &g)
Logical 'nor' operator.
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_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.
bdd bdd_const(bool value)
The BDD representing the given constant value.
uint64_t bdd_satcount(const bdd &f, bdd::label_type varcount)
Count the number of assignments x that make f(x) true.
bdd bdd_relprod(const bdd &states, const bdd &relation, const predicate< bdd::label_type > &pred)
Relational Product of states and a relation.
bool bdd_iscanonical(const bdd &f)
Check whether a BDD is canonical.
bdd operator+(const bdd &f)
pair< bdd, double > bdd_optmin(const bdd &f, const cost< bdd::label_type > &c)
Obtain the satisfying assignment that is minimal for the given linear cost function over the global d...
__bdd operator&(const bdd &lhs, const bdd &rhs)
__bdd bdd_invimp(const bdd &f, const bdd &g)
Logical 'inverse implication' operator.
bool bdd_unequal(const bdd &f, const bdd &g)
Whether the two BDDs represent different functions.
bdd bdd_ithvar(bdd::label_type var)
The BDD representing the i'th variable.
bdd bdd_relnext(const bdd &states, const bdd &relation, const function< optional< bdd::label_type >(bdd::label_type)> &m)
Forwards step with the Relational Product, including relabelling.
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_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.
bool bdd_isithvar(const bdd &f)
Whether a BDD is the function of a single positive variable.
__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_top()
The top of the powerset lattice.
Definition bdd.h:102
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.
bdd bdd_not(const bdd &f)
Negation of a BDD.
bool bdd_istrue(const bdd &f)
Whether a BDD is the constant true.
__bdd bdd_imp(const bdd &f, const bdd &g)
Logical 'implication' operator.
bdd bdd_satmin(const bdd &f)
The lexicographically smallest cube x such that f(x) is true.
bool bdd_isvar(const bdd &f)
Whether a BDD is a function dependent on a single variable, i.e. is a literal.
bdd bdd_relprev(const bdd &states, const bdd &relation, const function< optional< bdd::label_type >(bdd::label_type)> &m)
Backwards step with the Relational Product, including relabelling.
bool bdd_isfalse(const bdd &f)
Whether a BDD is the constant false.
__bdd bdd_high(const bdd &f)
Restrict the root to true, i.e. follow its high edge.
bdd bdd_satmax(const bdd &f)
The lexicographically largest cube x such that f(x) is 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...
__bdd bdd_xnor(const bdd &f, const bdd &g)
Logical 'xnor' operator.
bool operator!=(const bdd &f, const bdd &g)
__bdd bdd_equiv(const bdd &f, const bdd &g)
Logical 'equivalence' operator.
bdd bdd_bot()
The bottom of the powerset lattice.
Definition bdd.h:81
bool bdd_iscube(const bdd &f)
Whether a BDD represents a cube.
bdd::label_type bdd_maxvar(const bdd &f)
Get the maximal occurring variable in the function's support.
bdd operator~(const bdd &f)
bool bdd_isconst(const bdd &f)
Whether a BDD is a constant.
void bdd_support(const bdd &f, const consumer< bdd::label_type > &cb)
Get (in ascending order) all of the variable labels that occur in the BDD.
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_exists(const bdd &f, bdd::label_type var)
Existential quantification of a single variable.
bool operator==(const bdd &f, const bdd &g)
__bdd operator^(const bdd &lhs, const bdd &rhs)
bool bdd_eval(const bdd &f, const predicate< bdd::label_type > &xs)
Evaluate a BDD according to an assignment to its variables.
bool bdd_equal(const bdd &f, const bdd &g)
Whether the two BDDs represent the same function.
__bdd bdd_less(const bdd &f, const bdd &g)
Logical 'less than' operator.
uint64_t bdd_pathcount(const bdd &f)
Count all unique (but not necessarily disjoint) paths to the true terminal.
bdd bdd_replace(const bdd &f, const function< bdd::label_type(bdd::label_type)> &m)
Replace variables in f according to the mapping in m.
__bdd bdd_nand(const bdd &f, const bdd &g)
Logical 'nand' operator.
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_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 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::label_type bdd_minvar(const bdd &f)
Get the minimal occurring variable in the function's support.
bdd::label_type bdd_topvar(const bdd &f)
Get the root's variable label.
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:53
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:81