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

Export Solver and Theory Statistics #160

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ishehadeh
Copy link
Contributor

Addresses #18.

This PR adds a trait, SnapshotStatistics, and a collection of *StatsSnapshot data structures which generally mirror the various Stats data structures for each reasoner as well as the main Solver struct.

I chose to define new stat types because the existing reasoners::*::Stat types seemed particularly suited to recording statistics, and didn't include all the information printed with the print_stats() functions. The *StatsSnapshot types are intended to have a field corresponding to each line from print_stats() , and generally be simple, static structures which are easy to export and reason about. These structures also implement serde traits, when enabled.

The trait has a straightforward definition, just returning some structure with a few basic constraints:

pub trait SnapshotStatistics {
    type Stats: Sized + std::fmt::Debug;

    fn snapshot_statistics(&self) -> Self::Stats;
}

Each component implementing Theory now implements SnapshotStatistics, with it's own *StatsSnapshot as Stats.


As an example (and test) this PR also adds an option to export the aries-sat's solver stats as JSON.

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

Successfully merging this pull request may close these issues.

1 participant