Abstract
This article considers the efficient bottom-up query evaluation for stratified databases. We investigate the applicability of magic-set method to stratified databases containing negative body literals and show that culprit cycles cause unstratification. Based on the analysis, we present a labeling algorithm to distinguish the context for constructing magic sets, which is simpler and more efficient than the algorithms proposed by Balbin et al. [J. Logic Programming, 295–344 (1991)]. © 1997 John Wiley & Sons, Inc.