-
Notifications
You must be signed in to change notification settings - Fork 273
CBMC additional profiling info: Count and report all array constraints added during postprocessing #5478
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
Conversation
src/solvers/flattening/arrays.h
Outdated
enum class constraint_typet | ||
{ | ||
ARRAY_ACKERMANN, | ||
ARRAY_EQUALITY, | ||
ARRAY_WITH, | ||
ARRAY_WITH_OTHER, | ||
ARRAY_IF_TRUE, | ||
ARRAY_IF_FALSE, | ||
ARRAY_OF, | ||
ARRAY_TYPECAST, | ||
ARRAY_CONSTANT, | ||
ARRAY_NON_CONSTANT, | ||
ARRAY_COMPREHENSION | ||
}; | ||
|
||
typedef std::list<exprt> array_constraintst; | ||
typedef std::map<constraint_typet, array_constraintst> array_constraints_mapt; | ||
array_constraints_mapt array_constraints_map; | ||
void display_constraints(); | ||
std::string enum_to_string(constraint_typet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way of doing this? Wanted to include more specific information regarding the type of constraint. For example split constraints added for array_with to constraints added for the specific index and for other indices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this was about reporting metrics, but this PR stores copies of constraints and outputs them - what is the use case for this very detailed information?
src/solvers/flattening/arrays.h
Outdated
|
||
typedef std::list<exprt> array_constraintst; | ||
typedef std::map<constraint_typet, array_constraintst> array_constraints_mapt; | ||
array_constraints_mapt array_constraints_map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗Storing copies of these constraints is not ideal wrt memory consumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer applicable, changed to store only number of constraints, don't store the constraints themselves.
The intention was to investigate how array constraints added during post processing affects CBMC performance. In order to see if the constraints themselves give any information, I tracked them here. But this is not very helpful indeed. I will be changing this to track just the number of constraints rather than the constraints themselves. Let me know if you have any other metric in mind pertaining to this that could be useful. |
src/solvers/flattening/arrays.h
Outdated
enum class constraint_typet | ||
{ | ||
ARRAY_ACKERMANN, | ||
ARRAY_EQUALITY, | ||
ARRAY_WITH, | ||
ARRAY_WITH_OTHER, | ||
ARRAY_IF_TRUE, | ||
ARRAY_IF_FALSE, | ||
ARRAY_OF, | ||
ARRAY_TYPECAST, | ||
ARRAY_CONSTANT, | ||
ARRAY_NON_CONSTANT, | ||
ARRAY_COMPREHENSION | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a clean way of extending the existing lazy_typet
enum class into a new enum class to include ARRAY_EQUALITY
? Do not want to change the meaning of the lazy_typet
by adding ARRAY_EQUALITY
to the existing enum class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## develop #5478 +/- ##
===========================================
- Coverage 69.34% 69.34% -0.01%
===========================================
Files 1241 1241
Lines 100488 100530 +42
===========================================
+ Hits 69688 69709 +21
- Misses 30800 30821 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
^SIGNAL=0$ | ||
-- | ||
-- | ||
To test output for --show-array-constraints option that displays the count and list of all array constraints added during post processing in json format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ missing newline at end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
^SIGNAL=0$ | ||
-- | ||
-- | ||
To test output for --show-array-constraints option that displays the count and list of all array constraints added during post processing in json format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ missing newline at end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
1c8aa27
to
c88821c
Compare
…added during post processing Array theory constraints added during post processing might be useful to reason about proof runtimes. This commit adds a new parse option --show-array-constraints that tracks constraints pertaining to arrays added during post processing.
… format This commit adds utilities to track array constraints and also the type of constraint being added, eg: ackermann constraint, array_of etc. Added a new enum class constraint_typet which is an extension of lazy_typet. This enum class includes a separate value for constraints added for other indices array_with, constraints added for the 'true' and 'false branches of if etc in addition to those available in lazy_typet. Also define a new member of type std::map that tracks mapping between type of constraint and the constraint itself. Currently support json output.
…boolean option used in arrayst class Add an additional boolean argument to the class constrcutor to propagate the setting of parse option --show-array-constraints to true to the arrayst class. The entry point for this is in the default invocation of solver factory.
… format This commit adds utilities to track array constraints and also the type of constraint being added, eg: ackermann constraint, array_of etc. Added a new enum class constraint_typet which is an extension of lazy_typet. This enum class includes a separate value for constraints added for other indices array_with, constraints added for the 'true' and 'false branches of if etc in addition to those available in lazy_typet. Also define a new member of type std::map that tracks mapping between type of constraint and the constraint itself. Currently support json output. clang format arrays.cpp
…boolean option used in arrayst class Add an additional boolean argument to the class constrcutor to propagate the setting of parse option --show-array-constraints to true to the arrayst class. The entry point for this is in the default invocation of solver factory. clang format solver_factory and bv_pointers
clang format regression test Adding KNOWNBUG flag to ignore failed test The --smt2 option does not go over arrayst class so no output is generated. The current test thus fails on test-cprover-smt2.
…added during post processing Array theory constraints added during post processing might be useful to reason about proof runtimes. This commit adds a new parse option --show-array-constraints that tracks constraints pertaining to arrays added during post processing. fix command line argument to display error message of xml or plain format is used
add newline to test.desc
c88821c
to
04341a8
Compare
Track constraints added for arrays in post processing as a potentially useful metric for performance evaluation.