Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic PickOneCube(const BddSet &variables) #52

Open
SSoelvsten opened this issue May 28, 2024 · 1 comment
Open

Symbolic PickOneCube(const BddSet &variables) #52

SSoelvsten opened this issue May 28, 2024 · 1 comment

Comments

@SSoelvsten
Copy link
Contributor

SSoelvsten commented May 28, 2024

While Model Checking, to obtain a specific (symbolic) state s in a set S, one would want to use the PickOneCube(S) function. Yet to only obtain a single state, the resulting cube needs to fix a value for each variable. Hence, I would then want to provide some cube c of all states (similar to the Exists function).

Yet, doing so returns a non-symbolic vector of assignments which I have to convert back into a BDD.

  inline sylvan::Bdd
  satone(const sylvan::Bdd& f, const sylvan::Bdd& c)
  {
    const auto f_vals = f.PickOneCube(c);
    const auto c_vars = sylvan::BddSet(c).toVector();

    sylvan::Bdd res = top();
    for (int i = c_vars.size() - 1; 0 <= i; --i) {
      const int  var = c_vars[i];
      const bool val = f_vals[i];

      res &= val ? ithvar(var) : nithvar(var);
    }
    return res;
  }

As you are working towards v2.0, I would propose this is changed to return a sylvan::Bdd instead. If the user wants to have these values output instead then they can provide a begin iterator to some data structure they would like to feed the result into.

@SSoelvsten
Copy link
Contributor Author

This might just be a lack of exposing sylvan_sat_single in the C++ API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant