+0
 While reading a book, I came across such sentence:
"If he could have slept sitting upright in the driver's seat, he would have done so." 
What type of conditional is it? What context is it, past, present, future? I've never seen anything like this (the red part) before in any grammar book. Could anybody explain such usage?
+0
Hi SeroMack

Your sentence is a standard Type 3 conditional. It refers to the past.

Maybe looking at these will help:

- If he had found it possible to sleep (in that position), he would have slept (in that position).
- If he had had the ability to sleep (in a certain position), he would have slept (in that position).

And here is the way you would write the Type 1 and Type 2 conditional forms of your sentence:

Type 1:
- "If he can sleep (while) sitting upright in the driver's seat, he will do so."
("If he is able to sleep (while) sitting upright in the driver's seat, he will do so.")

Type 2:
"If he could sleep (while) sitting upright in the driver's seat, he would do so."
("If he were able to sleep (while) sitting upright in the driver's seat, he would do so.")
Comments  
Hi, Seromack. Welcome to English Forums. In writings, the using sometiomes is quite stunning.
seroMack "If he could have slept / had been able to sleep sitting upright in the driver's seat, he would have done so."

Could have slept shows the probability or opportunity of person which did not happen or was not realised.
Here the link on the subject is rather similar to what you refer.

http://www.EnglishForward.com/English/INeedHelpAgain/hkjnm/post.htm
Students: Are you brave enough to let our tutors analyse your pronunciation?
Thank you, it explained my somehow how it works. Yet, I'll have to look for some academic book on that topic Emotion: smile
 Yankee's reply was promoted to an answer.
 Hi Yankee,
 Thanks for the post. I know all conditional types. I found the above example very peculiar because of that could have slept form in conditional clause (after IF)

Emotion: smile
Teachers: We supply a list of EFL job vacancies
could have slept is just another way of saying had been able to sleep.

CJ
Emotion: big smileI know what it means Emotion: wink I just couldn't get the idea of what strange conditional pattern it was Emotion: smile