





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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
The
Module The LTL syntax, in a typewriter approximation of themathematical syntax, is supported in Maude by thefollowing
functional module (in the file model-checker.maude ). fmod LTL is sorts Prop Formula .subsort Prop < Formula. *** primitive LTL operators ops True False : -> Formula [ctor format (g o)] .op ~_ : Formula -> Formula [ctor prec 53 format (r o d)] .op _/_ : Formula Formula -> Formula [comm ctor gather (E e) prec 55 format (d r o d)]. op / : Formula Formula -> Formula [comm ctor gather (E e) prec 59 format (d r o d)]. 2
eq [] f = False R f .eq f W g = (f U g) / [] f .eq f |-> g = [](f -> (<> g)) .eq f => g = [] (f -> g) .eq f <=> g = [] (f <-> g). *** negative normal form eq ~ True = False .eq ~ False = True .eq ~ ~ f = f .eq ~ (f / g) = ~ f /\ ~ g .eq ~ (f /\ g) = ~ f / ~ g .eq ~ O f = O ~ f .eq ~(f U g) = (~ f) R (~ g) .eq ~(f R g) = (~ f) U (~ g). endfm 4
The
Module (II) Note the subsort Prop of Formula , corresponding to the set AP of atomic propositions. For the moment this is left unspecified. We will explain in what follows how suchatomic propositions are defined for a given system module
. Note that the nonconstructor connectives have been definedin terms of more basic constructor connectives in the firstset of equations. But since there are good reasons to putan LTL formula in negative normal form by pushing the negations next to the atomic propositions (this is specifiedby the second set of equations) we need to consider alsothe duals of the basic connectives
, and
as constructors. That is, we need to also have as constructorsthe dual connectives:
, and
(note that
is self-dual). 5
Associating Kripke structures to Rewrite Theories (II) This is because the state predicates need not be related tothe operational semantics of
: they are just certain predicates about the states of the system specified by
that are needed to specify some properties . Therefore, after choosing a given kind, say [Foo] , in
as our kind for states we can specify the relevant statepredicates in a module
protecting
according to the following general pattern: mod M-PREDS is protecting M. including SATISFACTION .subsort Foo < State .... endm 7
Associating Kripke structures to Rewrite Theories (III) Where the dots ‘
’ indicate the part in which the syntax and semantics of the relevant state predicates is specified,as further explained in what follows. The module SATISFACTION (which is contained in the file model-checker.maude ) is very simple, and has the following specification: fmod SATISFACTION is protecting LTL .sort State .op |= : State Formula ~> Bool. endfm where the sort State is unspecified. However, by importing SATISFACTION into
and giving the subsort declaration 8
Associating Kripke structures to Rewrite Theories (V) In Maude we can define parametric state predicates, that is, operators of sort Prop which need not be constants, but may have one or more sorts as parameter arguments. Wethen define the semantics of such state predicates (when the predicate holds) by appropriate equations.We can illustrate all this by means of a simple mutualexclusion example. Suppose that our original systemmodule
is the following module
, in which two processes, one named a and another named b , can be either waiting or in their critical section, and take turns accessingtheir critical section by passing each other a different token (either
or
). 10
Associating Kripke structures to Rewrite Theories (VI) mod MUTEX is sorts Name Mode Proc Token Conf .subsorts Token Proc < Conf .op none : -> Conf .op __ : Conf Conf -> Conf [assoc comm id: none] .ops a b : -> Name .ops wait critical : -> Mode .op [,] : Name Mode -> Proc .ops * $ : -> Token .rl [a-enter] : $ [a,wait] => [a,critical] .rl [b-enter] : * [b,wait] => [b,critical] .rl [a-exit] : [a,critical] => [a,wait] * .rl [b-exit] : [b,critical] => [b,wait] $. endm 11
Associating Kripke structures to Rewrite Theories (VIII) Note the two equations, defining when each of the twoparametric state predicates holds in a given state.The above example illustrates a general method by which desired state predicates for a module
are defined in a protecting extension, say
, of
which imports SATISFACTION . One specifies the desired states by choosing a sort in
and declaring it as a subsort of State
. One then defines the syntax of the desired state predicates as operators of sort Prop , and defines their semantics by means of a set of equations that specify for what states a given statepredicate evaluates to true . 13
Associating Kripke structures to Rewrite Theories (IX) We assume that those equations, when added to those of
, are (ground) Church-Rosser and terminating.Note that only the cases when a predicate holds need to be specified: given a state t and a, possibly parametric, state predicate p
u 1 ,... , u n
, when the ground expression t
p
u 1 ,... , u n
cannot be simplified to true , then the predicate does not hold. This means that to specify the semantics of the state predicates it is enough to give(possibly conditional) equations of the general form, t
p
v 1 ,... , v n
true if
There is in principle no need to specify when a statepredicate is false . 14
Associating Kripke structures to Rewrite Theories (XI)
Π
θ
p
p
, θ ground substitution
where, by convention, we use the simplified notation θ
p
to denote the ground term θ
p
x 1 ,... , x n
. This defines a labeling function
Π on the set of states T Σ /E,k assigning to each
t
Σ /E,k the set of atomic propositions,
Π
t
θ
p
Π
t
θ
p
true
The Kripke structure we are interested in is then
, k
Π
Σ /E,k
1 R
Π
16
Associating Kripke structures to Rewrite Theories (XII) Where
1 R
-rewriting relation
1 R among states of kind k , that is,
t
1 R
t ′
holds iff there are u
t
and u ′^
t ′
such that u ′^ is the result of applying one of the rules in
to u at some position.Under the usual assumptions that
is (ground) Church-Rosser and terminating (perhaps modulo someaxioms
contained in
) and
is (ground) coherent relative to
, u can always be chosen to be the canonical from of t under the equations
. In terms of the initial algebra
Reach ( R ) , we have the equivalent characterization, [ t
1 R
t
t
t
Reach ( R ) ,Arrow 1
17
Decidability of Propositional LTL (II) A decision procedure of this kind is called a model checking algorithm , since it checks whether ϕ holds in the model
with initial state a
. Detailed discussion of such algorithms for a variety of temporal logics such as
, and
∗ is beyond the scope of this course; see the excellent text“Model Checking” by Clark, Grumberg, and Peled. Thereare two rough classes of model checking algorithms:
explicit-state model checking algorithms, that explicitly search the state space of
to find a counterexample;
symbolic model checking algoritms, that use a symbolic Boolean representation of sets of states (typically BDDs) to compute the fixpoint of the transitionrelation, i.e., the set Reach A
a
. 19
The Maude Model Checker Suppose that, given a system module
specifying a rewrite theory
, E, φ, R
, we have:
chosen a kind k in
as our kind of states;
defined some state predicates
and their semantics in a module, say
, protecting
by the method already explained in this lecture. Then, as explained earlier, this defines a Kripke structure K
, k
Π on the set of atomic propositions
Π
. Given an initial state
t
Σ /E,k and an LTL formula ϕ
Π
we would like to have a procedure to decide the satisfactionrelation, 20