<!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>Provably correct graph transformations with small-tALC?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nadezhda Baklanova</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jon Haël Brenas</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rachid Echahed</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christian Percebois</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Strecker</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hanh Nhi Tran</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>We present a prototype for executing and verifying graph transformations. The transformations are written in a simple imperative programming language, and pre- and post-conditions as well as loop invariants are specified in the Description Logic ALC (whence the name of the tool). The programming language has a precisely defined operational semantics and a sound Hoare-style calculus. The tool consists of the following sub-components: a compiler to Java for executing the transformations; a verification condition generator; and a tableau prover for an extension of ALC capable of deciding the generated verification conditions. A description of these components and their interaction is the main purpose of this paper.</p>
      </abstract>
      <kwd-group>
        <kwd>Graph Transformations</kwd>
        <kwd>Programming Language Semantics</kwd>
        <kwd>Tableau Calculus</kwd>
        <kwd>Description Logic Key Terms</kwd>
        <kwd>ModelBasedSoftwareDevelopmentMethodology</kwd>
        <kwd>FormalMethod</kwd>
        <kwd>MathematicalModel</kwd>
        <kwd>VerificationProcess</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1 CNRS and Université de Grenoble</p>
      <p>
        2 Université de Toulouse / IRIT
Provably correct transformations of graph structures become increasingly
important, for example for pointer manipulating programs, model driven engineering
(such as EMF [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]) or the Semantic Web (with representation formats such as
RDF [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]).
      </p>
      <p>
        Contributions: This paper presents a new language, called small-tALC, and
accompanying programming environment for executing graph transformations and
reasoning about them. Let us characterize in a few words what our work is about
and what it is not about:
– The primary aim of our development is to be able to reason about graph
transformations in a pre- / post-condition style: can we ensure that any
graph satisfying the pre-condition is transformed into a graph satisfying
the post-condition? Essential ingredients of such a setup are a language for
describing the transformations, and an assertional formalism for specifying
the pre- and post-conditions.
? Part of this research has been supported by the Climt project (ANR-11-BS02-016).
– The transformation language is an imperative programming language with
special operations for manipulating graphs. This language is endowed with
traditional control flow constructs (selection and loops) and elementary
statements for adding and deleting arcs of a graph. There is a select statement
that can be understood as a generalized, non-deterministic assignment
operation and whose purpose is to perform matchings of rules in a target graph.
After a high-level overview of small-tALC (Section 2), we will give a more
detailed account of the program logic (in Section 3.1) and transformation
language (in Section 3.2). Our transformation language is by no means a
full-fledged programming language: for example, arithmetic operations are
excluded.
– The transformation language is not graphical, but textual. We do not
question the utility and appeal of a graphical notation, but this issue is orthogonal
to our concerns. We can imagine to couple small-tALC with existing graphical
editors, such as Henshin [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], in the sense of translating a graphical
description of a rule to our textual format. The usefulness of the inverse direction is
less evident, because the textual format is more expressive (offering, among
others, nested loops and branching statements).
– The transformation language is executable, by a translation to Java (see
Section 4): a code generator translates small-tALC to Java code, which can
then transform graphs specified in an appropriate format.
      </p>
      <p>Altogether, we are thus primarily interested in proofs of correctness of graph
transformations, for which two major approaches have emerged:
1. Model checking of graph transformations: given an initial graph and a set of
transformation rules, check whether the graph can eventually evolve into a
graph having certain properties, or whether specific properties can be
ascertained to be always satisfied. This kind of reasoning is possible in principle
(the initial graph can be specified by a pre-condition, invariants can be
specified as loop conditions, eventuality properties as post-conditions), but our
approach is clearly not geared towards this activity.
2. Full correctness proofs: given an arbitrary graph satisfying the pre-condition,
verify that it evolves into a graph satisfying the post-condition. This is the
kind of verification we are aiming at.</p>
      <p>
        Full correctness proofs are hard, and undecidability of the generated proof
obligations is a major concern for rich logics [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. We propose to use a
relatively simple logic, ALC, belonging to the family of Description Logics (DLs).
We summarize the logic in Section 3.1, and the fine-tuned interplay of the logic
and the transformation language (among others: branching and loop conditions
are formulas of this logic) brings it about that the proof obligations extracted
from programs are decidable, as argued in Section 5. We are currently working
on extending this approach to more expressive description logics, with the
purpose of being able to tackle realistic problems in the areas of UML-style model
transformations and RDF graph database transformations.
      </p>
      <p>The work described here has reached the state of a sound prototype. In the
corresponding sections, we will make precise which parts of the development are
completed to which degree, and indicate which missing parts still have to be
filled in. The small-tALC environment is available from the following web page,
where it will be regularly updated: http://www.irit.fr/~Martin.Strecker/
CLIMT/Software/smalltalc.html.</p>
      <p>
        Related work: Hoare-like logics have already been used to reason on graph
transformations (see, e.g. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]) but, as far as we are aware, no tool has been
implemented. small-tALC, which is also based on a Hoare-like calculus, allows one
to decide the verification problem, of programs operating on graphs, when the
properties are expressed in the ALC logic. Some implementations of verification
environments for pointer manipulating programs exist [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], however they often
impose severe restrictions on the kind of graphs that can be manipulated, such
as having a clearly identified spanning tree.
      </p>
      <p>
        Other tools dedicated to reasoning on graph transformations have been
proposed. For example, the GROOVE [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] system implements model-checking
techniques using LTL or CTL formulas and thus departs from small-tALC techniques.
      </p>
      <p>
        The computation of weakest preconditions from a graph rewriting system
is described by Habel, Pennemann and Rensink [
        <xref ref-type="bibr" rid="ref8 ref9">8,9</xref>
        ]. This work is concerned
with extraction of weakest preconditions, but no proof system for the formulas
is given. Pennemann [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] then describes a method of translating the extracted
formulas to a resolution theorem prover. Radke [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] uses a more expressive logic:
MSO. The spirit of the work described in this paper is similar, but we explicitly
restrict the expressiveness of the logical framework to obtain decidable proof
problems.
      </p>
      <p>
        In a similar vein, Asztalos et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] describe the verification of graph
transformations based on category-theoretic notions and by translation to a logic for
which no complete calculus is provided.
      </p>
      <p>Raven3 is a tool suite designed to handle and manipulate graph automata.
In some sense Raven tends to generalize model-checking techniques from word
to graph processing. Therefore techniques behind Raven tool are not directly
comparable to small-tALC.</p>
      <p>
        Alloy [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] is a popular framework for specifying and exploring relational
structures, and it has been used to analyze graph transformations [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] written
in the AGG transformation engine. Alloy interfaces with model checkers and can
display counter models in case a transformation does not satisfy its specification.
For verification, Alloy uses bounded model checking: errors for graphs of a certain
size are systematically detected, but has the disadvantage that graphs beyond
that size are not covered. As opposed to this, the proof method presented here
is exhaustive, being based on a complete, decidable calculus.
3 http://www.ti.inf.uni-due.de/research/tools/raven
      </p>
    </sec>
    <sec id="sec-2">
      <title>System Description</title>
      <sec id="sec-2-1">
        <title>User’s View</title>
        <p>
          To explore the perspective of a user of small-tALC, we will walk through
processing a simple program, but before, let us take a look at the kind of graphs
we will be transforming, such as the example graph in Figure 1a (displayed with
RDF-Gravity4). We will be processing graphs in RDF [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] format. These graphs
consist of nodes and typed edges. The graphs are simple: there cannot be
multiple edges of the same type between two nodes, but several edges, each of different
type. In the example, there is only one type of relation (also called role): r. Here,
instance node a0 is linked with nodes a1, a2 and a3; similarly b0 with b1 and
b2. Nodes can be typed. In our example, we have two types (also called concepts)
A and B. Nodes ai are of type A, and nodes bj of type B. It is a matter of display
to represent concepts as (meta-)nodes in Figure 1a, and also the (meta-)relation
type as arc linking a node to its type, but these meta-entities are subject to a
different treatment than object nodes and relations.
a
r
b
r
c_1: -B A
c_2: B
(a) Input graph
(b) Counter model after
failed proof
        </p>
        <p>Let us now turn to transformation programs, as the one depicted in Figure 2.
A program is composed of one or several parameterized rules; and a
parameterless main rule whose purpose is to specify the input- and output graph to be
transformed and to identify the root nodes of the input graph. Rules can be
assimilated to non-recursive procedures or macros. Procedural abstraction is so far
not fully developed in our framework, so the analysis presented in the following
concentrates on rule bodies.</p>
        <p>The rule ex_rule has a precondition (pre) saying that node a is only
connected (via arcs of type r) to nodes of type A, and that b is only connected to
4 http://semweb.salzburgresearch.at/apps/rdf-gravity/
concepts A, B; roles r;
rule ex_rule (a, b) {
vars c;
pre: (a : ([!] r A)) &amp;&amp; (b : ([!] r B));
select c with (b r c);
add (a r c);
post: (a : ([?] r B));
}
rule main () {
vars a, b;
ingraph "input_graph.rdf";
outgraph "output_graph.rdf";
a := node("a0");
b := node("b0");
ex_rule(a, b);
}
nodes of type B. The program now does the following: among the nodes that b
is connected to, we non-deterministically pick a node c and introduce an arc r
between a and c. For example, the program might introduce an arc between a0
and b1 in the graph of Figure 1a (or between a0 and b2). We can now assert
that after running this program, the node that variable a points to is connected
via r to at least one element of type B, as expressed in the postcondition.</p>
        <p>Suppose the example program is in file example.trans. Running the verifier
as follows confirms that the program is correct, i.e. that any graph satisfying
the precondition is transformed into a graph satisfying the postcondition.
&gt; graphprover example
starting proof ...formula valid</p>
        <p>Let us modify the post-condition, claiming that a is exclusively connected to
elements of type B: post: (a : ([!] r B));</p>
        <p>When running the verifier again, we see that the property is incorrect, and
that a counter-model has been created (see Figure 1b, here displayed with
Graphviz5). This counter-model describes the state at the beginning of the
program, namely a graph with four nodes, where c1 is of type A and not of type
B, and c2 of type B. Clearly, when connecting a with c2, the post-condition is
violated.</p>
        <p>We correct the post-condition, saying that a is only connected to elements
of type A or B: post: (a : ([!] r (A [||] B))); Running the verifier again
convinces us that this property is satisfied.</p>
        <p>How does the verifier validate or invalidate a program? The approach is
classic: from the annotated program, we extract a proof obligation by computing
weakest pre-conditions (see Section 3.2). This is an ALC formula that is sent
to a tableau decision procedure (described in Section 5.2). A failed proof
attempt produces a saturated tableau from which a counter-model can always be
extracted.</p>
        <p>Operational
semantics</p>
        <p>Program
logic</p>
        <p>Decision
procedure
Code Extraction (Scala/Java)</p>
        <p>Program
prover
(verified)</p>
        <p>
          Eclipse
environment
(unverified)
Major parts of small-tALC have a strong formal basis and are being developed in
a proof assistant. We use Isabelle [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ], but the formalization is easily adaptable
to related proof assistants. Essential ingredients (see Figure 3) are the
formalization of the program logic, the semantics of the programming language and
a decision procedure of the extension of ALC we use (the latter has currently
not been completely verified yet). This formalization (written in Isabelle’s own
functional and proof language) is automatically extracted to a general-purpose
programming language, which is Scala in our case. We therefore obtain a highly
reliable program prover, which is coupled with interface functionality (such as
parsers and viewers) provided by Eclipse / Xtext to obtain the verifier described
in Section 2.1. The transformation engine, described more in detail in Section 4,
is so far unverified, but at least the Java code generator (Section 4) could be
formally verified with by now standard compiler verification techniques.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Foundations</title>
      <sec id="sec-3-1">
        <title>Logic</title>
        <p>Our logic is a three-tier framework, the first level being Description Logic (DL)
concepts, the second level facts, the third level formulas (Boolean combinations of
facts and a simple form of quantification). Formulas occur not only in assertions
(such as pre- and postconditions), but also in statements (Boolean conditions
and select statement).</p>
        <p>
          Concepts: In this paper, we concentrate on the description logic ALC [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ]. For a
being atomic concept names and r role (or relation) names, the abstract syntax
of concepts C can be defined by the grammar:
        </p>
        <sec id="sec-3-1-1">
          <title>5 http://www.graphviz.org/</title>
          <p>C ::= ? (empty concept) j a (atomic concept)
j : C (complement)
j C u C (intersection) j C t C (union)
j ([?] r C) (some) j ([!] r C) (all)
j C (explicit substitution)</p>
          <p>The semantics of DLs is given by Kripke structures or, differently speaking,
by typed graphs. Under this interpretation, concepts represent sets of individuals.
The constructors :; u; t (in Ascii notation: !,[&amp;&amp;],[||]) then have the obvious
meaning. ([?] r C) is the set of individuals x such that there is at least one
rtyped edge (x r y) between x and y, where y belongs to C. Dually, ([!] r C) is
the set of individuals x all of whose r-edges go to individuals of type C.</p>
          <p>
            The last constructor, explicit substitution [
            <xref ref-type="bibr" rid="ref17">17</xref>
            ], is a particularity of our
framework, required for a gradual elimination of substitutions, as further described in
Section 5.5. We have three kinds of substitutions :
– Replacement of a variable by another variable, of the form [x := y],
– Adding a node v to / removing a node from an atomic concept a, of the form
[a := a + fvg] respectively [a := a fvg],
– Adding an edge (v1; v2) to / removing an edge from a role r, of the form
[r := r + f(v1; v2)g] respectively [r := r f(v1; v2)g].
          </p>
          <p>Facts: Facts make assertions about an instance being an element of a concept,
and about being in a relation. The grammar of facts is defined as follows:
f act ::= i : C (instance of concept)
j i r i (instance of role)
j i (:r) i (instance of role complement)
j i i (equality of instances)
j i 6 i (inequality of instances)</p>
          <p>Please note that since concepts are closed by complement, facts are closed by
negation (the negation of a fact is again representable as a fact), and this is the
main motivation for introducing the constructors “instance of role complement”
and “inequality of instances”.</p>
          <p>Formulas: A formula is a Boolean combination of facts. We also allow
quantification over individuals i (but not over relations or concepts), and, again, have
a constructor for explicit substitution. We overload the notation ? for empty
concepts and the Falsum.</p>
          <p>f orm ::= ? j f act j :f orm
j f orm ^ f orm j f orm _ f orm
j 8i:f orm j 9i:f orm
j f orm</p>
          <p>In Figure 2, we use the Ascii notation !, &amp;&amp;, || for negation, conjunction
and disjunction. The extension of interpretations from facts to formulas is
standard. As usual, a formula that is true under all interpretations is called valid.</p>
          <p>When calculating weakest preconditions (in Section 5.1), we obtain formulas
which essentially contain no existential quantifiers; we keep them as constructor
because they can occur as intermediate result of computations. We say that a
formula is essentially universally quantified if 8 only occurs below an even and 9
only below an odd number of negations. For example, :(9x: x : C ^ :(8y: y : D))
is essentially universally quantified.
3.2</p>
          <p>Programming Language
The programming language is an imperative language manipulating relational
structures. Its distinctive features are conditions (in conditional statements and
loops) that are restricted formulas of the logic ALC, in the sense of Section 3.1.
It has a non-deterministic assignment statement select ... with allowing to
select an element satisfying a fact. Traditional types (numbers, arrays, inductive
types) and accompanying operations are not provided; the language is thus only
targeted at transformations of graphs.</p>
          <p>Statements of our language are defined by the following grammar:
stmt ::= Skip (empty statement)
j select i with f orm (assignment)
j delete(i : C) (delete element from concept)
j add(i : C) (add element to concept)
j delete(i r i) (delete edge from relation)
j add(i r i) (insert edge in relation)
j stmt ; stmt (sequence)
j if f orm then stmt else stmt
j while f orm do stmt</p>
          <p>Please note that the keywords add and delete are overloaded for nodes and
for edges. There is no direct support for creating or deleting nodes in a graph,
only for “moving” them between concepts. We intend to simulate node creation
and deletion by providing a predefined concept heap such that add(n: heap)
corresponds to creating node n and delete(n: heap) to deallocating node n.
Details still have to be worked out.</p>
          <p>The semantics is a big-step semantics with rules of the form (st; ) ) 0
expressing that executing statement st in state produces a new state 0.</p>
          <p>The rules of the semantics are given in the Figure 4. Beware that we overload
logical symbols such as 9, ^ and : for use in the meta-syntax and as constructors
of f orm.</p>
          <p>We do not enter into the details (also see the Isabelle formalization).
Intuitively, the states manipulated by the operational semantics are the same as the
interpretations of formulas, and they describe the current structure of a graph:
which nodes are contained in each concept; which pair of nodes are contained in
a role; and which variables are bound to which nodes. We write (b) to evaluate
the condition b (a formula) in state .</p>
          <p>Most of the rules are standard, apart from the fact that we do not use
expressions, but formulas as conditions. The auxiliary function delete_edge modifies
the state by removing an r-edge between the elements represented by v1 and
v2, and similarly for generate_edge. There are analogous functions for adding /
deleting in concepts.</p>
          <p>(EDel)
(Skip)</p>
          <p>(Skip; ) )
0 = delete_edge v1 r v2
(delete(v1 r v2); ) )
0
(Seq)
(c1; ) )
(c1;c2; ) )
(if b then c1 else c2; ) )
0
(IfF)
: (b) (c2; ) )</p>
          <p>0
(if b then c1 else c2; ) )
0
(WT)
(b) (c; ) )
(while b do c; ) )
00 (while b do c; 00) )
0
0
(WF)</p>
          <p>: (b)
(while b do c; ) )</p>
          <p>The statement select v with F (v) selects an element vi that satisfies formula
F , and assigns it to v. For example, select a with a : A ^ (a r b) selects an
element a which is and instance of concept A and being r-related with a given
element b.</p>
          <p>select is a generalization of a traditional assignment statement. There may
be several instances that satisfy F , and the expressiveness of the logic might
not suffice to distinguish them. In this case, any such element is selected,
nondeterministically. Let us spell out the precondition of (SelAssT): Here, [v:=vi] is
an interpretation update for individuals, modifying for variable v and assigning
it a value vi in the semantic domain. We check whether the formula b would be
satisfied under this choice, and if it is the case, keep this assignment. In case
no satisfying instance exists, the semantics blocks, i.e. the given state does not
have a successor state, which can be considered as an error situation.
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Executing Graph Transformations</title>
      <p>Generating Java Code: For processing small-tALC programs such as the one in
Figure 2 and generating Java code, we use the Eclipse environment and, in
particular, the Xtext6 facilities for parsing, syntax highlighting and context-dependent
help. The program prover is currently not fully integrated in this framework, so</p>
      <sec id="sec-4-1">
        <title>6 http://www.eclipse.org/Xtext/</title>
        <p>that the interaction with the prover is performed via shell commands as described
in Section 2.1.</p>
        <p>In order to generate Java code for small-tALC programs, we parse the
program and then traverse the syntax tree with Xtext/Xtend, issuing calls to
appropriate Java functions that manipulate a graph (which is initially the input
graph provided in the program’s main rule). Here is a glimpse at the Xtend code
snippet that translates statements, in particular the add statement for roles:
def statement(Stmt s){
switch s{</p>
        <p>Add_stmt: add(s.lvar,s.role,s.rvar)
...</p>
        <p>}
}
def add(String lvar,String role,String rvar)’’’</p>
        <p>«graph».insertEdge(«lvar»,«role»,«rvar»);’’’</p>
        <p>
          Thus, a small-tALC program fragment add(a r b); is translated to a Java
call g.insertEdge(a, r, b);, where the graph g is the current graph.
Transforming Graphs: Once a Java program has been generated for a given
small-tALC program, it can be compiled and linked with a library that provides
graph manipulating functions such as the above-mentioned insertEdge. When
executing this program, it remains to read an input file containing a graph
description, to perform the transformation and to output the new graph. We
represent graphs in the RDF [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] format. Parsing and printing of RDF files is
based on the Apache Jena framework7.
5
5.1
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Reasoning about Graph Transformations</title>
      <sec id="sec-5-1">
        <title>Weakest Preconditions</title>
        <p>For proving program correctness, we use a standard approach in program
verification. For proving that a program prog establishes the postcondition Q if
started in a state satisfying the precondition P , we calculate the weakest
precondition of prog with respect to Q and then show that P implies this weakest
precondition.</p>
        <p>
          The details are inspired by the description in [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]: we compute weakest
preconditions wp (propagating post-conditions over statements and taking loop
invariants for granted) and verification conditions vc that aim at verifying loop
invariants. Both take a statement and a DL formula as argument and produce a
DL formula. For this purpose, while loops have to be annotated with loop
invariants, and the while constructor becomes: while ff ormg f orm do stmt. Here,
the first formula (in braces) is the invariant, the second formula the termination
condition. The two functions are defined by primitive recursion over statements,
see Figure 5 for the definition of wp (and the Isabelle sources for vc).
7 http://jena.apache.org/
wp(Skip; Q) = Q
wp(delete(v : C); Q) = Q[C := C fvg]
wp(add(v : C); Q) = Q[C := C + fvg]
wp(delete(v1 r v2); Q) = Q[r := r (v1; v2)]
wp(add(v1 r v2); Q) = Q[r := r + (v1; v2)]
wp(select v with b; Q) = 8v:(b ! Q)
wp(c1; c2; Q) = wp(c1; wp(c2; Q))
wp(if b then c1 else c2; Q) = ite(b; wp(c1; Q); wp(c2; Q))
wp(whilefivg b do c; Q) = iv
        </p>
        <p>Without going further into program semantics issues, let us only state the
following soundness result that relates the operational semantics and the functions
wp and vc:
Theorem 1 (Soundness). If vc(c; Q) is valid and (c; ) )
implies 0(Q).
0, then (wp(c; Q))</p>
        <p>What is more relevant for our purposes is the structure of the formulas
generated by wp and vc, because it has an impact on the decision procedure for the
DL fragment under consideration here. Besides the notion of “essentially
universally quantified” introduced in Section 3.1, we need the notion of quantifier-free
formula: A formula not containing a quantifier. In extension, we say that a
statement is quantifier-free if all of its formulas are quantifier-free.</p>
        <p>By induction on c, one shows:
Lemma 1 (Universally quantified). Let Q be essentially universally
quantified and c be a quantifier-free statement. Then wp(c; Q) and vc(c; Q) are
essentially universally quantified.</p>
        <p>There is one major problem with the definition of function wp: the
substitutions, such as C := C fvg or r := r (v1; v2). When conceiving them as a
meta-operations, as is usually done, we see that substitutions would yield
syntactically ill-formed formulas. For example, reducing ([?] r C)[C := C fvg] would
give ([?] r (C fvg)), which is not a valid concept expression. There are two ways
out of this difficulty: we could either relax our syntax and accept expressions of
the form ([?] r (C fvg)). This would induce a rather heavy change on the logic.
Alternatively, we can treat substitution as a constructor of our language. This is
the approach we have adopted, and therefore, substitutions appear as syntactic
elements in the definitions of Section 3.1. It remains to be seen (in Section 5.2)
how substitutions can be dealt with by proof methods of ALC.
5.2</p>
        <p>
          Tableau Method
The core of the decision procedure for proving the verification conditions that
are obtained as described in Section 5.1 is a tableau calculus which combines
the traditional logical rules of a tableau calculus [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ] with rules for progressively
eliminating the substitutions which are not part of the logic ALC.
        </p>
        <p>As a consequence, and departing again from common practice in the DL
literature, our tableau procedure does not manipulate facts (in the sense of
Section 3.1), but formulas, i.e. Boolean combinations of facts. This extension
becomes necessary because elimination of substitutions generates complex
formulas. These could in principle be directly decomposed into sub-tableaux, but
such a procedure obscures both the presentation and the implementation.
Preprocessing: The tableau manipulates quantifier-free formulas in negation
normal form (nnf ).</p>
        <p>The formulas obtained from function vc do possibly contain quantifiers, but
as mentioned before, the formulas are essentially universally quantified. To get
rid of these quantifiers, we therefore perform the following steps:
– We convert the entry formula f to a prenex normal form, i.e. a form 8x1 : : : xn:b
with quantifier-free body b.
– We drop the quantifier prefix; more precisely, we replace the bound variables
x1 : : : xn in b by free variables. This transformation preserves validity.
– We start the tableau with nnf (:b). The procedure is a satisfiability check
that either produces an empty tableau (meaning that f is valid) or a model
of :b that is a counter-example of f .</p>
        <p>In negation normal form, negations only occur in front of atomic concepts
(of the form :a, where a is an atomic concept). This invariant is maintained
throughout the tableau procedure.
5.3</p>
        <p>Tableau Rules
In the following, we present a high-level description of the tableau procedure.
(The reader consulting the Isabelle theories will notice that the formalization is
on two levels: a set-based, relational version, aiming at proving essential
properties such as soundness and completeness of the rules; and a list-based
implementation. The formal proofs of these theories are not yet finalized.)</p>
        <p>A tableau manipulates sets of branches (also called abox es - “assertional
boxes” in DL terminology). Each branch is a set of formulas. We first
concentrate on a set of rules aiming at decomposing formulas on a single branch. They
have the form ,! 0, expressing that branch is rewriten to 0. We write
; f instead of [ ff g for adding formula f to . The rules are displayed in
Figure 6.</p>
        <p>Let us comment on the rules: The structural rules conjC, disjCr, disjCl
(for concepts) and conjF, disjFr, disjFl (for formulas) should be clear. The
rule all allows to conclude y : C if x is only r-connected to elements of type
C, and there is an arc (x r y). The rule some inserts an arc (x r z) and a
membership z : C for an arbitrary z if it is known that x is r-connected to at
least one element of type C. The rule eq propagates an equality x y in the
branch, provided the equality is not x x.</p>
        <p>conjC
(x : (C1 u C2)) 2
not((x : C1) 2
and (x : C2) 2</p>
        <p>)
,! ; (x : C1); (x : C2)
disjCr
disjCl
all
(x : (C1 t C2)) 2
(x : (C1 t C2)) 2
(x : ([!] r C)) 2</p>
        <p>(x : C1) 2=
,! ; (x : C1)</p>
        <p>(x : C1) 2=
,! ; (x : C2)
(x r y) 2
,! ; (y : C)
(x : C2) 2=
(x : C2) 2=
(y : C) 2=
some
(x : ([?] r C)) 2
for all y; not((x r y) 2
,! ; (x r z); (z : C)
and (y : C) 2
)
subst
(x : (C )) 2
,! ; nnf (push((x : C) ))</p>
        <p>nnf (push((x : C) )) 2=
eq
(x
y) 2
,!</p>
        <p>x 6= y
[x := y]
conjF
f1 ^ f2 2
not(f1 2
and f2 2</p>
        <p>)
,! ; f1; f2
disjFr
f1 _ f2 2</p>
        <p>f1 2=
,! ; f1
f2 2=
disjFl
f1 _ f2 2</p>
        <p>f1 2=
,! ; f2
f2 2=</p>
        <p>The rule subst is applicable for concepts with substitutions. As motivated in
Section 5.1, substitutions cannot be eliminated at once, but they can be removed
progressively, whenever the tableau prover hits on a fact of the form (x : C ).
Note that the variable x was possibly not present in the original tableau with
which we have started the proof, but may have been introduced by a some-rule.
If we encounter such a situation, we push the substitution as far as possible. We
postpone the details to Section 5.5.</p>
        <p>A branch contains a clash (clash( )) if either of the following holds:
– for x a variable, (x : ?) 2
– for x a variable and a an atomic concept, (x : a) 2
– for x; y variables, (x r y) 2 and (x (:r) y) 2
and (x : :a) 2
– for x a variable, (x 6 x) 2
– ? 2</p>
        <p>Tableau Procedure
We can now formulate a depth-first-search function df s exploring a tableau. The
function takes a tableau (here implemented as a list of branches) and returns
a list of models. Initially, the tableau is just the formula [ff g] to be proved. If
the resulting list is empty, f is not satisfiable. Otherwise, the list contains an
element which is a model of f .</p>
        <p>df s[ ] = [ ]
df s( :: s) = if clash( )
then df s( s)
else if reducible( )
then df s(f 0j ,!
else [ ]</p>
        <p>The procedure progressively eliminates all inconsistent branches (with clash( )).
If a branch is not inconsistent, but reducible (i.e. , there exists a 0 with
,! 0), then we expand the tableau and explore the new branches.
5.5</p>
        <p>Eliminating Substitutions
The push function used in the subst rule of Figure 6 pushes substitutions into
formulas, “as far as possible”. The remaining tableau rules then decompose
formulas until substitutions hidden in subformulas become apparent and the subst
rule can be applied again. Intuitively speaking, this process decreases the “height”
of the substitutions in a formula, until they eventually disappear.</p>
        <p>For a formula f , we define push(f ) as the formula f 0 which is the result of
the rewrite system spelled out in the following. Thus: push(f ) = f 0 iff f f 0,
where the rewrite relation is defined in the following. There are numerous
cases to consider, and we do not present all of them.</p>
        <p>Substitution in formulas are pushed into subformulas:
– ? ?
– (:f )
– (f1 ^ f2)
– (f1 _ f2)
(:f )
(f1 ^ f2 )
(f1 _ f2 )
– (x : :C)
– (x : C1 u C2)
– (x : C1 t C2)
Substitution in facts: Substitutions of individual variables f [x := y] are carried
out as expected. Otherwise, we procede as follows:
– For substitutions of the form a := a fvg or a := a + fvg:
(x : c)[a := a fvg] (x : c) for a 6= c, and similarly for a := a + fvg
(x : a)[a := a fvg] (x : a) ^ x 6= v
(x : a)[a := a + fvg] (x : a) _ x = v
(x : ([?] r C))[a := a fvg] (x : ([?] r C[a := a fvg])), and
similarly for the other combinations involving constructor [?] or [!] and
substitutions a := a + = fvg.
– For substitutions of the form r := r f(v1; v2)g or r := r + f(v1; v2)g:
(x : c)[r := r f(v1; v2)g] x : c, and similarly for r + f(v1; v2)g
(x : ([!] r0 C))[r := r f(v1; v2)g] (x : ([!] r0 C)) for r 6= r0
(x : ([!] r C))[r := r f(v1; v2)g]
ite ((x = v1) ^ (v2 : (:C[r := r (v1; v2)])) ^ (v1 r v2);
(x : (&lt; 2 r (:C[r := r (v1; v2)])));
(x : ([!] r C[r := r (v1; v2)])))
Here, ite is for if-then-else: ite(a; b; c) = (a ! b) ^ (:a ! c).</p>
        <p>Please note that the logic ALC cannot completely express the effect of
substitution, and we have to resort to the more expressive logic ALCQ,
which turns out to be complete for substitutions. Thus, the “then” branch
of the ite construct expresses that x is r-connected to less than 2 elements
of (:C[r := r (v1; v2)]). We have however not yet implemented tableau
rules for ALCQ, so we stick to the simpler logic in this presentation.
(x : ([!] r C))[r := r + f(v1; v2)]
:((x = v1) ^ (v2 : :(C[r := r + (v1; v2)])) ^ (v1 (:r) v2))
^(x : ([!] r (C[r := r + (v1; v2)])))</p>
        <p>Similar rules for existential quantification (x : ([?] r C)).
6</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>We have presented small-tALC, a framework for executing graph
transformations and proving their correctness with a sound and complete calculus. One of
the distinctive features of the approach is its formal semantic basis. We are now
moving towards application, such as Sparql Query and Update in the
knowledge representation world, and model transformations as used in model-driven
engineering. The greatest challenge is the development of logics that are more
expressive than ALC but remain decidable. Even though a low proof-theoretic
complexity is not a major concern for program correctness proofs (these are
not executed on a large knowledge base), the concern changes when wanting to
execute programs efficiently on a large data set.</p>
      <p>
        Acknowledgements We are grateful to María Espinoza who has helped us
explore the applicability of graph transformations to the RDF world [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Budinsky</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brodsky</surname>
            ,
            <given-names>S.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Merks</surname>
          </string-name>
          , E.: Eclipse Modeling Framework. Pearson
          <string-name>
            <surname>Education</surname>
          </string-name>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Cyganiak</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanthaler</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wood</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>RDF 1.1 Concepts and Abstract Syntax</article-title>
          . http://www.w3.org/TR/rdf11-
          <fpage>concepts</fpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Arendt</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Biermann</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jurack</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krause</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Taentzer</surname>
          </string-name>
          , G.:
          <article-title>Henshin: Advanced concepts and tools for in-place EMF model transformations</article-title>
          .
          <source>In: Proceedings of MoDELS'10. Volume 6394 of LNCS</source>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Immerman</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rabinovich</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reps</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sagiv</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yorsh</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>The boundary between decidability and undecidability for transitive-closure logics</article-title>
          . In Marcinkowski, J.,
          <string-name>
            <surname>Tarlecki</surname>
          </string-name>
          , A., eds.: Computer Science Logic. Volume
          <volume>3210</volume>
          <source>of LNCS</source>
          . Springer Berlin / Heidelberg (
          <year>2004</year>
          )
          <fpage>160</fpage>
          -
          <lpage>174</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Poskitt</surname>
            ,
            <given-names>C.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plump</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Hoare-style verification of graph programs</article-title>
          .
          <source>Fundamenta Informaticae</source>
          <volume>118</volume>
          (
          <issue>1-2</issue>
          ) (
          <year>2012</year>
          )
          <fpage>135</fpage>
          -
          <lpage>175</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Møller</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwartzbach</surname>
            ,
            <given-names>M.I.:</given-names>
          </string-name>
          <article-title>The pointer assertion logic engine</article-title>
          .
          <source>In: PLDI</source>
          . (
          <year>2001</year>
          )
          <fpage>221</fpage>
          -
          <lpage>231</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ghamarian</surname>
            ,
            <given-names>A.H.</given-names>
          </string-name>
          , de Mol,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Rensink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Zambon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Zimakova</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Modelling and analysis using GROOVE</article-title>
          .
          <source>STTT</source>
          <volume>14</volume>
          (
          <issue>1</issue>
          ) (
          <year>2012</year>
          )
          <fpage>15</fpage>
          -
          <lpage>40</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Habel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pennemann</surname>
            ,
            <given-names>K.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rensink</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Weakest preconditions for high-level programs</article-title>
          . In Corradini,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Ehrig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            ,
            <surname>Ribeiro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Rozenberg</surname>
          </string-name>
          , G., eds.:
          <article-title>Graph Transformations (ICGT), Natal, Brazil</article-title>
          . Volume
          <volume>4178</volume>
          <source>of LNCS</source>
          . Springer Verlag, Berlin (
          <year>September 2006</year>
          )
          <fpage>445</fpage>
          -
          <lpage>460</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Habel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pennemann</surname>
            ,
            <given-names>K.H.</given-names>
          </string-name>
          :
          <article-title>Correctness of high-level transformation systems relative to nested conditions</article-title>
          .
          <source>MSCS</source>
          <volume>19</volume>
          (
          <issue>02</issue>
          ) (
          <year>2009</year>
          )
          <fpage>245</fpage>
          -
          <lpage>296</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Pennemann</surname>
            ,
            <given-names>K.H.</given-names>
          </string-name>
          :
          <article-title>Resolution-like theorem proving for high-level conditions</article-title>
          . In Ehrig, H.,
          <string-name>
            <surname>Heckel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rozenberg</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Taentzer</surname>
          </string-name>
          , G., eds.:
          <source>Graph Transformations. Volume 5214 of LNCS</source>
          . Springer Berlin / Heidelberg (
          <year>2008</year>
          )
          <fpage>289</fpage>
          -
          <lpage>304</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Radke</surname>
          </string-name>
          , H.:
          <article-title>HR* graph conditions between counting monadic second-order and second-order graph formulas</article-title>
          .
          <source>ECEASST</source>
          <volume>61</volume>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Asztalos</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lengyel</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Levendovszky</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Formal specification and analysis of functional properties of graph rewriting-based model transformation</article-title>
          .
          <source>Software Testing, Verification and Reliability</source>
          <volume>23</volume>
          (
          <issue>5</issue>
          ) (
          <year>2013</year>
          )
          <fpage>405</fpage>
          -
          <lpage>435</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Jackson</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Software Abstractions: Logic, language, and analysis</article-title>
          . MIT Press (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Baresi</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Spoletini</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>On the use of Alloy to analyze graph transformation systems</article-title>
          . In Corradini,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Ehrig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            ,
            <surname>Ribeiro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Rozenberg</surname>
          </string-name>
          , G., eds.:
          <source>Graph Transformations. Volume 4178 of LNCS</source>
          . Springer (
          <year>2006</year>
          )
          <fpage>306</fpage>
          -
          <lpage>320</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Nipkow</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulson</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          , Wenzel, M.:
          <article-title>Isabelle/HOL. A Proof Assistant for HigherOrder Logic</article-title>
          . Volume
          <volume>2283</volume>
          <source>of LNCS</source>
          . Springer Berlin / Heidelberg (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Expressive number restrictions in description logics</article-title>
          .
          <source>Journal of Logic and Computation</source>
          <volume>9</volume>
          (
          <issue>3</issue>
          ) (
          <year>1999</year>
          )
          <fpage>319</fpage>
          -
          <lpage>350</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Abadi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cardelli</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Curien</surname>
            ,
            <given-names>P.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lévy</surname>
            ,
            <given-names>J.J.:</given-names>
          </string-name>
          <article-title>Explicit substitutions</article-title>
          .
          <source>Journal of Functional Programming</source>
          <volume>1</volume>
          (
          <issue>4</issue>
          ) (
          <year>October 1991</year>
          )
          <fpage>375</fpage>
          -
          <lpage>416</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Nipkow</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klein</surname>
          </string-name>
          , G.:
          <article-title>Concrete Semantics</article-title>
          . http://www21.in.tum.de/~nipkow/ Concrete-Semantics/ (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Tableau algorithms for description logics</article-title>
          . In Dyckhoff, R., ed.:
          <source>Automated Reasoning with Analytic Tableaux and Related Methods. Volume 1847 of LNCS</source>
          . Springer (
          <year>2000</year>
          )
          <fpage>1</fpage>
          -
          <lpage>18</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Espinoza</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          :
          <article-title>Transformation de graphes en RDF</article-title>
          .
          <source>Master's thesis</source>
          , Université de Toulouse (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>