JOURNAL ARTICLE

Modular stratification and magic sets for Datalog programs with negation

Kenneth A. Ross

Year: 1994 Journal:   Journal of the ACM Vol: 41 (6)Pages: 1216-1266   Publisher: Association for Computing Machinery

Abstract

A class of “modularly stratified” logic programs is defined. Modular stratification generalizes stratification and local stratification, while allowing programs that are not expressible as stratified programs. For modularly stratified programs, the well-founded semantics coincides with the stable model semantics and makes every ground literal true or false. Modularly stratified programs are weakly stratified, but the converse is false. Unlike some weakly stratified programs, modularly stratified programs can be evaluated in a subgoal-at-a time fashion. An extension of top-down methods with memoing that handles this broader class of programs is presented. A technique for rewriting a modularly stratified program for bottom-up evaluation is demonstrated and extended to include magic-set techniques. The rewritten program, when evaluated bottom-up, gives correct answers according to the well-founded semantics, but much more efficiently than computing the complete well-founded model. A one-to-one correspondence between steps of the extended top-down method and steps during the bottom-up evaluation of the magic-rewritten program is exhibited, demonstrating that the complexity of the two methods is the same. Extensions of modular stratification to other operators such as set-grouping and aggregation, which have traditionally been stratified to prevent semantic difficulties, are discussed.

Keywords:
Stratification (seeds) Computer science Modular design Programming language Datalog Stable model semantics Rewriting Negation Semantics (computer science) Theoretical computer science Operational semantics

Metrics

71
Cited By
5.23
FWCI (Field Weighted Citation Impact)
39
Refs
0.96
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Logic, programming, and type systems
Physical Sciences →  Computer Science →  Artificial Intelligence
Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems
Logic, Reasoning, and Knowledge
Physical Sciences →  Computer Science →  Artificial Intelligence

Related Documents

JOURNAL ARTICLE

Magic Sets for disjunctive Datalog programs

Mario AlvianoWolfgang FaberGianluigi GrecoNicola Leone

Journal:   Artificial Intelligence Year: 2012 Vol: 187-188 Pages: 156-192
JOURNAL ARTICLE

Dynamic Magic Sets for Disjunctive Datalog Programs

Mario Alviano

Journal:   Leibniz-Zentrum für Informatik (Schloss Dagstuhl) Year: 2010 Pages: 226-235
© 2026 ScienceGate Book Chapters — All rights reserved.