844 research outputs found

    Automatic generation of simplified weakest preconditions for integrity constraint verification

    Get PDF
    Given a constraint cc assumed to hold on a database BB and an update uu to be performed on BB, we address the following question: will cc still hold after uu is performed? When BB is a relational database, we define a confluent terminating rewriting system which, starting from cc and uu, automatically derives a simplified weakest precondition wp(c,u)wp(c,u) such that, whenever BB satisfies wp(c,u)wp(c,u), then the updated database u(B)u(B) will satisfy cc, and moreover wp(c,u)wp(c,u) is simplified in the sense that its computation depends only upon the instances of cc that may be modified by the update. We then extend the definition of a simplified wp(c,u)wp(c,u) to the case of deductive databases; we prove it using fixpoint induction

    Magic Sets for Disjunctive Datalog Programs

    Get PDF
    In this paper, a new technique for the optimization of (partially) bound queries over disjunctive Datalog programs with stratified negation is presented. The technique exploits the propagation of query bindings and extends the Magic Set (MS) optimization technique. An important feature of disjunctive Datalog is nonmonotonicity, which calls for nondeterministic implementations, such as backtracking search. A distinguishing characteristic of the new method is that the optimization can be exploited also during the nondeterministic phase. In particular, after some assumptions have been made during the computation, parts of the program may become irrelevant to a query under these assumptions. This allows for dynamic pruning of the search space. In contrast, the effect of the previously defined MS methods for disjunctive Datalog is limited to the deterministic portion of the process. In this way, the potential performance gain by using the proposed method can be exponential, as could be observed empirically. The correctness of MS is established thanks to a strong relationship between MS and unfounded sets that has not been studied in the literature before. This knowledge allows for extending the method also to programs with stratified negation in a natural way. The proposed method has been implemented in DLV and various experiments have been conducted. Experimental results on synthetic data confirm the utility of MS for disjunctive Datalog, and they highlight the computational gain that may be obtained by the new method w.r.t. the previously proposed MS methods for disjunctive Datalog programs. Further experiments on real-world data show the benefits of MS within an application scenario that has received considerable attention in recent years, the problem of answering user queries over possibly inconsistent databases originating from integration of autonomous sources of information.Comment: 67 pages, 19 figures, preprint submitted to Artificial Intelligenc

    Bounded Implication for Existential Rules

    Get PDF
    The property of boundedness in Datalog formalizes whether a set of rules can be equivalently expressed by a non-recursive set of rules. Existential rules extend Datalog to the presence of existential variables in rule heads. In this paper, we introduce and study notions of boundedness for existential rules. We provide a notion of weak boundedness and a notion of strong boundedness for a rule set, and show that they correspond, respectively, to the notions of first-order rewritability of atomic queries and first-order rewritability of conjunctive queries over the set. While weak and strong boundedness are in general not equivalent, we show that, for some notable subclasses of existential rules, i.e., Datalog, single-head binary rules, and frontier-guarded rules, the two notions coincide

    Datalog with Negation and Monotonicity

    Get PDF
    Positive Datalog has several nice properties that are lost when the language is extended with negation. One example is that fixpoints of positive Datalog programs are robust w.r.t. the order in which facts are inserted, which facilitates efficient evaluation of such programs in distributed environments. A natural question to ask, given a (stratified) Datalog program with negation, is whether an equivalent positive Datalog program exists. In this context, it is known that positive Datalog can express only a strict subset of the monotone queries, yet the exact relationship between the positive and monotone fragments of semi-positive and stratified Datalog was previously left open. In this paper, we complete the picture by showing that monotone queries expressible in semi-positive Datalog exist which are not expressible in positive Datalog. To provide additional insight into this gap, we also characterize a large class of semi-positive Datalog programs for which the dichotomy `monotone if and only if rewritable to positive Datalog\u27 holds. Finally, we give best-effort techniques to reduce the amount of negation that is exhibited by a program, even if the program is not monotone
    corecore