Abstract
This paper presents a novel "parallel backtracking" technique designed to execute Prolog programs efficiently on high-performance vector processors. By integrating vector splitting and choice points, the proposed method harnesses the speed of SIMD (Single Instruction, Multiple Data) architectures while avoiding the memory exhaustion typically associated with process explosion in parallel logic programming.
Introduction
In the late 1980s, the potential for running logic programming languages like Prolog on vector supercomputers, such as the Cray-2, was a significant area of interest. These machines excel at performing uniform operations on large data arrays, making them theoretically ideal for "or-parallelism"—the simultaneous exploration of multiple search branches.
However, a critical challenge hindered this integration: process explosion. Naive parallel search strategies create new processes at every branch point. For complex combinatorial problems like the 12-queens puzzle, the number of processes grows exponentially, rapidly exceeding available memory. While previous vectorization methods worked for small-scale problems, they failed on larger ones due to this explosion. The authors address this by introducing a hybrid approach that maintains the efficiency of vectorization without compromising system stability.
Methodology: Parallel Backtracking
The core of the proposed solution is parallel backtracking, which combines the high-throughput nature of vector processing with the resource-conserving properties of traditional backtracking.
Or-vectorization
Instead of variables holding single scalar values, they hold "vectors" of values. Each element in the vector represents a different parallel search path, allowing the processor to evaluate multiple branches of a logic tree in a single clock cycle.
Vector Splitting and Choice Points
To prevent memory exhaustion, the system monitors the length of these data vectors. When a vector exceeds a predefined threshold, it is split into smaller, manageable chunks. Rather than processing all chunks simultaneously, the system executes one chunk and stores the others as "choice points." If the current execution path fails or completes, the system backtracks to the saved vector chunk and resumes.
Modified Flow Control
The researchers modified the intermediate code's v_merge function to act as a traffic controller. Instead of simply combining results, v_merge decides whether to merge vectors to maintain efficiency or trigger a backtrack to prevent vectors from becoming too large. Crucially, this implementation requires no changes to the program's logic or the high-level compiler, as the "explosion-free" behavior is handled at the interpretation level.
Key Insights
- Efficiency Threshold: Vector processors are often slower than scalar ones for small datasets. Peak performance is reached only with long vectors (typically 100+ elements). This method keeps vectors within this "sweet spot."
- Backtracking as Resource Management: Traditionally a logical search tool, backtracking is here repurposed as a "safety valve" to manage computational resources during parallel execution.
Evaluation and Results
The technique was evaluated using classic combinatorial benchmarks, including the 8-queens and 12-queens problems.
- Performance: A hand-compiled 8-queens implementation achieved 4.5 MLIPS (Million Logical Inferences Per Second) on a Hitachi S-810 supercomputer.
- Speedup: The system demonstrated a speedup of approximately eight times over standard scalar processing.
- Stability: Unlike previous naive vectorization methods, parallel backtracking successfully solved the 12-queens problem without crashing, proving its effectiveness in preventing process explosion.
Conclusion
The parallel backtracking technique offers a viable path for running logic programs on vector architectures. By treating backtracking as a flow-control mechanism for parallel data, the authors achieved significant performance gains while maintaining the robustness needed for large-scale search problems. Future work involves integrating this prototype into production-ready systems and optimizing the memory overhead associated with vector splitting and merging.
Summary updated