54
Timed P Automata Roberto Barbuti 1 Andrea Maggiolo Schettini 1 Paolo Milazzo 1 Luca Tesei 2 1. Dipartimento di Informatica, Universit` a di Pisa, Italy 2. Dipartimento di Matematica e Informatica, Universit` a of Camerino, Italy Ia¸ si – September, 2008 Paolo Milazzo (Universit` a di Pisa) Timed P Automata Ia¸ si – September, 2008 1 / 54

Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P Automata

Roberto Barbuti1 Andrea Maggiolo Schettini1

Paolo Milazzo1 Luca Tesei2

1. Dipartimento di Informatica, Universita di Pisa, Italy2. Dipartimento di Matematica e Informatica, Universita of Camerino, Italy

Iasi – September, 2008

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 1 / 54

Page 2: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Introduction

We are interested in modeling ecological systems

Recently, a model based on P systems of a population of Vultures of theCatalan Pyrenees has been studied

We would like to build models that can describe periodical changes in theenvironmental conditions

seasons

periodical hunt/harvest

We shall consider timed P systems and allow evolution rules to be changedwhen conditions on the elapsing of time are satisfied

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 2 / 54

Page 3: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 3 / 54

Page 4: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

P systems

A P system consists of a hierarchy of membranes, each of them containing

a multiset of objects

and a set of evolution rules

Evolution rules are applied with maximal parallelism to objects of the samemembrane

The application of evolution rules of different membranes is synchronizedby a global clock

Evolution rules can send objects into (immediately) outer and innermembranes

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 4 / 54

Page 5: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

P systems

c→ cin2

1

a→ bhere

2c→ aout

caaccc

cb→ cherebout

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 5 / 54

Page 6: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 6 / 54

Page 7: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P systems

Defined by Cavaliere and Sburlan

Each evolution rule is enriched with a natural number representing thetime (number of steps) needed by the rule to be enterely executed

When a rule with time n is applied

consumed objects are immediately removed

produced objects appear after n steps

Semantically, for each application of an evolution rule un−→ v in membrane

i , a pending rulen−1−−→i v is created. At each step:

everyk−→i v with k > 1 becomes

k−1−−→i v

every1−→i v is deleted and objects v are added to the content of

membrane i

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 7 / 54

Page 8: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example of timed P system

A timed P system computing the least common multiple of n1 and n2.

a n

1−1

a '

b n

2−1

b '

e a ' a

a '

a ' b ' et 1in2

a b e t

t 1in2

1

2

e b ' b

b '

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 8 / 54

Page 9: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Running the example

Let n1 = 4 and n2 = 6...a

n1−1

a '

b n

2−1

b '

e a ' a

a '

a ' b ' et 1in2

a b e t

t 1in2

1

2

e b ' b

b '

1 2 3 4 5 6 7 8 9 10 11 12 130

eab

ea′

ea

e

b′

e

b

e e ea′

b′

ea′

ea

e e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 9 / 54

Page 10: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P systems: definition

Definition A timed P system Π is a tuple

〈V , µ,w1, . . . ,wm,R1, . . . ,Rm〉

where

V is an alphabet whose elements are called objects.

µ is a membrane structure consisting of a hierarchy of m membraneslabelled by 1, 2, . . . ,m. The skin membrane is labelled by 1.

wi (i = 1, 2, . . . ,m) is a string of V ∗ representing a multisets ofobjects enclosed in membrane i .

Ri (i = 1, 2, . . . ,m) is a finite set of timed evolution rules associatedwith the membrane i . The rules are of the form u

n−→ v ,n ∈ IN, u ∈ V +, and v ∈ {ahere , aout , ainj

| a ∈ V , 1 ≤ j ≤ m}∗.

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 10 / 54

Page 11: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P systems: definition

Definition A multiset of pending rules U is a multiset of elements of the

formk−→i v , with k > 0

Definition A configuration is a pair (Π,U) where Π is a timed P systemand U is a multiset of pending rules

A computation performed by a timed P system Π can be described as asequence of steps between configurations

the initial configuration is (Π,∅)

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 11 / 54

Page 12: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

A step of a timed P system

Definition A configuration (Π,U) can perform a timed P step1−→ to a

configuration (Π′,U ′) if and only if:

Π′ is a timed P system resulting from an evolution step of Π usingmaximal parallelism, where:

I the effects of the rules u1−→ v are visible in Π′, i.e., the reactants have

disappeared and the products of the rules are availableI the effects of the rules u

n−→ v with n > 1 are half visible in Π′. Moreprecisely, the reactants have disappeared, but the products are not yetavailable

I for every element1−→i v in U , the objects v are added to membrane i ;

U ′ is the multiset union ofI the multiset of all elements

k−1−−→i v derived from all elementsk−→i v ,

k > 1, in U ; andI the multiset of all elements

n−1−−→i v , n > 1, representing that aninstance of a timed evolution rule u

n−→ v ∈ Ri , for some i , has beenfired in the evolution step of Π.

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 12 / 54

Page 13: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 13 / 54

Page 14: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed automata

We shall extend timed P systems with features from timed automata

A timed automaton is a finite state automaton extended with:

clocks

transitions enriched with conditions on the value of clocks and withclock reset actions

state invariants

x=2,

{x}c,

true, c, {x}

x <= 1, b, {}

true, a, {x}

x <= 1 x <= 221 0

x<=30

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 14 / 54

Page 15: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 15 / 54

Page 16: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P automata

A timed P automaton is a timed automaton with a discrete time domainin which each location is associated with a timed P system

all timed P systems must have the same membrane structure

A computation starts in the timed P system associated with the initallocation of the automaton

after each step, clocks are increased by one

When clocks reach values that satisfy the constraint of an outgoingtransition, such a transition might be fired

the computation in the current location is stopped

objects are moved to the location reached by the transition (in thecorresponding membranes)

some objects might be added to/removed from the skin membrane

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 16 / 54

Page 17: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

An example of timed P automaton

ea e a

x≤1

true

b

[−e ]x=1

aa2

aa

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea ex=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa

bbbd

x=2[−e ]

{x }

eveneven case

aaabbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 17 / 54

Page 18: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

The Ancient Egyptian multiplication algorithm (2000 B.C.)

d 0 while (a 0) if (a is even) a a / 2 b b * 2 else d d + b a a / 2 b b * 2 endifendwhile

a b

35 + 4217 + 84 8 168 4 336 2 672 1 + 1344 ------- d 1470

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 18 / 54

Page 19: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 0)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

aaaaa bbb e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 19 / 54

Page 20: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 1)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

aaaaa bbb ē

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 20 / 54

Page 21: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 2)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

aaaaa bbb

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 21 / 54

Page 22: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 3)Clock x = 1, pending rules U = { 1−→ aa ,

1−→ aa}

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

a bbb

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 22 / 54

Page 23: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 4)Clock x = 1, pending rules U = { 1−→ aa ,

1−→ aa}

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

bbb ea

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 23 / 54

Page 24: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 5)Clock x = 2, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

bbb ēaaaa

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 24 / 54

Page 25: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 6)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

bbbaaaa

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 25 / 54

Page 26: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 7)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

bbbbbbaa ddd

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 26 / 54

Page 27: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 8)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x baa 3x d e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 27 / 54

Page 28: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 9)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x baa 3x d ē

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 28 / 54

Page 29: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 10)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x baa 3x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 29 / 54

Page 30: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 11)Clock x = 1, pending rules U = { 1−→ aa}

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x b 3x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 30 / 54

Page 31: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 12)Clock x = 1, pending rules U = { 1−→ aa}

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x b 3x d e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 31 / 54

Page 32: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 13)Clock x = 2, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x b 3x d eaa

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 32 / 54

Page 33: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 14)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

6x b 3x daa

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 33 / 54

Page 34: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 15)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x da

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 34 / 54

Page 35: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 16)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x da

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 35 / 54

Page 36: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 17)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x da

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 36 / 54

Page 37: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 18)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x da e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 37 / 54

Page 38: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 19)Clock x = 2, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x d ē

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 38 / 54

Page 39: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 20)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

12x b 3x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 39 / 54

Page 40: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 21)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

24x b 15x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 40 / 54

Page 41: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 22)Clock x = 0, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

24x b 15x d e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 41 / 54

Page 42: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 23)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

24x b 15x d e

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 42 / 54

Page 43: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 24)Clock x = 1, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

24x b 15x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 43 / 54

Page 44: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Example: 5 x 3 (step 25 - THE END)Clock x = 2, pending rules U = ∅

ea e a

x≤1

true

b

[−e ]x=1

aa 2

a a

zero {}

zero #a?

ending

x≤1

[−e ]

x=1 {x }

! zerohiding ' a' pairs

ea e

x=1 {}

[e ]

even #a?

x≤2

x≤1 x≤1

test even #a

[−e ]x=2

odd{x }

odd case

aaa bbbd

x=2[−e ]

{x }

eveneven case

aaa bbb

x=1

{x } ! zero

x=1

{x }

[e ]

test zero #a

15x d

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 44 / 54

Page 45: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 45 / 54

Page 46: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P automata: definition

Definition A timed P automaton is a tuple

T = 〈Q,Σ, q0, E ,X ,F ,R, Inv〉

where:

Q is a finite set of locations

Σ is a finite alphabet of symbols

q0 is the initial location

E is a finite set of edges

X is a finite set of clocks

F = 〈V , µ〉 is a timed P frame: it contains the alphabet and themembrane structure shared by all the timed P systems

R is a function assigning to every q ∈ Q a set of sets of timedevolution rules

Inv is a function assigning to every q ∈ Q an invariant

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 46 / 54

Page 47: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P automata: definitionEach edge is a tuple (q, ψ, u, γ, σ, v , q′) where:

q is the source location

ψ is the clock constraint

u are the objects removed from the skin membrane

γ is the clock reset set

σ is a label (optional – can be used to accept languages)

v are the objects added to the skin membrane

q′ is the target location

A state of execution of a timed P automaton is a tuple 〈q, ν,Π,U〉, where:

q is a location

ν is a clock valuation

Π is the executing timed P systems

U is a multiset of pending rules

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 47 / 54

Page 48: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P automata: semantics

The behaviour of a timed P automaton is described by the labelledtransition system given by the following rules:

T1ν + 1 |= Inv(q) (Π,U)

1−→ (Π′,U ′)〈q, ν,Π,U〉 1−−→

TP〈q, ν + 1,Π′,U ′〉

T2

Π = 〈V , µ,w1,w2, . . . ,wm,R(q)〉(q, ψ, u, γ, σ, v , q′) ∈ E , ν |= ψ, u ⊆ w1 w ′1 = (w1\u) ∪ v

Π′ = 〈V , µ,w ′1,w2, . . . ,wm,R(q′)〉〈q, ν,Π,U〉 σ−−→

TP〈q′, ν\γ,Π′,U〉

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 48 / 54

Page 49: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Timed P automata: results

A computation of a timed P automaton is valid (gives an output) only if

the automaton reaches a location that is never left

the timed P system associated with such a location halts

the multiset of pending rules is empty

The output is the multiset of objects left in the skin membrane

Timed P automata are universal (they allow cooperative rules to be used)

We have proved that one membrane, one bi-stable catalist and analphabet with only one symbol (apart from the catalist) is enough toget universality

It would be interesting to check whether universality holds withnon-cooperative rules

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 49 / 54

Page 50: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Outline of the talk

1 Introduction

2 BackgroundP systemstimed P systemstimed automata

3 Timed P automataexampleformal definition

4 An applicationmodeling saddleback reintroduction

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 50 / 54

Page 51: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

The saddlebackWe have found a model for guiding the reintroduction of extirpated birdsin New Zealand mainland.

The model is derived from the observation of the population ofSaddleback birds (Philesturnus rufusater) on Mokoia Island

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 51 / 54

Page 52: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Description of the model

The model we have found:

is a stochastic, discrete-time female-only model (the female-onlyapproach assumes that there are sufficient males for all females to bepaired)

females are partitioned in two classes (first-year and older) withdifferent fecundity rates (#fledgings/season)

an annual harvest of females is scheduled, with harvesting takingplace at the start of breeding season.

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 52 / 54

Page 53: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

A timed P automaton model

j2 +32f 1

f 132f 2+

f 2+32f 2+

j2 +

f 1

f 2+

growing and selection

x≤32

f 12f 1

f 2+2f 2+

f 14f 1 j1 j1

f 2+4f 2+ j 1 j1 j1 j1

j14j 2+

spring

breeding season

x≤16

juveniles growing

x≤4

summer

autumn/winter

x=32

{x }[−40 f 2 +]

x=16

{x }x=4

{x }

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 53 / 54

Page 54: Timed P Automata - unipi.itpages.di.unipi.it/milazzo/talks/TimedPAut.pdf · Paolo Milazzo (Universit a di Pisa) Timed P Automata Ia˘si { September, 2008 7 / 54 Example of timed P

Conclusion

We have defined an extension of timed P system in which evolution rulesmay vary with time

timed P systems + timed automata = timed P automata

Our aim was to define a formalism to model ecological systems

Future work includes:

the development of a (stochastic) simulator

the application to some case study

further investigation of the computational capabilities

Paolo Milazzo (Universita di Pisa) Timed P Automata Iasi – September, 2008 54 / 54