Invited tutorial at LICS 2012