TY - GEN
T1 - Precondition inference from intermittent assertions and application to contracts on collections
AU - Cousot, Patrick
AU - Cousot, Radhia
AU - Logozzo, Francesco
PY - 2011
Y1 - 2011
N2 - Programmers often insert assertions in their code to be optionally checked at runtime, at least during the debugging phase. In the context of design by contracts, these assertions would better be given as a precondition of the method/procedure which can detect that a caller has violated the procedure's contract in a way which definitely leads to an assertion violation (e.g., for separate static analysis). We define precisely and formally the contract inference problem from intermittent assertions inserted in the code by the programmer. Our definition excludes no good run even when a non-deterministic choice (e.g., an interactive input) could lead to a bad one (so this is not the weakest precondition, nor its strengthening by abduction, since a terminating successful execution is not guaranteed). We then introduce new abstract interpretation-based methods to automatically infer both the static contract precondition of a method/procedure and the code to check it at runtime on scalar and collection variables.
AB - Programmers often insert assertions in their code to be optionally checked at runtime, at least during the debugging phase. In the context of design by contracts, these assertions would better be given as a precondition of the method/procedure which can detect that a caller has violated the procedure's contract in a way which definitely leads to an assertion violation (e.g., for separate static analysis). We define precisely and formally the contract inference problem from intermittent assertions inserted in the code by the programmer. Our definition excludes no good run even when a non-deterministic choice (e.g., an interactive input) could lead to a bad one (so this is not the weakest precondition, nor its strengthening by abduction, since a terminating successful execution is not guaranteed). We then introduce new abstract interpretation-based methods to automatically infer both the static contract precondition of a method/procedure and the code to check it at runtime on scalar and collection variables.
UR - http://www.scopus.com/inward/record.url?scp=79251554669&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=79251554669&partnerID=8YFLogxK
U2 - 10.1007/978-3-642-18275-4_12
DO - 10.1007/978-3-642-18275-4_12
M3 - Conference contribution
AN - SCOPUS:79251554669
SN - 9783642182747
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 150
EP - 168
BT - Verification, Model Checking, and Abstract Interpretation - 12th International Conference, VMCAI 2011, Proceedings
T2 - 12th International Conference on Verification, Model Checking, and Abstract Interpretation, VMCAI 2011
Y2 - 23 January 2011 through 25 January 2011
ER -