Static analysis of logic programs: an advanced tutorial