Skip to main content
QUICK REVIEW

[Paper Review] Approximating Constraint Propagation in Datalog

Dario Campagna, Beata Sarna-Starosta|arXiv (Cornell University)|Dec 16, 2011
Constraint Satisfaction and Optimization16 references3 citations
TL;DR

This paper presents a source-to-source transformation for Datalog LB that approximates constraint propagation from Constraint Programming to accelerate evaluation of programs with arithmetic constraints. By integrating filter predicates derived from integrity constraints and aggregates, the method achieves up to 8× speedups on recursive and non-recursive programs, outperforming prior constraint magic set techniques.

ABSTRACT

We present a technique exploiting Datalog with aggregates to improve the performance of programs with arithmetic (in)equalities. Our approach employs a source-to-source program transformation which approximates the propagation technique from Constraint Programming. The experimental evaluation of the approach shows good run time speed-ups on a range of non-recursive as well as recursive programs. Furthermore, our technique improves upon the previously reported in the literature constraint magic set transformation approach.

Motivation & Objective

  • To improve performance of Datalog LB programs with arithmetic (in)equality constraints by leveraging constraint propagation techniques from Constraint Programming.
  • To address the inefficiency of naive generate-and-test evaluation in existing Datalog compilers, where arithmetic constraints are treated as late-acting filters.
  • To develop a source-to-source transformation that pre-filters generators using domain reduction via constraint propagation, avoiding full enumeration of search space.
  • To outperform existing approaches like the constraint magic set transformation in terms of runtime efficiency and scalability.

Proposed method

  • The method introduces filter predicates derived from integrity constraints to pre-filter domains of variables before join operations, reducing the search space early.
  • It uses Datalog LB’s support for aggregates and type-safe predicates to encode domain constraints and propagate bounds information through arithmetic expressions.
  • The transformation applies a source-to-source rewriting that inserts filter predicates before joins, approximating the effect of constraint propagators in CP.
  • The approach leverages Datalog LB’s static type system and integrity constraints to declare filter types that restrict variable domains based on arithmetic constraints.
  • The transformation is applied to both non-recursive and recursive programs, including the Flights and I*AM=SAM puzzles.
  • The method is evaluated on a range of benchmarks, comparing performance with and without the transformation in both LogicBlox and XSB systems.

Experimental results

Research questions

  • RQ1Can constraint propagation be effectively approximated in Datalog using source-to-source transformation to improve performance on arithmetic constraints?
  • RQ2How does the proposed filter predicate transformation compare to the constraint magic set transformation in terms of runtime efficiency?
  • RQ3Does the transformation scale effectively across both non-recursive and recursive Datalog programs with arithmetic constraints?
  • RQ4Why does the transformation improve performance in LogicBlox but degrade it in XSB, and what does this reveal about system-specific constraint ordering effects?
  • RQ5Can the integration of constraint propagation with semi-naive bottom-up evaluation in Datalog further enhance performance?

Key findings

  • The proposed transformation achieved speedups of up to 8× on programs with longer original run times in the LogicBlox environment.
  • For programs with original run times below 0.1 seconds, the transformation showed performance degradation in LogicBlox, indicating a threshold effect for optimization benefit.
  • The method outperformed the constraint magic set transformation, particularly on recursive and complex programs such as the Flights benchmark.
  • In XSB, the transformation caused performance degradation for most programs, attributed to constraint ordering imposed by the transformation that increased overhead.
  • The CMR+FP variant (with filter predicates) showed significant improvements in LogicBlox, with speedups ranging from 2× to 8× depending on program complexity.
  • The results suggest that the effectiveness of the transformation is highly dependent on the underlying evaluation engine’s handling of constraint ordering and incremental computation.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.