-
Notifications
You must be signed in to change notification settings - Fork 469
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
Solver policies should be global constants (like C enums) #584
Comments
The api description of solve_n should describe all its preconditions/valid inputs. I do not mind if there is a module somewhere with a bunch of constants defined ALL_POLICY = "ALL" Full disclosure, I'll use "MINMAX" instead of from modulex import MINMAX_POLICY; MINMAX_POLICY |
I agree that we should have a module with constants for policies, and strictly use only it. I think it's less important whether to use strings to ints, but strings make it more tempting to not use the constants. regardless, @pgoodman raised an excellent point that |
Let's do not get strict. I vote not to force users to import stuff just to do a small script. |
could we make the constants available through class variables, so no import is needed?
then users could easily use them without import, with tab-complete in their editor/ide, with equal readability to strings. the downside is that the Manticore class is not the right place for those constants. |
|
In retrospect, I think policies should actually be functions or classes, not enums. |
Summary of the problem
Right now manticore uses strings to represent solver policies. For example, there is
MINMAX
, etc. These are encoded in theConcretize._ValidPolicies
list. These should really be named constants with numeric values, and they should be more uniformly used.For example, the
solve_n
method of theState
class hasminmax
as its policy, and it's not clear if that default policy is even possible or meaningful.The text was updated successfully, but these errors were encountered: