Theory and practice of logic programming (Cambridge University Press, 2001)