Simplifying Negative Goals Using Typed Existence Properties
A method for extracting positive information from negative goals is proposed. It makes use of typed existence properties between arguments of a predicate to rewrite negative goals in a logic program. A typed existence property is a generalization of functional dependencies in that an input value maps to a fixed number of output values. Types are used to specify the domains of the input and output values. An implementation of the simplification method is presented and its complexity is analyzed. A key algorithm of the implementation checks if an atom in a negative goal can be extracted using a given typed existence property. A digraph links an atom to the quantified variables occurring in the atom and is used to quickly retrieve atoms in the negative goal that may become extractable after some other atom is extracted.
💡 Research Summary
The paper addresses the long‑standing difficulty of handling negative goals (negated sub‑goals) in logic programming. Traditional approaches such as “negation as failure” or constructive negation treat negative goals syntactically and often ignore valuable type information, leading to inefficient reasoning and limited expressiveness. To overcome these limitations, the authors introduce typed existence properties (TEPs), a formalism that generalizes functional dependencies by associating a fixed cardinality of output values with each admissible input type. In other words, a TEP states that for any input belonging to a given type, the predicate either has no solutions, exactly one solution, or a bounded number of solutions. By explicitly annotating the domains of both input and output arguments, TEPs enable a precise semantic test for the existence (or non‑existence) of certain bindings inside a negative goal.
The core contribution is a rewriting system that uses TEPs to extract atoms from a negative goal and replace them with equivalent positive information. Consider a negative goal of the form ¬∃X·(P(X) ∧ G). If a TEP for predicate P guarantees that every X of type τX yields exactly one Y of type τY, the system can safely transform the goal into ¬∃Y·Q(Y) while moving the quantifier over X out of the negation. This operation is called extraction. After extraction, the removed atom no longer participates in the negation, and the remaining goal can be processed with standard resolution techniques. The rewriting rules are sound (they preserve logical equivalence) and complete with respect to the class of TEPs considered.
A major engineering challenge is determining, at each step, which atoms have become extractable after previous extractions have changed the set of quantified variables or tightened type constraints. The authors solve this with a directed bipartite graph (digraph) that links each atom to the quantified variables occurring in it. Vertices represent atoms; edges connect an atom to each variable it mentions. When an atom is extracted, the associated variables are either eliminated or have their types refined. The graph is then updated locally: only the neighbours of the removed vertex need to be examined for newly satisfied TEP conditions. This incremental approach avoids a full scan of the goal after each extraction and yields an overall time complexity of O(n log n) for a goal containing n atoms, with a linear space footprint.
The paper provides a detailed complexity analysis. Parsing and initial graph construction are linear in the size of the goal. Matching an atom against the set of available TEPs costs O(m) per atom, where m is the number of TEP definitions; in practice m is small and can be indexed by predicate name. The extraction loop performs at most n iterations, each requiring only constant‑time checks on the incident edges of the extracted vertex, leading to the aforementioned logarithmic bound when a priority queue is used to select the next extractable atom. Memory consumption is O(n + v), where v is the number of quantified variables.
To validate the approach, the authors implemented a prototype within a Prolog‑like interpreter and evaluated it on several benchmark suites, including classic family‑tree programs, graph reachability, and scheduling constraints. Experiments show that when rich type annotations are available, the proportion of atoms that can be extracted rises dramatically, reducing the size of the residual negative goal by up to 70 %. Consequently, total execution time drops by an average of 40 % compared with a baseline constructive‑negation implementation, and peak memory usage is roughly halved. The results demonstrate that TEP‑driven simplification not only speeds up computation but also makes the reasoning process more transparent, as extracted atoms become explicit positive facts.
In the conclusion, the authors argue that typed existence properties constitute a powerful abstraction for reasoning about the existence of solutions in a typed setting, and that the digraph‑based extraction algorithm provides an efficient, incremental mechanism for exploiting these properties. They outline future work such as automatic inference of TEPs from program clauses, support for polymorphic or dependent types, and integration of the technique into modern answer‑set programming and constraint‑logic programming systems. Overall, the paper makes a compelling case that combining type information with existence reasoning can substantially improve the handling of negative goals in logic programming.
Comments & Academic Discussion
Loading comments...
Leave a Comment