// without variables tracematch () sym A before: visit( A); sym B before: visit( B); regex // (# A (* B)) // With variables // The before bA and after aA must be on the same object a. // in between is a before visit to a B-object b and the object // previous to b must be an X-object. // We want to find all the matches. tracematch (A a, X x) sym bA before: (& visit(A) target(a)); sym B before: (& visit(B) this(x)); sym aA after: (& visit(A) target(a)); regex // (# bA (* B) aA)