Extended Finite-State Machine Inference with Parallel Ant Colony...
Transcript of Extended Finite-State Machine Inference with Parallel Ant Colony...
![Page 1: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/1.jpg)
Extended Finite-State Machine Inference
with Parallel Ant Colony Based Algorithms
BIOMA @ PPSN’14
September 13, 2014
Daniil Chivilikhin
PhD student
ITMO University
Vladimir Ulyantsev
PhD student
ITMO University
Anatoly Shalyto
Dr.Sci., professor
ITMO University
![Page 2: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/2.jpg)
Motivation: Reliable software
• Systems with high cost of failure
– Energetics
– Aerospace
– Finances
– …
• We want to have reliable software
– Testing is not enough
– Verification is needed
EFSM Inference with Parallel
ACO based Algorithms
2
![Page 3: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/3.jpg)
Challenge
• Reliable systems are hard to develop
• Verification is time consuming
EFSM Inference with Parallel
ACO based Algorithms
3
![Page 4: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/4.jpg)
Model-driven development
• Automated software engineering
• Model-driven development
Software
specificationModel Code
EFSM Inference with Parallel
ACO based Algorithms
4
![Page 5: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/5.jpg)
Automata-based programming
Software
specificationModel Code
Extended
Finite-state
machine
EFSM Inference with Parallel
ACO based Algorithms
5
![Page 6: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/6.jpg)
Extended Finite-State Machine
EFSM Inference with Parallel
ACO based Algorithms
6
![Page 7: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/7.jpg)
Automated-controlled object
Finite-state
machine
Controlled
objectActions
Events
Automata-based programming
EFSM Inference with Parallel
ACO based Algorithms
7
![Page 8: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/8.jpg)
Automata-based programming:
advantages • Model before programming code, not vice
versa
• Possibility of program verification using
Model Checking
Model Code
Finite-state machine
EFSM Inference with Parallel
ACO based Algorithms
8
![Page 9: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/9.jpg)
Conventional workflow
EFSM Inference with Parallel
ACO based Algorithms
9
Requirements
Programming
Testing
Verification
![Page 10: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/10.jpg)
Automata-based programming
workflow
EFSM Inference with Parallel
ACO based Algorithms
10
Requirements
Program
Automated
inference
Easy for the user
Time-consuming
for computer
![Page 11: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/11.jpg)
Issues
• Hard to build an EFSM with desired
behavior
• Sometimes, several hours on a single
machine
• Use parallel algorithms
EFSM Inference with Parallel
ACO based Algorithms
11
![Page 12: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/12.jpg)
EFSM inference algorithms
• Genetic algorithm (GA)
• Previous work: Mutation-based Ant Colony
Optimization (MuACO)
• …
• No parallel implementations so far
EFSM Inference with Parallel
ACO based Algorithms
12
![Page 13: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/13.jpg)
In this work
• Develop several parallel versions of
MuACO
• Compare
– With each other
– With parallel GA
– Statistical significance
EFSM Inference with Parallel
ACO based Algorithms
13
![Page 14: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/14.jpg)
EFSM mutations
EFSM Inference with Parallel
ACO based Algorithms
14
![Page 15: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/15.jpg)
MuACO algorithm
EFSM Inference with Parallel
ACO based Algorithms 15
![Page 16: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/16.jpg)
MuACO algorithm
A0 = random FSM
Graph = {A0}
while not stop() do
ConstructAntSolutions
UpdatePheromoneValues
EFSM Inference with Parallel
ACO based Algorithms
16
![Page 17: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/17.jpg)
Constructing ant solutions
• Use a colony of ants
• An ant is placed on a
graph node
• Each ant has a limited
number of steps
• On each step the ant
moves to the next node
EFSM Inference with Parallel
ACO based Algorithms
17
A
A4
A3
A2
A1
![Page 18: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/18.jpg)
Ant step: selecting the next node
Go to best mutated FSM
Probabilistic selection
P = Pnew
P = 1 – Pnew
}4,3,2,1{ AAAAw
uwuw
uvuv
Avp
A
f(A)=10
А4
f(A4)=9
A3
f(A3)=0
A2
f(A2)=12
A1
f(A1)=8Mutation
A
A4
A3
A2
A1
EFSM Inference with Parallel
ACO based Algorithms
18
![Page 19: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/19.jpg)
Why parallel MuACO?
• Single-node MuACO is more efficient than
GA for EFSM inference – Chivilikhin D., Ulyantsev V. MuACOsm - A New
Mutation-Based Ant Colony Optimization Algorithm
for Learning Finite-State Machines / In GECCO’13
– Chivilikhin D., Ulyantsev V. Inferring Automata-Based
Programs from Specification With Mutation-Based Ant
Colony Optimization / In GECCO’14
EFSM Inference with Parallel
ACO based Algorithms
19
![Page 20: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/20.jpg)
Parallel combinatorial optimization
• Randomized algorithms
• More exploration – higher chance of
finding optimal solution
• Increase exploration using parallelism
EFSM Inference with Parallel
ACO based Algorithms
20
![Page 21: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/21.jpg)
Parallel metaheuristics
• Evolutionary algorithms
– Island scheme
– Migration
– MuACO doesn’t have a population
• Ant Colony algorithms
– Multiple colonies
– This can work
EFSM Inference with Parallel
ACO based Algorithms
21
![Page 22: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/22.jpg)
Three parallel MuACO algorithms
1. Independent parallel MuACO
2. Shared best solutions
3. MuACO with crossover
EFSM Inference with Parallel
ACO based Algorithms
22
![Page 23: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/23.jpg)
Independent parallel MuACO
• m processors
• Generate m random initial solutions
• Start m MuACO algorithms
• Terminate when at least one finds optimal
solution
• NO interaction between algorithms
EFSM Inference with Parallel
ACO based Algorithms
23
![Page 24: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/24.jpg)
Shared best solutions
EFSM Inference with Parallel
ACO based Algorithms
24
• i-th algorithm restarts with j-th algorithm’s best
solution
![Page 25: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/25.jpg)
MuACO with crossovers
EFSM Inference with Parallel
ACO based Algorithms
25
Crossovers from: F. Tsarev and K. Egorov. Finite state machine induction using
genetic algorithm based on testing and model checking. In GECCO’11 Companion
Proc., pp.759–762, Dublin, Ireland, 2011.
![Page 26: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/26.jpg)
Other tested approaches
• Parallel fitness evaluation
• Different algorithm settings
• …
• No good
EFSM Inference with Parallel
ACO based Algorithms
26
![Page 27: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/27.jpg)
Input data:
• Number of states C
• Set of test scenarios
• Set of temporal properties
Goal: build an EFSM with C states
compliant with scenarios and temporal
properties
Learning EFSMs from scenarios and
temporal properties
EFSM Inference with Parallel
ACO based Algorithms 27
![Page 28: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/28.jpg)
Scenarios and temporal
properties • Scenario
– T [x1 & x2]/z1, A [true], A [x2 & !x1]/z2, T [x1]/z3
• Temporal properties – Linear temporal
logic
– G(wasEvent 𝑇 ⇒ wasAction 𝑧1 )
EFSM Inference with Parallel
ACO based Algorithms 28
![Page 29: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/29.jpg)
Learning EFSMs: Fitness function
• Pass inputs to EFSM, record outputs
• Compare generated outputs with references
• Use verifier to check temporal properties
• Fitness = string similarity measure (edit
distance) + verification part
EFSM Inference with Parallel
ACO based Algorithms 29
![Page 30: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/30.jpg)
Experimental setup
• 50 random EFSMs with 10 states
• One input variable
• Two input events
• Two output actions
• Sequence length up to 2
• 24-core AMD Opteron 6234 2.4 GHz
processor EFSM Inference with Parallel
ACO based Algorithms 30
![Page 31: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/31.jpg)
Compared algorithms
• Sequential MuACO
• Independent parallel MuACO
• Parallel MuACO + Shared best
• Parallel MuACO + Crossovers
• Parallel MuACO + Shared best +
Crossovers
• Independent parallel GA
EFSM Inference with Parallel
ACO based Algorithms 31
![Page 32: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/32.jpg)
Results: MuACO speedup
EFSM Inference with Parallel
ACO based Algorithms 32
Sequential MuACO runtime = 1392 s.
![Page 33: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/33.jpg)
Results: median time
EFSM Inference with Parallel
ACO based Algorithms 33
![Page 34: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/34.jpg)
Results: comparison with GA
EFSM Inference with Parallel
ACO based Algorithms 34
![Page 35: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/35.jpg)
Statistical significance
• Both “Crossovers” are significantly better
than other algorithms
• Not significantly different from each other
EFSM Inference with Parallel
ACO based Algorithms 35
![Page 36: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/36.jpg)
Combining exact and
metaheuristic algorithms • ICMLA’14: Combining Exact And
Metaheuristic Techniques For Learning
Extended Finite-State Machines From Test
Scenarios and Temporal Properties
(accepted)
EFSM Inference with Parallel
ACO based Algorithms 36
![Page 37: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/37.jpg)
Combining exact and
metaheuristic algorithms
EFSM Inference with Parallel
ACO based Algorithms 37
Scenarios Fast exact
algorithm
EFSM 1
MuACO Temporal
properties
Final EFSM
![Page 38: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/38.jpg)
Combining exact and metaheuristic algorithms: results
Crossovers Exact + Crossovers
Mean time, s.
208 78
Median time, s.
73 28
EFSM Inference with Parallel
ACO based Algorithms 38
![Page 39: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/39.jpg)
Conclusion
• Parallel EFSM inference algorithms are
very efficient
• Parallel MuACO algorithms with crossover
demonstrated best performance
• With super-linear speedup
EFSM Inference with Parallel
ACO based Algorithms 39
![Page 40: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/40.jpg)
Future work
• Parallel MuACO-GA algorithm
• Experiments using more computational
nodes
• More experiments with exact algorithms
EFSM Inference with Parallel
ACO based Algorithms 40
![Page 41: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/41.jpg)
Acknowledgements
• This work was financially supported by the
Government of Russian Federation, Grant 074-
U01, and also partially supported by RFBR,
research project No. 14-01-00551 a.
EFSM Inference with Parallel
ACO based Algorithms
41
![Page 42: Extended Finite-State Machine Inference with Parallel Ant Colony …bioma.ijs.si/conference/2014/files/10-presentation.pdf · Finite-state machine EFSM Inference with Parallel ACO](https://reader034.fdocuments.net/reader034/viewer/2022043023/5f3f11c152e5677de054a839/html5/thumbnails/42.jpg)
Thank you for your attention!
Daniil Chivilikhin
Vladimir Ulyantsev
Anatoly Shalyto
Extended Finite-State Machine Inference with Parallel Ant
Colony Based Algorithms
{chivdan,ulyantsev}@rain.ifmo.ru
EFSM Inference with Parallel
ACO based Algorithms
42