





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of reachability models in rewriting logic, which is a logical framework for reasoning about concurrent systems. A reachability model is a pair of a σ-algebra and a family of binary relations that satisfy certain conditions. The document also covers the notions of satisfaction, soundness and completeness, reachability homomorphisms, and the initial model tr. Additionally, it touches upon the importance of coherence in rewriting logic and its relationship with the equality rule and rewriting proofs.
Typology: Study notes
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















Jos´
e Meseguer
Computer Science Department
University of Illinois at Urbana-Champaign
1
Reachability Models
The models of equational theories are algebras. What arethe models of rewrite theories? There are several answersto this question. The simplest answer, which we shall use inthis course, is that they are
reachability models
.
By definition, given a pair
, φ
, with
a membership
equational signature and
φ
a function specifying frozenness
information for
, then a
, φ
-reachability model is a pair
→
A
where:
A, ι
A
is a
-algebra, and
A
A
,k
k
∈
K
a
-indexed family of binary relations,
with
A
,k
2 k
such that:
2
Satisfaction
By definition, a
, φ
-reachability model
→
A
satisfies
a rewrite theory
, E, φ, R
, written
→
, if
an only if it satisfies each equation
e
and each rule in
r
, written
→
e
, and
→
r
, which means:
, and
for each rewrite rule in
,
l
t
t
′
i
u
i
u
′ i
j
v
j
s
j
l
w
l
w
′ l
with, say
t, t
′
of kind
k
, and
w
l
, w
′ l
of kind
k
l
, and for
each assignment
a
such that: (i)
i
a
u
i
a
u
′ i
, (ii)
j
a
v
j
s
j
, and (iii)
l
a
w
l
A
,k
l
a
w
′ l
, we have,
a
t
A
,k
a
t
′
4
Soundness and Completeness of Rewriting Logic
The following theorem can be easily proved by induction ofthe depth of a rewriting logic proof and is left as anexercise: Theorem
(Soundness). For each rewrite theory
, E, φ, R
and
, φ
-reachability model
→
A
such that
→
we have:
t
t
′
→
t
t
′
Rewriting logic is also
complete
(Bruni and Meseguer, Proc.
ICALP’03), that is, we have:
t
t
′
t
t
′
5
The Initial Model
R
The most obvious reachabilty model for a rewrite theory R
, E, φ, R
is the model
R
Σ
/E
R
, where, by
definition,
t
R
t
′
t
t
′
This is indeed a reachability model, and
R
, because
(exercise) all the requirements are guaranteed by
Σ
/E
being
a
-algebra and by the inference rules of rewriting logic.
Using the Soundness Theorem and the initiality theorem formembership equational logic it is then nontrivial butrelatively easy to prove (exercise) that we have:
7
The Initial Model
R
(II)
Theorem
. (Initiality Theorem). Assuming that
is
sensible,
R
is initial in the class of reachability models that
satisfy
. That is, if
→
, then there is a unique
, φ
-reachability homomorphism
eval
RA
→
R
→
Therefore, when reasoning about a concurrent systemspecified by a rewrite theory
, for example as a system
module in Maude, we will view
R
as the
standard model
specified by
, that is, as the mathematical model denoted
by the specification
. In other words, the initial algebra
semantics of equational logic generalizes in a natural way toan initial reachability model semantics for rewriting logic.
8
Executing Rewrite Theories (II)
The best possible situation is assuming that
is a
collection
of equational axioms, such as associativity,
commutativity, and identity, for which we have an A
matching algorithm
, so that given a rewrite rule
t
t
′
and terms
u
′
, v
′
it becomes
decidable
whether we can
perform a one-step rewrite
u
v
using
t
t
′
with
u
A
u
′
and
v
A
v
′
. Recall Lecture 5, where (changing
there by
here) the analogue of the
Equality
inference step was
achieved with the decidable relation
R/A
.
In practice, what may be reasonable to have as equations ina rewrite theory
is a disjoint union
with
as above
and
ground confluent, sort-decreasing, and terminating
modulo
, that is, the usual executability assumptions for
functional modules.
10
Executing Rewrite Theories (III)
The key idea is now the following. Given a rewrite theory R
A, φ, R
with
having the just-mentioned
executability assumptions we can
simulate it and make it
decidable
by means of the rewrite theory
, A, φ,
,
where, by definition,
t
t
′
t
t
′
.
In what follows we will assume that both the equations
and the rules
are
unconditional
, and that for each rule
t
t
′
in
,
vars
t
′
vars
t
. The ideas can be generalized
to the conditional case but this requires a somewhat morecomplex transformed theory
. The equivalence we want is:
t
t
′
can
E/A
t
can
E/A
t
′
11
Coherence
Assuming
confluent (resp. ground confluent),
sort-decreasing and terminating modulo
, we say that the
rules
are
coherent
(resp. ground coherent) with
modulo
relative to
φ
if for each
-term
t
(resp. ground
-term
t
) such that
t
1 R
φ
/A
t
′
and
u
can
E/A
t
we have:
t
1
R
φ
!
E/A
t
′
!
E/A
w
u
1
R
φ
u
′
!
13
Coherence (II)
Throughout we will assume that
is any combination of
associativity, commutativity, and identity axioms, and that
is preregular modulo
. The relation
E/A
is the relation
of rewriting with
modulo
zero, one, or more steps,
denoted
∗ E/A
in Lecture 5. The symbol “
” indicates a
terminating rewrite. The one-step rewriting relation
1 R
φ
/A
with
modulo
is the restriction to frozennes conditions
φ
of what would be denoted
R/A
in Lecture 5.
The TCS paper by Viry (TCS 285, 487–517, 2002) gives“critical pair-like” conditions to check coherence. TheMaude Coherence Checker Tool can check coherencemodulo commutativity. A future version will perform suchchecks modulo other axiom combinations
.
14
Congruence’
. For each
f
k
1
... k
n
k
in
, with
j
,... , n
φ
f
, with
t
i
Σ
k
i
,
i
n
, and
with
t
′ j
Σ
k
j
,
t
j
1
t
′ j
f
t
1
,... , t
j
,... , t
n
1
f
t
1
,... , t
′ j
,... , t
n
Replacement’
. For each rule in
of the form,
l
t
t
′
i
u
i
u
′ i
j
v
j
s
j
k
w
k
w
′ k
and finite substitution
θ
Σ
,
i
θ
u
i
θ
u
′ i
j
θ
v
j
s
j
k
θ
w
k
θ
w
′ k
θ
t
1
θ
t
′
Transitivity’
t
1
1
t
2
t
2
t
3
t
1
t
3
16
More on Rewriting Proofs (II)
The two main lemmas below about this equivalent inferencesystem have somewhat tedious but essentiallyunproblematic proofs by induction, that are left as exercises. Lemma
(Equivalence)
t
t
′
′
t
t
′
Lemma
(Sequentialization) Wenever we have
′
t
t
′
there is an
n
and proofs
′
t
i
1
t
′ i
,
i
n
, such that:
t
t
1
,
t
′ i
t
i
,
i
n
, and
t
′ n
t
′
.
17
Semantic Equivalence through Coherence (II)
For
n
we have
can
E/A
t
can
E/A
t
′
and a proof in
can be found by
Reflexivity
and
Equality
. Let us assume
that the result holds for
n
and let us prove it for
n
. The
point is then that, by repeated application of
Equality
and
Transitivity
, we can build proofs
′
t
t
n
and
′
t
n
t
′
, where the first proof can be
sequentialized with
n
1-step rewrites, and the second with
only one 1-step rewrite. By the induction hypothesis wethen have
can
E/A
t
can
E/A
t
n
. So we will be done
by repeatedly using
Transitivity’
if we can show
can
E/A
t
n
can
E/A
t
′
. Note that we have a proof
′
t
n
1
t
′ n
, which by its very definition makes
no use of
Equality
. Therefore we have a one-step rewrite
t
n
1 R
φ
t
′ n
, and
a fortiori
t
n
1 R
φ
/A
t
′ n
.
19
Semantic Equivalence through Coherence (III)
We also have a proof
t
′ n
t
′
; therefore
can
E/A
t
′ n
can
E/A
t
′
. The desired proof of
can
E/A
t
n
can
E/A
t
′
then follows by Coherence
(see diagram) by repeated application of
Equality
and
Transitivity
. q.e.d. t
n
1
R
φ
!
E/A
t
′ n
!
E/A
can
E/A
t
′
can
E/A
t
n
1
R
φ
u
′
!
E/A
20