Skip to content

Commit

Permalink
Remove deprecated quantification overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed Jun 26, 2023
1 parent 5abfe74 commit 3c07d8a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 172 deletions.
28 changes: 0 additions & 28 deletions src/adiar/bdd/quantify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ namespace adiar
return internal::quantify<bdd_quantify_policy>(f, var, or_op);
}

// LCOV_EXCL_START
// TODO (deprecated): remove
__bdd bdd_exists(const bdd &f, const shared_file<bdd::label_t> &vars)
{
return internal::quantify<bdd_quantify_policy>(f, vars, or_op);
}

// TODO (deprecated): remove
__bdd bdd_exists(bdd &&f, const shared_file<bdd::label_t> &vars)
{
return internal::quantify<bdd_quantify_policy>(std::forward<bdd>(f), vars, or_op);
}
// LCOV_EXCL_STOP

__bdd bdd_exists(const bdd &f, const std::function<bool(bdd::label_t)> &vars)
{
return internal::quantify<bdd_quantify_policy>(f, vars, or_op);
Expand All @@ -109,20 +95,6 @@ namespace adiar
return internal::quantify<bdd_quantify_policy>(f, var, and_op);
}

// LCOV_EXCL_START
// TODO (deprecated): remove
__bdd bdd_forall(const bdd &f, const shared_file<bdd::label_t> &vars)
{
return internal::quantify<bdd_quantify_policy>(f, vars, and_op);
}

// TODO (deprecated): remove
__bdd bdd_forall(bdd &&f, const shared_file<bdd::label_t> &vars)
{
return internal::quantify<bdd_quantify_policy>(std::forward<bdd>(f), vars, and_op);
}
// LCOV_EXCL_STOP

__bdd bdd_forall(const bdd &f, const std::function<bool(bdd::label_t)> &vars)
{
return internal::quantify<bdd_quantify_policy>(f, vars, and_op);
Expand Down
60 changes: 0 additions & 60 deletions src/adiar/deprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,6 @@ namespace adiar
{
// LCOV_EXCL_START

//////////////////////////////////////////////////////////////////////////////
/// \brief Existential quantification of multiple variables.
///
/// \details Repeatedly calls `bdd_exists` for the given variables
/// while optimising garbage collecting intermediate results.
///
/// \param f BDD to be quantified.
///
/// \param vars Variables to quantify in f (in order of their quantification)
///
/// \returns \f$ \exists x_{i_1}, \dots, x_{i_k} : f \f$
//////////////////////////////////////////////////////////////////////////////
[[deprecated("Replaced with using 'predicates', 'generators' etc. for multiple variables")]]
__bdd bdd_exists(const bdd &f, const shared_file<bdd::label_t> &vars);

/// \cond
[[deprecated("Replaced with using 'predicates', 'generators' etc. for multiple variables")]]
__bdd bdd_exists(bdd &&f, const shared_file<bdd::label_t> &vars);
/// \endcond


//////////////////////////////////////////////////////////////////////////////
/// \brief Forall quantification of multiple variables.
///
/// \details Repeatedly calls `bdd_forall` for the given variables
/// while optimising garbage collecting intermediate results.
///
/// \param f BDD to be quantified.
///
/// \param vars Variables to quantify in f (in order of their quantification)
///
/// \returns \f$ \forall x_{i_1}, \dots, x_{i_k} : f \f$
//////////////////////////////////////////////////////////////////////////////
[[deprecated("Replaced with using 'predicates', 'generators' etc. for multiple variables")]]
__bdd bdd_forall(const bdd &f, const shared_file<bdd::label_t> &vars);

/// \cond
[[deprecated("Replaced with using 'predicates', 'generators' etc. for multiple variables")]]
__bdd bdd_forall(bdd &&f, const shared_file<bdd::label_t> &vars);
/// \endcond

//////////////////////////////////////////////////////////////////////////////
/// \brief Project family of sets onto a domain, i.e. remove from every
/// set all variables not mentioned.
///
/// \param A Family of sets to project
///
/// \param dom The domain to project onto (in ascending order)
///
/// \returns
/// \f$ \prod_{\mathit{dom}}(A) = \{ a \setminus \mathit{dom}^c \mid a \in A \} \f$
//////////////////////////////////////////////////////////////////////////////
[[deprecated("Replaced with using 'predicates' for multiple variables")]]
__zdd zdd_project(const zdd &A, const shared_file<zdd::label_t> &dom);

/// \cond
[[deprecated("Replaced with using 'predicates' for multiple variables")]]
__zdd zdd_project(zdd &&A, const shared_file<zdd::label_t> &dom);
/// \endcond

// LCOV_EXCL_STOP
}

Expand Down
30 changes: 0 additions & 30 deletions src/adiar/internal/algorithms/quantify.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,36 +508,6 @@ namespace adiar::internal
}
};

//////////////////////////////////////////////////////////////////////////////
// Multi-variable (file)
// TODO (deprecated): Remove

// LCOV_EXCL_START
template<typename quantify_policy>
typename quantify_policy::unreduced_t
quantify(typename quantify_policy::reduced_t dd,
const shared_file<typename quantify_policy::label_t> labels,
const bool_op &op)
{
const size_t labels_size = labels->size();
if (labels_size == 0) { return dd; }

file_stream<typename quantify_policy::label_t> label_stream(labels);

for (size_t label_idx = 0u; label_idx < labels_size - 1; label_idx++) {
if (is_terminal(dd)) { return dd; }

adiar_debug(label_stream.can_pull(), "Should not exceed 'labels' size");
dd = quantify<quantify_policy>(dd, label_stream.pull(), op);
}

adiar_debug(label_stream.can_pull(), "Should not exceed 'labels' size");
const typename quantify_policy::label_t label = label_stream.pull();
adiar_debug(!label_stream.can_pull(), "Should pull final label");
return quantify<quantify_policy>(dd, label, op);
}
// LCOV_EXCL_STOP

//////////////////////////////////////////////////////////////////////////////
// Multi-variable (predicate)
template<typename quantify_policy>
Expand Down
54 changes: 0 additions & 54 deletions src/adiar/zdd/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,60 +58,6 @@ namespace adiar
static constexpr bool quantify_onset = false;
};

//////////////////////////////////////////////////////////////////////////////
// LCOV_EXCL_START
// TODO (deprecated): remove

shared_file<zdd::label_t>
extract_non_dom(const zdd &dd, const shared_file<zdd::label_t> &dom)
{
shared_file<zdd::label_t> dom_inv;
internal::label_writer diw(dom_inv);

internal::file_stream<zdd::label_t> ls(dom);
internal::level_info_stream<> dd_meta(dd);

while (dd_meta.can_pull()) {
zdd::label_t dd_label = dd_meta.pull().label();
bool found_dd_label = false;

while (ls.can_pull()) {
zdd::label_t dom_label = ls.pull();

if (dd_label == dom_label) {
found_dd_label = true;
break;
}
}
if (!found_dd_label) { diw << dd_label; }
ls.reset();
}

return dom_inv;
}

inline __zdd zdd_project_multi(zdd &&A, const shared_file<zdd::label_t> &dom)
{
if (is_terminal(A)) { return A; }
if (dom->size() == 0) { return zdd_null(); }

const shared_file<zdd::label_t> dom_inv = extract_non_dom(A, dom);
if (dom_inv->size() == zdd_varcount(A)) { return zdd_null(); }

return internal::quantify<zdd_project_policy>(std::forward<zdd>(A), dom_inv, or_op);
}

__zdd zdd_project(const zdd &A, const shared_file<zdd::label_t> &dom)
{
return zdd_project_multi(zdd(A), dom);
}

__zdd zdd_project(zdd &&A, const shared_file<zdd::label_t> &dom)
{
return zdd_project_multi(std::forward<zdd>(A), dom);
}

// LCOV_EXCL_STOP
//////////////////////////////////////////////////////////////////////////////
__zdd zdd_project(const zdd &A, const std::function<bool(zdd::label_t)> &dom)
{
Expand Down

0 comments on commit 3c07d8a

Please sign in to comment.