Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Searching for Liveness Property Violations in Concurrent Systems with ACO
1. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Searching for Liveness Property Violations
in Concurrent Systems with ACO
Francisco Chicano and Enrique Alba
GECCO 2008, Atlanta, USA, July 12-16, 2008 1 / 34
2. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Motivation
Motivation
• Concurrent software is difficult to test ...
• ... and it is in the heart of a lot of critical systems
• Techniques for proving the correctness of concurrent software are required
• Model checking → fully automatic
• In the past the work using metaheuristics focused on safety properties
• In this work we focus on liveness properties
GECCO 2008, Atlanta, USA, July 12-16, 2008 2 / 34
3. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Explicit State Model Checking
• Objective: Prove that model M satisfies the property :
• HSF-SPIN: the property f is an LTL formula
Model M LTL formula ¬ f Intersection Büchi automaton
(never claim)
s0
!p∨q s0
s5
s3 ∩ s0 s2
= s1 s3
s1 p∧!q
q s2
s2 s5
s1 s7
s4
s4
s6
s8
s9
GECCO 2008, Atlanta, USA, July 12-16, 2008 3 / 34
4. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Explicit State Model Checking
• Objective: Prove that model M satisfies the property :
• HSF-SPIN: the property f is an LTL formula
Model M LTL formula ¬ f Intersection Büchi automaton
(never claim)
s0
!p∨q s0
s5
s3 ∩ s0 s2
= s1 s3
s1 p∧!q
q s2
s2 s5
s1 s7
s4
s4
s6
s8
s9
GECCO 2008, Atlanta, USA, July 12-16, 2008 4 / 34
5. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Explicit State Model Checking
• Objective: Prove that model M satisfies the property :
• HSF-SPIN: the property f is an LTL formula
Model M LTL formula ¬ f Intersection Büchi automaton
(never claim)
s0
!p∨q s0
s5
s3 ∩ s0 s2
= s1 s3
s1 p∧!q
q s2
s2 s5
s1 s7
s4
s4
s6
s8
s9
Using Nested-DFS
GECCO 2008, Atlanta, USA, July 12-16, 2008 5 / 34
6. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
State Explosion Problem
• Number of states very large even for small models
s0
s1 s3
s2
Memory
s5
s7
s4
s6
s8
s9
• Example: Dining philosophers with n philosophers → 3n states
20 philosophers → 1039 GB for storing the states
• Solutions: collapse compression, minimized automaton representation, bitstate
hashing, partial order reduction, symmetry reduction
• Large models cannot be verified but errors can be found
GECCO 2008, Atlanta, USA, July 12-16, 2008 6 / 34
7. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Heuristic Model Checking
• The search for errors can be directed by using heuristic information
5
s0
2 2 Heuristic value
s1 3 s3
s2 1
s5
0
s7
4
s4 0
s6
6
s8 7
s9
• Different kinds of heuristic functions have been proposed in the past:
• Formula-based heuristics • Deadlock-detection heuristics
• Structural heuristics • State-dependent heuristics
GECCO 2008, Atlanta, USA, July 12-16, 2008 7 / 34
8. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Safety and Liveness Properties
Safety property s0
s1 s3
s2
s5
s7
s4
• Counterexample ≡ path to accepting state s6
• Graph exploration algorithms can be used: DFS and BFS s8
s9
Liveness property s0
s1 s3
s2
s5
s7
• Counterexample ≡ path to accepting cycle s4
s6
• It is not possible to apply DFS or BFS s8
s9
GECCO 2008, Atlanta, USA, July 12-16, 2008 8 / 34
9. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Strongly Connected Components
a b
c
e
f g d
GECCO 2008, Atlanta, USA, July 12-16, 2008 9 / 34
10. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Strongly Connected Components
GECCO 2008, Atlanta, USA, July 12-16, 2008 10 / 34
11. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Strongly Connected Components
GECCO 2008, Atlanta, USA, July 12-16, 2008 11 / 34
12. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Explicit State MC State Explosion Heuristic MC Safety & Liveness SCCs
Strongly Connected Components
N-SCC
a b
P-SCC c
e
F-SCC
f g d
GECCO 2008, Atlanta, USA, July 12-16, 2008 12 / 34
13. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
Optimization/Search Techniques
OPTIMIZATION/SEARCH TECHNIQUES
OPTIMIZATION/SEARCH TECHNIQUES
EXACT
EXACT APPROXIMATED
APPROXIMATED
Ad Hoc Heuristics
Ad Hoc Heuristics METAHEURISTICS
METAHEURISTICS
Based on Calculus
Based on Calculus Enumeratives
Enumeratives Trayectory-based
Trayectory-based Population-based
Population-based
• Newton • Depth First Search • SA • EA
• Gradient • Branch and Bound • VNS • ACO
• TS • PSO
GECCO 2008, Atlanta, USA, July 12-16, 2008 13 / 34
14. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACO: Introduction
• Ant Colony Optimization (ACO) metaheuristic is inspired by the
foraging behaviour of real ants
• ACO Pseudo-code
GECCO 2008, Atlanta, USA, July 12-16, 2008 14 / 34
15. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACO: Construction Phase
• The ant selects its next node stochastically
• The probability of selecting one node Trail
k
depends on the pheromone trail and the τij
heuristic value (optional) of the edge/node
Heuristic
i
ηij
Ni
• The ant stops when a complete
solution is built
m
j
l
k
GECCO 2008, Atlanta, USA, July 12-16, 2008 15 / 34
16. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACO: Pheromone Update
• Pheromone update
During the construction phase
with
After the construction phase
with
• Trail limits (particular of MMAS)
Pheromones are kept in the interval [τmin, τmax]
GECCO 2008, Atlanta, USA, July 12-16, 2008 16 / 34
17. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACOhg: Huge Graphs Exploration
The length of the ant
paths is limited by λant What if…?
λant
Objective node
Initial node
Starting nodes for path construction change
After σs steps
Second stage Third stage
GECCO 2008, Atlanta, USA, July 12-16, 2008 17 / 34
18. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACOhg-live
• The search is an alternation of two phases
First phase: search for accepting states
Second phase: search for cycles from the accepting states
ACOhg-live Pseudocode
First phase
GECCO 2008, Atlanta, USA, July 12-16, 2008 18 / 34
19. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACOhg-live
• The search is an alternation of two phases
First phase: search for accepting states
Second phase: search for cycles from the accepting states
ACOhg-live Pseudocode
Second phase
GECCO 2008, Atlanta, USA, July 12-16, 2008 19 / 34
20. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACOhg-live
• The search is an alternation of two phases
First phase: search for accepting states
Second phase: search for cycles from the accepting states
ACOhg-live Pseudocode
Tabu list
GECCO 2008, Atlanta, USA, July 12-16, 2008 20 / 34
21. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Metaheuristics ACO ACOhg ACOhg-live
ACOhg-live
• The search is an alternation of two phases
First phase: search for accepting states
Second phase: search for cycles from the accepting states
ACOhg-live Pseudocode • Improvement
Tabu list
using SCCs
First phase: accepting
states in N-SCC are
ignored
Both phases: cycle
detected in F-SCC is a
violation
GECCO 2008, Atlanta, USA, July 12-16, 2008 21 / 34
22. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Promela Models
• We used 11 Promela models for the experiments
Model LoC Scalable Processes LTL formula (liveness)
alter 64 no 2 □(p → ◊q) ^ □(r → ◊s)
giopj 740 yes j+6 □(p → ◊q)
phij 57 yes j+1 □(p → ◊q)
elevj 191 yes j+3 □(p → ◊q)
sgc 1001 no 20 ◊p
• Parameters for ACOhg-live
Parameter msteps colsize λant σs ξ a ρ α β
1st phase 10 20 0.7
100 4 5 0.2 1.0 2.0
2nd phase 20 4 0.5
• Formula-based and finite state machine heuristics
• ACOhg-live implemented in HSF-SPIN
• 100 independent executions and statistical validation
GECCO 2008, Atlanta, USA, July 12-16, 2008 22 / 34
23. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Promela Models
• We used 11 Promela models for the experiments
Model LoC Scalable Processes LTL formula (liveness)
alter 64 no 2 □(p → ◊q) ^ □(r → ◊s)
j=10,15,20
giopj 740 yes j+6 □(p → ◊q)
phij 57 yes
j=20,30,40 j+1 □(p → ◊q)
elevj 191 yes j+3 □(p → ◊q)
sgc 1001
j=10,15,20
no 20 ◊p
• Parameters for ACOhg-live
Parameter msteps colsize λant σs ξ a ρ α β
1st phase 10 20 0.7
100 4 5 0.2 1.0 2.0
2nd phase 20 4 0.5
• Formula-based and finite state machine heuristics
• ACOhg-live implemented in HSF-SPIN
• 100 independent executions and statistical validation
GECCO 2008, Atlanta, USA, July 12-16, 2008 23 / 34
24. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results I: Influence of the SCC Improvement
SD
SD
GECCO 2008, Atlanta, USA, July 12-16, 2008 24 / 34
25. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results I: Influence of the SCC Improvement
SD
SD
SD SD
SD SD
SD SD
GECCO 2008, Atlanta, USA, July 12-16, 2008 25 / 34
26. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results I: Influence of the SCC Improvement
SD
SD SD SD
SD
SD SD
SD SD
SD SD
GECCO 2008, Atlanta, USA, July 12-16, 2008 26 / 34
28. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results II: ACOhg-live+ vs. NDFS and INDFS
Models ACOhg-live+ NDFS INDFS
alter
giop10
giop15
giop20
phi20
phi30
phi40
elev10
elev15
elev20
sgc
GECCO 2008, Atlanta, USA, July 12-16, 2008 28 / 34
29. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results II: ACOhg-live+ vs. NDFS and INDFS
Models ACOhg-live+ NDFS INDFS
alter
SD 1069
giop10
giop15 10001 1059
giop20
10001
phi20 9999
phi30
phi40
elev10
elev15
elev20
sgc
GECCO 2008, Atlanta, USA, July 12-16, 2008 29 / 34
30. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results II: ACOhg-live+ vs. NDFS and INDFS
Models ACOhg-live+ NDFS INDFS
alter
SD 1069
giop10
392192
giop15 388096 1059
15360
10001
giop20
10001
phi20 9999
phi30
phi40
elev10
elev15
elev20
sgc
GECCO 2008, Atlanta, USA, July 12-16, 2008 30 / 34
31. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
Results II: ACOhg-live+ vs. NDFS and INDFS
Models ACOhg-live+ NDFS INDFS
alter
SD 1069
giop10
392192
giop15 15320
388096 1059
15360
10001
15670
giop20
10001
phi20 9999
phi30
phi40
elev10
elev15
elev20
sgc
GECCO 2008, Atlanta, USA, July 12-16, 2008 31 / 34
32. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Models & parameters Results Discussion
How to use ACOhg-live
• ACOhg-live should be used in the first/middle stages of the software development,
when software errors are expected
• ACOhg-live can also be used in other phases of the software development for testing
concurrent software
Large model or
a short couterexample
is needed ACOhg-live
Model
Small model and (I)NDFS
any counterexample
is needed fast
GECCO 2008, Atlanta, USA, July 12-16, 2008 32 / 34
33. Algorithmic Conclusions
Introduction Background Experiments
Proposal & Future Work
Conclusions & Future Work
Conclusions & Future Work
Conclusions
• ACOhg-live is the first algorithm based on metaheuristics (to the best of our
knowledge) applied to the search for liveness errors in concurrent models
• The improvement based on the SCCs of the never claim outperforms the efficacy of
ACOhg-live
• ACOhg-live is able to outperform (Improved) Nested-DFS in efficacy and efficiency
in the search for liveness errors
Future Work
• Analysis of parameterization for reducing the parameters
• Include ACOhg-live into JavaPathFinder for finding liveness errors in Java programs
• Combine ACOhg-live with techniques for reducing the memory required for the search
such as partial order reduction (work in progress)
GECCO 2008, Atlanta, USA, July 12-16, 2008 33 / 34
34. Searching for Liveness Property Violations
in Concurrent Systems with ACO
Thanks for your attention !!!
GECCO 2008, Atlanta, USA, July 12-16, 2008 34 / 34