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

ff: sub-theory #9210

Merged
merged 7 commits into from Oct 11, 2022
Merged

ff: sub-theory #9210

merged 7 commits into from Oct 11, 2022

Conversation

alex-ozdemir
Copy link
Member

This patch adds a "sub-theory" of FF.

  • a sub-theory is initialized with a field size, and responsible only for the field of that size.
  • its interface is a restriction of the general SMT theory interface
  • the full FF solver essentially just multiplexes between the sub-theories

This patch adds a "sub-theory" of FF.

* a sub-theory is initialized with a field size, and responsible only for the field of that size.
* its interface is a restriction of the general SMT theory interface
* the full FF solver essentially just multiplexes between the sub-theories
src/theory/ff/sub_theory.h Outdated Show resolved Hide resolved
namespace theory {
namespace ff {

class SubTheory : EnvObj, context::ContextNotifyObj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give some quick doc on the overall purpose of this class here (along the lines of the PR description).

// Atoms
context::CDList<Node> d_atoms;

FfStatistics* d_stats;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc these 3.

alex-ozdemir and others added 2 commits October 10, 2022 14:02
Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
// Facts, in notification order.
//
// Uses SAT context.
context::CDList<Node> d_facts;
Copy link
Member

@ajreynol ajreynol Oct 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a bit funny to maintain this when the Theory also can reproduce the fact queue (from this member https://github.com/cvc5/cvc5/blob/main/src/theory/theory.h#L813).
Is it critical to maintain this list? Or could this be extracted from the fact queue from TheoryFf?

If you are interested in a standard way of accessing this list, I can give some guidance, e.g. using interfaces from the TheoryState utility https://github.com/cvc5/cvc5/blob/main/src/theory/theory_state.h (I'm somewhat surprised the class introduced in this PR does not depend on this utility already).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list contains only the facts for this sub-theory. That is, those in the specific field that this sub-theory manages.

We could extract those from the theory-wide list as needed, but keeping them here seemed asymptotically better?

We could also keep a list here of indices into the global list, which maybe fixes the asymptotic issue, but I'm not sure the global list is meant to support random access. Also, I don't really like the idea of keeping indices into a list that is very far away codebase-wise.

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we stick with this solution, I'll leave a comment about this conversation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this makes sense to me, yes comment in the doc on this.

// What is that conflict?
const std::vector<Node>& conflict() const;

// Get a model.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this can only be called at a certain point? E.g. after full effort check? If so, document this.

}
}

// CoCoA symbols must start with a letter and contain only letters and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cries.

@ajreynol ajreynol enabled auto-merge (squash) October 11, 2022 19:28
@ajreynol ajreynol merged commit 4883af0 into cvc5:main Oct 11, 2022
@alex-ozdemir alex-ozdemir deleted the ff-subtheory branch October 12, 2022 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moderate Complexity normal Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants