HAL Id: inria-00000039
https://hal.inria.fr/inria-00000039
Submitted on 20 May 2005
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Structural Presburger-definable Digit Vector Automata
Jérôme Leroux
To cite this version:
Jérôme Leroux. Structural Presburger-definable Digit Vector Automata. [Research Report] PI 1718, 2005. �inria-00000039�
I
R I S A
INST ITUT D
E RECHE RC
HEE N IN
FORMAT IQU
E ET SYS
TÈMES A
LÉATOIRE S
P U B L I C A T I O N I N T E R N E
No
I R I S A
CAMPUS UNIVERSITAIRE DE BEAULIEU - 35042 RENNES CEDEX - FRANCE
ISSN 1166-8687
1718
STRUCTURAL PRESBURGER-DEFINABLE DIGIT VECTOR AUTOMATA
JÉRÔME LEROUX
Campus de Beaulieu – 35042 Rennes Cedex – France Tél. : (33) 02 99 84 71 00 – Fax : (33) 02 99 84 71 71 http://www.irisa.fr
Structural Presburger-denable Digit Vector Automata
Jérôme Leroux
Systèmes communicantsProjet VerTeCs
Publication interne n1718 May 2005 13 pages
Abstract:
Digit Vector Automata (DVA) provide a natural symbolic representation for regular sets of integer vectors encoded as strings of digit vectors (least signicant digit rst). We prove that the minimal DVA that represents a Presburger-denable set is structurally Presburger-denable:that means, the DVA obtained by modifying the initial state and the set of nal states represents a Presburger-denable set.
Key-words:
Automata, Presburger arithmetic, Semi-linear set, Symbolic representation(Résumé : tsvp)
Centre National de la Recherche Scientifique Institut National de Recherche en Informatique (UMR6074) Université de Rennes 1 – Insa de Rennes et en Automatique – unité de recherche de Rennes
Structure des automates Presburger-dénissables
Résumé :
Les automates nis permettent de représenter symboliquement des ensembles innis de vecteurs d'entiers, décomposés comme des mots de vecteurs de chires. On montre que l'automate min- imal représentant un ensemble Presburger-dénissable, est structurellement Presburger-dénissable:c'est à dire, que les automates obtenus en changeant l'état initial et les états naux représentent des ensembles Presburger-dénissables.
Mots clés :
Automate, Arithmétique de Presburger, Ensemble semilinéaire, Représentation symbol- iqueStructural Presburger-denable Digit Vector Automata 3 Presburger arithmetic [21] is a decidable logic used in a large range of applications. Dierent techniques [11] and tools have been developed for manipulating the Presburger-denable sets (the sets of integer vectors satisfying a Presburger formula): by working directly on the Presburger-formulas (implemented inOmega[20]), by using semi-linear sets [12] (implemented inBrain[22]), or by using Digit Vector Automata (DVA) that represent regular sets of integer vectors encoded as strings of digit vectors, least or most signicant digit rst [23, 7] (implemented inFast [1],Lash[15] andCSL-ALV [2]). Presburger-formulas and semi-linear sets lack canonicity: there does not exist a natural way to canonically represent a set. As a direct consequence, a set that possesses a simple representation could unfortunately be represented in an unduly complicated way. Moreover, deciding if a given vector of integers is in a given set, is at least NP-hard [4, 12]. On the other hand, a minimization procedure for automata provides a canonical representation for DVA-denable sets (a set represented by a DVA).
That means, the DVA that represents a given set only depends on the set and not on the way we have computed it. For this reason, DVA are well adapted for applications that require a lot of Boolean manipulations like model-checking.
Recently, the DVA obtained by modifying the set of nal states, has provided some applications.
First, we have proved that modifying the set of nal states of a DVA, provides some simple sets that can be used for deciding in polynomial time if a DVA is Presburger-denable (that means, the DVA represents a Presburger-denable set) [17]. Recall that the previous algorithm for deciding this property, was given by Muchnik in 1991 [18, 19, 8], and works in quadruply-exponential time. Second, Bartzis and Bultan [3] provided a widening operator for DVA in order to enforce the convergence of the incrementally computed DVA, during the reachability state space exploration of an innite state system. This operator is obtained by modifying the set of nal states of Presburger-denable DVA, but they do not prove that the obtained DVA remain Presburger-denable.
However, from practical and theoretical point of view, working only with Presburger-denable DVA has some advantages. First the manipulation complexity (boolean operations and variable elimination) is at most3-exponential time for Presburger-denable DVA (see [13, 17]) and non-elementary for general DVA (see [5]). Second, we can compute in polynomial time, a Presburger-formula that denes the set represented by a Presburger-denable DVA. Then this formula can be used in other tools likeOmega. In this paper, we introduce a new automata-based representation for regular subsets ofZm, called the digit Vector automata (DVA). Even if DVA are very similar to other automata-based representations [6, 7, 8], it is the rst automata-based representation for any regular subsets of Zm, that is both canonical (there exists a unique minimal DVA that represents a given set
X
) and stable by modifying the initial state (this stability provides a natural way for associating a subset of Zm to any state of the DVA). Moreover, we prove that the minimal DVA that represents a Presburger-denable set is structurally Presburger-denable: that means, any DVA obtained by modifying the initial state and the set of nal states, is Presburger-denable.1 Notations
We denote by Z and Nnf0g respectively the set of integers and non-negative integers. The set
X
m is called the set of vectors withm
2 N components in a setX
. Given an integeri
2 f1;::: ;m
g and a vectorx
2X
m, thei
-th component ofx
is writtenx
[i
] 2X
. We denote bye
0 the vectore
0 =(0;::: ;
0). Vectorsx
+y
andt:x
are dened by(x
+y
)[i
]=(x
[i
])+(y
[i
]) and (t:x
)[i
]=t:
(x
[i
]) for anyi
2f1;::: ;m
g,x;y
2Qm,t
2Q. We denote byhx;y
i=Pmi=1x
[i
]:y
[i
], the dot product of two vectorsx;y
2Qm. Given a functionsf
:X
!Y
,A
X
andB
Y
, we denef
(A
)=ff
(a
);a
2A
g andf
?1(B
)=fx
2X
;f
(x
)2B
g.Given a non-empty nite alphabet , we denote by+ the set of non-empty words over and we denote by
the empty word. As usual denotes the set of words+[fg. A subsetL is called a language. The concatenation of two words 1 and 2 (resp. two languages L1 and L2) is denoted by 1:
2 (resp. L1:
L2 =f1:
2; (1;
2) 2 L1 L2g). Given a word 2, we denote by (i)i2N thePIn1718
4 Jérôme Leroux sequence of words dened by the induction
0 = and i+1 = i:
. We denote by the language =fi;i
2Ng. The length of a word is denoted by jj2N. For any non-empty word2+, we denote by[1], ..., [jj] the elements insuch that =[1]:::
[jj].2 Digit Vector Automata
In this section, the Digit Vector Automata (DVA) representation, a state-based representation of set of integer vectors, is presented. The sets obtained by moving the initial state and modifying the set of nal states of a DVA are respectively characterized in sections 2.2 and 2.3.
2.1 Digit vector decomposition
Let us consider an integer
r
2called the basis of decomposition and the set of digits r=f0;::: ;r
?1g. In this section, we study the least signicant digit rst decomposition of an integer vector inZm into a word of digit vectors in (mr). This decomposition can be easily obtained by considering the sequence (
r;)2(mr) of functionsr; :Zm!Zm uniquely dened by the following equalities [16]:(
r;b(x
)=r:x
+b
(b;x
)2mrZm r;1:2 =r;1r;2 (1;
2)2(mr)(mr)Assume that the dimension
m
is equal to 1 and consider a couple (;s
) 2 rS
r whereS
r is the set of sign digitsS
r =f0;r
?1g. The following equality is called the least signicant digit rst decomposition with 2-complement: r;
s
1?
r
= (
P
jj
i=1
r
i?1[i
]2N ifs
=0P
jj
i=1
r
i?1[i
]?r
jj2ZnN ifs
=r
?1The previous decomposition shows intuitively that
s
= 0 correspond to the non-negative sign digit whereass
=r
?1 corresponds to the negative one.For a general dimension
m
1, let us consider the function r :(mr)S
mr!Zm dened by the following equality: r(;s
)=r;
s
1?
r
A couple (
;s
) 2(mr)S
mr such thatx
=r(;s
) is called ar
-decomposition ofx
2Zm. Remark that anyx
2Zm owns at least oner
-decomposition.Function
r naturally associate to any language L (mr)S
mr a subsetX
= r(L) of Zm. Remark however that there exists some languagesL1,L2 andLsuch that L1\L2=Land such that r(L1)\r(L2) 6=r(L). For instance, considerL1 =f(;
0)g, L2 =f(0;
0)g and L=;. Such a side eect is due to the fact that an integer vectorx
2Zm does not have a uniquer
-decomposition. The following lemma characterizesr
-decompositions associated to the same vector.Lemma 1
Twor
-decompositions(1;s
1) and (2;s
2) are associated to the same vector if and only ifs
1 =s
2 and1:s
1\2:s
26=;.Proof :
Let us rst remark that for any sign digit vectors
2S
mr, we have r;s( s1?r) = s
1?r. In particular, we have
r(:s
k;s
) = r(;s
) for any word 2 (mr) and for anyk
2N. This equality is well known whens
=0and it just means that adding extra zero digits to the least signicant digit rst decomposition of a non-negative integer does not change its value.Assume rst that(
1;s
1)and(2;s
2)are such thats
1=s
2 and 1:s
1\2:s
2 6=;, and let us prove that r(1;s
1) =r(2;s
2). There existk
1;k
2 2Nsuch that 1:s
1k1 =2:s
k22. In particular, from the previous paragraph we deduce r(1;s
1)=r(1:s
k11;s
1)=r(2:s
k22;s
2)=r(2;s
2).Irisa
Structural Presburger-denable Digit Vector Automata 5 Next, assume that
r(1;s
1) = r(2;s
2) and let us prove thats
1 =s
2 and 1:s
1 \2:s
2 6= ;. As the manipulated structures are dened component wise, we can assume without loss of generality that the dimensionm
is equal to 1. Remark that the sign digitss
1 ands
2 must be equal. In fact, otherwise, there existsi
1;i
2 2f1;
2g such thats
i1 =0 ands
i2 =r
?1and in this case we have shown that r(i1;s
i1) 2N and r(i2;s
i2)2ZnN which is in contradiction with r(1;s
1)=r(2;s
2). Let us considerk
1;k
2 2Nsuch that the wordsw
1=1:s
1k1 andw
2 =2:s
k22 have the same length denoted byk
2N. The rst paragraph shows thatr(w
1;s
1)=r(w
2;s
2). Ass
1 =s
2, we deduce the following equality:k
X
i=1
r
i?1:
(w
1[i
]?w
2[i
])=0Assume by contradiction that
w
1 6=w
2. In this casek
2 Nnf0g and there exists a maximal (for )j
2f1;::: ;k
gsuch thatw
1[j
]6=w
2[j
]. We have:j
w
1[i
]?w
2[i
]j8
>
<
>
:
=0 if
i > j
1 if
i
=j
r
?1 ifi < j
We deduce the following bound::j
k
X
i=1
r
i?1:
(w
1[i
]?w
2[i
])j=jr
j:
(w
1[j
]?w
2[j
])+jX?1i=1
r
i?1:
(w
1[i
]?w
2[i
])jj
r
j:
(w
1[j
]?w
2[j
])j?Xj?1i=1
j
r
i?1:
(w
1[i
]?w
2[i
])jr
j?jX?1i=1
r
i?1:
(r
?1)=1
We obtain a contradiction. We deduce that
w
1 =w
2 and in particular the wordw
=w
1 =w
2 is in 1:s
1\2:s
2. Q.E.DA language L (mr)
S
mr is said saturated [14] if for any (;s
) 2 (mr)S
mr, we have(
;s
) 2L if and only if (:s;s
) 2 L. Previous lemma 1 shows that a language Lis saturated if and only if there existsX
Zm such that L = ?1r (X
). In particular, we deduce that the side eectL
1
\L
2
= L and
r(L1)\2(L2) 6= r(L) is no longer true for saturated language. In fact, for any saturated languages L1;
L2 and for any #2 f[;
\;
n;
g, the language L1#L2 is saturated and r(L1)#r(L2)=r(L1#L2).We are interested in associating to a saturated language a state-based symbolic representation, called Digit Vector Automata.
Denition 1 (Digit Vector Automata)
A Digit Vector Automaton (DVA) A is a tuple A =(
Q;
mr;;q
0;F
0) where:
Q
is a non-empty nite set of states.:
Q
mr!Q
is the transition function.
q
02Q
is the initial state.
F
0Q
S
mr is the set of nal states such that (q;s
) 2F
0 if and only if (q
0;s
) 2F
0 for everyq
0 =(q;s
).PIn1718
6 Jérôme Leroux
q
0;
8
<
:
(0
;
0;
0);
(0
;r
?1;r
?1);
(
r
?1;
0;r
?1)9
=
;
q
1;
8
<
:
(
r
?1;r
?1;r
?1);
(
r
?1;
0;
0);
(0
;r
?1;
0)9
=
;
q
?;
;b
[1]+b
[2]=b
[3]+r
b
[1]+b
[2]+1=b
[3]b
[1]+b
[2]=b
[3]b
[1]+b
[2]+1=b
[3]+r
b
[1]+b
[2]+162b
[3]+f0;r
gb
[1]+b
[2]62b
[3]+f0;r
gmr
Figure 1: DVAAX representing
X
=fx
2Z3;x
[1]+x
[2]=x
[3]gq
0;
8
<
:
(0
;
0);
(
r
?1;
0);
(
r
?1;r
?1)9
=
;
q
1;
f (r
?1;
0)gb
[1]> b
[2]b
[1]< b
[2]b
[1]b
[2]b
[1]b
[2]Figure 2: DVAAX representing
X
=fx
2Z2;x
[1]x
[2]gq
0;S
mrmr
q
0;
;mr
Figure 3: On the left, DVAAZm. On the right, DVA A;
Irisa
Structural Presburger-denable Digit Vector Automata 7 As usual, function
is uniquely extended overQ
(mr)by(q;
1:
2)=((q;
1);
2). Moreover, a tuple (q;;q
0)such thatq
0=(q;
) is denoted byq
?!q
0 or justq
!q
0, and called a path fromq
toq
0 labeled by. Such a stateq
0 is said reachable fromq
(whenq
=q
0, we just say thatq
0 is reachable).The language L(A) recognized by a DVA A is dened by L(A) = f(
;s
) 2 (mr)S
mr; ((q
0;
);s
) 2F
0g. Thanks to the condition (q;s
) 2F
0 if and only if (q
0;s
) 2F
0 for everyq
?!sq
0, the language L(A) is saturated. The setX
=r(L(A))Zm is called the set represented by the DVAA.q
0;
f (0;
0)gq
1;
(0
;
0);
(
r
?1;
0)
q
?;
;mr
b
[1]6=0^b
[2]=1b
[1]=0^b
[2]=0b
[2]=0b
[2]6=0(:(
b
[1]=0^b
[2]=0))^(:(
b
[1]6=0^b
[2]=1))Figure 4: DVAAX representing
X
=fx
2Z2;V
r(x
[1]) =x
[2]gSets represented by DVA correspond to the
r
-denable sets. Recall ([8]) that a setX
Zm is saidr
-denable if it can be dened in the rst order theory FO(Z;
+;
;V
r) whereV
r :Z!Z is ther
-valuation function dened byV
r(0)=0 andV
r(x
) is the greatest power ofr
that dividesx
2Znf0g (gure 4). Recall also that a Number Decision Diagram (NDD) [6, 24] that represents a setX
Zm, is an automaton over mr that recognizes the languagef:s
; (;s
)2?1r (X
)g. We do not consider NDD in this paper because the automaton obtained from a NDD by replacing the initial state by an other state is not a NDD in general (it does not recognizes a language of the form f:s
; (;s
) 2?1r (X
0)g whereX
0 Zm). However, DVA and NDD have slightly the same structure and we can easily compute a NDD from a DVA and conversely, that represents the same setX
. In particular, we directly deduce from [8] and this remark, the following corollary 1Corollary 1
A setX
Zm can be represented by a DVA if and only if it isr
-denable.Remark 1
As in the NDD case, DVA can be eciently manipulated by reprensenting the set fb
2mr;
q
?!bq
0g and fs
2S
mr; (q;s
) 2F
0g by some Binary Decision Diagrams (BDD) [9] over the alphabet r (and not the exponential onemr).2.2 Moving the initial state
The DVA obtained from a DVA A by replacing the initial state
q
0 by a stateq
2Q
is denoted byAq. To simplify notations, when a set
X
Zm is implicitly represented by a DVA A, we denote byX
q Zm the set represented by the DVA Aq. We are going to characterize the setX
q in function ofX
. As an application, we show that anyr
-denable setX
Zm is represented by a unique minimal DVA.Proposition 1
For any pathq
?!q
0 in a DVA Athat represents a setX
, we haveX
q0 =r;?1(X
q).PIn1718
8 Jérôme Leroux
Proof :
Without loss of generality, we can restrict our proof to a pathq
0 ?!q
in a DVA A that represents a setX
. Let us consider an integer vectorx
2X
q. There exists a pathq
?!wq
0 ands
2S
mr such thatx
= r(w;s
) and (q
0;s
) 2F
0. We deduce that we have a pathq
0 ?:w?!q
0 with(q
0;s
) 2F
0. Therefore r(:w;s
) 2X
. From r(:w;s
) = r;(r(w;s
)) = r;(x
), we deduce thatx
2 r;?1(X
) and we have proved the inclusionX
qr;?1(X
). For the converse inclusion, consider an integer vectorx
2r;?1(X
). Asr;(x
)2X
, there exists a pathq
0?!wq
0 ands
2S
mr such thatr;(x
)=r(w;s
) and(
q;s
) 2F
0. Moreover, asx
2 Zm, there exists (w
0;s
0) 2(mr)S
mr such thatx
=r(w
0;s
0). From the equality r;(x
) = r(w;s
), we deduce that r(:w
0;s
0) = r(w;s
). Lemma 1 shows thats
0 =s
and there existsk
1;k
2 2 N such that:w
0:s
k1 =w:s
k2. As we have a pathq
0 ?!wq
0 with (q
0;s
) 2F
0 and Ais a DVA, we deduce thatq
00 =(q
0;s
k2) is such that (q
0 0;s
) 2F
0. From:w
0:s
k1 =w:s
k2, we get thatq
0 ?:w???0:s?k!1q
00. In particular we have a pathq
?w?0?:s?k!1q
00 with (q
00;s
) 2F
0. We deduce thatx
=r(w
0:s
k1;s
)2X
q and we have proved r;?1(X
)X
q. Q.E.D The previous proposition 1 proves in particular that the setQ
X =fr;?1(X
); 2(mr)g is nite whenX
isr
-denable. The minimal (for the number of states) DVA that represents ar
-denable setX
Zm can be easily characterized by introducing the DVA AX dened by the set of statesQ
X, the transition function X dened by a X(X
0;b
)=r;b?1(X
0) for anyX
0 2Q
X, the initial stateq
0;X =X
, the set of nal statesF
0;X =f(X
0;s
)2Q
XS
mr; 1?sr 2X
0g.A DVA A is said minimal if for any DVA A0 that represents the same set than A, the num- ber of states j
Q
j of A is less than or equal to the number of states jQ
0j of A0. Two DVAA
1
= (
Q
1;
mr;
1;q
0;1;F
0;1) and A2 = (Q
2;
mr;
2;q
0;2;F
0;2) are said isomorph if there exists a one- to-one relationQ
1Q
2 such that 1(q
1;b
) 2(q
2;b
) and fs
2S
mr; (q
1;s
) 2F
0;1g = fs
2S
mr; (q
2;s
)2F
0;2gfor anyq
1q
2, and such thatq
0;1q
0;2.Theorem 1
For anyr
-denable setX
Zm, the DVAAX is the unique (up to isomorphism) minimal DVA that representsX
.Proof :
First remark that AX is a DVA that representsX
. Next, let us consider a minimal DVAA=(
Q;
mr;;q
0;F
0)that representsX
. Proposition 1 proves that there exists a functionf
:Q
X !Q
such thatX
f(X0) =X
0 for anyX
0 2Q
X. In particular jQ
Xj jQ
j and as A is minimal, we havej
Q
Xj=jQ
jand in particularAX is also minimal. Moreover, we deduce thatf
is a one-to-one function.Just remark that A and AX are isomorph for the one-to-one relation = f(
X
0;f
(X
0));X
0 2Q
Xg. Q.E.DFrom the previous theorem 1 and corollary 1, we deduce that a set
X
Zm isr
-denable if and only ifQ
X =fr;?1(X
); 2(mr)g is nite.2.3 Replacing the set of nal states
Given a DVA A, the class of subsets
F
Q
S
mr such that(q;s
)2F
if and only if(q
0;s
)2F
for any transitionq
?!sq
0, is denoted by FA. The DVA obtained from a DVA A be replacing the set of nal statesF
0 by a setF
2FA is denoted by AF. To simplify notions, when a setX
Zm is implicitly represented by a DVA A, we denote byX
F the set represented by the DVA AF. In this section, the set FA is geometrically characterized by introducing the notion of eyes, semi-eyes and kernel.Let us consider the equivalence relation A over
Q
S
rm dened by(q
1;s
1)A(q
2;s
2)if and only ifs
1 =s
2 and (q
1;s
1)\(q
2;s
2)6=;.An eye
Y
is an equivalence class for the relation A (see gure 5). A semi-eye is a nite union of eyes. Remark that the class of semi-eyes is exactlyFA.Let us consider the function
e:Q
S
mr !Q
S
mr dened by e(q;s
)=((q;s
);s
).The kernel ker(
Y
) of a subsetY
Q
S
mr is dened asker (Y
) = Tn2Nne(Y
) and corresponds to the greatest (for ) x-point for e included inY
. Remark that the kernel of any eyeY
is a nonIrisa