<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Shape and Content</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>D. Calvanese</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>T. Kotek</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M. Simkus</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>H. Veith</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>F. Zuleger</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Free University of Bozen-Bolzano</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Vienna University of Technology</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>The veri cation community has studied dynamic data structures primarily in a bottom-up way by analyzing pointers and the shapes induced by them. Recent work in elds such as separation logic has made signi cant progress in extracting shapes from program source code. Many real world programs however manipulate complex data whose structure and content is most naturally described by formalisms from object oriented programming and databases. In this paper, we attempt to bridge the conceptual gap between these two communities. Our approach is based on Description Logics (DLs), a widely used knowledge representation paradigm which gives a logical underpinning for diverse modeling frameworks such as UML and ER. We show how DLs can be used on top of an existing shape analysis to add content descriptions to the shapes. Technically, we assume that we have separation logic shape invariants obtained from a shape analysis tool, and requirements on the program data in terms of description logic. We show that the two-variable fragment of rst order logic with counting and trees (whose decidability was presented at LICS 2013) can be used as a joint framework to embed suitable DLs and separation logic.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>The manipulation and storage of complex information in imperative
programming languages is often achieved by dynamic data structures. The veri cation
of programs with dynamic structures however is notoriously di cult, and is a
highly active area of current research. This paper aims to put a new perspective
on this problem. We discuss how the analysis of the shape can be complemented
by an analysis of the content to be stored.</p>
      <p>
        Shape analysis is concerned with the analysis of pointers and of the structures
induced by them. Recent years have seen considerable progress in automatic
methods for inferring basic shape properties such as lists and trees and variations
thereof (cyclic lists, doubly-linked lists, etc.). This success has been enabled by
succinct formalisms for representing heap structures, most notably separation
? Kotek, Veith and Zuleger were supported by the Austrian National Research Network
S11403-N23 (RiSE) of the Austrian Science Fund (FWF) and by the Vienna Science
and Technology Fund (WWTF) through grants PROSEED and ICT12-059. Simkus
was supported by the FWF grants P25518 and the WWTF grants ICT12-15.
logic [
        <xref ref-type="bibr" rid="ref12 ref7">12,7</xref>
        ]. With a few exceptions e.g. [
        <xref ref-type="bibr" rid="ref10 ref9">9,10</xref>
        ] the majority of papers on shape
analysis has focused on the (graph-theoretic) shape of the data structures rather
than their information content. For instance, classical shape analysis does not
capture simple concepts such as \a list of students where each student has a list
of teachers" but only the more combinatorial concept \list of lists".
      </p>
      <p>
        Content representation has been studied by several disciplines including
databases, modeling and knowledge representation. These research
communities typically model reality by classes and binary relationships between these
classes. For example, the database community uses entity-relationship (ER)
diagrams, and UML diagrams have been studied in requirements engineering. UML
and ER diagrams can often be expressed in Description Logics (DLs), which
have been studied extensively by the knowledge representation community, and
is used for many modeling tasks, see [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        Content representation in the form of UML and ER has become a central
pillar of industrial software engineering. In complex software projects, the source
code is usually accompanied by design documents which provide extensive
documentation and models of data structure content. This documentation is both
an opportunity and a challenge for program veri cation. Recent hardware
verication papers have demonstrated how design diagrams can be integrated into
an industrial veri cation work ow [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Problem Statement and Main Goal. Shape analysis and content
representation have been very successful paradigms for their respective scope and purpose.
They show their limitations, however, when we consider programs which lie in
their intersection. This large class of programs is using the heap extensively to
store complex information: essentially, the heap is an in-memory database. In
line with the discussion above, this database is often an informal instantiation
of an abstract UML or ER scheme.</p>
      <p>The goals of veri cation are often related to both the content and the data
structure representation, e.g. the veri cation of complex heap invariants in a le
system, the adherence to security policies, etc. Classical shape analysis,
however, is not equipped to represent relationships between complex data on the
appropriate abstraction level; mutatis mutandis, suitable content representation
formalisms such as DLs are oblivious of the data structures and operations to
manage the data on the heap.</p>
      <p>We conclude that shape analysis and content representation represent two
valid views of the heap, (i) as a collection of data structures satisfying
structural and graph-theoretic properties in the former case, and (ii) as a collection
of containers of entities and their relationships in the latter case. In order to
adequately analyze programs with dynamically allocated data structures, it is
necessary to combine the two approaches. In this paper, we choose a DL and a
separation logic fragment as concrete logical frameworks to study this question.</p>
      <p>The methodological goal of this paper is a proof of concept to establish
description logic as an assertion and proof formalism for the veri cation of
highlevel properties of programs with dynamic data structures. The technical
challenge is to nd a veri cation methodology along with a suitable formalism that
bridges the gap between shape analysis and content representation, i.e., between
description logic and separation logic.</p>
      <p>
        Logics. DLs are mature and well understood logics, they have good
algorithmic properties and enjoy e cient reasoners. DLs vary in expressivity and
complexity, and are usually selected according to the expressivity needed to
formalize the given target domain. A precise framework for reasoning over UML
class diagrams and ER diagrams can be found in [
        <xref ref-type="bibr" rid="ref1 ref3">3,1</xref>
        ]. Moreover, DLs are the
logical backbone of the Web Ontology Language (OWL) for the Semantic Web [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
In this paper we employ a very expressive description logic (henceforth called
L), based on the so called ALCHOIF , which we speci cally tailor to better
support reasoning about complex pointer structures.
      </p>
      <p>
        Separation logic is a powerful proof-theoretic framework which is used to
reason about correctness of programs with dynamically allocated memory.
Separation logic is an extension of Hoare logic. Due to its support for local
reasoning, separation logic is the most prominent logic for reasoning about the
heap. While early papers on separation logic [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] dealt with highly
expressive but undecidable logics, we use a fragment of separation logic from [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
which was successfully used in program analysis tools and whose reasoning
complexity is polynomial.
      </p>
      <p>
        In order to study the combination of description logic and sep- CT 2
aration logic, we identify a powerful decidable logic which
incorporates both. In Figure 1, SL and DL denote the separation logic SL DL
fragment and the description logic that we use, respectively. The
logic CT 2 is an extension of rst order logic with counting and
trees. Motivated by applications in shape analysis, a recent deep Fig. 1.
result in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] shows that nite satis ability of CT 2-formulae is in NEXPTIME.
Thus, [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] connects a major line of research in nite model theory to shape and
content analysis.
      </p>
      <p>
        Our contributions:
{ The semantics of SL is given in terms of heap functions. We de ne memory
structures based on DL semantics for representing the heap and transform
the semantics of SL to a semantics based on memory structures.
{ We study the description logic L as a formalism for expressing content
properties of memory structures using concrete examples.
{ We give an embedding of a fragment of the separation logic from [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] into
CT 2. L has a fairly standard reduction (see e.g. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]) to CT 2. Moreover, we
give a complexity-preserving reduction of satis ability of CT 2 over memory
structures to nite satis ability of CT 2.
{ We describe a program model for sequential imperative heap-manipulating
programs without procedures. Our rst main contribution is a Hoare-style
proof system for verifying content properties on top of (already veri ed)
shape properties stated in separation logic.
{ Our second main contribution is precise backward-translation of content
properties along loop-less code. This backward-translation allows us to
reduce the inductiveness of the Hoare-annotations to satis ability in CT 2. We
prove the soundness and completeness of this reduction.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>A.</given-names>
            <surname>Artale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Ryzhikov</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>Reasoning over extended ER models</article-title>
          .
          <source>In Proc. of ER</source>
          , pages
          <volume>277</volume>
          {
          <fpage>292</fpage>
          . Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>F.</given-names>
            <surname>Baader</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. L.</given-names>
            <surname>McGuinness</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nardi</surname>
          </string-name>
          , and
          <string-name>
            <surname>P. F.</surname>
          </string-name>
          <article-title>Patel-Schneider, editors. The Description Logic handbook: theory, implementation, and applications</article-title>
          . Cambridge University Press,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>D.</given-names>
            <surname>Berardi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          , and G. De Giacomo.
          <article-title>Reasoning on UML class diagrams</article-title>
          .
          <source>Arti cial Intelligence</source>
          ,
          <volume>168</volume>
          (
          <issue>12</issue>
          ):
          <volume>70</volume>
          {
          <fpage>118</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>J.</given-names>
            <surname>Berdine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Calcagno</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>W. O'Hearn.</surname>
          </string-name>
          <article-title>Symbolic execution with Separation Logic</article-title>
          .
          <source>In APLAS</source>
          , volume
          <volume>3780</volume>
          , pages
          <fpage>52</fpage>
          {
          <fpage>68</fpage>
          . Springer-Verlag,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>A.</given-names>
            <surname>Borgida</surname>
          </string-name>
          .
          <article-title>On the relative expressiveness of description logics and predicate logics</article-title>
          .
          <source>Artif</source>
          . Intell.,
          <volume>82</volume>
          (
          <issue>1-2</issue>
          ):
          <volume>353</volume>
          {
          <fpage>367</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>W.</given-names>
            <surname>Charatonik</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Witkowski</surname>
          </string-name>
          .
          <article-title>Two-variable logic with counting and trees</article-title>
          .
          <source>In LICS</source>
          , pages
          <volume>73</volume>
          {
          <fpage>82</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Ishtiaq and P. W. O'Hearn</surname>
          </string-name>
          .
          <article-title>Bi as an assertion language for mutable data structures</article-title>
          .
          <source>POPL</source>
          , pages
          <volume>14</volume>
          {
          <fpage>26</fpage>
          . ACM,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>D.</given-names>
            <surname>James</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Leonard</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. O'Leary</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Talupur</surname>
            , and
            <given-names>M. R.</given-names>
          </string-name>
          <string-name>
            <surname>Tuttle</surname>
          </string-name>
          .
          <article-title>Extracting models from design documents with mapster</article-title>
          .
          <source>PODC</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>S.</given-names>
            <surname>Magill</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Berdine</surname>
          </string-name>
          , E. Clarke, and
          <string-name>
            <given-names>B.</given-names>
            <surname>Cook</surname>
          </string-name>
          .
          <article-title>Arithmetic strengthening for shape analysis</article-title>
          .
          <source>In Static Analysis</source>
          , volume
          <volume>4634</volume>
          <source>of LNCS</source>
          , pages
          <volume>419</volume>
          {
          <fpage>436</fpage>
          . Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>S.</given-names>
            <surname>Magill</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-H. Tsai</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Lee</surname>
            , and
            <given-names>Y.-K.</given-names>
          </string-name>
          <string-name>
            <surname>Tsay</surname>
          </string-name>
          .
          <article-title>Automatic numeric abstractions for heap-manipulating programs</article-title>
          .
          <source>POPL</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. W3C OWL Working Group.
          <article-title>OWL 2 Web Ontology Language: Document Overview</article-title>
          .
          <source>W3C Recommendation</source>
          , 27
          <year>October 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>J. C.</surname>
          </string-name>
          <article-title>Reynolds. Separation Logic: A logic for shared mutable data structures</article-title>
          .
          <source>In In Proc. of LICS</source>
          , pages
          <volume>55</volume>
          {
          <fpage>74</fpage>
          , Washington, DC, USA,
          <year>2002</year>
          . IEEE Computer Society.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>