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>
184 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
242 template <
typename ForwardIt,
typename = enable_if<!is_convertible<ForwardIt, bdd>>>
303 template <
typename ForwardIt>
765 template <
typename ForwardIt>
775 template <
typename ForwardIt>
1019 template <
typename ForwardIt>
1035 template <
typename ForwardIt>
1037 bdd_exists(bdd&& f, ForwardIt begin, ForwardIt end)
1048 template <
typename ForwardIt>
1050 bdd_exists(__bdd&& f, ForwardIt begin, ForwardIt end)
1060 template <
typename ForwardIt>
1076 template <
typename ForwardIt>
1078 bdd_exists(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1089 template <
typename ForwardIt>
1091 bdd_exists(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1297 template <
typename ForwardIt>
1313 template <
typename ForwardIt>
1315 bdd_forall(bdd&& f, ForwardIt begin, ForwardIt end)
1326 template <
typename ForwardIt>
1328 bdd_forall(__bdd&& f, ForwardIt begin, ForwardIt end)
1338 template <
typename ForwardIt>
1354 template <
typename ForwardIt>
1356 bdd_forall(
const exec_policy& ep, bdd&& f, ForwardIt begin, ForwardIt end)
1367 template <
typename ForwardIt>
1369 bdd_forall(
const exec_policy& ep, __bdd&& f, ForwardIt begin, ForwardIt end)
1397 const bdd& relation,
1415 const bdd& relation,
1424 const bdd& relation,
1445 const bdd& relation,
1455 const bdd& relation,
1481 const bdd& relation,
1521 const bdd& relation,
1530 const bdd& relation,
1552 const bdd& relation,
1562 const bdd& relation,
1588 const bdd& relation,
1958 template <
typename OutputIt,
1959 typename = enable_if<!is_convertible<OutputIt, consumer<bdd::label_type>>>>
2034 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2080 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2132 template <
typename ForwardIt,
typename = enable_if<is_const<
typename ForwardIt::reference>>>
2178 typename = enable_if<!is_convertible<OutputIt, consumer<pair<bdd::label_type, bool>>>
2293 template <
typename ForwardIt>
2347 template <
typename ForwardIt>
2358 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:100
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.
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 f, i.e. the number of levels in the BDD.
__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:79
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:169
function< double(VarType)> cost
Cost function that assigns a cost to each variable.
Definition functional.h:155
function< void(Arg)> consumer
Consumer function of value(s) of type(s) Args.
Definition functional.h:60
generator< typename ForwardIt::value_type > make_generator(ForwardIt &begin, ForwardIt &end)
Wrap a begin and end iterator pair into a generator function.
Definition functional.h:176
std::function< TypeSignature > function
General-purpose polymorphic function wrapper.
Definition functional.h:38
function< bool(Args...)> predicate
Predicate function given value(s) of type(s) Args.
Definition functional.h:48
consumer< ValueType > make_consumer(OutputIt &iter)
Wrap an iterator into a consumer function.
Definition functional.h:67
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