30
New Search Strategies for the Petri Net CEGAR Approach Budapest University of Technology and Economics Department of Measurement and Information Systems New Search Strategies for the Petri Net CEGAR Approach Ákos Hajdu 1 , András Vörös 1 , Tamás Bartha 2 1 Department of Measurement and Information Systems Budapest University of Technology and Economics, Budapest, Hungary 2 Institute for Computer Science and Control MTA SZTAKI, Budapest, Hungary Petri Nets 2015, Brussels, Belgium, 26.06.2015.

New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR ApproachBudapest University of Technology and EconomicsDepartment of Measurement and Information Systems

New Search Strategies for thePetri Net CEGAR Approach

Ákos Hajdu1, András Vörös1, Tamás Bartha2

1Department of Measurement and Information Systems

Budapest University of Technology and Economics, Budapest, Hungary2Institute for Computer Science and Control

MTA SZTAKI, Budapest, Hungary

Petri Nets 2015, Brussels, Belgium, 26.06.2015.

Page 2: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 3: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 4: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Introduction – Reachability analysis

Reachability analysis

o Is a given marking reachable from the initial marking?

o Drawback: complexity

• Decidable [Mayr’81]

• At least EXPSPACE-hard [Lipton’76]

• No precise upper bound is known

o Possible solutions

• Partial order reduction

• Symbolic methods

• Abstraction

Page 5: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Introduction – Abstraction

Abstraction

o General approach to handle large (infinite) state spaces

• Less detailed (finite, smaller) state space representation

o Abstraction refinement is required

• A behavior in the abstract model may not be realizable

• Refine using information from the explored part

o CounterExample Guided Abstraction Refinement

o Applying CEGAR on Petri nets [Wimmel & Wolf’11]

Page 6: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 7: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

CEGAR approach on Petri nets

Abstraction of Petri nets: state equation

m0 + Cx = m1

Initial abstraction

Reachabilityproblem

Stateequation

Initial marking Target marking

Firing countof transitions

(unknown)

Incidence matrix

Page 8: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Initialabstraction

Reachabilityproblem

Stateequation

CEGAR approach on Petri nets

Analysis of the abstract model

o Solving the state equation for thefiring count of transitions

o Integer Linear Programming problem

o Necessary, but not sufficient criterion for reachability

Analysis of theabstract model

Not reachableNo solution

m0 + Cx = m1

Page 9: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

CEGAR approach on Petri nets

Examining the solution

o Bounded exploration of the state space

Initialabstraction

Analysis of theabstract modelReachability

problem

Stateequation

Not reachableNo solution

Examine the solution

Reachable

SolutionRealizable

Realizable solution

Partial solution

Partial solution

Page 10: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

CEGAR approach on Petri nets

Abstraction refinemento Exclude the counterexample without

losing any realizable solution

o Constraints can be added to the state equation• The state equation may become infeasible

• A new solution can be obtained

o Traversing the solution space of the state equation

Initialabstraction

Analysis of theabstract model

Examine thesolutionReachability

problem

Stateequation

Not reachable ReachableNo solution

SolutionRealizable

Refine theabstraction Not realizableConstraints

Page 11: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

CEGAR approach on Petri nets

Traversing the solution space

o Semi-linear space• Base solutions

• T-invariants

o Two types of constraints• Jump: obtain different base solution

• Increment: reach non-base solutionsby adding T-invariants

Initialabstraction

Analysis of theabstract model

Examine thesolutionReachability

problem

Stateequation

Not reachable ReachableNo solution

SolutionRealizable

Refine theabstraction Not realizableConstraints

m0 + Cx = m1

Page 12: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

CEGAR approach on Petri nets

Constraint examples

Initialabstraction

Analysis of theabstract model

Examine thesolutionReachability

problem

Stateequation

Not reachable ReachableNo solution

SolutionRealizable

Refine the abstraction Not realizableConstraints

(t0) (t2,t1)Jump: t0 < 1

(t0) (t1,t0,t2)Increment: t1 > 0

Invariants can “lend” tokens

Page 13: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Our previous results

Correctness of the algorithm [Hajdu et al.’14]

o The algorithm may give a wrong answer

o Detect these cases and also solve some of them

Completeness of the algorithm [Hajdu et al.’13]

o The algorithm may…

• …fail to decide the problem

• …fail to terminate

o Improvements, but still incomplete

Page 14: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 15: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

New iteration strategy

A reason for incompleteness

o Increment constraints add a T-invariant to a solution

o Possible cases:

1. Cannot fire

2. Fires and enables some other transition

3. Fires but does not enable any transition– Different solution is obtained without any progress terminate

– There may be „distant” invariants

} Repeat refinementcycle

Page 16: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

New iteration strategy

Our new strategy

o Extending increment constraints

• “Lending” tokens to places “lending” tokens to invariants

o Distant invariant

• Z is a distant invariant for Y if Z can produce tokens in places connected to Y

o Problems to be solved

• Number of tokens to “borrow”

• Termination criterion– E.g.: X lends to Y and Y lends to X infinite loop

Page 17: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

New iteration strategy

Number of tokens „borrowed”

o One token at a time and repeat

o Some problems cannot be solved this way

Termination criterion

o Form a chain of invariants

• If Z did not help Y find distant invariant for (Z + Y)

• Union of transitions finite

Page 18: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 19: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Search strategies

The algorithm traverses the solution space

o Multiple jump/increment constraints

o We examined different strategies

• Depth-first search

• Breadth-first search

o We developed a complex strategy

Page 20: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Search strategies

Depth-first search

+ Efficient regarding memory usage

+ Fast convergence

- May not find the minimal solution

- May not terminate

Breadth-first search

+ Always finds the minimal solution

- Less efficient than DFS

- May not terminate if there is no solution

Page 21: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Search strategies

Complex strategy

o Based on DFS

o Expand one level of the solution space

• All partial solutions of a solution vector

o Define an ordering between the partialsolutions

o Filter based on the order

Page 22: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Search strategies

Ordering

o Partial order: Parikh image of firing sequence

Filtering

oMaximal solutions

• Closest to a realizable solutions

• Infinite loops can be detected

o Minimal solutions

• Slower convergence

• May involve different T-invariants

Page 23: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 24: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Evaluation

Implementation: PetriDotNet framework

Comparison of algorithms

o SARA tool

• Wimmel & Wolf

o Saturation-based method (developed at our group)

• Symbolic algorithm

Comparison of search strategies

o BFS ↔ DFS ↔ Complex strategy

Page 25: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Comparison of the algorithms

FMSo Flexible manufacturing system

o Fixed structure

o Parameter affects state space

1E-3

1E-2

1E-1

1E+0

1E+1

1E+2

10 100 1000 10000

Ru

nti

me

(s)

Model parameter

Our algorithm Saturation SARA

0,001

0,01

0,1

1

10

100

10 100

Ru

nti

me

(s)

Model parameter

Our algorithm Saturation SARA

Dining philosopherso Illustration of mutual exclusion

o Structure grows with parameter

Page 26: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Comparison of search strategies

Models with large solution space

0,1%

1,0%

10,0%

100,0%

Chain1+2

Chain1+3

Chain1+4

Chain1+4*

Chain2+2

Chain2+3

Chain2+3*

Ru

nti

me

/ ru

nti

me

of

BFS

Model

DFS Complex

0%

20%

40%

60%

80%

100%

120%

140%

160%

180%

Chain1+2

Chain1+3

Chain1+4

Chain1+4*

Chain2+2

Chain2+3

Chain2+3*

Len

gth

/ le

ngt

ho

f B

FS

Model

DFS Complex

BFS

BFS

Page 27: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Outline of the talk

1. Introduction

2. The CEGAR approach on Petri nets

3. New iteration strategy

4. Search strategies

5. Evaluation

6. Conclusions

Page 28: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Conclusions

Theoretical results

o New iteration strategy and limitations

Practical results

o Behavior of BFS, DFS and a complex strategy

Future work

o Forward reachability: did we reach the limits?

o How structure and behavior affects performance?

[email protected]@mit.bme.hu

PetriDotNet: bit.ly/1RqnareMeasurements: bit.ly/1CoMJSG

Page 29: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

References

[Mayr’81] MAYR, EW. "An algorithm for the general Petri net reach-ability problem." Proc. 13th Annual ACM Symposium on Theory of Computing, 1981. 1981.

[Lipton’76] Lipton, Richard. "The reachability problem requires exponential space." Research Report 62, Department of Computer Science, Yale University, New Haven, Connecticut (1976).

[Wimmel & Wolf’11] Wimmel, Harro, and Karsten Wolf. "Applying CEGAR to the Petri net state equation." Tools and Algorithms for the Construction and Analysis of Systems. Springer Berlin Heidelberg, 2011. 224-238.

[Hajdu et al.’13] Hajdu, Ákos, et al. "Extensions to the CEGAR approach on Petri Nets." (2013): 274-288.

[Hajdu et al.’14] Hajdu, Akos, et al. "Extensions to the CEGAR Approach on Petri Nets." Acta Cybernetica 21 (2014): 401-417.

Page 30: New Search Strategies for the Petri Net CEGAR Approach · New Search Strategies for the Petri Net CEGAR Approach Introduction –Abstraction Abstraction oGeneral approach to handle

New Search Strategies for the Petri Net CEGAR Approach

Models

FMSDining philosophers

Chain 2+3