SYNTACTIC THEORY FOR BIGRAPHS Troels C. Damgaard (tcd@itu.dk) Joint work with Lars Birkedal, Arne John Glenstrup, and Robin Milner Bigraphical Programming Languages (BPL) Group IT University of Copenhagen 4 May 2007 / École Normale Supérieure, Paris TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 1 / 61
RELEVANT PUBLICATIONS Damgaard and Birkedal. Axiomatizing Binding Bigraphs. Nordic Journal of Computing, 2006., Birkedal, Damgaard, Glenstrup and Milner. Matching of Bigraphs. In Proceedings of Graph Transformation for Verification and Concurrency Workshop 2006, Electronic Notes in Theoretical Computer Science. Elsevier, 2007., and Damgaard. Syntactic Theory for Bigraphs. Masters Thesis. IT University of Copenhagen, 2006. (with expanded introduction and overviews). See my webpage for more information (e.g., links to more publications and to the BPL group): www.itu.dk/people/tcd/ TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 2 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 3 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 4 / 61
INTRODUCING BIGRAPHS BIGRAPHS AND BIGRAPHICAL REACTIVE SYSTEMS (BRSS) In one line: A graphical model of mobile computation that emphasizes both locality and connectivity due to Milner and coworkers. Developed with two main aims to model directly important aspects of ubiquitous systems, and to provide a general theory for reactive systems, where many existing calculi for mobility and concurrency may be represented and investigated. In particular, the theory provides us with tools to derive from a BRS a labelled transition system whose associated bisimulation relation is a congruence relation. On the next few slides a crash course on bigraphs. We return to how to define bigraphical reactive systems. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 5 / 61
INTRODUCING BIGRAPHS (CONT.) SO WHAT IS A BIGRAPH? Essentially, a bigraph is a place graph a forest, and a link graph a (hyper-)graph sharing nodes. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 6 / 61
INTRODUCING BIGRAPHS (CONT.) A BIGRAPH A COMBINATION OF A PLACE GRAPH AND A LINK GRAPH These are examples of place and link graphs: But we like to draw a bigraph in a single picture, like this: On the next few slides, an example of a concrete bigraph model.... TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 7 / 61
A BIGRAPH MODEL OF AN OFFICE A = A consists of roots (dashed boxes), nodes (solid boxes), and links (green lines). Each node has a control (in sans serif) indicating the number and type of ports for linkage. Ports can be either free or binding the latter indicated by circular attachments. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 8 / 61
BIGRAPHS ARE COMPOSABLE A = Non-ground bigraphs contain holes (or sites) and/or inner names. B = C = We can compose B and C by plugging the holes of B with the roots of C. B and C compose to form A. We write A = BC. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 9 / 61
BINDING BIGRAPHS A = Binding bigraphs, enforce a scoping discipline on linkage connected to a binding ports or local outer names binders. All peers (inner names or ports) linked to a binder, must be nested within the node. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 10 / 61
INTERFACES B : 2, ({x}, ), {x, z} 2, (, ), C : 0, (), 2, ({x}, ), {x, z} Formally, a bigraph is a morphism in a category of interfaces, hence, bigraph composition is simply the categorical composition. For example, B and C compose exactly, because the innerface of B is equal to the outerface of C. We can also combine bigraphs with a tensor product,, which is simply juxtaposition of roots; requiring that outer and inner names are disjoint. A parallel product B C, requiring only inner names to be disjoint can be straightforwardly derived from. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 11 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 12 / 61
MOTIVATION EXPRESSING BIGRAPHS How to give a bigraph? Two basic approaches CONSTRUCT GRAPH STRUCTURE DIRECTLY Bigraphs are simply a collection of certain graphs. We can just give explicit sets of constituents (i.e, nodes, links, names, controls, etc.); and, a number of maps to build bigraph structure (i.e., nesting, linking, etc.). CONSTRUCT INDUCTIVELY FROM SET OF ELEMENTARY BIGRAPHS Construct bigraphs inductively as the smallest set of bigraphs built from a set of elementary bigraphs; and, a few operators. composition G0 G 1 vertical composition of bigraphs, product G0 G 1 horizontal composition of bigraphs, and abstraction (X)P to make global names X of P local. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 13 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE FOR BIGRAPHS (CONT.) BUILDING AN EXPRESSION FOR A Bigraph A Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 14 / 61
LANGUAGE CONSIDERATIONS The terms in the language are explicitly typed with interfaces determining when tensor product, composition, and abstraction is well defined. Hence, formation rules ensure well formed terms denote bigraphs. The interface for expressions can be determined by induction. Similarly, the bigraph denoted by an expression can be determined by induction. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 15 / 61
CONCLUSION THEOREM (COMPLETENESS OF LANGUAGE) All binding bigraphs can be expressed using composition, tensor product, and abstraction ( ), from constants 1, merge 2, y/x, /x, K y( X), π, U.... follows immediately from the normal form theorem. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 16 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 17 / 61
MOTIVATION MOTIVATION As a basis for structured analysis of bigraphs we develop a normal form theorem that details a number of subclasses of bigraphs (overview, next slide); gives a corresponding expression format for each class. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 18 / 61
NORMAL FORMS THE DISCRETE VARIANT FOR MATCHING We analyze bigraphs and define discrete decomposition separating a bigraph B into a global link graph w and a discrete bigraph D, which has one-one linkage to global outer names; Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 19 / 61
NORMAL FORMS (CONT.) THE DISCRETE VARIANT FOR MATCHING We analyze bigraphs and define discrete decomposition separating a bigraph B into a global link graph w and a discrete bigraph D, which has one-one linkage to global outer names; decomposing a discrete bigraph D into separate roots discrete primes P; and, Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 19 / 61
NORMAL FORMS (CONT.) THE DISCRETE VARIANT FOR MATCHING We analyze bigraphs and define discrete decomposition separating a bigraph B into a global link graph w and a discrete bigraph D, which has one-one linkage to global outer names; decomposing a discrete bigraph D into separate roots discrete primes P; and, decomposing discrete primes P into separate nodes and holes. Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 19 / 61
CONCLUSION MAIN RESULT - SOUNDNESS AND COMPLETENESS OF THE NORMAL FORM Main theorem states soundness and completeness of the normal form; TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 20 / 61
CONCLUSION MAIN RESULT - SOUNDNESS AND COMPLETENESS OF THE NORMAL FORM Main theorem states soundness and completeness of the normal form; and takes about two pages to state in full detail. THEOREM (Schema: NORMAL FORM) Any bigraph of class C can be expressed on the format E. For any other expression E on this format, the requirements R 1,..., R n 1 (between constituents of E and E ) hold. Gritty details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 20 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 21 / 61
MOTIVATION MOTIVATION Would like to reason about graph equality on the term level i.e., to reason syntactically about equality of bigraphs. For example, we might like to show that: ( pcy1 pda z0 ) (1 1) = ( pcy1 1 pda z0 1 ), y/x x/z = y/z. We give a syntactic equational theory by stating basic equalities between bigraph expressions extending work for pure bigraphs by Milner. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 22 / 61
CATEGORICAL AXIOMS Categorical axioms deal with basic properties like associativity of composition and tensor product, A(BC) = (AB)C and A (B C) = (A B) C, unit for composition and tensor products (identities on certain interfaces), and handling symmetries (permutations on the place graph structure) (C1) A id I = A = id J A (A : I J) (C2) A(BC) = (AB)C (C3) A id ɛ = A = id ɛ A (C4) A (B C) = (A B) C (C5) id I id J = id I J (C6) (A 1 B 1 )(A 0 B 0 ) = (A 1 A 0 ) (B 1 B 0 ) (C7) γ I,ɛ = id I (C8) γ J,I γ I,J = id I J (C9) γ I J,K = (γ I,K id J )(id I γ J,K ) (C10) γ I,K (A B) = (B A)γ H,J (A : H I, B : J K ) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 23 / 61
GLOBAL LINK AXIOMS Link axioms mainly state the ways in which compositions of linkings can be equally expressed without composition. (L1) x/x = id x (L2) /y y/x = /x (L3) /y y = id ɛ (L4) z/{y y}(id Y y/x) = z/{y X} TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 24 / 61
PLACING AND ION AXIOMS Place axioms explain the basic ways in which placing expressions for equal bigraphs can vary. (P1) merge 2 (1 id 1 ) = id 1 (P2) merge 2 (merge 2 id 1 ) = merge 2 (id 1 merge 2 ) (P3) merge 2 γ 1,1,(, ) = merge 2 Two axioms for ions deal with renaming of the names on both the interfaces of an ion. (N1) (id 1 α)k y( X) = K α( y)( X) (N2) K y( X) σ = K y( σ 1 ( X)) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 25 / 61
BINDING AXIOMS Binding axioms state basic equalitites between expressions with the abstraction operator and/or the concretion constant. ( )P = P abstracting no names is the same as not abstracting. (Y ) Y = id (Y ) abstracting a concretion of the names Y is just an identity on Y. ( X Z id Y )(X)P = P concreting an abstraction of the names X gives you back the bigraph P that you started with. (id X (Y )P))G = extending the scope of an abstraction over a set (Y )(P id X )G of global names X is ok, when the entire expression has a local innerface. (X Y )P = (X)(Y )P abstracting and abstracting again is the same as abstracting the union of the names involved. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 26 / 61
CONCLUSION MAIN RESULT - SOUNDNESS AND COMPLETENESS OF THE EQUATIONAL THEORY THEOREM (SOUNDNESS AND COMPLETENESS) For all binding bigraph expressions E and F, [[E]] = [[F]], i.e.,e and F denote the same bigraph iff E = F. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 27 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 28 / 61
ADDING DYNAMICS We build bigraphical reactive systems (BRS) by giving a set of rewriting rules; expressed essentially as a pair of bigraphs, like those below: We can rewrite a bigraph a with a rule R R, if a matches R. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 29 / 61
ADDING DYNAMICS (CONT.) THE MATCHING PROBLEM To determine, whether and how a redex matches a bigraph. Suppressing some detail a redex R matches a ground agent a, if a decomposes, s.t., a = C(R id Z )d for context C, and discrete parameter d. We can illustrate a match schematically, like this: TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 30 / 61
MOTIVATION So, we have definitions DEFINITION (A BIGRAPH) Official definition: G = (V, E, ctrl, link, prnt) : I J DEFINITION (A MATCH IN BIGRAPHS) Official definition: [... ] a = C(R id Z )d, where C is a context, and d a discrete parameter [... ] PROBLEM (CONSTRUCTING A CONTEXT AND PARAMETER) How to construct a context C and parameter d, given agent a and redex R? Instead, we look to characterize in a constructive manner the matching problem; and, hope to be able to specialize the characterization into an algorithmic approach. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 31 / 61
MATCHING SENTENCES We define a new representation for a match as a relation and look to inductively characterize this relation. DEFINITION (MATCHING SENTENCE) ω a, ω R, ω C a, R C, d for wirings (essentially, link graphs) ω a, ω R, ω C and discrete bigraphs a, R, C, d. a, d are ground, R and C are products of discrete primes, R is can be constructed without using permutations (convenience). TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 32 / 61
MATCHING SENTENCES (CONT.) DEFINITION (VALID MATCHING SENTENCE) A matching sentence as above is valid iff (id ω a )a = (id ω C )(C ω R id Z )(R id Z )d. Valid matching sentences recapture original definition of matching; as we have simply decomposed discretly agent, context, redex and parameter. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 33 / 61
RULES FOR DERIVING VALID MATCHING SENTENCES MATCHING RULES We give a set of rules for deriving valid matching sentences. We take two axioms, one concerned with introducing nonconnected linkage; and, one, which allows to conclude when we have roots with equal structure in agent and parameter (up to certain renamings). And seven rules, most of which serve to introduce an elementary bigraph or operator. For example, and, PRODUCT ω a, ω R, ω C ω a, R C, d ω b, ω S, ω D ω b, S D, e ω a ω b, ω R ω S, ω C ω D ω a b, R S C D, d e, MERGE ω a, ω R, ω C a, R C, d a global ω a, ω R, ω C (merge id)a, R (merge id)c, d. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 34 / 61
RULES ILLUSTRATED PRODUCT TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 35 / 61
RULES ILLUSTRATED (CONT.) MERGE TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 36 / 61
RULES - DETAILS CLOSE σ a, σ R, id YR σ C a, R C, d σ C : Y Y C σ R : U Y R (id /(Y R Y C ))σ a, (id /Y R )σ R, (id /Y C )σ C a, R C, d PERM ω a, ω R, ω C a, m i P π 1 (i) C, (π id)d ω a, ω R, ω C a, m i P i Cπ, d PRODUCT ω a, ω R, ω C ω a, R C, d ω b, ω S, ω D ω b, S D, e ω a ω b, ω R ω S, ω C ω D ω a b, R S C D, d e LSUB σa ωa, ω R, σ C ω C p, R P, d σ a : Z W σ C : U W P : U X ω a, ω R, ω C ( σ a id)(z )p, R ( σ C id)(u)p, d MERGE ω a, ω R, ω C a, R C, d a global ω a, ω R, ω C (merge id)a, R (merge id)c, d Rules illustrated TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 37 / 61
RULES - DETAILS (CONT.) ION ω a, ω R, ω C (( v)/( X) id)p, R (( v)/( Z ) id)p, d α = y/ u σ : { y} σ ω a, ω R, σα ω C (K y( X) id)p, R (K u( Z ) id)p, d SWITCH ω a, id ɛ, ω C (σ ω R id) p, id P, d P : W Y σ : W U ω a, ω R, ω C p, ( σ id)(w )P U, d PRIME-AXIOM α : X U β : Z σ L : Y U p : Y Z σ(σ L β), id ɛ, σ p, id (X) α, (X)(α 1 σ L β id 1 )p WIRING-AXIOM y, X, y/x idɛ, id ɛ id ɛ, id ɛ Rules illustrated TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 37 / 61
CONCLUSION MAIN RESULT - SOUNDNESS AND COMPLETENESS OF THE RULES THEOREM (SOUNDNESS) The rules for matching are sound, that is, any matching sentence that can be derived is valid. THEOREM (COMPLETENESS) The rules for matching are complete, that is, any valid matching sentence can be derived from the rules. The equality theory and normal forms are employed heavily to prove these theorems. Gritty proof details TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 38 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 39 / 61
CURRENT WORK TERM MATCHING In the BPL group we build a tool to experiment with bigraphical reactive systems. Bigraphs are represented using a term language with constants and operators corresponding exactly to the elementary bigraphs and combinators. Based on the work presented we use a simple approach to implementing matching in such a tool: First step: Recast rules to work on terms one simply has to add a single rule STRUCT to allow application of structural congruence on terms. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 40 / 61
CURRENT WORK (CONT.) NORMAL INFERENCES To specialize the characterization into an algorithm, for mechanically finding matches, define normal inferences; kinds of inferences that are complete in the sense that all valid matching sentences can be inferred; and, suitable restricted, s.t. inferences can be built mechanically with minimum amount of search. In particular, normal inference definitions for term matching needs to address precisely how and where to apply structural congruence. NORMAL INFERENCE VS. ALGORITHMIC APPROACH Each definition of normal inferences correspond to a different algorithmic approach to matching. Might even be worthwhile extending the set of rules to allow even more freedom in choosing a definition of normal inference. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 41 / 61
FUTURE WORK ON MATCHING Term-based matching using normal inferences is nice it is firmly based on the theory presented here; and problematic the pilot-version, we are currently testing, is horribly inefficient. Hence, we aim (and hope to be able) to build more efficient methods; while retaining our formal foundation. Some ideas: Work with a term normal form more suited for matching. Instead of matching links online while building an inference, derive a set of constraints for these. Add rules to allow shortcutting obviously invalid/valid matches. Smarter ways of combining matching and rewriting. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 42 / 61
THANK YOU! Thank you for listening! TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 43 / 61
OUTLINE 1 BACKGROUND BIGRAPHS 2 TERM LANGUAGE Expressing Bigraphs Language 3 NORMAL FORM THEOREM(S) 4 EQUATIONAL THEORY 5 CHARACTERIZATION OF MATCHING Background Bigraphical Reactive Systems Characterization Rules Details 6 CURRENT AND FUTURE WORK 7 APPENDIX (GRITTY DETAILS) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 44 / 61
OUTLINE OF APPENDICES Term Language Normal Form Rules Illustrated The SWITCH rule Proof Method TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 45 / 61
INDUCTIVE LANGUAGE DETAILS DEFINITION (INDUCTIVE LANGUAGE FOR BINDING BIGRAPHS) The smallest set of bigraphs built by three operators composition, tensor product (juxtaposition), and abstraction (Y )P of names Y on primes P; from the identities on all interfaces and a set of elementary bigraphs. (Details on elementary bigraphs and abstraction next slides.) Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 46 / 61
ELEMENTARY BIGRAPHS PLACINGS DEFINITION (2 KINDS OF PLACING) Merge merge n : n,, 1, [ ], Permutation π π X : m, X, X m, π( X), X (EXAMPLES) MERGE AND PERMUTATION merge 3 = 0 1 2 y x {0 2, 1 0, 2 1} [{x},,{y}] = 1 2 y 0 x Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 47 / 61
TERM CONSTANTS LINKINGS DEFINITION (2 BASIC KINDS OF LINKINGS) Substitution σ y/ X : 0, [], X 0, [], Y Closure /X : 0, [], X id ɛ (EXAMPLES) LINKINGS Plain substitution [y 1, y 2, y 3 ]/[{x 1, x 2 }, {}, {x 3 }] = y 1 y 2 y 3 x 1 x 2 x 3 Renaming α [y 1, y 2, y 3 ]/[x 1, x 2, x 3 ] = y 1 y 2 y 3 x 1 x 2 x 3 Closure /{x 1, x 2, x 3 } = x1 x 2 x 3 Wiring ω (id {y1,y2} /{z 1, z 2 }) [y 1, z 1, y 2, z 2 ] / = [{}, {x 1, x 2 }, {x 4, x 5}, {x 6 }] y 1 x 1 x 2 x 4 y 2 x 5 x 6 TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 48 / 61
ELEMENTARY BIGRAPHS (CONT.) CONCRETIONS AND IONS DEFINITION (CONCRETIONS AND IONS) Concretion X : 1, [X], X 1, [ ], X Ion K y( X) : 1, (X), X 1, ( ), Y (EXAMPLES) CONCRETIONS AND IONS {x 1, x 2 } = 0 x 1 x 2 x 1 x 2 K [y1,y 2 ]([{x 1 },{x 2,x 3 },{}]) = K y 1 y 2 x 1 x 2 x 3 Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 49 / 61
OPERATORS (CONT.) ABSTRACTION (COMPOSITION AND TENSOR PRODUCT) (Standard categorical composition and tensor product as defined earlier.) DEFINITION (ABSTRACTION) Abstraction (Y )P : I 1, [Y ], Z Y (EXAMPLE) ABSTRACTION ({y 1, y 2 })({y 3 }) {y 1, y 2, y 3, z} = 0 y 1 y 2 y 3 y 1 y 2 y 3 z z Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 50 / 61
BIGRAPH A A MODEL OF AN OFFICE A = Back to expression TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 51 / 61
NORMAL FORM THE NAME-DISCRETE VARIANT FOR THE EQUATIONAL THEORY We define and prove that four forms of binding bigraph expressions generate all binding bigraphs, and that those forms are unique up to certain specified isomorphisms. DEFINITION (BINDING DISCRETE NORMAL FORM (BDNF)) MDNF M ::= (K y( X) id Z )P PDNF P ::= (Y B ) ( ) ( ( n merge n+k id Y i α i ) ) k i M i π DDNF D ::= (P 0... P n 1 )π α BDNF B ::= ( ω n ) i σ i D More details for each form on the next pages. Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 52 / 61
NORMAL FORM (CONT.) DETAILS FREE DISCRETE MOLECULES MDNF Any free discrete molecule M : I 1, { y} Z can be expressed as (K y( X) id Z )P where P : I 1, ({ X}), { X} Z is a name-discrete prime. This expression is unique up to renaming of the local names on the innerface of the ion, and (correspondingly) on the outer face of the prime P. (For formal details see [Damgaard, Birkedal, 06].) Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 53 / 61
NORMAL FORM (CONT.) DETAILS NAME-DISCRETE PRIMES PDNF Any name-discrete prime P : I 1, Y B, Y can be expressed as (Y B ) ( merge n+k id Y ) ( α0 α n 1 M 0 M k 1 ) π where every M i : Yi M is a free discrete molecule, and for renamings α i : Yi C, we have Y = ( i n Y i C ) i k Y i M. This expression is unique up to reordering of the concretions and molecules, and the ordering of the sites inside the molecules; the permutation π changes accordingly to preserve the innerface. (For formal details see [Damgaard, Birkedal, 06].) Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 54 / 61
NORMAL FORM (CONT.) DETAILS NAME-DISCRETE BIGRAPHS DDNF Any name-discrete bigraph D with outer width n can be expressed as (P 0... P n 1 )π α where every P i is a name-discrete prime, α is a renaming, and π is a permutation. This expression is unique up to reordering of the the sites inside the primes; the permutation π changes accordingly to preserve the innerface. (For formal details see [Damgaard, Birkedal, 06].) Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 55 / 61
NORMAL FORM (CONT.) DETAILS BIGRAPHS BDNF Any bigraph G : I n, Y B, { Y B } Y F can be expressed as ( ) n ω σ i D where D : I n, X, { X} Z is name-discrete, ω : Z Y F is a (global) wiring, and each σ i : ( X i ) ( Y B i) is a local substitution on the bound names of D. The expression is unique up to (local and global) renamings on the innerface of the wiring and (correspondingly) on the outerface of D. (For formal details see [Damgaard, Birkedal, 06].) i Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 56 / 61
RULES ILLUSTRATED RULES ILLUSTRATED This section contains illustrated versions of the rules. Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 57 / 61
RULES DETAILS PREMISE CLOSE σ a, σ R, id YR σ C a, R C, d σ C : Y Y C σ R : U Y R (id /(Y R Y C ))σ a, (id /Y R )σ R, (id /Y C )σ C a, R C, d If TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION CLOSE σ a, σ R, id YR σ C a, R C, d σ C : Y Y C σ R : U Y R (id /(Y R Y C ))σ a, (id /Y R )σ R, (id /Y C )σ C a, R C, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE PERM ω a, ω R, ω C a, m i P π 1 (i) C, (π id)d ω a, ω R, ω C a, m i P i Cπ, d If (here ρ = π 1 ) TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION PERM ω a, ω R, ω C a, m i P π 1 (i) C, (π id)d ω a, ω R, ω C a, m i P i Cπ, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE PRODUCT ω a, ω R, ω C ω a, R C, d ω b, ω S, ω D ω b, S D, e ω a ω b, ω R ω S, ω C ω D ω a b, R S C D, d e If TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION PRODUCT ω a, ω R, ω C ω a, R C, d ω b, ω S, ω D ω b, S D, e ω a ω b, ω R ω S, ω C ω D ω a b, R S C D, d e Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE LSUB σa ωa, ω R, σ C ω C p, R P, d σ a : Z W σ C : U W ω a, ω R, ω C ( σ a id)(z )p, R ( σ C id)(u)p, d If TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION LSUB σa ωa, ω R, σ C ω C p, R P, d σ a : Z W σ C : U W ω a, ω R, ω C ( σ a id)(z )p, R ( σ C id)(u)p, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE MERGE ω a, ω R, ω C a, R C, d aglobal ω a, ω R, ω C (merge id)a, R (merge id)c, d If TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION MERGE ω a, ω R, ω C a, R C, d aglobal ω a, ω R, ω C (merge id)a, R (merge id)c, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE ION ω a, ω R, ω C (( v)/( X) id)p, R (( v)/( Z ) id)p, d α = y/ u σ : { y} σ ω a, ω R, σα ω C (K y( X) id)p, R (K u( Z ) id)p, d If (here (s X ) = ( v)/ X)) and (s Z ) = ( v)/ Z ). TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION ION ω a, ω R, ω C (( v)/( X) id)p, R (( v)/( Z ) id)p, d α = y/ u σ : { y} σ ω a, ω R, σα ω C (K y( X) id)p, R (K u( Z ) id)p, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) PREMISE SWITCH ω a, id ɛ, ω C (σ ω R id) p, id P, d P : W Y σ : W U ω a, ω R, ω C p, ( σ id)(w )P U, d If TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
RULES DETAILS (CONT.) CONCLUSION SWITCH ω a, id ɛ, ω C (σ ω R id) p, id P, d P : W Y σ : W U ω a, ω R, ω C p, ( σ id)(w )P U, d Then TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 58 / 61
THE SWITCH RULE All rules work, intuitively, by comparing structure in the agent and context position ω a, ω R, ω C a, R C, d. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 59 / 61
THE SWITCH RULE All rules work, intuitively, by comparing structure in the agent and context position ω a, ω R, ω C a, R C, d. A single rule, SWITCH, allows us (essentially) to switch redex structure to the context position, when the context contains only a hole. SWITCH ω a, id ɛ, ω C (σ ω R id) p, id P, d P : W Y σ : W U ω a, ω R, ω C p, ( σ id)(w )P α, d TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 59 / 61
THE SWITCH RULE All rules work, intuitively, by comparing structure in the agent and context position ω a, ω R, ω C a, id R, d. A single rule, SWITCH, allows us (essentially) to switch redex structure to the context position, when the context contains only a hole. SWITCH ω a, id ɛ, ω C (σ ω R id) p, id P, d P : W Y σ : W U ω a, ω R, ω C p, ( σ id)(w )P α, d Intuitively, SWITCH allows us to build inferences by initially seeking to match agent and context; and, when reaching a hole in the context, switch redex structure to the context position in the matching sentence. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 59 / 61
PROOF METHOD (COMPLETENESS) DEFINITION The size of a matching sentence ω a, ω R, ω C a, R C, d is the number of ions in a. PROOF METHOD Establish a series of lemmas that express how a valid sentence may be derived by applications of inference rules to valid sentences of lesser or equal size. Use normal form theorems to help decompose components of given valid sentence; and, verify that the claimed valid sentences, do exist. in particular, unicity results for normal form theorems yield a number of equalities for decomposed parts, which help here. Lemmas and main theorem on following pages. Back to overview TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 60 / 61
PROOF METHOD (COMPLETENESS) (CONT.) LEMMA (1) Every valid sentence ω a, ω R, ω C a, R C, d is provable using the CLOSE and the PERM rule on a valid sentence, of equal size, of the form σ a, σ R, σ C a, S n i P i, e. LEMMA (2) Every valid sentence σ a, σ R, σ C a, R P n i P i, d, with P and P i prime and discrete, is provable using the PRODUCT rule on valid sentences, of lesser or equal size, of the form σa P, σr P, σp C σs C p, S P, e and σa C, σr C, σc C σs C a, R n i P i, e. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 61 / 61
PROOF METHOD (COMPLETENESS) (CONT.) LEMMA (3) Every valid sentence σ a, σ R, σ C a, R id ɛ, d is provable using PRODUCT and WIRING-AXIOM. LEMMA (4) Every valid sentence ω a, ω R, ω C p, R P, d, with p and P prime and discrete, is provable using the LSUB rule on a valid sentence, of lesser or equal size, of the form ω a, ω R, ω C p, R P, d, where p and P are discrete free primes. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 61 / 61
PROOF METHOD (COMPLETENESS) (CONT.) LEMMA (5) Every valid sentence σ a, σ R, σ C p, R P, d, with p and P discrete and free primes, is provable using MERGE, PRODUCT (iterated), and SWITCH rules on valid sentences, each of lesser or equal size, and each on one of two forms: σ a, σ R, σ C pn, id P N, e, where p n and P N are free discrete primes, σ a, σ R, σ C m, S M, e, where m and M are free discrete molecules. LEMMA (6) Every valid sentence σ a, σ R, σ C m, R M, d, with m and M free discrete molecules, is provable using the ION rule on a valid sentence σ a, σ R, σ C p, R P, d, of lesser size, where p and P are discrete primes. LEMMA (7) Every valid sentence σ a, σ R, σ C p, id P, e, with p and P free discrete primes, is provable using the MERGE and PRODUCT (iterated) rules on valid sentences of equal or lesser size, which are either instances of rule PRIME-AXIOM or of the form σ a, σ r, σ M m, R M, d. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 61 / 61
PROOF METHOD (COMPLETENESS) (CONT.) THEOREM The rules for matching are complete, that is, any valid matching sentence can be derived from the rules. PROOF. By induction on the size of a sentence. By the lemmas above, we have that all valid sentences with size n can be derived from valid sentences of the form σ a, σ R, σ C m, R M, d, with m and M free discrete molecules, of size less than or equal to n. By Lemma 6, these can be derived from sentences of size less than n. TROELS C. DAMGAARD (ITU) SYNTACTIC THEORY FOR BIGRAPHS ENS, PARIS 61 / 61