static Pair web_matchTriple_dollarVars(Symbol a, Symbol b, Symbol c, Web web) { L nodes = web_nodes(web); if (l(nodes) == 1) { // check self-relation WebNode n = first(nodes); if (nodeMatch_dollarVars(b, web_getRelationOpt(n, n)) == 0 && nodeMatch_dollarVars(a, n) == 0 && nodeMatch_dollarVars(c, n) == 0) ret pair(n); } else if (l(nodes) == 2) { WebNode n1 = first(nodes), n2 = second(nodes); if (nodeMatch_dollarVars(b, web_getRelationOpt(n1, n2)) == 0 && nodeMatch_dollarVars(a, n1) == 0 && nodeMatch_dollarVars(c, n2) == 0) ret pair(n1, n2); if (nodeMatch_dollarVars(b, web_getRelationOpt(n2, n1)) == 0 && nodeMatch_dollarVars(a, n2) == 0 && nodeMatch_dollarVars(c, n1) == 0) ret pair(n2, n1); } null; }