adiar icon indicating copy to clipboard operation
adiar copied to clipboard

Generalise API to use Assignment Functions / Generators

Open SSoelvsten opened this issue 1 year ago • 1 comments

Follow-up on #147 , #419 , and #225 :

The Restrict and Eval function currently takes a shared_file<assignment_t> as an input which is quite clunky.

:warning: These will break when we introduce variable reordering (?).

bdd_restrict

  • [ ] Add bdd_restrict(bdd f, function<optional<bool>(bdd::label_type)> af)
  • [ ] Add bdd_restrict(bdd f, generator<int> as) :warning:
  • [x] Add bdd_restrict(bdd f, generator<std::pair<bdd::label_type, bool>> as) :warning:
  • [x] Add template<typename IT> bdd_restrict(bdd f, IT begin, IT end) :warning:

bdd_eval

  • [x] Add bdd_eval(bdd f, std::function<std::pair<label_t, bool>()> gen) :warning:
  • [x] Add template<typename IT> bdd_eval(bdd f, IT begin, IT end) :warning:

Notes

We may also at this point want to reconsider some of the design choices on assignment_func in #419 . The generator functions should definitely return true or false rather having a third "incorrect" value.

SSoelvsten avatar Jan 10 '23 11:01 SSoelvsten