Checking - Calculus Structural Congruence is Graph Isomorphism Complete

Preview:

DESCRIPTION

Checking - Calculus Structural Congruence is Graph Isomorphism Complete. Victor Khomenko 1 and Roland Meyer 2 1 School of Computing Science, Newcastle University, UK 2 Department of Computing Science, University of Oldenburg, Germany. - Calculus Syntax. - PowerPoint PPT Presentation

Citation preview

Checking -Calculus Structural Congruence is

Graph Isomorphism Complete

Victor Khomenko1 and Roland Meyer2

1School of Computing Science,Newcastle University, UK

2Department of Computing Science,University of Oldenburg, Germany

2

-Calculus Syntax

P ::= 0| K a⌊ 1,…,an⌋| P + P| P | P| .P| a:P

::= a<b>| a(x)|

No replication operator ‘!’ – using recursive definitions of the form K a⌊ 1,…,an :=P⌋ instead

Input prefix a(x).P and restriction x:P bind name x in P

NOCLASH assumption (can always be enforced by -conversion):

• each name is bound at most once• the sets of bound and free names are disjoint

3

Structural congruence

The smallest congruence ≡ defined by the following axioms:

α-conversion of bound names is permitted (α)+ and | are associative and commutative (AC+), (AC|)0 is a neutral element for + and | (0+), (0|)x:P ≡ P if x is not a free name of P (P)x:y:P ≡ y:x:P (C)x:(P | Q) ≡ P | x:Q if x is not a free name of P (SE|)

Note: ≡ does not expand recursive calls

4

SOS rules

PaPa

PPQPQP

PP

QPQPQQ

PPPxKzaPaK

QyzPNQzxMPyx

PMP

::(Res)

||(Par)

andif,(Struct)

:)~(if,}~/~{~(Const)

|}/{).(|).((React)

.(Tau)

Not needed!

5

Checking structural congruence

SC – the problem of checking structural congruence ≡ of two -Calculus terms

• Repeatedly solved by -Calculus tools (e.g. the states of the system are the equivalence classes w.r.t. ≡)

hence the computational complexity of SC is of interest

reduction of SC to Graph Isomorphism (GI) problem allows for an efficient solution in practice, by employing a GI solver

6

Graph isomorphism problem (GI)

Source: Wikipedia

(a) = 1 (b) = 6(c) = 8 (d) = 3(g) = 5 (h) = 2(i) = 4 (j) = 7

G1=(V1,E1) and G2=(V2,E2) are isomorphic if there is a 1-to-1 mapping :V1V2 such that {v,w}E1 iff {(v),(w)}E2

7

The complexity of GI

•Trivially in NP, but not believed to be NP-complete (as Stockmeyer’s polynomial hierarchy PH would then collapse)

•No polynomial-time algorithm known

•Can be solved very efficiently in practice

•Complexity class GI – comprises problems Cook reducible to GI, e.g. Digraph Isomorphism (DGI), Labelled Digraph Isomorphism (LDGI) and many others

8

GISC reduction (SC is GI-hard)• It is enough to reduce DGI to SC• Given a digraph G(V,E), where V={v1,…,vn}, build the term

• The reduction uses a very restricted -Calculus fragment: all the restrictions are in the beginning of the term no +, prefixing operator ‘.’, actions, public channels | can be replaced by + calls to process identifiers can be replaced by actions,

e.g., L v,w⌊ ⌋ can be replaced by v<w>.0• Summary: , at least one of | or +, and some means of

referring to bound names are enough to make the fragment GI-hard

EwvVvn wvLvKvv

),(1 ,|::

9

SCGI reduction (SC is in GI)• Reduce SC to the Term Equality problem (TE), which is

known to be equivalent to GI [Basin’94]: Decide if two terms built using quantifiers introducing bound names; some of these

quantifiers may commute, i.e., θx:θy:t θy:θx:t associative, commutative and associative-commutative

binary operators uninterpreted functional symbols and constants the names bound by the quantifiers

are equivalent modulo associativity, commutativity and associativity-

commutativity axioms for the corresponding operators the commutativity of corresponding quantifiers α-conversion of bound names

10

SCTE reduction: main ideasProblem 1: the input prefixes are different from quantifiers in TE, and the individual prefixes do not directly correspond to constants or variables in TESolution: substitute a<b> by s(a,b) and x(y).P by ρy:r(x,y).P, where ρ is a new non-commutative quantifier

Problem 2: some axioms in the definition of ≡ have no analogs in TE, viz. (0+), (0|), (P), (SE|)Solution: translate the terms into the following normal form:

enforce the NOCLASH assumption use (0+), (0|) and (P) to simplify the terms until none of

these axioms applies maximise the scope of restrictions using (SE|) (in the

reverse direction)This normal form does not require these axioms to prove structural congruence (long and tedious proof in the paper)

11

SCTE reduction (cont’d)The resulting terms comprise an instance of TE, where:

• + and | are associative-commutative operators

• s(_,_), r(_,_), the prefixing operator ‘.’ and the process identifiers are uninterpreted functional symbols

is a commutative quantifier and ρ is a non-commutative quantifier

• public channels, and 0 are constants (since all the axioms for 0 no longer apply, it can be regarded as uninterpreted)

• the names introduced by the restriction and input prefixes are the names bound by the quantifiers and ρ

12

SCTE reduction: an example

x:a<x>.b(z).z<x>.0 | y:a(p).b<y>.0 | q:.0 | t:0

x:a<x>.b(z).z<x>.0 | y:a(p).b<y>.0 | .0

x:y:(a<x>.b(z).z<x>.0 | a(p).b<y>.0 | .0)

x:y:(s(a,x).ρz:r(b,z).s(z,x).0 | ρp:r(a,p).s(b,y).0 | .0)

≡ (SE|)

≡ (P), (0|)

translation

13

TELDGI reduction [Basin’94]• Build the parse tree of the TE term

• Compound the vertices corresponding to associative and associative-commutative operations into vertices with larger out-degrees

• Drop the arc labels for commutative operators

1 2 3 4

*

Gt4Gt3Gt2Gt1

(t1*t2)*(t3*t4)

(* is not the top-level operator of t1-t4)

14

TELDGI reduction (cont’d)• Translating the quantifiers

• Erase the names of bound variables (to express that they can be changed by α-conversion)

• Drop the arc labels for commutative quantifiers

1 2

θ

Gt

θx1:…:θxn:t

(θ-quantification is not the top-level operation of t)

x1 x2 x2

for n=2

15

TELDGI reduction: an examplex:y:s(a,x).ρz:r(x,z).s(z,y).K(a,x) | .s(a, b).K(a,b) + .0 +

.K(a,b) | ρp:r(a,p).s(p,c).ρq:r(c,q).s(q, a).0

16

TELDGI reduction: optimisation-1• Share sub-terms whose structural congruence is easy to

check (e.g. restriction-free or trivial sub-terms only)

17

TELDGI reduction: optimisation-2• Eliminate ρ-vertices, together with the associated auxiliary

vertices (their position can always be recovered)

18

TELDGI reduction: optimisation-3• After the common sub-terms are shared (and parallel arcs

removed), the auxiliary vertices for quantifiers have the in- and out-degree one, and can be contracted

• Adjacent vertices corresponding to the prefixing operator ‘.’ can be compounded

• The 0 vertex (unique after sharing common sub-terms) can be eliminated

• The unlabelled vertices corresponding to the variables can be labelled by either ρ or (depending on the type of the binding quantifier)

19

The result of these optimisationsReduction from 60/63 down to 26/38 vertices/arcs

20

Summary and extensions

These results are not affected if either or both of the following axioms are added:

x:(P + Q) ≡ P + x:Q if x is not a free name of P (SE+)

x:.P ≡ .x:P if x does not occur in (SE)

-Calculus fragment Complexity of SC full -Calculus GI-complete, at least one of + or |, and some means of referring to restricted channels (i/o prefixes, process identifiers)

GI-complete

without both + and | in Pwithout in P

21

Conclusions

• Showed that SC is a GI-complete problem• The result is robust:

holds for restricted fragments of -Calculus holds for alternative definitions of ≡, viz. with

(SE+) and/or (SE) -Calculus fragments for which SC is in P have

been identified• Practical algorithm for solving SC:

reduce to TE use the optimised TELDGI translation use a GI solver

22

Future work

• Extension to the following axioms looks plausible:

x:.P ≡ 0 if has the form x<·> or x(·) (P)

x:(P + Q) ≡ x:P + x:Q (D+)• Also generalisation of (P) to an axiom replacing any

process that has no behaviour in any context by 0

Related work• Engelfriet and Gelsema• Gadducci• Romanel and Priami

23

Thank you!Any questions?

Recommended