-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fix: Error wording closer to semantics #676
Changes from 10 commits
502c990
a402443
c681d76
d2e15a3
7641d24
1dbd53a
7f0193a
32600c9
9eb5120
0a287f9
11c0598
6fbfafd
9ae9e3c
ee8cb55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ namespace Microsoft.Boogie; | |
public abstract class ProofObligationDescription { | ||
/// <summary> | ||
/// A description of what this proof obligation means when it has been | ||
/// successfully proven. | ||
/// successfully proved. | ||
/// </summary> | ||
public abstract string SuccessDescription { get; } | ||
|
||
|
@@ -32,75 +32,75 @@ public abstract class ProofObligationDescription { | |
|
||
public class AssertionDescription : ProofObligationDescription | ||
{ | ||
public override string SuccessDescription => "This assertion holds."; | ||
public override string SuccessDescription => "this assertion holds"; | ||
|
||
public override string FailureDescription => "This assertion might not hold."; | ||
public override string FailureDescription => "this assertion could not be proved"; | ||
|
||
public override string ShortDescription => "assert"; | ||
} | ||
|
||
public class PreconditionDescription : ProofObligationDescription | ||
{ | ||
public override string SuccessDescription => | ||
"All preconditions hold for this call."; | ||
"all preconditions hold for this call"; | ||
|
||
public override string FailureDescription => | ||
"A precondition for this call might not hold."; | ||
"a precondition for this call could not be proved"; | ||
|
||
public override string ShortDescription => "precondition"; | ||
} | ||
|
||
public class RequiresDescription : ProofObligationDescription | ||
{ | ||
public override string SuccessDescription => | ||
"This precondition holds."; | ||
"this precondition holds"; | ||
|
||
public override string FailureDescription => | ||
"This is the precondition that might not hold."; | ||
"this is the precondition that could not be proved"; | ||
|
||
public override string ShortDescription => "requires"; | ||
} | ||
|
||
public class PostconditionDescription : ProofObligationDescription | ||
{ | ||
public override string SuccessDescription => | ||
"All postconditions hold for this return path."; | ||
"all postconditions hold for this return path"; | ||
|
||
public override string FailureDescription => | ||
"A postcondition might not hold on this return path."; | ||
"a postcondition could not be proved on this return path"; | ||
|
||
public override string ShortDescription => "postcondition"; | ||
} | ||
|
||
public class EnsuresDescription : ProofObligationDescription | ||
{ | ||
public override string SuccessDescription => | ||
"This postcondition holds."; | ||
"this postcondition holds"; | ||
|
||
public override string FailureDescription => | ||
"This is the postcondition that might not hold."; | ||
"this is the postcondition that could not be proved"; | ||
|
||
public override string ShortDescription => "ensures"; | ||
} | ||
|
||
public class InvariantEstablishedDescription : AssertionDescription | ||
{ | ||
public override string SuccessDescription => | ||
"This loop invariant holds on entry."; | ||
"this loop invariant holds on entry"; | ||
|
||
public override string FailureDescription => | ||
"This loop invariant might not hold on entry."; | ||
"this loop invariant could not be proved on entry"; | ||
|
||
public override string ShortDescription => "invariant established"; | ||
} | ||
|
||
public class InvariantMaintainedDescription : AssertionDescription | ||
{ | ||
public override string SuccessDescription => | ||
"This loop invariant is maintained by the loop."; | ||
"this loop invariant is maintained by the loop"; | ||
|
||
public override string FailureDescription => | ||
"This loop invariant might not be maintained by the loop."; | ||
"this loop invariant might not be maintained by the loop"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This message still contains the "might not" phrasing, as opposed to "could not be proved". Unfortunately, using that wording makes it pretty awkward: "this loop invariant could not be proved to be maintained by the loop". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about: "this invariant could not be proved within the loop"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the current PR, I used the second one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I like that one, too. |
||
|
||
public override string ShortDescription => "invariant maintained"; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Intervals.bpl(64,3): Error: This assertion might not hold. | ||
Intervals.bpl(75,3): Error: This assertion might not hold. | ||
Intervals.bpl(94,3): Error: This assertion might not hold. | ||
Intervals.bpl(140,3): Error: This assertion might not hold. | ||
Intervals.bpl(151,3): Error: This assertion might not hold. | ||
Intervals.bpl(202,3): Error: This assertion might not hold. | ||
Intervals.bpl(240,3): Error: This assertion might not hold. | ||
Intervals.bpl(252,3): Error: This assertion might not hold. | ||
Intervals.bpl(263,3): Error: This assertion might not hold. | ||
Intervals.bpl(285,3): Error: This assertion might not hold. | ||
Intervals.bpl(307,3): Error: This assertion might not hold. | ||
Intervals.bpl(64,3): Error: this assertion could not be proved | ||
Intervals.bpl(75,3): Error: this assertion could not be proved | ||
Intervals.bpl(94,3): Error: this assertion could not be proved | ||
Intervals.bpl(140,3): Error: this assertion could not be proved | ||
Intervals.bpl(151,3): Error: this assertion could not be proved | ||
Intervals.bpl(202,3): Error: this assertion could not be proved | ||
Intervals.bpl(240,3): Error: this assertion could not be proved | ||
Intervals.bpl(252,3): Error: this assertion could not be proved | ||
Intervals.bpl(263,3): Error: this assertion could not be proved | ||
Intervals.bpl(285,3): Error: this assertion could not be proved | ||
Intervals.bpl(307,3): Error: this assertion could not be proved | ||
|
||
Boogie program verifier finished with 17 verified, 11 errors |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
TestIntervals.bpl(26,3): Error: This assertion might not hold. | ||
TestIntervals.bpl(71,3): Error: This assertion might not hold. | ||
TestIntervals.bpl(72,3): Error: This assertion might not hold. | ||
TestIntervals.bpl(26,3): Error: this assertion could not be proved | ||
TestIntervals.bpl(71,3): Error: this assertion could not be proved | ||
TestIntervals.bpl(72,3): Error: this assertion could not be proved | ||
|
||
Boogie program verifier finished with 2 verified, 3 errors |
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.
If we are going after "proven" to stress out this is about proofs, then why not also "proven" instead of "holds"?
Like "Boogie proved this assertion".
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.
Same goes for other such patterns.
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.
That's a good point. Note that the success message is for now only displayed in rare occasions, in some toolings and while hovering Dafny programs in VSCode. Since there is no call to action, "holds" is the same as "was proven", but it's shorter.