If I had had some cash on me, I would have bought an ice-cream.
I would have chosen a direct flight if there had been tickets left.
In spoken English, you will often hear shortened forms like could've, should've, would've.
To make a negative form, add "not" after the modal:
modal + not + have + past participle
It is common to use contracted negative forms like couldn't, shouldn't.
She shouldn't have said that.
We couldn't have foreseen that change of plans.
He might not have noticed the error.
To make a question with a modal verb referring to the past, we swap the modal and the subject:
modal + subject + have + past participle ... ?
Should I have called you earlier?
Would he have believed me?
Meaning of past modals
could have + past participle
Something was possible in the past or there was a probability, but it didn't happen.
He could have slept till noon but the alarm clock woke him up.
We could have stayed longer but we decided to leave.
He could have been seriously injured. Fortunately, nothing happened.
couldn't have + past participle
Opposite to could have: something was hypothetically impossible.
I can't believe Kevin didn't show up! He couldn't have forgotten about the meeting.
Thanks for your help! I couldn't have managed without you!
I checked the equipment many times: it couldn't have failed.
Keep in mind that we don't use "can" as a past modal. However, you can use can't as a synonym to couldn't.
The boy can't have written such an essay on his own.(= couldn't)
should have + past participle
It was a good idea to do something, but it didn't happen.
He should have told me that they cancelled the conference.
You should have come to the party yesterday, it was fun.
I should have followed your advice, you were right.
shouldn't have + past participle
The addition of "not" reverses the meaning: it was a bad idea to do something, but it still happened.
I shouldn't have drunk so much coffee before bedtime.
We shouldn't have tried to fix the car ourselves.
You really shouldn't have lied. Why didn't you tell the truth?
must have + past participle
We use this modal verb to show a high degree of certainty. We are almost 100% sure that something took place in the past.
Where are my gloves? I must have left them in the taxi.
This antique chandelier looks terrific. You must have spent a fortune.
Phillip called to say he'd be late. He must have missed the train.
might have + past participle
Might expresses less certainty compared to must. We say "might have done" when some past event seems probable but we aren't absolutely sure.
They might have misunderstood us.
She might have met him yesterday.
It might have slipped his mind.
We can also say may have done with the same meaning but might is more common.
would have + past participle
When we wanted something to happen but it didn't happen in the end, we use would + have + past participle.
It has the same meaning as in the third conditional sentences.
I would have telephoned that company, but there wasn't a phone number on their website.
He would have taken a warm coat, but he didn't see the weather forecast.
She would have got a pay raise if she had been more persistent.
Try to express probability using modal verbs instead of long complex sentences like "It is possible that..." / "It is probable that..." / "I am sure that...". The shorter the sentence, the more natural and "native" it sounds.
To recap, let's put all the past modals into a table.
could have done
He could have called me (= but he didn't)
couldn't have done
It couldn't have snowed in June (= but it did)
should have done
You should have spoken to your boss (= but you didn't)
shouldn't have done
You shouldn't have shouted at your boss (= but you did)
must have done
They must have got lost (= I'm sure they did)
might have done
She might have missed your call (= she probably did).