Hi Doug: while working on the strategies chapter for the User's Guide I encountered the problem of explaining the connection between traversal specifications (the old model: you call them path directives in Demeter/Java; I also include series parallel graphs) and strategies. Below is my current view of this translation. Do you agree with this translation? It shows the central role of name maps on the strategy side. What are the limitations in the current Demeter/Java regarding the traversal specifications and strategies which may be used? -- Karl -------------------- Traversal specifications (a both simplified and generalized form of what is in Demeter/Java) are of the form D : [A,bypassing {-> X,y,Y, -> ...},B] | [A,through {-> X,y,Y, -> ...},B] | [A,B] | D1.D2 | D1+D2 and strategies are of the form (a simplified form of what you have/need in Demeter/Java) Strategy = List(StrategyEdge) StrategyNode StrategyNode NameMap. StrategyEdge = StrategyNode "->" StrategyNode ConstraintMap. NameMap = List(NameMapElement). NameMapElement = StrategyNode ":" ClassValuedVariable. ConstraintMap = List(Constraint). Constraint : Bypassing | OnlyThrough *common* ["at" ClassValuedVariable] List(SymbolicEdge). SymbolicEdge = "->" [ ClassValuedVariable] LabeledValuedVariable ClassValuedVariable. Bypassing = "bypassing". OnlyThrough = "only-through". // bypassing: all of the images of the symbolic edges have constraint map false, others are true // only-through: all of the images of the symbolic edges have constraint map true, others are false // a localized form of bypassing and only-through is also useful (optional part c selected) // bypassing: all of the images of the symbolic edges outgoing from c // have constraint map false, others (outgoing from c) are true // only-through: all of the images of the symbolic edges outgoing from c // have constraint map true, others (outgoing from c) are false // Multiple constraints are allowed only for localized constraints Demeter/Java assumes that class-valued variables are classes and relation-valued variables are part names (identity mapping to a class graph). We first translate traversal specifications of the form D : [A,B] | D1.D2 | D1+D2 A and B are class-valued variables. A traversal specification is mapped into a strategy as follows: Each class valued-variable occurrence is mapped into a strategy graph node using function gen which maps a class valued variable occurrence A into a unique identifier gen(A). Different occurences of A are mapped into different identifiers. translation function T: Traversal specifications -> strategies T([A,B]) = {nA -> nB; N(nA) = A, N(nB) = B}, where nA=gen(A), nB=gen(B). T(D1.D2) = T(D1) union T(D2) and redirect edges into gen(Target(D1)) into gen(Source(D2)) and delete gen(Target(D1)). T(D1+D2) = T(D1) union T(D2) and redirect edges out of gen(Source(D1)) to go out of gen(Source(D2)) and redirect edges into gen(Target(D1)) into gen(Target(D2)). Delete gen(Source(D1)) and gen(Target(D1)). Next we generalize for bypassing and through: D : [A,bypassing {-> X,y,Y, -> ...},B] | [A,through {-> X,y,Y, -> ...},B] ... T([A,bypassing {-> X,y,Y},B]) = T([A,B]) but the constraint map for nA -> nB assigns false to -> X,y,Y and true to all other edges. T([A,through (X,y,Y),B]) = T([A,X]) union T([X,Y]) union T([Y,B]) and the constraint map for gen(X) -> gen(Y) assigns true only to the edge -> X,y,Y and false to all the other edges. In other words, strategy edge gen(X) -> gen(Y) has constraint map only-through -> X,y,Y.