Reasoning with Mutable Data Structures Tamara Rezk Javier Blanco F A MAF Universidad Nacional de Córdoba, Argentina Reasoning with Mutable Data Structures– p. 1/16
This talk Motivation: a problem (pointer variables aliasing) Reynolds’ Logic More problems (reasoning with the logic), more motivations Method to implement pointer-programs Case study Conclusions Reasoning with Mutable Data Structures– p. 2/16
� � � ✠ � ✠ � ☛ ✡ ✡ ✡ � ✠ � ✟ ✁ ✄ ✡ ✡ ✁ ✂ ✄ ✂ � ✁ ✝ ✁ ✞ ✄ ☎ ✝ ✞ � ✡ Aliasing everywhere ✂✆☎ Reasoning with Mutable Data Structures– p. 3/16
� ☛ � ✠ � ✡ ✡ ✡ � ✁ ✠ � ✠ � ✡ ✡ ✟ � � � ✁ ✂ ✄ ✂ � ✁ ✝ ✄ ✞ ✄ ☎ ✝ ✞ � ✁ ✡ Aliasing everywhere ✂✆☎ � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
� ✠ � ✠ � ✡ ✡ ✡ � ✁ ✠ � ✡ ✡ ✡ � ✟ � ☛ � ✁ ✂ ✄ ✂ � ✁ ✝ ✄ ✞ ✄ ☎ ✝ ✞ � ✁ � Aliasing everywhere ✂✆☎ � � � � � � � � � � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
✡ � ✠ � ✡ ✡ ✡ ✠ � ✡ � ☛ � � ✠ � ✡ � ✟ ✁ ✞ ✁ ✄ ✝ ✂ � ✁ ✄ ✂ ☎ ✝ ✞ � ✁ ✄ � Aliasing everywhere ✂✆☎ � � � � � � � � � � � � � � � � � � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
✡ � ✡ ✡ ✡ ✟ � ✠ � ✡ � ☛ � � ✠ � ✡ � ✠ ✁ ✞ ✁ ✄ ✝ ✂ � ✁ ✄ ✂ ☎ ✝ ✞ � ✁ ✄ � Aliasing everywhere ✂✆☎ � � � � � � � � � � � � � � � � � � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
� � ✁ � ✝ � ✝ ✟ � ✠ � ☛ ✠ ✟ � ✠ � ✠ � ✟ � ✠ � � ☛ ✆ ✝ ✠ ✆ ☛ ✁ ✂ ✄ ☎ � ✆ ✁ ☛ ✝ ☛ ✁ ✟ ☛ ✡ ✞ ☎ ✝ � ✡ ✞ ☎ ✆ ✁ � Aliasing everywhere � � � � � � � � � � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
� � ✁ � ✝ � ✝ ✟ � ✠ � ☛ ✠ ✟ � ✠ � ✠ � ✟ � ✠ � � ☛ ✆ ✝ ✠ ✆ ☛ ✁ ✂ ✄ ☎ � ✆ ✁ ☛ ✝ ☛ ✁ ✟ ☛ ✡ ✞ ☎ ✝ � ✡ ✞ ☎ ✆ ✁ � Aliasing everywhere � � � � � � � � � � � � � � � � � Reasoning with Mutable Data Structures– p. 3/16
☎ � ✝ � ✁ ✆ ✟ ✝ ✟ ✁ ✆ ☎ ✞ ✡ � ✝ ✞ ✝ ✆ ☛ ✁ ✂ ✄ ☎ � ✁ ✡ ☛ ✝ ☛ ✆ ✁ ☛ � How to verify the program? Reasoning with Mutable Data Structures– p. 4/16
☎ ✤ ✄ ☎ ✥ ✖ ✘ ✜ ✞ ✣ ✢ ☛ ✘ ✚ ✁ ✖ ✘ ✞ ✜ ✛ � ✄ ✘ ✞ ✡ ✘ ✚ ✡ ☛ ✛ ☛ ✢ ✣ ✞ ✘ ✡ ✡ ✚ ✛ ✖ � ✡ ✞ ✟ ✡ � ★ ✁ ✟ ✡ ✖ ✘ ✆ ✦✧ ✄ ✡ ✟ ✁ ✟ ✁ ✂ ☎ ✚ ☎ ✄ ✘ ✞ ✡ ✞ ✟ ✘ ✞ ☎ ✝ � ✁ ✆ ✟ ✝ ✟ ✁ ✆ ☎ ✞ ✡ � ✝ ✞ ✝ ✆ ☛ ✁ ✂ ✄ ☎ � ✁ ✡ ☛ ✝ ☛ ✆ ✁ ☛ � � ✚ ✟ ✡ ✒ ✘ ✕ ☞ ✟ ✖ ✡ ✆ ✗ ☎ ✚ ✞ ✡ ✎ ✍ ✁ ✝ ✂ ✄ ☎ ✆ ✄ ✁ ✞ ✌ ✟ ✟ � ✄ ☎ ☞ ☎ Reasoning with Mutable Data Structures– p. 4/16 How to verify the program? ✄ ✙✘ ✚✪✩ ✝✔✓ ✆✑✏ ✠☛✡ ✄ ✙✘
☎ ✤ ✄ ☎ ✥ ✖ ✘ ✜ ✞ ✣ ✢ ☛ ✘ ✚ ✁ ✖ ✘ ✞ ✜ ✛ � ✄ ✘ ✞ ✡ ✘ ✚ ✡ ☛ ✛ ☛ ✢ ✣ ✞ ✘ ✡ ✡ ✚ ✛ ✖ � ✡ ✞ ✟ ✡ � ★ ✁ ✟ ✡ ✖ ✘ ✆ ✦✧ ✄ ✡ ✟ ✁ ✟ ✁ ✂ ☎ ✚ ☎ ✄ ✘ ✞ ✡ ✞ ✟ ✘ ✞ ☎ ✝ � ✁ ✆ ✟ ✝ ✟ ✁ ✆ ☎ ✞ ✡ � ✝ ✞ ✝ ✆ ☛ ✁ ✂ ✄ ☎ � ✁ ✡ ☛ ✝ ☛ ✆ ✁ ☛ � � ✚ ✟ ✡ ✒ ✘ ✕ ☞ ✟ ✖ ✡ ✆ ✗ ☎ ✚ ✞ ✡ ✎ ✍ ✁ ✝ ✂ ✄ ☎ ✆ ✄ ✁ ✞ ✌ ✟ ✟ � ✄ ☎ ☞ ☎ Reasoning with Mutable Data Structures– p. 4/16 How to verify the program? ✄ ✙✘ ✚✪✩ ✝✔✓ ✆✑✏ ✠☛✡ ✄ ✙✘
☛ ✦✧ ✥ ☎ ✄ ✘ ✞ ✡ ✡ ✘ ✟ ✁ ✟ ✁ ✂ ✄ ☎ ✖ ✜ ✄ ✘ ✡ � ✛ ☛ ✢ ✣ ✞ ✚ ✤ ✞ ✖ ✁ ✚ ✘ ☛ ✢ ✣ ☎ ✘ ✜ ✟ ✠ ✞ ✡ ✚ ✘ ✡ � � ✛ ✠ � ✡ ✡ ✡ ☛ � ☎ ✖ ✞ ✡ ✡ ✞ ✚ ✆ ✚ ✘ ✖ ✟ � ✁ ★ � ✡ ✟ ✞ � ✘ ✡ � ✟ ✞ ☎ ✆ ✁ ✟ ✝ ✆ � ✁ � ✝ � ✝ � ✁ ✡ ✝ ✄ ✁ ☛ ✁ ✂ ✄ ☎ � ✆ ☛ ☎ ✝ ☛ ✆ ✁ ☛ ✡ ✞ ✂ ☎ ✞ ✡ ✟ ✖ ✆ ✗ ☎ � ✞ ✚ ☞ ✘ ✡ ✟ ✛ ☎ ✄ ✘ ✟ ✕ ✆ ✄ ✄ ✁ ✝ ✞ ✟ ✟ ✄ ☎ ✁ ☞ ✌ ✍ ✡ ✎ ✂ ✒ ✠ Reasoning with Mutable Data Structures– p. 4/16 How to verify the program? ✄ ✙✘ ✚✪✩ ✝✔✓ ✆✑✏ ✠☛✡ ✄ ✙✘
☛ ✢ ✁ ✄ ✘ ✞ ✡ ✦✧ ✡ ✟ ✟ ✥ ✁ ✂ ✄ ☎ ☎ ✄ ✘ ☎ ✖ ✡ ✖ ✛ � ✣ ✞ ✚ ✘ ✤ ✁ ✘ ✚ ✘ ☛ ✢ ✣ ✞ ✜ ✞ ✞ ✡ � ✚ ✘ ✡ � ✟ � ✠ ✡ ✞ ✡ ✡ ☛ � ✠ � ✠ ✡ � ✚ ★ ✆ ✚ ✘ ✖ ✡ ✟ ✁ � ☎ ✡ ✟ ✞ � � ✖ ✛ ☛ ✘ � ✆ ✞ ☎ ✆ ✁ ✟ ✝ ✟ ✁ � � ✝ � ✝ � ✁ ✂ ✡ ✝ ☎ ✁ ☛ ✁ ✂ ✄ ☎ � ✆ ☛ ☎ ✝ ☛ ✆ ✁ ☛ ✡ ✞ ✄ ✆ ✜ ✘ ✆ ✗ ☎ ✍ ✁ ✞ ✡ ✚ ✡ ✟ ✟ ✛ ☎ ✄ ✘ ✞ ✡ ✖ ✟ ✄ ☎ ✁ ✝ ✞ ✟ ✟ ✄ ✄ ☞ ☞ ✌ ✍ ✡ ✎ ✄ ✒ ✂ ✕ � Reasoning with Mutable Data Structures– p. 4/16 How to verify the program? ✄ ✙✘ ✚✪✩ ✝✔✓ ✆✑✏ ✠☛✡ ✄ ✙✘
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : . New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands. Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : . New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands. Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : . New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands. Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : . New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands. Restrictions over expressions (no pointer references, due to variables substitution) Reasoning with Mutable Data Structures– p. 5/16
� Separation Logic Extension of Hoare logic (J.Reynolds, P .O’Hearn). No need of using complex reachability predicates. Novel ”separating conjunction” : . New ways of assertion (predicate ”points-to” ). Rules for heap manipulation commands. Restrictions over expressions (no pointer references, due to variables substitution). Reasoning with Mutable Data Structures– p. 5/16
Recommend
More recommend