Source: http://people.rennes.inria.fr/Olivier.Sentieys/teach/TP_TNS.pdf