-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This issue aims to specify the next evolution of calculus annotations (#7). The goal is to incorporate soundness of refutations as well, whereas the current design only allows guardrails for proofs.
- Sound proofs: If Caesar says the encoded program verifies, then the actual program satisfies the specification as well.
- Sound refutations: If Caesar prints a counter-example to verification, then the actual program also has a counter-example.
- Proof rules encoded based on decision of lfp/gfp semantics only (not proc vs. coproc).
- Proof rules such as
@inductionor@unrollshould now obtain the direction from a calculus annotation, or, if that does not exist, based on the direction of the (co)proc. Aprocis assumed to use gfp, and acoprocis assumed to uselfpsemantics by default. - It is not a hard error anymore to use e.g.
@inductionin aprocannotated with@wp. If there is a@wpannotation, we just encode with the correspondinglfpencoding.
- Proof rules such as
- Tracking under- or over-approximations.
- Caesar should have an internal analysis that collects statements that encode "real" code, collecting a list of
Spans and aDirection. Proof rules may use analysis information from blocks nested in it, such as their loop body. - The
@inductionencoding for gfps under-approximates, and over-approximates for lfps. - The
@unrollencoding for gfps over-approximates, and under-approximates for lfps. - The other proof rules are exact and require exact loop bodies, according to the docs.
- Caesar should have an internal analysis that collects statements that encode "real" code, collecting a list of
- From proc direction and approximation analysis to
AbstractionKind.- If we're in a proc and all approximating statements under-approximating, then we have
AbstractionKind::Proof. Dual for coproc and over-approximating. This corresponds to the guarantees we checked before with the calculus annotations. - Conversely, if we're in a proc and all statements are over-approximating, then we have
AbstractionKind::Refutation. Dual for coproc and under-approximating. This means that if we get a counter-example, then we know that the real program also fails the specification. - If there's no approximations in the body, then we have
AbstractionKind::Exact. If there's a mix, then we haveAbstractionKind::Unknown.
- If we're in a proc and all approximating statements under-approximating, then we have
- Explaining verification output.
- If the verification result is "verified", but
AbstractionKindis not eitherProoforExact, then throw an error and let the user know (as is done now). - If the verification result is a counterexample, but the
AbstractionKindis not eitherRefutationorExact, then add a note to the error that the error might very well be spurious. In case ofAbstractionKind::Refutation, let the user know that the error is real and not spurious. - In case of a notice, we should highlight the relevant "wrong" approximating statements in the diagnostic based on the collection before.
- If the verification result is "verified", but
Notes:
- Once Limited functions #54 by @ole-thoeb gets merged, the way that recursive functions are encoded might also result in additional approximations.
- This is all orthogonal to the
ModelConsistencyintroduced for slicing.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request