4,137 research outputs found

    A Framework for Efficient Execution of Logic Programs.

    Get PDF
    The focus of this dissertation is to develop an efficient framework for sequential execution of logic programs. Within this framework the logic programs are executed by pruning the goal-search tree whenever applicable. Three new concepts for pruning of computation during execution of logic programs are introduced. (1) Failure-binding. A Failure-binding for a literal is a binding which when applied to the literal fails the goal obtained from the literal. Failure-bindings for a literal are identified by analyzing the goal-tree of a goal which is obtained from the literal. The failure-bindings for a literal are used for intelligent backtracking based on the generator-consumer approach. Intelligent backtracking based on failure-bindings prune the computation of search space which lead to late detection of failure. (2) Failure-solution. A Failure-solution of a goal is unacceptable to some other subgoal in the forward execution. Failure-solutions of a goal are identified by analyzing the history of computation, during execution. Failure-solutions of the goals are used for intelligent forward execution. Intelligent forward execution prunes the computation of search space which leads to repeated failure resulting from repeated successes of a goal. (3) Forward jumping. Forward jumping is a method to avoid reexecution of some subgoals after backtracking (instead of naive forward execution after backtracking). Forward jumping is based on the dynamic subgoal dependencies in a rule. Such jumping prunes the computation of the search spaces which leads to the same sequences of successes of subgoals after backtracking. To facilitate the implementation of these concepts a new data structure, called segmented-stack, is defined. The space complexity of a segmented stack is linear in the number of nodes in the stack. Depth-first search as well as breadth-first search are very easily implemented on a segmented-stack during execution of logic programs. Execution of logic programs on a segmented-stack allows association of the search space, as well as the solutions, of a goal with the frame of the goal. This enables implementation of intelligent backtracking, intelligent forward execution and forward jumping. The search based on each of these paradigms is proved to be sound and complete. It is also shown that the implementation of these paradigms preserves the order of results obtained by Prolog. The effects of the non-logical operators, in Prolog, on the paradigms are studied. The search based on the these paradigms is compared individually, and collectively, with the standard search by Prolog

    Intelligent search strategies based on adaptive Constraint Handling Rules

    Full text link
    The most advanced implementation of adaptive constraint processing with Constraint Handling Rules (CHR) allows the application of intelligent search strategies to solve Constraint Satisfaction Problems (CSP). This presentation compares an improved version of conflict-directed backjumping and two variants of dynamic backtracking with respect to chronological backtracking on some of the AIM instances which are a benchmark set of random 3-SAT problems. A CHR implementation of a Boolean constraint solver combined with these different search strategies in Java is thus being compared with a CHR implementation of the same Boolean constraint solver combined with chronological backtracking in SICStus Prolog. This comparison shows that the addition of ``intelligence'' to the search process may reduce the number of search steps dramatically. Furthermore, the runtime of their Java implementations is in most cases faster than the implementations of chronological backtracking. More specifically, conflict-directed backjumping is even faster than the SICStus Prolog implementation of chronological backtracking, although our Java implementation of CHR lacks the optimisations made in the SICStus Prolog system. To appear in Theory and Practice of Logic Programming (TPLP).Comment: Number of pages: 27 Number of figures: 14 Number of Tables:

    Independence in constraint logic programs

    Full text link
    Studying independence of literals, variables, and substitutions has proven very useful in the context of logic programming (LP). Here we study independence in the broader context of constraint logic programming (CLP). We show that a naive extrapolation of the LP definitions of independence to CLP is unsatisfactory (in fact, wrong) for two reasons. First, because interaction between variables through constraints is more complex than in the case of logic programming. Second, in order to ensure the efUciency of several optimizations not only must independence of the search space be considered, but also an orthogonal issue - "independence of constraint solving." We clarify these issues by proposing various types of search independence and constraint solver independence, and show how they can be combined to allow different independence-related optimizations, from parallelism to intelligent backtracking. Sufficient conditions for independence which can be evaluated "a-priori" at run-time are also proposed. Our results suggest that independence, provided a suitable definition is chosen, is even more useful in CLP than in LP

    Relating goal scheduling, precedence, and memory management in and-parallel execution of logic programs

    Full text link
    The interactions among three important issues involved in the implementation of logic programs in parallel (goal scheduling, precedence, and memory management) are discussed. A simplified, parallel memory management model and an efficient, load-balancing goal scheduling strategy are presented. It is shown how, for systems which support "don't know" non-determinism, special care has to be taken during goal scheduling if the space recovery characteristics of sequential systems are to be preserved. A solution based on selecting only "newer" goals for execution is described, and an algorithm is proposed for efficiently maintaining and determining precedence relationships and variable ages across parallel goals. It is argued that the proposed schemes and algorithms make it possible to extend the storage performance of sequential systems to parallel execution without the considerable overhead previously associated with it. The results are applicable to a wide class of parallel and coroutining systems, and they represent an efficient alternative to "all heap" or "spaghetti stack" allocation models

    Complete and efficient methods for supporting side effects in independent/restricted and-parallelism

    Get PDF
    It has been shown that it is possible to exploit Independent/Restricted And-parallelism in logic programs while retaining the conventional "don't know" semantics of such programs. In particular, it is possible to parallelize pure Prolog programs while maintaining the semantics of the language. However, when builtin side-effects (such as write or assert) appear in the program, if an identical observable behaviour to that of sequential Prolog implementations is to be preserved, such side-effects have to be properly sequenced. Previously proposed solutions to this problem are either incomplete (lacking, for example, backtracking semantics) or they force sequentialization of significant portions of the execution graph which could otherwise run in parallel. In this paper a series of side-effect synchronization methods are proposed which incur lower overhead and allow more parallelism than those previously proposed. Most importantly, and unlike previous proposals, they have well-defined backward execution behaviour and require only a small modification to a given (And-parallel) Prolog implementation
    • …
    corecore