## Diagram: Prompt Template
### Overview
The image displays a structured "Prompt Template" designed to guide an AI agent through a specific logic-based pathfinding task. The layout is divided into three distinct functional regions: a large "Task Description" panel on the left, a "Reasoning Guidance" panel in the top-right, and a "Problem Facts" panel in the bottom-right. The template is designed to enforce strict constraints, specific output formatting, and a chain-of-thought reasoning process.
### Components/Axes
* **Header**: "Prompt Template" (Centered at the top).
* **Left Panel (Task Description)**: Contains the core instructions, constraints, valid actions, and an example.
* **Top-Right Panel (Reasoning Guidance)**: Contains a step-by-step heuristic for the AI to follow.
* **Bottom-Right Panel (Problem Facts)**: Contains the specific maze configuration and current state for the current instance of the problem.
### Detailed Analysis
#### 1. Task Description (Left Panel)
* **Role**: Problem-solving agent that thinks step-by-step.
* **Task**: Help Bob navigate a maze to rescue Alice.
* **Maze Description**: Includes room connections, door status (open/locked), key locations, and start/target locations.
* **Valid Actions**: `start`, `move_to`, `pick_up_key`, `use_key`, `unlock_and_open_door_to`, `rescue`.
* **Syntax**:
* Room IDs: Column-Row (e.g., 'A1').
* Key IDs: Positive integers (e.g., '1').
* **Key Constraints**:
1. Must be between adjacent/connected rooms.
2. Keys must be picked up before use.
3. Locked doors require specific keys.
4. Minimize actions/distance.
5. `use_key` must occur immediately before `unlock_and_open_door_to`.
* **Output Format**: Python list of tuples: `[('start', 'RoomID'), ('move_to', 'RoomID'), ...]`
* **Example**: Provided input/output block demonstrating the required syntax.
#### 2. Reasoning Guidance (Top-Right Panel)
* **Steps**:
1. Find shortest path from Bob to Alice.
2. Identify locked doors.
3. Find required keys.
4. Plan key collection order.
5. Track actions.
6. Avoid unnecessary steps.
* **Complex Path Handling**: Break into segments, solve separately, combine while maintaining optimality.
#### 3. Problem Facts (Bottom-Right Panel)
* **Connections**:
* A6 ↔ A5 (Open)
* A6 ↔ B6 (Open)
* B6 ↔ C6 (Open)
* C6 ↔ D6 (Open)
* C5 ↔ C4 (Open)
* C4 ↔ D4 (Open)
* D6 ↔ D5 (Closed/Locked, requires Key 10)
* D6 ↔ E6 (Open)
* D5 ↔ D4 (Open)
* E6 ↔ F6 (Open)
* A4 ↔ A3 (Open)
* A1 ↔ B1 (Open)
* **Key Location**: Key 10 is in Room A5.
* **Positions**: Bob is in F6; Alice is in C5.
### Key Observations
* **Constraint Enforcement**: The prompt explicitly mandates the order of operations (e.g., `use_key` must precede `unlock_and_open_door_to`), which is a common technique to prevent LLMs from hallucinating invalid sequences.
* **Modularity**: The separation of "Task Description" (static instructions) from "Problem Facts" (dynamic data) suggests this template is intended to be reused with different maze configurations.
* **Chain-of-Thought**: The "Reasoning Guidance" section forces the model to perform internal planning before generating the final output, increasing the likelihood of finding the optimal path.
### Interpretation
This document is a highly engineered prompt designed to minimize errors in an automated pathfinding task. By defining a strict Python-like syntax for the output, the creator ensures that the AI's response can be parsed programmatically by a downstream system (e.g., a game engine or a simulator). The inclusion of "Reasoning Guidance" is a classic "Chain-of-Thought" prompting strategy, which significantly improves performance on multi-step logic problems by forcing the model to decompose the problem into smaller, manageable segments before committing to a final sequence of actions. The specific constraints (e.g., "use_key" immediately before "unlock") suggest the underlying system is sensitive to the order of operations, likely requiring a specific state-change sequence to function correctly.