Acyclic path matching