230 likes | 340 Views
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.
E N D
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
-Calculus Syntax P ::=0| K⌊a1,…,an⌋| P + P| P | P|.P|a:P ::= a<b>| a(x)| No replication operator ‘!’ – using recursive definitions of the form K⌊a1,…,an⌋:=P instead Input prefix a(x).P and restriction x:Pbind 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
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
SOS rules Not needed!
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 SCis of interest • reduction of SC to Graph Isomorphism (GI) problem allows for an efficient solution in practice, by employing a GI solver
Graph isomorphism problem (GI) 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 (a) = 1 (b) = 6 (c) = 8 (d) = 3 (g) = 5 (h) = 2 (i) = 4 (j) = 7 Source: Wikipedia
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
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
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
SCTE reduction: main ideas Problem 1: the input prefixes are different from quantifiers in TE, and the individual prefixes do not directly correspond to constants or variables in TE Solution: substitute a<b> by s(a,b) and x(y).P by ρy:r(x,y).P, where ρ isa 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)
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 ρ
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) ≡ (P), (0|) ≡ (SE|) translation
* 1 2 3 4 Gt4 Gt3 Gt2 Gt1 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 (t1*t2)*(t3*t4) (* is not the top-level operator of t1-t4)
θ Gt 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 for n=2 1 2 θx1:…:θxn:t (θ-quantification is not the top-level operation of t) x2 x1 x2
TELDGI reduction: an example x: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
TELDGI reduction: optimisation-1 • Share sub-terms whose structural congruence is easy to check (e.g. restriction-free or trivial sub-terms only)
TELDGI reduction: optimisation-2 • Eliminate ρ-vertices, together with the associated auxiliary vertices (their position can always be recovered)
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)
The result of these optimisations Reduction from 60/63 down to 26/38 vertices/arcs
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)
Conclusions • Showed that SCis 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 TELDGItranslation • use a GI solver
Future work • Extension to the following axioms looks plausible: x:.P ≡ 0ifhas 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
Thank you! Any questions?