47 research outputs found
On the Efficiency of Optimising Shallow Backtracking in Prolog
The cost of backtracking has been identified as one of the bottlenecks in
achieving peak performance in compiled Prolog programs. Much of the backtracking in
Prolog programs is shallow, i.e. is caused by unification failures in the head of a
clause when there are more alternatives for the same procedure, and so special treatment
of this form of backtracking has been proposed as a significant optimisation. This
paper describes a modified WAM which optimises shallow backtracking. Four different
implementation approaches are compared. A number of benchmark results are presented,
measuring the relative tradeoffs between compilation time, code size, and run time. The
results show that the speedup gained by this optimisation can be significant
SICStus maskinkodskompilering
SICStus Prolog bygger på en WAM-emulator, Warrens Abstract Machine, skriven i C för portabilitet. Denna rapport beskriver SICStus maskinkodutökning som gör att predikat kan kompileras direkt till maskinkod på maskiner baserade på 68K- och Sparc-processorer
On applying Or-Parallelism and Tabling to logic programs
Dissertação de Doutoramento em Ciência de Computadores apresentada à Faculdade de Ciências da Universidade do Port
PrologPF: Parallel Logic and Functions on the Delphi Machine
PrologPF is a parallelising compiler targeting a distributed system of general purpose workstations connected by a relatively low performance network. The source language extends standard Prolog with the integration of higher-order functions.
The execution of a compiled PrologPF program proceeds in a similar manner to standard Prolog, but uses oracles in one of two modes. An oracle represents the sequence of clauses used to reach a given point in the problem search tree, and the same PrologPF executable can be used to build oracles, or follow oracles previously generated.
The parallelisation strategy used by PrologPF proceeds in two phases, which this research shows can be interleaved. An initial phase searches the problem tree to a limited depth, recording the discovered incomplete paths. In the second phase these paths are allocated to the available processors in the network. Each processor follows its assigned paths and fully searches the referenced subtree, sending solutions back to a control processor. This research investigates the use of the technique with a one-time partitioning of the problem and no further scheduling communication, and with the recursive application of the partitioning technique to effect dynamic work reassignment.
For a problem requiring all solutions to be found, execution completes when all the distributed processors have completed the search of their assigned subtrees. If one solution is required, the execution of all the path processors is terminated when the control processor receives the first solution.
The presence of the extra-logical Prolog predicate cut in the user program conflicts with the use of oracles to represent valid open subtrees. PrologPF promotes the use of higher-order functional programming as an alternative to the use of cut. The combined language shows that functional support can be added as a consistent extension to standard Prolog
Goal driven theorem proving using conceptual graphs and Peirce logic
The thesis describes a rational reconstruction of Sowa's theory of Conceptual
Graphs. The reconstruction produces a theory with a firmer logical foundation than was
previously the case and which is suitable for computation whilst retaining the
expressiveness of the original theory. Also, several areas of incompleteness are
addressed. These mainly concern the scope of operations on conceptual graphs of
different types but include extensions for logics of higher orders than first order. An
important innovation is the placing of negation onto a sound representational basis.
A comparison of theorem proving techniques is made from which the principles of
theorem proving in Peirce logic are identified. As a result, a set of derived inference rules,
suitable for a goal driven approach to theorem proving, is developed from Peirce's beta
rules. These derived rules, the first of their kind for Peirce logic and conceptual graphs,
allow the development of a novel theorem proving approach which has some similarities
to a combined semantic tableau and resolution methodology. With this methodology it is
shown that a logically complete yet tractable system is possible. An important result is the
identification of domain independent heuristics which follow directly from the
methodology. In addition to the theorem prover, an efficient system for the detection of
selectional constraint violations is developed.
The proof techniques are used to build a working knowledge base system in Prolog
which can accept arbitrary statements represented by conceptual graphs and test their
semantic and logical consistency against a dynamic knowledge base. The same proof
techniques are used to find solutions to arbitrary queries. Since the system is logically
complete it can maintain the integrity of its knowledge base and answer queries in a fully
automated manner. Thus the system is completely declarative and does not require any
programming whatever by a user with the result that all interaction with a user is
conversational. Finally, the system is compared with other theorem proving systems
which are based upon Conceptual Graphs and conclusions about the effectiveness of the
methodology are drawn