Runtime Engines
Execution strategies for Queries, Proofs, and Plans.
The Multi-Engine Approach
CNL-PL does not have a single "run" function. It has specialized Engines that consume the Plan IR and interact with the KB in different ways.
1. The Query Engine (Fast Path)
This is the workhorse for high-speed retrieval. It executes the Plan IR directly against the Bitsets. It is optimized for Throughput. It does not track provenance or explanations. It simply calculates the result set as fast as the CPU allows.
2. The Proof Engine (Trace Path)
This engine is optimized for Explainability. When it executes an operation (like an Intersection), it records a "Justification Node".
If it derives that "John is active", it records: "John is active BECAUSE (John is a user) AND (John has logged in)."
This builds a DAG (Directed Acyclic Graph) of justifications. This overhead makes it slower than the Query Engine, but essential for the "Verify" and "Explain" pragmatics.
3. The Planner Engine (Search Path)
This engine uses ActionPlans. It treats the current KB as a "State". It explores the state space by tentatively applying actions.
It uses algorithms like Forward Chaining or Backward Chaining to find a sequence of actions that leads to a goal. It relies heavily on the `BoolPlan` evaluator to check preconditions efficiently at each step.