Deciding Contextual Equivalence for IMJ* Andrzej Murawski Steven - - PowerPoint PPT Presentation

deciding contextual equivalence for imj
SMART_READER_LITE
LIVE PREVIEW

Deciding Contextual Equivalence for IMJ* Andrzej Murawski Steven - - PowerPoint PPT Presentation

Deciding Contextual Equivalence for IMJ* Andrzej Murawski Steven Ramsay Nikos Tzevelekos University of Warwick University of Oxford Queen Mary University of London For all interface tables and IMJ contexts such


slide-1
SLIDE 1

Deciding Contextual Equivalence for IMJ*

Steven Ramsay Andrzej Murawski Nikos Tzevelekos University of Warwick University of Oxford Queen Mary University of London

slide-2
SLIDE 2

it follows that: terminates iff terminates For all interface tables and IMJ contexts such that:

slide-3
SLIDE 3

3

2 + x 2 * x can be witnessed by let x = 1 in if □ == 2 then skip else (while 1 do skip) let x = 1 in if 2 + x == 2 then skip else (while 1 do skip) diverges let x = 1 in if 2 * x == 2 then skip else (while 1 do skip) terminates

{ [], [0,2], [1,3],… } { [], [0,0], [1,2],… }

slide-4
SLIDE 4

4

let x = new {_: IntRef;} in new {_:I; run: λ_. if x.val = 0 then x.val := 1; f.run(); if x.val = 2 then skip else div else if x.val = 1 then x.val := 2 else div } new {_:I; run: λ_. div} let z = new { _:IRef;} in let f = new {_:I; run: λ_. z.val.run() } in z.val := □ z.val.run()

fobj zobj call zobj.run() call fobj.run() call zobj.run() ret zobj.run ret fobj.run ret zobj.run

slide-5
SLIDE 5

let x = new {_:IntRef;} in let c1 = new {_:ObjRef;} in let c2 = new {_:ObjRef;} in new {_:ObjCell; get: λ_.if x.val then c1.val else c2.val, getprev: λ_.if x.val then c2.val else c1.val, set: λo. if x.val then x.val := 0 else x.val := 1; if x.val then c1.val := o else c2.val := o } let last = new {_:ObjRef;} in let current = new {_:ObjRef;} in new {_:ObjCell; get: λ_.current.val, getprev: λ_.last.val, set: λo.last.val := current.val; current.val := o }

slide-6
SLIDE 6

6

IMJ*

[MRT ATVA’15] new { this: I; m1: body1, …, mk: bodyk } let x = exp in exp if x = exp then exp else exp while exp do exp exp.fld exp.fld := exp exp = exp exp + exp (I)exp exp ; exp null skip exp.m(exp1,…,expk) x n

slide-7
SLIDE 7

IMJ*

[MRT ATVA’15]

Only finite types, ground fields Only first-order objects Only iteration Only second-order objects returning ground data

slide-8
SLIDE 8

8

Qu, QuItem, QuItemId

Given a queue machine

? t

slide-9
SLIDE 9

9

Qu, QuItem, QuItemId

Given a queue machine

? t

slide-10
SLIDE 10

10

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = qI head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 b b: Qu

slide-11
SLIDE 11

11

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = qI head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 b b: Qu b.enq(3)

slide-12
SLIDE 12

12

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = q1 head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 prev: QuItemId = myId: QuItemId = deq () : void = ….. enqd? : int = 3 b b: Qu d: QuItem b.enq(3) ret b.enq(d) Assuming δE(qI, 3) = q1

slide-13
SLIDE 13

13

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = q1 head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 prev: QuItemId = myId: QuItemId = deq () : void = ….. enqd? : int = 3 b b: Qu d: QuItem b.enq(3) ret b.enq(d) b.enq(6)

slide-14
SLIDE 14

14

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = q2 head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 prev: QuItemId = myId: QuItemId = deq () : void = ….. enqd? : int = 3 enqd? : int = 6 prev: QuItemId = myId: QuItemId = deq () : void = ….. b b: Qu d: QuItem f: QuItem b.enq(3) ret b.enq(d) b.enq(6) ret b.enq(f) Assuming δE(q1 , 6) = q2

slide-15
SLIDE 15

15

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = q2 head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 prev: QuItemId = myId: QuItemId = deq () : void = ….. enqd? : int = 3 enqd? : int = 6 prev: QuItemId = myId: QuItemId = deq () : void = ….. b b: Qu d: QuItem f: QuItem b.enq(3) ret b.enq(d) b.enq(6) ret b.enq(f) d.deq()

slide-16
SLIDE 16

16

Qu, QuItem, QuItemId

Given a queue machine

?

qState: int = q3 head: QuItemId = enq (d: int) : QuItem = ……………….. enqd? : int = 0 prev: QuItemId = myId: QuItemId = deq () : void = ….. enqd? : int = 0 enqd? : int = 6 prev: QuItemId = myId: QuItemId = deq () : void = ….. b b: Qu d: QuItem f: QuItem b.enq(3) ret b.enq(d) b.enq(6) ret b.enq(f) d.deq() ret d.deq Assuming δD(q2) = q3 and checking d.prev.enqd? = 0 and d.myId.enqd? != 0

slide-17
SLIDE 17

IMJ*

[MRT ATVA’15]

Only finite types, ground fields Only first-order objects Only iteration Only second-order objects returning ground data

slide-18
SLIDE 18

18

CONEQCT [MRT ATVA’15 (TOOL)]

Translate IMJ* terms into their strategies in the game model, represented as two IMJ Automata (IMJA). Reduce the equivalence problem for IMJA to the emptiness problem for Fresh Pushdown Register Automata (FPDRA). Solve the emptiness problem for FPDRA using saturation algorithm.

1 2 3

[MT POPL’14] [MRT ATVA’15] [MRT ATVA’15] [MT ICALP’12] [MRT MFCS’14]

slide-19
SLIDE 19

A machine representation for strategies (sets of plays).

IMJA:

fobj zobj call zobj.run() call fobj.run() call zobj.run() ret zobj.run ret fobj.run ret zobj.run

Object creation Call stack discipline Finite set of possible moves modulo

  • bject names

Fresh-name recognition Visible pushdown stack Accepts words over a nominal alphabet

(Representation of stores not shown)

slide-20
SLIDE 20

20

A machine representation for strategies (sets of plays).

IMJA:

ν2. call 3.myMethod(2) / (k, {2,3}) q q’ ν2. ret 3.myMethod(2) / (k, {2,3}, {2}) q q’ ν2. 2 q q’

+ Bookkeeping

slide-21
SLIDE 21

f:I Ⱶ new {_:I; run: λ_. div} : I ν1. 1

fobj, zobj

slide-22
SLIDE 22

let x = new {_: IntRef;} in new {_:I; run: λ_. if x.val = 0 then x.val := 1; f.run(); if x.val = 2 then skip else div else if x.val = 1 then x.val := 2 else div } ν3. 3 ν1. 1

f:I Ⱶ

slide-23
SLIDE 23

SYNCHRONISATION

Simulate two sets of registers using one set equipped with a representation of one

  • f exponentially many correspondences.

REPRESENTATION OF SYMMETRIC DIFFERENCE (FPRDA) PLAYS OF SYSTEM 1 (IMJA) PLAYS OF SYSTEM 2 (IMJA)

slide-24
SLIDE 24

24

SYMMETRIC DIFFERENCE (FPRDA) ACCEPTING CONFIGURATIONS (RA) CONFIGURATIONS LEADING TO ACCEPT (RA)

slide-25
SLIDE 25

25

FUTURE WORK