Recognizing functions from graph