Abstract
DatalogMTL is a powerful extension of Datalog that incorporates Metric Temporal Logic (MTL) operators, enabling reasoning over continuous-time data. While its utility in stream reasoning and ontology-based data access is well-recognized, its exact computational complexity remained an open question. This paper proves that the data complexity of DatalogMTL is PSPACE-complete and demonstrates that the language is expressive enough to capture the entire PSPACE complexity class over ordered inputs.
Introduction: The Challenge of Temporal Reasoning
In the era of "Big Data," reasoning about events over time is critical. Industrial monitoring systems, for instance, must identify complex patterns like a "risky overheat" condition—defined as a machine exceeding 40°C for a continuous 10-second interval or hitting 60°C twice within a specific window. DatalogMTL was designed to handle such scenarios by combining the recursive logic of Datalog with the metric operators of MTL.
Despite its adoption, the precise computational "cost" of DatalogMTL was previously unknown, with estimates ranging between PSPACE and EXPSPACE. This research bridges that gap, providing tight complexity bounds and exploring the limits of the language's expressive power.
Methods: From Continuous Time to Discrete Automata
The core challenge in DatalogMTL is that time is continuous, typically represented by rational numbers. To make reasoning tractable, the authors employ a sophisticated automata-theoretic approach centered on discretization.
The Ruler and Windows
The authors introduce the concept of a "ruler"—a set of regularly distributed time points derived from the greatest common divisor of all numeric constants in the program. They then define "windows," which are snapshots of the facts true over specific intervals on this ruler.
Formalizing Interval Operations
To track how facts propagate through time, the logic must precisely handle interval arithmetic. The authors define specific operations for calculating endpoints and openness for various temporal combinations, which is essential for maintaining the consistency of the "ruler" across recursive rules.
Automata Construction
The researchers construct two non-deterministic generalized Büchi automata where states correspond to these windows. One automaton processes the "past" and the other the "future." By showing that the "canonical model" (the minimal set of derived facts) follows the structure of the ruler, they prove that checking consistency is equivalent to checking if these automata have a non-empty language. Crucially, they demonstrate that these checks can be performed "on-the-fly" using only polynomial space (PSPACE), even with binary-encoded numbers.
Key Insights and Expressive Power
The research yields several significant insights into the nature of temporal logic:
- Discretizing the Continuous: Even with arbitrary rational intervals, the logic of a DatalogMTL program "crystallizes" around a discrete ruler, allowing a transition from continuous time to state-machine analysis.
- The Power of Negation: When DatalogMTL is allowed to use negation on input predicates, it becomes PSPACE-complete. In terms of descriptive complexity, this makes it significantly more powerful than standard Datalog, which only captures PTIME.
- The "Falsum" Threshold: In forward-propagating fragments (rules looking only at present/future), the inclusion of the falsum predicate ($\perp$)—used to denote contradictions—triggers a jump in combined complexity from EXPTIME-complete to EXPSPACE-complete.
Key Results
The paper establishes definitive bounds for DatalogMTL:
- Data Complexity: Fact entailment is PSPACE-complete. This settles a long-standing open question in the field.
- Expressive Power: DatalogMTL captures PSPACE over ordered inputs, placing it among the most expressive logic languages capable of expressing any problem solvable in polynomial space.
- Combined Complexity: For the forward-propagating fragment, the bound is EXPSPACE-complete with the falsum predicate and EXPTIME-complete without it.
Limitations and Future Outlook
While PSPACE is a significant improvement over EXPSPACE, it remains computationally demanding for massive, real-time data streams. The authors suggest that future work should focus on identifying simpler fragments of DatalogMTL that might fall into more efficient classes like PTIME or $AC^0$. Additionally, exploring "pointwise" semantics—where facts hold only at discrete points rather than continuous intervals—could offer new avenues for optimizing temporal reasoning.
Summary updated