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

Portfolio Solver #284

Merged
merged 3 commits into from Nov 2, 2016
Merged

Portfolio Solver #284

merged 3 commits into from Nov 2, 2016

Conversation

marcogario
Copy link
Contributor

  • Created Portfolio class that uses multiprocessing to solve the problem
    using multiple solvers.

  • The solver provides a naive incremental interface by using
    IncrementalTrackingSolver Interface

  • get_value and get_model work after a SAT query. Other
    artifacts (unsat-core, interpolants) are not supported.

  • Extend Factory.is_* to include portfolio key-word, and exported as
    is_* shortcuts. The syntax becomes:

     is_sat(f, portfolio=["s1", "s2"])
    

Exceptions are currently not handled internally. Similarly, logic testing is done only when the solvers are started (i.e., during solve()). If at least one solver terminates, this might not be a problem, but it is not nice.

@marcogario
Copy link
Contributor Author

@mikand: This is not ready to be merged, but I'd like some feedback. An open point that I am not sure how to manage is multiple instances of the same solver with different options. I cannot figure out a syntax that I like.

@marcogario marcogario mentioned this pull request Jul 24, 2016
@marcogario marcogario added this to the 0.5.1 milestone Jul 26, 2016
@marcogario
Copy link
Contributor Author

Done with the exception handling (as discussed). Missing is the handling of options for solvers, including multiple instance of the same solver with different options (btw, we should find a meaningful example for this).

@marcogario marcogario changed the title Portfolio: Initial draft of Portfolio Solver Portfolio Solver Aug 2, 2016
@marcogario marcogario modified the milestones: 0.6.0, 0.5.1 Aug 11, 2016
class MSatOptions(SolverOptions):
"""Options from MathSAT Solver. """
VALID_OPTIONS = SolverOptions.VALID_OPTIONS +\
[("random_seed", None),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

randomseed is part of the SMT-LIB standard, we should move this option to SolverOptions (and incidentally, consider which other options from the standard we can support at this time).

- Created Portfolio class that uses multiprocessing to solve the problem
  using multiple solvers.
- The solver provides a naive incremental interface by using
  IncrementalTrackingSolver Interface
- get_value and get_model work after a SAT query. Other
  artifacts (unsat-core, interpolants) are not supported.
- Extend Factory.is_* to include `portfolio` key-word, and exported as
  is_* shortcuts. The syntax becomes:

       is_sat(f, portfolio=["s1", "s2"])

- Exceptions are handled via the 'exit_on_exception' option
- Logic testing is done only when the solvers are started (i.e., during
  solve()).  If at least one solver terminates, this might not be a
  problem, but it is not nice.
Copy link
Contributor

@mikand mikand left a comment

Choose a reason for hiding this comment

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

Great work!

@@ -76,6 +76,8 @@ class BoolectorSolver(IncrementalTrackingSolver,
LOGICS = [QF_BV, QF_UFBV, QF_ABV, QF_AUFBV, QF_AX]
OptionsClass = BoolectorOptions

OptionsClass = BoolectorOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicated line (see above)

@@ -88,6 +90,28 @@ def __init__(self, environment, logic, **options):
self.declarations = {}
return

def _prepare_config(self, options):
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this function used?

import logging
from multiprocessing import Process, Queue, Pipe

from pysmt.solvers.solver import IncrementalTrackingSolver, SolverOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work? SolverOptions is now in pysmt.solvers.options ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only if you believe with all your heart! 😉

pysmt.solver imports SolverOptions, therefore it is visible from there. I left it like this, in case we want to split the files in the future.

This addresses the PR comments.
Conflicts:
	pysmt/solvers/solver.py
	pysmt/test/test_solving.py
@mikand mikand merged commit ad2f872 into master Nov 2, 2016
@mikand mikand deleted the portfolio branch November 2, 2016 13:42
nbailluet pushed a commit to nbailluet/pysmt that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants