Make sygus infer find function definitions (#1951)