traverse ancestors to find definitions