How can the Glass Shader be imitated using only other shaders? Exactly what does the Glass shader do?  I would guess that it combines the effects of Glossy (zero roughness) for reflections, and Refraction for, obviously, light refracting through the object.  Glass could just be a handy combination of Add, Glossy and Refraction nodes.

Making and looking at test objects using all types of shaders, comparing, it appears that this isn't quite right.  I can't quite explain how it's not looking the same, just that (unless I'm doing something stupid) there's an irresolvable difference.  

In order to understand exactly how Glass works, and learn in more depth what all the shaders do, is there a way to arrange non-Glass shaders and other nodes to imitate exactly the Glass shader?

(Of course, I could peek at the source code, but other Blender users may be wondering too, and not be literate in C++.)
What is missing is the Fresnel effect of the surface reflecting more light at higher angles of incidence.
You can use a fresnel node (Add node > Input > Fresnel) as the factor for a Mix node mixing the Refraction and Glossy shader to get this effect.


Mixed with only an Add Shader node:


Some examples with the above materials: