-
Notifications
You must be signed in to change notification settings - Fork 44
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
Refactor assert orders #699
Conversation
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.
Looks very good and is a really nice change!
...g/informatik/ultimate/lib/tracecheckerutils/assertorders/AssertOrderSmtFeatureHeuristic.java
Outdated
Show resolved
Hide resolved
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.
Nice :)
|
||
/** | ||
* Partition the statement positions between lowerIndex and upperIndex according to their depth. (See documentation | ||
* for the meaning of 'depth'). The result is stored in the map 'depth2Statements'. The partitioning is done |
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.
Where is this documentation regarding the meaning of "depth"?
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.
Should be fixed, this part was removed and some documentation added to partitionStatementsAccordingDepth
.
mAnnotSSA.setFormulaAtNonCallPos(i, mAnnotateAndAssertCodeBlocks.annotateAndAssertNonCall(i)); | ||
} | ||
} | ||
|
||
assert callPositions.containsAll(mTrace.getCallPositions()); | ||
assert mTrace.getCallPositions().containsAll(callPositions); |
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.
Did you intend to remove these checks?
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.
Oh, that's interesting: These checks were not present in AnnotateAndAsserterWithStmtOrderPrioritization
(which is the basis for the new AnnotateAndAsserter
). Therefore I also removed the variable callPositions
, because it was unused. But I think it does not hurt to add these checks again.
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.
Wait, these assertions state that all calls of the trace are already asserted. This is only reasonable, if the whole SSA is asserted here. We could keep the second assertion, but it would be trivially satisfied, since for all i
, if trace.isCallPosition(i)
is true, then i
is element of trace.getCallPositions()
. So I think it is reasonable to remove these assertions.
This is already checked in Counterexample::requireControlConfigurations
This PR aims to refactor the assert orders. Currently the situation is as follows:
AssertCodeBlockOrderType
).NOT_INCREMENTALLY
is handled in the classAnnotateAndAsserter
, while all the others are handled in the subclassAnnotateAndAsserterWithStmtOrderPrioritization
(that hardly makes use of the methods of the superclass).AnnotateAndAsserterWithStmtOrderPrioritization
are just methods (e.g.annotateAndAssertOutsideLoopFirst1
) that doe not only the partitioning of the trace, but also asserts the SSA directly and thus returns aLBool
.This situation is not nice for several reasons:
NOT_INCREMENTALLY
does not need any special handling, it can be also seen as an assert order that partitions the trace into a single partition.AnnotateAndAsserterWithStmtOrderPrioritization
contains many methods that just belong to a single assertion order.Therefore the following changes were made:
IAssertOrder
with a single methods that performs the partitioning, but not the assertion itself.AnnotateAndAsserterWithStmtOrderPrioritization
to the new classAssertOrderUtils
NOT_INCREMENTALLY
there exists also an implementation ofIAssertOrder
,AssertOrderNotIncrementally
. ThereforeAnnotateAndAsserter
is no more required and thus was deleted andAnnotateAndAsserterWithStmtOrderPrioritization
was renamed toAnnotateAndAsserter
AnnotateAndAsserter
we first create an instance of the desiredIAssertOrder
ingetAssertOrder
, perform the partioning and then assert the partioned SSA inannotateAndAssert
(which was previosuly performed by every assert order itself).Note: I ran already the nightly build, but there was a small bug (connected to #692). I just fixed it and re-ran the nightly build.