# iochoa808/rantanplan architecture

> Architecture diagram of the GitHub repository iochoa808/rantanplan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iochoa808/rantanplan
- Repository: https://github.com/iochoa808/rantanplan

## Overview

RantanPlan accepts a planning problem through its CLI or Unified Planning integration, converts it for the C++ backend, preprocesses it, and searches for a plan using configurable semantics, encodings, and search modes. The graph preserves documented numeric, symmetry, interference, and propagator capabilities. Some internals are represented by their source directories because their wiring was not sampled; dashed edges indicate documented capabilities whose precise implementation link is unverified.

Main entry points: [`rantanplan/cpp/src/passes/pipeline.cpp`](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/passes/pipeline.cpp) (Preprocessing pipeline), [`rantanplan/cpp/src/config/strategy_factory.cpp`](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/config/strategy_factory.cpp) (Strategy factory), [`rantanplan/cpp/src/planners`](https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/planners) (Planner search), [`rantanplan/cpp/src/encoders/grounded_encoder.cpp`](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/encoders/grounded_encoder.cpp) (SMT encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Python frontend"]
  node_frontend["Python planner<br/>[planner_wrapper.py]"]
  node_cnf["CNF compiler"]
end

subgraph group_model["Problem model"]
  node_wire["Protobuf exchange<br/>[protobuf_io.cpp]"]
  node_problem["Planning problem<br/>[problem.hpp]"]
  node_plan["Plan result<br/>[plan.cpp]"]
end

subgraph group_prep["Preprocessing"]
  node_pipeline["Preprocessing pipeline<br/>[pipeline.cpp]"]
  node_grounding["Reachability grounding"]
  node_rpg["Relaxed planning graph"]
  node_pruning["Action pruning"]
  node_achievers["Goal achievers"]
  node_interference["Interference analysis"]
  node_symmetry["Symmetry breaking"]
end

subgraph group_solve["Encoding and search"]
  node_factory["Strategy factory"]
  node_encoder["SMT encoding"]
  node_parallel["Parallel semantics"]
  node_planner["Planner search"]
  node_pdla["PDLA search<br/>[pdla_planner.cpp]"]
  node_propagators["Custom propagators"]
end

subgraph group_support["Analysis and integration"]
  node_config["Configuration<br/>[config.hpp]"]
  node_logger["Runtime diagnostics<br/>[logger.hpp]"]
end

node_user(("CLI / UP user"))
node_z3["Z3 solver"]

node_user -->|"submits problem"| node_frontend
node_frontend -.->|"normalizes conditions"| node_cnf
node_frontend -->|"exchanges problem"| node_wire
node_wire -->|"loads model"| node_problem
node_problem -->|"enters preprocessing"| node_pipeline
node_pipeline -.->|"runs passes"| node_grounding
node_pipeline -->|"runs analysis"| node_rpg
node_pipeline -->|"runs analysis"| node_interference
node_pipeline -->|"runs analysis"| node_achievers
node_pipeline -.->|"runs analysis"| node_symmetry
node_rpg -.->|"identifies removable actions"| node_pruning
node_pruning -.->|"removes actions"| node_problem
node_config -->|"selects strategy"| node_factory
node_pipeline -->|"supplies analysis results"| node_factory
node_factory -->|"creates encoder"| node_encoder
node_factory -->|"creates semantics"| node_parallel
node_encoder -->|"uses analysis"| node_interference
node_encoder -.->|"builds constraints"| node_z3
node_parallel -.->|"defines step semantics"| node_encoder
node_factory -->|"creates search planner"| node_planner
node_factory -->|"creates propagator"| node_propagators
node_planner -->|"encodes horizons"| node_encoder
node_planner -.->|"solves constraints"| node_z3
node_propagators -.->|"extends solving"| node_z3
node_factory -->|"selects PDLA search"| node_pdla
node_pdla -->|"uses achiever analysis"| node_achievers
node_planner -.->|"produces plan"| node_plan
node_frontend -.->|"returns plan"| node_plan
node_config -->|"controls verbosity"| node_logger
node_planner -.->|"reports progress"| node_logger

click node_frontend "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/planner_wrapper.py"
click node_cnf "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cnf_condition_compiler.py"
click node_wire "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/protobuf_io.cpp"
click node_problem "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/problem.hpp"
click node_config "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/config/config.hpp"
click node_pipeline "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/passes/pipeline.cpp"
click node_grounding "https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/grounding"
click node_rpg "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/analysis/numeric_relaxed_planning_graph.cpp"
click node_pruning "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/passes/action_pruning_pass.cpp"
click node_achievers "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/abstraction/achievers_analysis.cpp"
click node_interference "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/analysis/interference_analysis.hpp"
click node_symmetry "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/symmetries/smt_symmetry_checker.cpp"
click node_factory "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/config/strategy_factory.cpp"
click node_encoder "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/encoders/grounded_encoder.cpp"
click node_parallel "https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/encoders/parallelism"
click node_planner "https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/planners"
click node_pdla "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/planners/pdla_planner.cpp"
click node_propagators "https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/planners/propagators"
click node_plan "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/plan.cpp"
click node_logger "https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/util/logger.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_cnf,node_user toneBlue
class node_wire,node_problem,node_plan toneAmber
class node_pipeline,node_grounding,node_rpg,node_pruning,node_achievers,node_interference,node_symmetry toneMint
class node_factory,node_encoder,node_parallel,node_planner,node_pdla,node_propagators toneRose
class node_config,node_logger,node_z3 toneIndigo
```

## Components

### Python frontend

- [Python planner](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/planner_wrapper.py): `rantanplan/planner_wrapper.py`
- [CNF compiler](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cnf_condition_compiler.py): `rantanplan/cnf_condition_compiler.py`

### Problem model

- [Protobuf exchange](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/protobuf_io.cpp): `rantanplan/cpp/src/problem/protobuf_io.cpp`
- [Planning problem](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/problem.hpp): `rantanplan/cpp/src/problem/problem.hpp`
- [Plan result](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/problem/plan.cpp): `rantanplan/cpp/src/problem/plan.cpp`

### Preprocessing

- [Preprocessing pipeline](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/passes/pipeline.cpp): `rantanplan/cpp/src/passes/pipeline.cpp`
- [Reachability grounding](https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/grounding): `rantanplan/cpp/src/grounding`
- [Relaxed planning graph](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/analysis/numeric_relaxed_planning_graph.cpp): `rantanplan/cpp/src/analysis/numeric_relaxed_planning_graph.cpp`
- [Action pruning](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/passes/action_pruning_pass.cpp): `rantanplan/cpp/src/passes/action_pruning_pass.cpp`
- [Goal achievers](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/abstraction/achievers_analysis.cpp): `rantanplan/cpp/src/abstraction/achievers_analysis.cpp`
- [Interference analysis](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/analysis/interference_analysis.hpp): `rantanplan/cpp/src/analysis/interference_analysis.hpp`
- [Symmetry breaking](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/symmetries/smt_symmetry_checker.cpp): `rantanplan/cpp/src/symmetries/smt_symmetry_checker.cpp`

### Encoding and search

- [Strategy factory](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/config/strategy_factory.cpp): `rantanplan/cpp/src/config/strategy_factory.cpp`
- [SMT encoding](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/encoders/grounded_encoder.cpp): `rantanplan/cpp/src/encoders/grounded_encoder.cpp`
- [Parallel semantics](https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/encoders/parallelism): `rantanplan/cpp/src/encoders/parallelism`
- [Planner search](https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/planners): `rantanplan/cpp/src/planners`
- [PDLA search](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/planners/pdla_planner.cpp): `rantanplan/cpp/src/planners/pdla_planner.cpp`
- [Custom propagators](https://github.com/iochoa808/rantanplan/tree/main/rantanplan/cpp/src/planners/propagators): `rantanplan/cpp/src/planners/propagators`

### Analysis and integration

- [Configuration](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/config/config.hpp): `rantanplan/cpp/src/config/config.hpp`
- [Runtime diagnostics](https://github.com/iochoa808/rantanplan/blob/main/rantanplan/cpp/src/util/logger.hpp): `rantanplan/cpp/src/util/logger.hpp`

### Other components

- **CLI / UP user**
- **Z3 solver**

## Connections

- CLI / UP user → Python planner: submits problem (evidence: `README.md`)
- Python planner → CNF compiler: normalizes conditions (evidence: `README.md`)
- Python planner → Protobuf exchange: exchanges problem (evidence: `README.md`)
- Protobuf exchange → Planning problem: loads model (evidence: `rantanplan/cpp/src/problem/protobuf_io.cpp`)
- Planning problem → Preprocessing pipeline: enters preprocessing (evidence: `rantanplan/cpp/src/passes/pipeline.cpp`)
- Preprocessing pipeline → Reachability grounding: runs passes (evidence: `README.md`)
- Preprocessing pipeline → Relaxed planning graph: runs analysis (evidence: `rantanplan/cpp/src/passes/pipeline.cpp`)
- Preprocessing pipeline → Interference analysis: runs analysis (evidence: `rantanplan/cpp/src/passes/pipeline.cpp`)
- Preprocessing pipeline → Goal achievers: runs analysis (evidence: `rantanplan/cpp/src/passes/pipeline.cpp`)
- Preprocessing pipeline → Symmetry breaking: runs analysis (evidence: `README.md`)
- Relaxed planning graph → Action pruning: identifies removable actions (evidence: `README.md`)
- Action pruning → Planning problem: removes actions (evidence: `rantanplan/cpp/src/problem/problem.hpp`)
- Configuration → Strategy factory: selects strategy
- Preprocessing pipeline → Strategy factory: supplies analysis results
- Strategy factory → SMT encoding: creates encoder
- Strategy factory → Parallel semantics: creates semantics
- SMT encoding → Interference analysis: uses analysis (evidence: `rantanplan/cpp/src/encoders/grounded_encoder.cpp`)
- SMT encoding → Z3 solver: builds constraints (evidence: `README.md`)
- Parallel semantics → SMT encoding: defines step semantics (evidence: `README.md`)
- Strategy factory → Planner search: creates search planner
- Strategy factory → Custom propagators: creates propagator
- Planner search → SMT encoding: encodes horizons (evidence: `rantanplan/cpp/src/planners/pdla_planner.cpp`)
- Planner search → Z3 solver: solves constraints (evidence: `README.md`)
- Custom propagators → Z3 solver: extends solving (evidence: `README.md`)
- Strategy factory → PDLA search: selects PDLA search
- PDLA search → Goal achievers: uses achiever analysis
- Planner search → Plan result: produces plan (evidence: `README.md`)
- Python planner → Plan result: returns plan (evidence: `README.md`)
- Configuration → Runtime diagnostics: controls verbosity (evidence: `rantanplan/cpp/src/util/logger.hpp`)
- Planner search → Runtime diagnostics: reports progress (evidence: `README.md`)
