-
Notifications
You must be signed in to change notification settings - Fork 54
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
Clustering (--comparefuns for equivalence checking) #931
base: scala-2
Are you sure you want to change the base?
Conversation
val postcondition = function.postcondition | ||
|
||
val precondition = exprOps.preconditionOf(function.fullBody) //function.precondition | ||
val postcondition = exprOps.postconditionOf(function.fullBody) //function.postcondition | ||
val bodyPre = exprOps.withPrecondition(body, precondition) | ||
val bodyPost = exprOps.withPostcondition(bodyPre,postcondition) |
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.
Could you try to manipulate specifications (getting pre/postconditions, and changing them), using the new BodyWithSpecs
API?
@drganam : I just realized that @opaque
def zero_check(arg: BigInt): Boolean = {
if (arg > 0) zero_check(arg - 1)
else true
} ensuring (res => zero1(arg) == zero2(arg)) |
|
||
case Some(paths) => | ||
// Support wildcard `_` as specified in the documentation. | ||
// A leading wildcard is always assumes. |
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.
Small typo: assumed
|
||
case Some(paths) => | ||
// Support wildcard `_` as specified in the documentation. | ||
// A leading wildcard is always assumes. |
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 here for "assumes", perhaps you could factor this code into a common function
Induction and @traceInduct annotation | ||
------------------------------------- | ||
|
||
We introduce the @traceInduct annotation for automating proofs using induction. Stainless will transform the annotated lemma by generating the inductive proof, based on the structure of one of the functions that appear in the lemma. This approach is useful for functions that have simple inductive form and are easily mapped into inductive proofs. |
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.
You can surround @traceInduct
(and other code) with backquotes like this ``@traceInduct``.
@jad-hamza @vkuncak the latest implementation (with |
Introduces two command line options: --comparefuns and --models, for equivalence checking of specified functions