Replies: 5 comments
-
@tjhance suggests:
@utaal thinks that should work, but believe it will require inspecting the query results to decide what/when to report (instead of emitting all of the messages generated by the expand errors queries as notes, which is what we do now) |
Beta Was this translation helpful? Give feedback.
-
As discussed on slack, this problem isn't restricted just to expanding quantifier expressions: e.g., if d(a) expands to f(a) && m(a) |
Beta Was this translation helpful? Give feedback.
-
The current workaround, taking into consideration @tjhance's scenario, is to only expand through one function call or one quantifier. We can remove this restriction when we can expand one layer at a time. |
Beta Was this translation helpful? Give feedback.
-
Consider adding support to unfold the definition of a lambda: this would be useful for lifted encodings, like the temporal logic for https://github.com/vmware-research/verifiable-controllers |
Beta Was this translation helpful? Give feedback.
-
@tjhance Has your recent revamp of the expand-errors feature addressed this? |
Beta Was this translation helpful? Give feedback.
-
@jonhnet encountered an
--expand-errors
diagnostic that pointed to aforall
inside a predicate that was assumed to be true.Here 2023-08-24-09-02-04.zip is the captured error message.
My diagnosis is that this is due to the forall not being provable after
--expand-errors
split the predicates.A simplified model of the behavior follows (though this is not exactly faithful, as I forced the split assertion failure with a false predicate):
This results in:
which is misleading for the user. While the
no(i)
is indeed not provable, we have assumedseq_bounded_by_length(ss)
to be true, which is a typical proof debugging technique, and the failure in the forall is irrelevant for the user at this point.Note that in this small example I had to write a false predicate to reproduce the error, but in a more complex situation the forall may not be directly provable and may require some manual proof (that a user isn't going to necessarily need for the final proof text).
I propose that we disable splitting the
forall
s to avoid these situations, and increase the likelihood that the expanded error is not misleading to the user. @jonhnet reports that he has never encountered a misleading expanded error report in dafny, and he values this property.There is an alternative, I believe: we may be able to collect all the predicates involved in a split and add them as disjunction to the split atoms. This way if any of the split predicates is known to be true, we would not report an error for any of its (recursive) conjuncts / foralls. I don't have the bandwidth to try this right now, but it's worth considering (@chanheec may be interested).
Beta Was this translation helpful? Give feedback.
All reactions