# Supporting Multiple Pointing Devices in Windows by nikeborome

VIEWS: 3 PAGES: 18

• pg 1
```									Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Obtaining Memory-Efficient
Reachability Graph Representations
Using the Sweep-Line Method

Thomas Mailund and Michael Westergaard
Department of Computer Science
University of Aarhus
Denmark

March 30, 2004                                                                      1/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Setting (1)
• We want to explicitely store the entire reachability
graph, but conserve space by storing each
state/node using as few bits as possible
• The most naїve representation of a state would
store a pair (n, m) as two independent numbers,
potentially wasting space (if n,m  {0, ... ,4}, we
would use 2 · ceil(log(5)) = 3 + 3 = 6 bits per state,
or even 32 + 32 = 64 bits or more, if we store them
as integers)
• A better approach is to enumerate the
syntactically possible states, and use only enough
bits to distinguish between them (ceil(log(5 · 5)) =
5 bits per state)

March 30, 2004                                                                      2/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Setting (2)

• The optimal solution is to enumerate the
reachable states only, and store each state using
the number of bits required to distinguish them
(in the example, if only 13 of the states were
actually reachable, we could store each state using
ceil(log(13)) = 4 bits only)
• Unfortunately we do not know the number of
reachable states until after we have constructed
the entire reachability graph. We try to address
this problem here

March 30, 2004                                                                      3/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Outline

• Condensed Representation
• The Sweep-Line Method
• On-the-fly Construction of the Condensed
Representation
• Experimental Results

March 30, 2004                                                                      4/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Example (1)
•    2 runners in a race with 2 laps
•    Either
t1) runner 1 finishes a lap before runner 2,
t2) runner 2 finishes a lap before runner 1, or
t3) both runners finish a lap at the same time
•    A runner can be at most 1 lap ahead of the other
runner
•    In the beginning neither of the runners have
finished any laps
•    The state of the system is a pair (n, m), where n is
the number of laps completed by runner 1 and m
is the number of laps completed by runner 2

March 30, 2004                                                                      5/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method    TACAS 2004

Example (2)
•   Only some (7) of the syntactically
possible states (9) are reachable
•   At least ceil(log(9))=4 bits are
used to store each state, although
ceil(log(7))=3 bits would suffice
•   In realistic examples, the number
of syntactically possible states is
much larger than the number of
reachable states, so distinguishing
only between reachable states
yields a good reduction
•   Alas, we first know the number of
reachable states, when we have
constructed the reachability graph

March 30, 2004                                                                          6/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method       TACAS 2004

Condensed Representation
• We assume that we can
Transition                               4             6
enumerate the transitions
• Assign to each reachable   Destination
state a number, 0…R-1state
Number of transitions

•
2                3            5

State
number

0            1

March 30, 2004                                                                          7/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Traversal of Condensed Representation
4         6
• We assume the existence of a
(partial) mapping next that for a state
5
and a transition gives the next state
2           3
(e.g. next((1,0), t3)=(2,1))
• We have not lost any information
0
with this reduction, so analysis is still
1
possible; for example a depth-first
traversal would look like:
DFS(0, sI)
proc DFS(i, m)
if (visited(i)) return
analyse(m)
for each (t, i’) in E[i]
DFS(i’, next(m, t))
end for
end proc

March 30, 2004                                                                      8/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

The Sweep-Line Method
Not yet discovered state                    sweep-line
• We assume a progress
measure, ψ, that assigns to
each state a progress
value, such that s->s’ =>
Discovered but
ψ(s)≤ψ(s’)
unprocessed state

• Here, we take ψ(n,m)=n
• All states to be processed
are in front of the sweep-
line
• All new states are added in
the sweep-line
front of Processed state
• We do not need the states
behind the sweep-line;
they can safely be removed
from memory                                  0               1        2
progress

March 30, 2004                                                                      9/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method        TACAS 2004

On-the-fly Construction
Number of bits used to
of the Condensod Representation
represent the successor states
sweep-line

4               6
State
number

Number of        Transition   Destination
transitions                      state

2                3             5Now 3 bits are
required

0                1

progress

March 30, 2004                                                                              10/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Experimental Results

• A prototypical implementation of the described
method has been made in Design/CPN, a tool for
editing, simulating and analysing Coloured Petri
Nets
• The implementation does not take into account
the different sizes of the numbers, and encodes
everything in a machine word

March 30, 2004                                                                     11/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method          TACAS 2004

Experimental Results (Runner Example)
size/kb                                                          r a t io
8                                                                      1.20
Full size
7                                                                      1.05
Condensed size
6               Ratio                                                  0.90

5                                                                      0.75

4                                                                       0.60

3                                                                      0.45

2                                                                      0.30

1                                                                      0.15

0                                                                    0.00
0          20           40   La ps
60          80          100

March 30, 2004                                                                            12/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method         TACAS 2004

Experimental Results
(Stop and Wait Protocol)
size/mb                                                                  ratio
4,0                                                                        2,00
3,5                                                                          1,75
3,0                                                                          1,50
2,5                                                                          1,25
2,0                                                                          1,00
Full size
1,5                                                                         0,75
Condensed size
1,0                                                 Size ratio               0,50
0,5                                                 Time ratio               0,25
0,0                                                                          0,00
0          20            40       60                80          100
Packets

March 30, 2004                                                                             13/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method     TACAS 2004

Experimental Results
(Dining Philosophers)
size/mb                                                                  ratio
4,0                                                                          4,0
3,5                                                                          3,5
Full size
3,0                 Condensed size                                            3,0
2,5                Size ratio                                                2,5
Time ratio
2,0                                                                           2,0
1,5                                                                          1,5
1,0                                                                          1,0
0,5                                                                           0,5
0,0                                                                           0,0
0                5             10                   15            20
Philosophers

March 30, 2004                                                                           14/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Conclusion

• We have seen an efficient representation of
reachability graphs, and how this representation
can be traversed for analysis
• We have seen how the efficient representation can
be calculated efficiently using the sweep-line
method
• We have seen how the method performs on some
examples – basically, the method performs well
when the sweep-line method performs well, i.e.
for systems with a clear notion of progress

March 30, 2004                                                                     15/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Future Work

• Implementation of LTL/CTL checker
• Use on more realistic examples
• Use the described method with methods reducing
the reachability graph itself, e.g. symmetry
reduction

March 30, 2004                                                                     16/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Non-monotone Progress Measures

• If s->s’ => ψ(s)≤ψ(s’), we say that ψ is monotone
• If the progress measure we use is not monotone,
the algorithm still works, but the generated
reachability graph may be an unfolding of the real
reachability graph
• The unfolded reachability graph and the real
reachability graph are bisimilar (so CTL* is
preserved)
• This actually happens in the Dining Philosophers
example

March 30, 2004                                                                     17/16
Memory-Efficient Reachability Graph Representations Using Sweep-Line Method   TACAS 2004

Non-monotone Progress Measures (2)

•   To the runner example,