fbpx
Wikipedia

Difference bound matrix

In model checking, a field of computer science, a difference bound matrix (DBM) is a data structure used to represent some convex polytopes called zones. This structure can be used to efficiently implement some geometrical operations over zones, such as testing emptyness, inclusion, equality, and computing the intersection and the sum of two zones. It is, for example, used in the Uppaal model checker; where it is also distributed as an independent library.[1]

More precisely, there is a notion of canonical DBM; there is a one-to-one relation between canonical DBMs and zones and from each DBM a canonical equivalent DBM can be efficiently computed. Thus, equality of zone can be tested by checking for equality of canonical DBMs.

Zone edit

A difference bound matrix is used to represents some kind of convex polytopes. Those polytopes are called zone. They are now defined. Formally, a zone is defined by equations of the form  ,  ,   and  , with   and   some variables, and   a constant.

Zones have originally be called region,[2] but nowadays this name usually denote region, a special kind of zone. Intuitively, a region can be considered as a minimal non-empty zones, in which the constants used in constraint are bounded.

Given   variables, there are exactly   different non-redundant constraints possible,   constraints which use a single variable and an upper bound,   constraints which uses a single variable and a lower bound, and for each of the   ordered pairs of variable  , an upper bound on  . However, an arbitrary convex polytope in   may require an arbitrarily great number of constraints. Even when  , there can be an arbitrary great number of non-redundant constraints  , for   some constants. This is the reason why DBMs can not be extended from zones to convex polytopes.

Example edit

As stated in the introduction, we consider a zone defined by a set of statements of the form  ,  ,   and  , with   and   some variables, and   a constant. However some of those constraints are either contradictory or redundant. We now give such examples.

  • the constraints   and   are contradictory. Hence, when two such constraints are found, the zone defined is empty.
     
    Figure in   showing  ,   which are disjoint
  • the constraints   and   are redundant. The second constraint being implied by the first one. Hence, when two such constraints are found in the definition of the zone, the second constraint may be removed.
     
    Figure in   showing   and   which contains the first figure

We also give example showing how to generate new constraints from existing constraints. For each pair of clocks   and  , the DBM has a constraint of the form  , where   is either < or ≤. If no such constraint can be found, the constraint   can be added to the zone definition without loss of generality. But in some case, a more precise constraint can be found. Such an example is now going to be given.

  • the constraints  ,   implies that  . Thus, assuming that no other constraint such as   or   belongs to the definition, the constraint   is added to the zone definition.
     
    Figure in   showing  ,   and their intersections
  • the constraints  ,   implies that  . Thus, assuming that no other constraint such as   or   belongs to the definition, the constraint   is added to the zone definition.
     
    Figure in   showing  ,   and their intersections
  • the constraints  ,   implies that  . Thus, assuming that no other constraint such as   or   belongs to the definition, the constraint   is added to the zone definition.

Actually, the two first cases above are particular cases of the third cases. Indeed,   and   can be rewritten as   and   respectively. And thus, the constraint   added in the first example is similar to the constraint added in the third example.

Definition edit

We now fix a monoid   which is a subset of the real line. This monoid is traditionally the set of integers, rationals, reals, or their subset of non-negative numbers.

Constraints edit

In order to define the data structure difference bound matrix, it is first required to give a data structure to encode atomic constraints. Furthermore, we introduce an algebra for atomic constraints. This algebra is similar to the tropical semiring, with two modifications:

  • An arbitrary ordered monoid may be used instead of  .
  • In order to distinguish between " " and " ", the set of elements of the algebra must contain information stating whether the order is strict or not.

Definition of constraints edit

The set of satisfiable constraints is defined as the set of pairs of the form:

  •  , with  , which represents a constraint of the form  ,
  •  , with  , where   is not a minimal element of  , which represents a constraint of the form  ,
  •  , which represents the absence of constraint.

The set of constraint contains all satisfiable constraints and contains also the following unsatisfiable constraint:

  •  .

The subset   can not be defined using this kind of constraints. More generally, some convex polytopes can not be defined when the ordered monoid does not have the least-upper-bound property, even if each of the constraints in its definition uses at most two variables.

Operation on constraints edit

In order to generate a single constraint from a pair of constraints applied to the same (pair of) variable, we formalize the notion of intersection of constraints and of order over constraints. Similarly, in order to define a new constraints from existing constraints, a notion of sum of constraint must also be defined.

Order on constraints edit

We now define an order relation over constraints. This order symbolize the inclusion relation.

First, the set   is considered as an ordered set, with < being inferior to ≤. Intuitively, this order is chosen because the set defined by   is strictly included in the set defined by  . We then state that the constraint   is smaller than   if either   or (  and   is less than  ). That is, the order on constraints is the lexicographical order applied from right to left. Note that this order is a total order. If   has the least-upper-bound property (or greatest-lower-bound property) then the set of constraints also have it.

Intersection of constraints edit

The intersection of two constraints, denoted as  , is then simply defined as the minimum of those two constraints. If   has the greatest-lower bound property then the intersection of an infinite number of constraints is also defined.

Sum of constraints edit

Given two variables   and   to which are applied constraints   and  , we now explain how to generate the constraint satisfied by  . This constraint is called the sum of the two above-mentioned constraint, is denoted as   and is defined as  .

Constraints as an algebra edit

Here is a list of algebraic properties satisfied by the set of constraints.

  • Both operations are associative and commutative,
  • Sum is distributive over intersection, that is, for any three constraints,   equals  ,
  • The intersection operation is idempotent,
  • The constraint   is an identity for the intersection operation,
  • The constraint   is an identity for the sum operation,

Furthermore, the following algebraic properties holds over satisfiable constraints:

  • The constraint   is a zero for the sum operation,
  • It follows that the set of satisfiable constraints is an idempotent semiring, with   as zero and   as unity.
  • If 0 is the minimum element of  , then   is a zero for the intersection constraints over satisfiable constraints.

Over non-satisfiable constraints both operations have the same zero, which is  . Thus, the set of constraints does not even form a semiring, because the identity of the intersection is distinct from the zero of the sum.

DBMs edit

Given a set of   variables,  , a DBM is a matrix with column and rows indexed by   and the entries are constraints. Intuitively, for a column   and a row  , the value   at position   represents  . Thus, the zone defined by a matrix  , denoted by  , is  .

Note that   is equivalent to  , thus the entry   is still essentially an upper bound. Note however that, since we consider a monoid  , for some values of   and   the real   does not actually belong to the monoid.

Before introducing the definition of a canonical DBM, we need to define and discuss an order relation on those matrices.

Order on those matrices edit

A matrix   is considered to be smaller than a matrix   if each of its entries are smaller. Note that this order is not total. Given two DBMs   and  , if   is smaller than or equal to  , then  .

The greatest-lower-bound of two matrices   and  , denoted by  , has as its   entry the value  . Note that since   is the «sum» operation of the semiring of constraints, the operation   is the «sum» of two DBMs where the set of DBMs is considered as a module.

Similarly to the case of constraints, considered in section "Operation on constraints" above, the greatest-lower-bound of an infinite number of matrices is correctly defined as soon as   satisfies the greatest-lower-bound property.

The intersection of matrices/zones is defined. The union operation is not defined, and indeed, a union of zone is not a zone in general.

For an arbitrary set   of matrices which all defines the same zone  ,   also defines  . It thus follow that, as long as   has the greatest-lower-bound property, each zone which is defined by at least a matrix has a unique minimal matrix defining it. This matrix is called the canonical DBM of  .

First definition of canonical DBM edit

We restate the definition of a canonical difference bound matrix. It is a DBM such that no smaller matrix defines the same set. It is explained below how to check whether a matrix is a DBM, and otherwise how to compute a DBM from an arbitrary matrix such that both matrices represents the same set. But first, we give some examples.

Examples of matrices edit

We first consider the case where there is a single clock  .

The real line edit

We first give the canonical DBM for  . We then introduce another DBM which encode the set  . This allow to find constraints which must be satisfied by any DBM.

The canonical DBM of the set of real is  . It represents the constraints  ,  ,   and  . All of those constraints are satisfied independently of the value assigned to  . In the remaining of the discussion, we will not explicitly describe constraints due to entries of the form  , since those constraints are systematically satisfied.

The DBM   also encodes the set of real. It contains the constraints   and   which are satisfied independently on the value of  . This show that in a canonical DBM  , a diagonal entry is never greater than  , because the matrix obtained from   by replacing the diagonal entry by   defines the same set and is smaller than  .

The empty set edit

We now consider many matrices which all encodes the empty set. We first give the canonical DBM for the empty set. We then explain why each of the DBM encodes the empty set. This allow to find constraints which must be satisfied by any DBM.

The canonical DBM of the empty set, over one variable, is  . Indeed, it represents the set satisfying the constraint  ,  ,   and  . Those constraints are unsatisfiable.

The DBM   also encodes the empty set. Indeed, it contains the constraint   which is unsatisfiable. More generally, this show that no entry can be   unless all entries are  .

The DBM   also encodes the empty set. Indeed, it contains the constraint   which is unsatisfiable. More generally, this show that the entry in the diagonal line can not be smaller than   unless it is  .

The DBM   also encodes the empty set. Indeed, it contains the constraints   and   which are contradictory. More generally, this show that, for each  , if  , then   and   are both equal to ≤.

The DBM   also encodes the empty set. Indeed, it contains the constraints   and   which are contradictory. More generally, this show that for each  ,  , unless   is  .

Strict constraints edit

The examples given in this section are similar to the examples given in the Example section above. This time, they are given as DBM.

The DBM   represents the set satisfying the constraints   and  . As mentioned in the Example section, both of those constraints implies that  . It means that the DBM   encodes the same zone. Actually, it is the DBM of this zone. This shows that in any DBM  , for each  , the constraint   is smaller than the constraint  .

As explained in the Example section, the constant 0 can be considered as any variable, which leads to the more general rule: in any DBM  , for each  , the constraint   is smaller than the constraint  .

Three definition of canonical DBM edit

As explained in the introduction of the section Difference Bound Matrix, a canonical DBM is a DBM whose rows and columns are indexed by  , whose entries are constraints. Furthermore, it follows one of the following equivalent properties.

  • there are no smaller DBM defining the same zone,
  • for each  , the constraint   is smaller than the constraint  
  • given the directed graph   with edges   and arrows   labelled by  , the shortest path from any edge   to any edge   is the arrow  . This graph is called the potential graph of the DBM.

The last definition can be directly used to compute the canonical DBM associated to a DBM. It suffices to apply the Floyd–Warshall algorithm to the graph and associates to each entry   the shortest path from   to   in the graph. If this algorithm detects a cycle of negative length, this means that the constraints are not satisfiable, and thus that the zone is empty.

Operations on zones edit

As stated in the introduction, the main interest of DBMs is that they allow to easily and efficiently implements operations on zones.

We first recall operations which were considered above:

  • testing for the inclusion of a zone   in a zone   is done by testing whether the canonical DBM of   is smaller than or equal to the DBM of  ,
  • A DBM for the intersection of a set of zones is the greatest-lower-bound of the DBM of those zones,
  • testing for zone emptiness consists in checking whether the canonical DBM of the zone consists only of  ,
  • testing whether a zone is the entire space consists in checking whether the DBM of the zone consists only of  .

We now describe operations which were not considered above. The first operations described below have clear geometrical meaning. The last ones become corresponds to operations which are more natural for clock valuations.

Sum of zones edit

The Minkowski sum of two zones, defined by two DBMs   and  , is defined by the DBM   whose   entry is  . Note that since   is the «product» operation of the semiring of constraints, the operation   over DBMs is not actually an operation of the module of DBM.

In particular, it follows that, in order to translate a zone   by a direction  , it suffices to add the DBM of   to the DBM of  .

Projection of a component to a fixed value edit

Let   a constant.

Given a vector  , and an index  , the projection of the  -th component of   to   is the vector  . In the language of clock, for  , this corresponds to resetting the  -th clock.

Projecting the  -th component of a zone   to   consists simply in the set of vectors of   with their  -th component to  . This is implemented on DBM by setting the components   to   and the components   to  

Future and past of a zone edit

Let us call the future the zone   and the past the zone  . Given a point  , the future of   is defined as  , and the past of   is defined as  .

The names future and past comes from the notion of clock. If a set of   clocks are assigned to the values  ,  , etc. then in their future, the set of assignment they'll have is the future of  .

Given a zone  , the future of   are the union of the future of each points of the zone. The definition of the past of a zone is similar. The future of a zone can thus be defined as  , and hence can easily be implemented as a sum of DBMs. However, there is even a simpler algorithm to apply to DBM. It suffices to change every entries   to  . Similarly, the past of a zone can be computed by setting every entries   to  .

See also edit

References edit

  1. ^ "UPPAAL DBM Library". GitHub. 16 July 2021.
  2. ^ Dill, David L (1990). "Timing assumptions and verification of finite-state concurrent systems". Automatic Verification Methods for Finite State Systems. Lecture Notes in Computer Science. Vol. 407. pp. 197–212. doi:10.1007/3-540-52148-8_17. ISBN 978-3-540-52148-8.
  • Difference Bound Matrices Lecture #20 of Advanced Model Checking Joost-Pieter Katoen
  • Péron, Mathias; Halbwachs, Nicolas (2008). "An Abstract Domain Extending Difference-Bound Matrices with Disequality Constraints" (PDF). Verification, Model Checking, and Abstract Interpretation. Lecture Notes in Computer Science. Vol. 4349. pp. 268–282. doi:10.1007/978-3-540-69738-1_20. ISBN 978-3-540-69735-0.

difference, bound, matrix, model, checking, field, computer, science, difference, bound, matrix, data, structure, used, represent, some, convex, polytopes, called, zones, this, structure, used, efficiently, implement, some, geometrical, operations, over, zones. In model checking a field of computer science a difference bound matrix DBM is a data structure used to represent some convex polytopes called zones This structure can be used to efficiently implement some geometrical operations over zones such as testing emptyness inclusion equality and computing the intersection and the sum of two zones It is for example used in the Uppaal model checker where it is also distributed as an independent library 1 More precisely there is a notion of canonical DBM there is a one to one relation between canonical DBMs and zones and from each DBM a canonical equivalent DBM can be efficiently computed Thus equality of zone can be tested by checking for equality of canonical DBMs Contents 1 Zone 2 Example 3 Definition 3 1 Constraints 3 1 1 Definition of constraints 3 1 2 Operation on constraints 3 1 2 1 Order on constraints 3 1 2 2 Intersection of constraints 3 1 2 3 Sum of constraints 3 1 3 Constraints as an algebra 3 2 DBMs 3 2 1 Order on those matrices 3 2 2 First definition of canonical DBM 3 2 3 Examples of matrices 3 2 3 1 The real line 3 2 3 2 The empty set 3 2 3 3 Strict constraints 3 3 Three definition of canonical DBM 4 Operations on zones 4 1 Sum of zones 4 2 Projection of a component to a fixed value 4 3 Future and past of a zone 5 See also 6 ReferencesZone editA difference bound matrix is used to represents some kind of convex polytopes Those polytopes are called zone They are now defined Formally a zone is defined by equations of the form x c displaystyle x leq c nbsp x c displaystyle x geq c nbsp x 1 x 2 c displaystyle x 1 leq x 2 c nbsp and x 1 x 2 c displaystyle x 1 geq x 2 c nbsp with x 1 displaystyle x 1 nbsp and x 2 displaystyle x 2 nbsp some variables and c displaystyle c nbsp a constant Zones have originally be called region 2 but nowadays this name usually denote region a special kind of zone Intuitively a region can be considered as a minimal non empty zones in which the constants used in constraint are bounded Given n displaystyle n nbsp variables there are exactly n n 1 displaystyle n n 1 nbsp different non redundant constraints possible n displaystyle n nbsp constraints which use a single variable and an upper bound n displaystyle n nbsp constraints which uses a single variable and a lower bound and for each of the n 2 displaystyle n 2 nbsp ordered pairs of variable x y displaystyle x y nbsp an upper bound on x y displaystyle x y nbsp However an arbitrary convex polytope in R n displaystyle mathbb R n nbsp may require an arbitrarily great number of constraints Even when n 2 displaystyle n 2 nbsp there can be an arbitrary great number of non redundant constraints x lt i y c i i N displaystyle x lt iy c i i in mathbb N nbsp for c i displaystyle c i nbsp some constants This is the reason why DBMs can not be extended from zones to convex polytopes Example editAs stated in the introduction we consider a zone defined by a set of statements of the form x 1 c displaystyle x 1 leq c nbsp x 1 c displaystyle x 1 geq c nbsp x 1 x 2 c displaystyle x 1 leq x 2 c nbsp and x 1 x 2 c displaystyle x 1 geq x 2 c nbsp with x 1 displaystyle x 1 nbsp and x 2 displaystyle x 2 nbsp some variables and c displaystyle c nbsp a constant However some of those constraints are either contradictory or redundant We now give such examples the constraints x 1 3 displaystyle x 1 leq 3 nbsp and x 1 4 displaystyle x 1 geq 4 nbsp are contradictory Hence when two such constraints are found the zone defined is empty nbsp Figure in R 2 textstyle mathbb R 2 nbsp showing x 1 3 textstyle x 1 leq 3 nbsp x 1 4 textstyle x 1 geq 4 nbsp which are disjoint the constraints x 1 3 displaystyle x 1 leq 3 nbsp and x 1 4 displaystyle x 1 leq 4 nbsp are redundant The second constraint being implied by the first one Hence when two such constraints are found in the definition of the zone the second constraint may be removed nbsp Figure in R 2 textstyle mathbb R 2 nbsp showing x 1 3 textstyle x 1 leq 3 nbsp and x 1 4 textstyle x 1 leq 4 nbsp which contains the first figure We also give example showing how to generate new constraints from existing constraints For each pair of clocks x 1 displaystyle x 1 nbsp and x 2 displaystyle x 2 nbsp the DBM has a constraint of the form x 1 x 2 c displaystyle x 1 prec x 2 c nbsp where displaystyle prec nbsp is either lt or If no such constraint can be found the constraint x 1 x 2 displaystyle x 1 prec x 2 infty nbsp can be added to the zone definition without loss of generality But in some case a more precise constraint can be found Such an example is now going to be given the constraints x 1 3 displaystyle x 1 leq 3 nbsp x 2 3 displaystyle x 2 geq 3 nbsp implies that x 1 x 2 6 displaystyle x 1 leq x 2 6 nbsp Thus assuming that no other constraint such as x 1 x 2 5 displaystyle x 1 leq x 2 5 nbsp or x 1 lt x 2 6 displaystyle x 1 lt x 2 6 nbsp belongs to the definition the constraint x 1 x 2 6 displaystyle x 1 leq x 2 6 nbsp is added to the zone definition nbsp Figure in R 2 textstyle mathbb R 2 nbsp showing x 1 3 textstyle x 1 leq 3 nbsp x 2 3 textstyle x 2 geq 3 nbsp and their intersections the constraints x 2 3 displaystyle x 2 leq 3 nbsp x 1 x 2 3 displaystyle x 1 leq x 2 3 nbsp implies that x 1 6 displaystyle x 1 leq 6 nbsp Thus assuming that no other constraint such as x 1 5 displaystyle x 1 leq 5 nbsp or x 1 lt 6 displaystyle x 1 lt 6 nbsp belongs to the definition the constraint x 1 6 displaystyle x 1 leq 6 nbsp is added to the zone definition nbsp Figure in R 2 textstyle mathbb R 2 nbsp showing x 1 3 textstyle x 1 leq 3 nbsp x 1 x 2 3 textstyle x 1 leq x 2 3 nbsp and their intersections the constraints x 1 x 2 3 displaystyle x 1 leq x 2 3 nbsp x 2 x 3 3 displaystyle x 2 leq x 3 3 nbsp implies that x 1 x 3 6 displaystyle x 1 leq x 3 6 nbsp Thus assuming that no other constraint such as x 1 x 3 5 displaystyle x 1 leq x 3 5 nbsp or x 1 lt x 3 6 displaystyle x 1 lt x 3 6 nbsp belongs to the definition the constraint x 1 x 3 6 displaystyle x 1 leq x 3 6 nbsp is added to the zone definition Actually the two first cases above are particular cases of the third cases Indeed x 1 3 displaystyle x 1 leq 3 nbsp and x 2 3 displaystyle x 2 geq 3 nbsp can be rewritten as x 1 0 3 displaystyle x 1 leq 0 3 nbsp and 0 x 2 3 displaystyle 0 leq x 2 3 nbsp respectively And thus the constraint x 1 x 2 6 displaystyle x 1 leq x 2 6 nbsp added in the first example is similar to the constraint added in the third example Definition editWe now fix a monoid M 0 displaystyle M 0 nbsp which is a subset of the real line This monoid is traditionally the set of integers rationals reals or their subset of non negative numbers Constraints edit In order to define the data structure difference bound matrix it is first required to give a data structure to encode atomic constraints Furthermore we introduce an algebra for atomic constraints This algebra is similar to the tropical semiring with two modifications An arbitrary ordered monoid may be used instead of R displaystyle mathbb R nbsp In order to distinguish between lt m displaystyle lt m nbsp and m displaystyle leq m nbsp the set of elements of the algebra must contain information stating whether the order is strict or not Definition of constraints edit The set of satisfiable constraintsis defined as the set of pairs of the form m displaystyle leq m nbsp with m M displaystyle m in M nbsp which represents a constraint of the form m displaystyle leq m nbsp lt m displaystyle lt m nbsp with m M displaystyle m in M nbsp where m displaystyle m nbsp is not a minimal element of M displaystyle M nbsp which represents a constraint of the form lt m displaystyle lt m nbsp lt displaystyle lt infty nbsp which represents the absence of constraint The set of constraint contains all satisfiable constraints and contains also the following unsatisfiable constraint lt displaystyle lt infty nbsp The subset q Q q 2 displaystyle q in mathbb Q mid q leq sqrt 2 nbsp can not be defined using this kind of constraints More generally some convex polytopes can not be defined when the ordered monoid does not have the least upper bound property even if each of the constraints in its definition uses at most two variables Operation on constraints edit In order to generate a single constraint from a pair of constraints applied to the same pair of variable we formalize the notion of intersection of constraints and of order over constraints Similarly in order to define a new constraints from existing constraints a notion of sum of constraint must also be defined Order on constraints edit We now define an order relation over constraints This order symbolize the inclusion relation First the set lt displaystyle lt leq nbsp is considered as an ordered set with lt being inferior to Intuitively this order is chosen because the set defined by x lt c displaystyle x lt c nbsp is strictly included in the set defined by x c displaystyle x leq c nbsp We then state that the constraint 1 m 1 displaystyle prec 1 m 1 nbsp is smaller than 2 m 2 displaystyle prec 2 m 2 nbsp if either m 1 lt m 2 displaystyle m 1 lt m 2 nbsp or m 1 m 2 displaystyle m 1 m 2 nbsp and 1 displaystyle prec 1 nbsp is less than 2 displaystyle prec 2 nbsp That is the order on constraints is the lexicographical order applied from right to left Note that this order is a total order If M displaystyle M nbsp has the least upper bound property or greatest lower bound property then the set of constraints also have it Intersection of constraints edit The intersection of two constraints denoted as 1 m 1 2 m 2 displaystyle prec 1 m 1 sqcap prec 2 m 2 nbsp is then simply defined as the minimum of those two constraints If M displaystyle M nbsp has the greatest lower bound property then the intersection of an infinite number of constraints is also defined Sum of constraints edit Given two variables x 1 displaystyle x 1 nbsp and x 2 displaystyle x 2 nbsp to which are applied constraints 1 m 1 displaystyle prec 1 m 1 nbsp and 2 m 2 displaystyle prec 2 m 2 nbsp we now explain how to generate the constraint satisfied by x 1 x 2 displaystyle x 1 x 2 nbsp This constraint is called the sum of the two above mentioned constraint is denoted as 1 m 1 2 m 2 displaystyle prec 1 m 1 prec 2 m 2 nbsp and is defined as min 1 2 m 1 m 2 displaystyle min prec 1 prec 2 m 1 m 2 nbsp Constraints as an algebra edit Here is a list of algebraic properties satisfied by the set of constraints Both operations are associative and commutative Sum is distributive over intersection that is for any three constraints 1 m 1 2 m 2 3 m 3 displaystyle prec 1 m 1 sqcap prec 2 m 2 prec 3 m 3 nbsp equals 1 m 1 3 m 3 2 m 2 3 m 3 displaystyle prec 1 m 1 prec 3 m 3 sqcap prec 2 m 2 prec 3 m 3 nbsp The intersection operation is idempotent The constraint lt displaystyle lt infty nbsp is an identity for the intersection operation The constraint 0 displaystyle leq 0 nbsp is an identity for the sum operation Furthermore the following algebraic properties holds over satisfiable constraints The constraint lt displaystyle lt infty nbsp is a zero for the sum operation It follows that the set of satisfiable constraints is an idempotent semiring with lt displaystyle lt infty nbsp as zero and 0 displaystyle leq 0 nbsp as unity If 0 is the minimum element of M displaystyle M nbsp then 0 displaystyle leq 0 nbsp is a zero for the intersection constraints over satisfiable constraints Over non satisfiable constraints both operations have the same zero which is lt displaystyle lt infty nbsp Thus the set of constraints does not even form a semiring because the identity of the intersection is distinct from the zero of the sum DBMs edit Given a set of n displaystyle n nbsp variables x 1 x n displaystyle x 1 dots x n nbsp a DBM is a matrix with column and rows indexed by 0 x 1 x n displaystyle 0 x 1 dots x n nbsp and the entries are constraints Intuitively for a column C displaystyle C nbsp and a row R displaystyle R nbsp the value m displaystyle m nbsp at position C R displaystyle C R nbsp represents C R m displaystyle C prec R m nbsp Thus the zone defined by a matrix D C R m C R C R 0 x 1 x n displaystyle D prec C R m C R C R in 0 x 1 dots x n nbsp denoted by R D displaystyle mathcal R D nbsp is x 1 x n R C R 0 x 1 x n C C R R m C R displaystyle x 1 dots x n in mathbb R mid bigwedge C R in 0 x 1 dots x n C prec C R R m C R nbsp Note that C R m displaystyle C prec R m nbsp is equivalent to C R m displaystyle C R prec m nbsp thus the entry m displaystyle prec m nbsp is still essentially an upper bound Note however that since we consider a monoid M displaystyle M nbsp for some values of C displaystyle C nbsp and R displaystyle R nbsp the real C R displaystyle C R nbsp does not actually belong to the monoid Before introducing the definition of a canonical DBM we need to define and discuss an order relation on those matrices Order on those matrices edit A matrix D displaystyle D nbsp is considered to be smaller than a matrix D displaystyle D nbsp if each of its entries are smaller Note that this order is not total Given two DBMs D displaystyle D nbsp and D displaystyle D nbsp if D displaystyle D nbsp is smaller than or equal to D displaystyle D nbsp then R D R D displaystyle mathcal R D subseteq mathcal R D nbsp The greatest lower bound of two matrices D displaystyle D nbsp and D displaystyle D nbsp denoted by D D displaystyle D sqcap D nbsp has as its a b displaystyle a b nbsp entry the value a b m a b a b m a b displaystyle prec a b m a b sqcap prec a b m a b nbsp Note that since displaystyle sqcap nbsp is the sum operation of the semiring of constraints the operation displaystyle sqcap nbsp is the sum of two DBMs where the set of DBMs is considered as a module Similarly to the case of constraints considered in section Operation on constraints above the greatest lower bound of an infinite number of matrices is correctly defined as soon as M displaystyle M nbsp satisfies the greatest lower bound property The intersection of matrices zones is defined The union operation is not defined and indeed a union of zone is not a zone in general For an arbitrary set D displaystyle mathcal D nbsp of matrices which all defines the same zone Z displaystyle Z nbsp D D D displaystyle sqcap D in mathcal D D nbsp also defines Z displaystyle Z nbsp It thus follow that as long as M displaystyle M nbsp has the greatest lower bound property each zone which is defined by at least a matrix has a unique minimal matrix defining it This matrix is called the canonical DBM of Z displaystyle Z nbsp First definition of canonical DBM edit We restate the definition of a canonical difference bound matrix It is a DBM such that no smaller matrix defines the same set It is explained below how to check whether a matrix is a DBM and otherwise how to compute a DBM from an arbitrary matrix such that both matrices represents the same set But first we give some examples Examples of matrices edit We first consider the case where there is a single clock x 1 displaystyle x 1 nbsp The real line edit We first give the canonical DBM for R displaystyle mathbb R nbsp We then introduce another DBM which encode the set R displaystyle mathbb R nbsp This allow to find constraints which must be satisfied by any DBM The canonical DBM of the set of real is 0 lt lt 0 displaystyle left begin array ll leq 0 amp lt infty lt infty amp leq 0 end array right nbsp It represents the constraints 0 0 0 displaystyle 0 leq 0 0 nbsp x 1 0 displaystyle x 1 leq 0 infty nbsp 0 x 1 displaystyle 0 leq x 1 infty nbsp and 0 0 0 displaystyle 0 leq 0 0 nbsp All of those constraints are satisfied independently of the value assigned to x 1 displaystyle x 1 nbsp In the remaining of the discussion we will not explicitly describe constraints due to entries of the form lt displaystyle lt infty nbsp since those constraints are systematically satisfied The DBM lt lt lt lt displaystyle left begin array ll lt infty amp lt infty lt infty amp lt infty end array right nbsp also encodes the set of real It contains the constraints 0 lt 0 displaystyle 0 lt 0 infty nbsp and x 1 lt x 1 displaystyle x 1 lt x 1 infty nbsp which are satisfied independently on the value of x 1 displaystyle x 1 nbsp This show that in a canonical DBM D displaystyle D nbsp a diagonal entry is never greater than 0 displaystyle leq 0 nbsp because the matrix obtained from D displaystyle D nbsp by replacing the diagonal entry by 0 displaystyle leq 0 nbsp defines the same set and is smaller than D displaystyle D nbsp The empty set edit We now consider many matrices which all encodes the empty set We first give the canonical DBM for the empty set We then explain why each of the DBM encodes the empty set This allow to find constraints which must be satisfied by any DBM The canonical DBM of the empty set over one variable is lt lt lt lt displaystyle left begin array ll lt infty amp lt infty lt infty amp lt infty end array right nbsp Indeed it represents the set satisfying the constraint 0 lt 0 displaystyle 0 lt 0 infty nbsp 0 lt x 1 displaystyle 0 lt x 1 infty nbsp x 1 lt 0 displaystyle x 1 lt 0 infty nbsp and x 1 lt x 1 displaystyle x 1 lt x 1 infty nbsp Those constraints are unsatisfiable The DBM lt lt lt lt displaystyle left begin array ll lt infty amp lt infty lt infty amp lt infty end array right nbsp also encodes the empty set Indeed it contains the constraint x 1 lt 0 displaystyle x 1 lt 0 infty nbsp which is unsatisfiable More generally this show that no entry can be lt displaystyle lt infty nbsp unless all entries are lt displaystyle lt infty nbsp The DBM lt lt lt lt 1 displaystyle left begin array ll lt infty amp lt infty lt infty amp lt 1 end array right nbsp also encodes the empty set Indeed it contains the constraint x 1 lt x 1 1 displaystyle x 1 lt x 1 1 nbsp which is unsatisfiable More generally this show that the entry in the diagonal line can not be smaller than 0 displaystyle leq 0 nbsp unless it is lt displaystyle lt infty nbsp The DBM lt lt 1 1 lt displaystyle left begin array ll lt infty amp lt 1 leq 1 amp lt infty end array right nbsp also encodes the empty set Indeed it contains the constraints 0 lt x 1 1 displaystyle 0 lt x 1 1 nbsp and x 1 1 displaystyle x 1 leq 1 nbsp which are contradictory More generally this show that for each C R 0 x 1 x n displaystyle C R in 0 x 1 dots x n nbsp if m C R m R C displaystyle m C R m R C nbsp then R C displaystyle prec R C nbsp and C R displaystyle prec C R nbsp are both equal to The DBM lt 1 2 lt displaystyle left begin array ll lt infty amp leq 1 leq 2 amp lt infty end array right nbsp also encodes the empty set Indeed it contains the constraints 0 x 1 1 displaystyle 0 leq x 1 1 nbsp and x 1 2 displaystyle x 1 leq 2 nbsp which are contradictory More generally this show that for each C R 0 x 1 x n displaystyle C R in 0 x 1 dots x n nbsp m C R m R C displaystyle m C R leq m R C nbsp unless m C R displaystyle m C R nbsp is displaystyle infty nbsp Strict constraints edit The examples given in this section are similar to the examples given in the Example section above This time they are given as DBM The DBM 0 lt lt lt 0 3 3 lt 0 displaystyle left begin array lll leq 0 amp lt infty amp lt infty lt infty amp leq 0 amp leq 3 leq 3 amp lt infty amp leq 0 end array right nbsp represents the set satisfying the constraints x 2 3 displaystyle x 2 leq 3 nbsp and x 1 x 2 3 displaystyle x 1 leq x 2 3 nbsp As mentioned in the Example section both of those constraints implies that x 1 6 displaystyle x 1 leq 6 nbsp It means that the DBM 0 6 lt lt 0 3 3 lt 0 displaystyle left begin array lll leq 0 amp leq 6 amp lt infty lt infty amp leq 0 amp leq 3 leq 3 amp lt infty amp leq 0 end array right nbsp encodes the same zone Actually it is the DBM of this zone This shows that in any DBM C R m C R c r 0 x 1 x n displaystyle prec C R m C R c r in 0 x 1 dots x n nbsp for each 1 i j n displaystyle 1 leq i j leq n nbsp the constraint x i 0 m x i 0 displaystyle prec x i 0 m x i 0 nbsp is smaller than the constraint x j 0 m x j 0 x i x j m x i x j displaystyle prec x j 0 m x j 0 prec x i x j m x i x j nbsp As explained in the Example section the constant 0 can be considered as any variable which leads to the more general rule in any DBM C R m C R c r 0 x 1 x n displaystyle prec C R m C R c r in 0 x 1 dots x n nbsp for each a b c 0 x 1 x n displaystyle a b c in 0 x 1 dots x n nbsp the constraint a b m a b displaystyle prec a b m a b nbsp is smaller than the constraint c b m c b a c m a c displaystyle prec c b m c b prec a c m a c nbsp Three definition of canonical DBM edit As explained in the introduction of the section Difference Bound Matrix a canonical DBM is a DBM whose rows and columns are indexed by 0 x 1 x n displaystyle 0 x 1 dots x n nbsp whose entries are constraints Furthermore it follows one of the following equivalent properties there are no smaller DBM defining the same zone for each a b c 0 x 1 x n displaystyle a b c in 0 x 1 dots x n nbsp the constraint a b m a b displaystyle prec a b m a b nbsp is smaller than the constraint c b m c b a c m a c displaystyle prec c b m c b prec a c m a c nbsp given the directed graph G displaystyle G nbsp with edges 0 x 1 x n displaystyle 0 x 1 dots x n nbsp and arrows a b displaystyle a b nbsp labelled by a b m a b displaystyle prec a b m a b nbsp the shortest path from any edge a displaystyle a nbsp to any edge b displaystyle b nbsp is the arrow a b displaystyle a b nbsp This graph is called the potential graph of the DBM The last definition can be directly used to compute the canonical DBM associated to a DBM It suffices to apply the Floyd Warshall algorithm to the graph and associates to each entry a b displaystyle a b nbsp the shortest path from a displaystyle a nbsp to b displaystyle b nbsp in the graph If this algorithm detects a cycle of negative length this means that the constraints are not satisfiable and thus that the zone is empty Operations on zones editAs stated in the introduction the main interest of DBMs is that they allow to easily and efficiently implements operations on zones We first recall operations which were considered above testing for the inclusion of a zone Z 1 displaystyle Z 1 nbsp in a zone Z 2 displaystyle Z 2 nbsp is done by testing whether the canonical DBM of Z 1 displaystyle Z 1 nbsp is smaller than or equal to the DBM of Z 2 displaystyle Z 2 nbsp A DBM for the intersection of a set of zones is the greatest lower bound of the DBM of those zones testing for zone emptiness consists in checking whether the canonical DBM of the zone consists only of lt displaystyle lt infty nbsp testing whether a zone is the entire space consists in checking whether the DBM of the zone consists only of lt displaystyle lt infty nbsp We now describe operations which were not considered above The first operations described below have clear geometrical meaning The last ones become corresponds to operations which are more natural for clock valuations Sum of zones edit The Minkowski sum of two zones defined by two DBMs D displaystyle D nbsp and D displaystyle D nbsp is defined by the DBM D D displaystyle D D nbsp whose a b displaystyle a b nbsp entry is D a b D a b displaystyle D a b D a b nbsp Note that since displaystyle nbsp is the product operation of the semiring of constraints the operation displaystyle nbsp over DBMs is not actually an operation of the module of DBM In particular it follows that in order to translate a zone Z displaystyle Z nbsp by a direction v displaystyle v nbsp it suffices to add the DBM of v displaystyle v nbsp to the DBM of Z displaystyle Z nbsp Projection of a component to a fixed value edit Let d M displaystyle d in M nbsp a constant Given a vector x x 1 x n displaystyle vec x x 1 dots x n nbsp and an index 1 i n displaystyle 1 leq i leq n nbsp the projection of the i displaystyle i nbsp th component of x displaystyle vec x nbsp to d displaystyle d nbsp is the vector x 1 x i 1 d x i 1 x n displaystyle x 1 dots x i 1 d x i 1 dots x n nbsp In the language of clock for d 0 displaystyle d 0 nbsp this corresponds to resetting the i displaystyle i nbsp th clock Projecting the i displaystyle i nbsp th component of a zone Z displaystyle Z nbsp to d displaystyle d nbsp consists simply in the set of vectors of Z displaystyle Z nbsp with their i displaystyle i nbsp th component to d displaystyle d nbsp This is implemented on DBM by setting the components x i a displaystyle x i a nbsp to d D 0 a displaystyle leq d D 0 a nbsp and the components a x i displaystyle a x i nbsp to d D 0 a displaystyle leq d D 0 a nbsp Future and past of a zone edit Let us call the future the zone F t t t R 0 displaystyle F t dots t mid t in mathbb R geq 0 nbsp and the past the zone P t t t R 0 displaystyle P t dots t mid t in mathbb R geq 0 nbsp Given a point x x 1 x n R n displaystyle vec x x 1 dots x n in mathbb R n nbsp the future of x displaystyle vec x nbsp is defined as x 1 t x n t t R 0 F x displaystyle x 1 t dots x n t mid t in mathbb R geq 0 F vec x nbsp and the past of x displaystyle vec x nbsp is defined as P x displaystyle P vec x nbsp The names future and past comes from the notion of clock If a set of n displaystyle n nbsp clocks are assigned to the values x 1 displaystyle x 1 nbsp x 2 displaystyle x 2 nbsp etc then in their future the set of assignment they ll have is the future of x displaystyle vec x nbsp Given a zone Z displaystyle Z nbsp the future of Z displaystyle Z nbsp are the union of the future of each points of the zone The definition of the past of a zone is similar The future of a zone can thus be defined as F Z displaystyle F Z nbsp and hence can easily be implemented as a sum of DBMs However there is even a simpler algorithm to apply to DBM It suffices to change every entries x i 0 displaystyle x i 0 nbsp to lt displaystyle lt infty nbsp Similarly the past of a zone can be computed by setting every entries 0 x i displaystyle 0 x i nbsp to lt displaystyle lt infty nbsp See also editRegion model checking a zone minimal under inclusion satisfying some propertiesReferences edit UPPAAL DBM Library GitHub 16 July 2021 Dill David L 1990 Timing assumptions and verification of finite state concurrent systems Automatic Verification Methods for Finite State Systems Lecture Notes in Computer Science Vol 407 pp 197 212 doi 10 1007 3 540 52148 8 17 ISBN 978 3 540 52148 8 Difference Bound Matrices Lecture 20 of Advanced Model Checking Joost Pieter Katoen Peron Mathias Halbwachs Nicolas 2008 An Abstract Domain Extending Difference Bound Matrices with Disequality Constraints PDF Verification Model Checking and Abstract Interpretation Lecture Notes in Computer Science Vol 4349 pp 268 282 doi 10 1007 978 3 540 69738 1 20 ISBN 978 3 540 69735 0 Retrieved from https en wikipedia org w index php title Difference bound matrix amp oldid 1219254749 Zone, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.