 
Summary: Function Matching
Amihood Amir
Yonatan Aumann
Moshe Lewenstein
Ely Porat
BarIlan University BarIlan University BarIlan University BarIlan University
and
Georgia Tech
Abstract
We present problems in three different application areas: identifying similar code where
global register reallocation and spill code minimization were done (programming languages);
protein threading (computational biology); and searching for color icons under different color
maps (image processing).
We introduce a new search model function matching that enables solving the above
problems. The function matching problem has as its input a text T of length n over alphabet
T and a pattern P = P[1]P[2] · · · P[m] of length m over alphabet P . We seek all text locations
i where the mlength substring that starts at i is equal to f(P[1])f(P[2]) · · · f(P[m]), for some
function f : P T .
We give a randomized algorithm which solves the function matching problem in time O(n log n)
with probability 1
