Сделать отрицательное предложние Fred had learnt the poem by heart
Fred hadn`t learnt the poem by heart.
Fred had not learnt the poem by heart.