result
if
would have + past
participle
condition
Past Perfect
I would have told Mary
if
I had seen her.
I would have invited Tara
if
she had been free
yesterday.
Their teacher would have
been sad
if
they had not passed their
exam.
Would you have stayed at
home
if
it had rained yesterday?
What would you have done
if
it had rained yesterday?
Sometimes, we use should have, could have, might
have instead of would have, for example: If you had bought a
lottery ticket, you might have won.
http://www.perfect-english-grammar.com/support-files/third_conditional_form.pdf