Automated Formal Static Analysis and Retrieval of Source Code - JKU
Automated Formal Static Analysis and Retrieval of Source Code - JKU
Automated Formal Static Analysis and Retrieval of Source Code - JKU
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2.3. THE SIMPLIFICATION OF THE VERIFICATION CONDITIONS 19<br />
The truth constants appear, usually, when safety verification conditions are generated in order<br />
to insure the input condition <strong>of</strong> the basic functions. A list with the possible occurrences <strong>of</strong> the truth<br />
constants, either on the left-h<strong>and</strong>-side, either on the right-h<strong>and</strong>-side <strong>of</strong> the logical connectives, is<br />
applied recursively to the initial set <strong>of</strong> verification conditions, until the formulae do not change<br />
anymore.<br />
Example 2.1.<br />
...<br />
(*truth constants elimination on the rhs*)<br />
•[lhs ⇒ True]:→ •[True],<br />
•[lhs ⇒ False]:→ •[Not[lhs]],<br />
•[lhs ⇔ True]:→ •[lhs],<br />
•[lhs ⇔ False]:→ •[Not[lhs]]<br />
...<br />
In the next step we normalize the formulae by transforming the equalities <strong>and</strong> inequalities such<br />
that they have 0 on the right-h<strong>and</strong>-side <strong>and</strong> ≥, >, =, ≠ occur only. Afterwards, the inequalities<br />
<strong>and</strong> equalities from the assumptions or from the goal are then rearranged such that the order is:<br />
≠, =, ≥ <strong>and</strong> >.<br />
Some simplifications involving the relationships between ≠, =, ≥, > are done in the next<br />
steps:<br />
Example 2.2.<br />
•[And[pre ,g ≠ 0,body ,g =0,post ]]:→ •[False],<br />
•[And[pre ,g ≠ 0,body ,g ≥ 0,post ]]:→ •[And[pre,g>0,body,post]],<br />
•[And[pre ,g ≠ 0,body ,g >0,post ]]:→ • [And[pre,g>0,body,post]],<br />
...<br />
For the inference rules:<br />
Quantifiers elimination<br />
From the assumptions<br />
From the goal<br />
Φ,φ x←a ⊢Ψ<br />
Φ,∃φ⊢Ψ (∃ ⊢) Φ⊢Ψ,ψ a is new x←t<br />
Φ⊢Ψ,∃ψ<br />
x x<br />
Φ,φ x←t ⊢Ψ<br />
Φ,∀φ⊢Ψ (∀ ⊢) Φ⊢Ψ,ψ t has to be found x←a<br />
Φ⊢Ψ,∀ψ<br />
x x<br />
we introduce new skolem constants <strong>and</strong> meta-variables, namely:<br />
(⊢ ∃) t has to be found<br />
(⊢ ∀) a is new<br />
• skolem constants for universally quantified formulae in the goal <strong>and</strong> existentially quantified<br />
formulae in the assumptions;<br />
• meta-variables for universally quantified formulae in the assumptions <strong>and</strong> existentially quantified<br />
formulae in the goal.