2 research outputs found
Automatic Error Localization for Software using Deductive Verification
Even competent programmers make mistakes. Automatic verification can detect
errors, but leaves the frustrating task of finding the erroneous line of code
to the user. This paper presents an automatic approach for identifying
potential error locations in software. It is based on a deductive verification
engine, which detects errors in functions annotated with pre- and
post-conditions. Using an automatic theorem prover, our approach finds
expressions in the code that can be modified such that the program satisfies
its specification. Scalability is achieved by analyzing each function in
isolation. We have implemented our approach in the widely used Frama-C
framework and present first experimental results. This is an extended version
of [8], featuring an additional appendix.Comment: This is an extended version of [8], featuring an additional appendi
ΠΠΎΠΌΠΏΠ»Π΅ΠΊΡΠ½ΡΠΉ ΠΏΠΎΠ΄Ρ ΠΎΠ΄ ΡΠΈΡΡΠ΅ΠΌΡ C-lightVer ΠΊ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠΉ Π»ΠΎΠΊΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ ΠΎΡΠΈΠ±ΠΎΠΊ Π² C-ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°Ρ
The C-lightVer system for the deductive verification of C programs is being developed at the IIS SB RAS. Based on the two-level architecture of the system, the C-light input language is translated into the intermediate C-kernel language. The meta generator of the correctness conditions receives the C-kernel program and Hoare logic for the C-kernel as input. To solve the well-known problem of determining loop invariants, the definite iteration approach was chosen. The body of the definite iteration loop is executed once for each element of the finite dimensional data structure, and the inference rule for them uses the substitution operation rep, which represents the action of the cycle in symbolic form. Also, in our meta generator, the method of semantic markup of correctness conditions has been implemented and expanded. It allows to generate explanations for unproven conditions and simplifies the errors localization. Finally, if the theorem prover fails to determine the truth of the condition, we can focus on proving its falsity. Thus a method of proving the falsity of the correctness conditions in the ACL2 system was developed. The need for more detailed explanations of the correctness conditions containing the replacement operation rep has led to a change of the algorithms for generating the replacement operation, and the generation of explanations for unproven correctness conditions. Modifications of these algorithms are presented in the article. They allow marking rep definition with semantic labels, extracting semantic labels from rep definition and generating description of break execution condition.Π ΠΠ‘Π Π‘Π Π ΠΠ ΡΠ°Π·ΡΠ°Π±Π°ΡΡΠ²Π°Π΅ΡΡΡ ΡΠΈΡΡΠ΅ΠΌΠ° C-lightVer Π΄Π»Ρ Π΄Π΅Π΄ΡΠΊΡΠΈΠ²Π½ΠΎΠΉ Π²Π΅ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ Π‘-ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ. ΠΡΡ
ΠΎΠ΄Ρ ΠΈΠ· Π΄Π²ΡΡ
ΡΡΠΎΠ²Π½Π΅Π²ΠΎΠΉ Π°ΡΡ
ΠΈΡΠ΅ΠΊΡΡΡΡ ΡΠΈΡΡΠ΅ΠΌΡ, Π²Ρ
ΠΎΠ΄Π½ΠΎΠΉ ΡΠ·ΡΠΊ C-light ΡΡΠ°Π½ΡΠ»ΠΈΡΡΠ΅ΡΡΡ Π² ΠΏΡΠΎΠΌΠ΅ΠΆΡΡΠΎΡΠ½ΡΠΉ ΡΠ·ΡΠΊ C-kernel. ΠΠ΅ΡΠ°Π³Π΅Π½Π΅ΡΠ°ΡΠΎΡ ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΡΡΠΈ ΠΏΡΠΈΠ½ΠΈΠΌΠ°Π΅Ρ Π½Π° Π²Ρ
ΠΎΠ΄ C-kernel ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΈ Π»ΠΎΠ³ΠΈΠΊΡ Π₯ΠΎΠ°ΡΠ° Π΄Π»Ρ C-kernel. ΠΠ»Ρ ΡΠ΅ΡΠ΅Π½ΠΈΡ ΠΈΠ·Π²Π΅ΡΡΠ½ΠΎΠΉ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ Π·Π°Π΄Π°Π½ΠΈΡ ΠΈΠ½Π²Π°ΡΠΈΠ°Π½ΡΠΎΠ² ΡΠΈΠΊΠ»ΠΎΠ² Π²ΡΠ±ΡΠ°Π½ ΠΏΠΎΠ΄Ρ
ΠΎΠ΄ ΡΠΈΠ½ΠΈΡΠ½ΡΡ
ΠΈΡΠ΅ΡΠ°ΡΠΈΠΉ. Π’Π΅Π»ΠΎ ΡΠΈΠΊΠ»Π° ΡΠΈΠ½ΠΈΡΠ½ΠΎΠΉ ΠΈΡΠ΅ΡΠ°ΡΠΈΠΈ ΠΈΡΠΏΠΎΠ»Π½ΡΠ΅ΡΡΡ ΠΎΠ΄ΠΈΠ½ ΡΠ°Π· Π΄Π»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΡΡΡΡΠΊΡΡΡΡ Π΄Π°Π½Π½ΡΡ
ΠΊΠΎΠ½Π΅ΡΠ½ΠΎΠΉ ΡΠ°Π·ΠΌΠ΅ΡΠ½ΠΎΡΡΠΈ, Π° ΠΏΡΠ°Π²ΠΈΠ»ΠΎ Π²ΡΠ²ΠΎΠ΄Π° Π΄Π»Ρ Π½ΠΈΡ
ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅Ρ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡ Π·Π°ΠΌΠ΅Π½Ρ rep, Π²ΡΡΠ°ΠΆΠ°ΡΡΡΡ Π΄Π΅ΠΉΡΡΠ²ΠΈΠ΅ ΡΠΈΠΊΠ»Π° Π² ΡΠΈΠΌΠ²ΠΎΠ»ΠΈΡΠ΅ΡΠΊΠΎΠΉ ΡΠΎΡΠΌΠ΅. Π’Π°ΠΊΠΆΠ΅ Π² Π½Π°ΡΠ΅ΠΌ ΠΌΠ΅ΡΠ°Π³Π΅Π½Π΅ΡΠ°ΡΠΎΡΠ΅ Π²Π½Π΅Π΄ΡΠ΅Π½ ΠΈ ΡΠ°ΡΡΠΈΡΠ΅Π½ ΠΌΠ΅ΡΠΎΠ΄ ΡΠ΅ΠΌΠ°Π½ΡΠΈΡΠ΅ΡΠΊΠΎΠΉ ΡΠ°Π·ΠΌΠ΅ΡΠΊΠΈ ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΡΡΠΈ. ΠΠ½ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΠΏΠΎΡΠΎΠΆΠ΄Π°ΡΡ ΠΏΠΎΡΡΠ½Π΅Π½ΠΈΡ Π΄Π»Ρ Π½Π΅Π΄ΠΎΠΊΠ°Π·Π°Π½Π½ΡΡ
ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΈ ΡΠΏΡΠΎΡΠ°Π΅Ρ Π»ΠΎΠΊΠ°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΎΡΠΈΠ±ΠΎΠΊ. ΠΠ°ΠΊΠΎΠ½Π΅Ρ, Π΅ΡΠ»ΠΈ ΡΠΈΡΡΠ΅ΠΌΠ° ACL2 Π½Π΅ ΡΠΏΡΠ°Π²Π»ΡΠ΅ΡΡΡ Ρ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ΠΌ ΠΈΡΡΠΈΠ½Π½ΠΎΡΡΠΈ ΡΡΠ»ΠΎΠ²ΠΈΡ, ΠΌΠΎΠΆΠ½ΠΎ ΡΠΎΡΡΠ΅Π΄ΠΎΡΠΎΡΠΈΡΡΡΡ Π½Π° Π΄ΠΎΠΊΠ°Π·Π°ΡΠ΅Π»ΡΡΡΠ²Π΅ Π΅Π³ΠΎ Π»ΠΎΠΆΠ½ΠΎΡΡΠΈ. Π Π°Π½Π΅Π΅ Π½Π°ΠΌΠΈ Π±ΡΠ» ΡΠ°Π·ΡΠ°Π±ΠΎΡΠ°Π½ ΡΠΏΠΎΡΠΎΠ± Π΄ΠΎΠΊΠ°Π·Π°ΡΠ΅Π»ΡΡΡΠ²Π° Π»ΠΎΠΆΠ½ΠΎΡΡΠΈ ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΡΡΠΈ Π΄Π»Ρ ΡΠΈΡΡΠ΅ΠΌΡ ACL2. ΠΠ΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎΡΡΡ Π² Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΡΡ
ΠΎΠ±ΡΡΡΠ½Π΅Π½ΠΈΡΡ
ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΡΡΠΈ, ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΠΈΡ
ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡ Π·Π°ΠΌΠ΅Π½Ρ rep, ΠΏΡΠΈΠ²Π΅Π»Π° ΠΊ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π°Π»Π³ΠΎΡΠΈΡΠΌΠΎΠ² Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΈ Π·Π°ΠΌΠ΅Π½Ρ, ΠΈΠ·Π²Π»Π΅ΡΠ΅Π½ΠΈΡ ΡΠ΅ΠΌΠ°Π½ΡΠΈΡΠ΅ΡΠΊΠΈΡ
ΠΌΠ΅ΡΠΎΠΊ ΠΈ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΠΎΠ±ΡΡΡΠ½Π΅Π½ΠΈΠΉ Π½Π΅Π΄ΠΎΠΊΠ°Π·Π°Π½Π½ΡΡ
ΡΡΠ»ΠΎΠ²ΠΈΠΉ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΡΡΠΈ. Π ΡΡΠ°ΡΡΠ΅ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½Ρ ΠΌΠΎΠ΄ΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ Π΄Π°Π½Π½ΡΡ
Π°Π»Π³ΠΎΡΠΈΡΠΌΠΎΠ². ΠΡΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡ ΠΏΠΎΠΌΠ΅ΡΠΈΡΡ ΠΈΡΡ
ΠΎΠ΄Π½ΡΠΉ ΠΊΠΎΠ΄ ΡΡΠ½ΠΊΡΠΈΠΈ rep ΡΠ΅ΠΌΠ°Π½ΡΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ ΠΌΠ΅ΡΠΊΠ°ΠΌΠΈ, ΠΈΠ·Π²Π»Π΅ΠΊΠ°ΡΡ ΡΠ΅ΠΌΠ°Π½ΡΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΠΌΠ΅ΡΠΊΠΈ ΠΈΠ· ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡ rep, Π° ΡΠ°ΠΊΠΆΠ΅ Π³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°ΡΡ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΡΡΠ»ΠΎΠ²ΠΈΡ ΠΈΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΈΠ½ΡΡΡΡΠΊΡΠΈΠΈ break