A Python tool to create deterministic transition systems from PDDL (Planning Domain Definition Language) files.
This parser converts classical planning problems described in PDDL format into deterministic transition systems represented as state transition graphs. It's particularly useful for:
- Converting PDDL planning problems to MDP representations
- Analyzing planning domain structures
- Generating transition systems for reinforcement learning
- Security and attack graph analysis (when combined with MulVAL)
- 🔄 PDDL Parsing: Parse domain and problem PDDL files
- 🗂️ Transition System: Generate deterministic transition systems
- 💾 Pickle Export: Save transition systems for later use
- 🔗 MulVAL Integration: Works with MulVAL attack graphs
- Language: Python 3.x (developed on Python 3.5+)
- Dependencies:
- pandas (for data manipulation)
- pickle (for serialization)
# Clone the repository
git clone https://github.com/leelening/pddl-parser.git
cd pddl-parser
# Install dependencies
pip install pandas# Generate transition system from PDDL files
python constructor.py ./examples/domain.pddl ./examples/problem.pddlThis creates a transitions.pickle file containing the deterministic transition system.
The tool expects two PDDL files:
- domain.pddl: Defines the planning domain (predicates, actions, effects)
- problem.pddl: Defines the specific problem instance (initial state, goal)
An example is provided in the examples/ directory:
examples/
├── domain.pddl # Example planning domain
└── problem.pddl # Example problem instance
These files can be generated using MulVAL-to-PDDL.
.
├── constructor.py # Main script to generate transition systems
├── examples/ # Example PDDL files
│ ├── domain.pddl
│ └── problem.pddl
└── transitions.pickle # Generated output (after running)
- Parse Domain: Extract actions, preconditions, and effects
- Parse Problem: Extract initial state and goal conditions
- Build State Space: Enumerate all possible states
- Generate Transitions: For each state-action pair, determine next state
- Export: Save as pickle file for later use
The output transitions.pickle contains a dictionary mapping:
- States → Available actions
- (State, Action) → Next state
This parser is designed to work with MulVAL-to-PDDL:
- Use MulVAL to generate attack graphs
- Convert to PDDL using MulVAL-to-PDDL
- Parse PDDL to transition system using this tool
- Use transition system for security analysis or planning
For testing and solving PDDL problems, use the online editor:
import pickle
# Load the transition system
with open('transitions.pickle', 'rb') as f:
transitions = pickle.load(f)
# Access transitions
# Format: transitions[(current_state, action)] = next_state- Python 3.x
- pandas
- pickle (standard library)
- Supports deterministic planning domains only
- State space must be finite and reasonably sized
- Action effects should be deterministic
MIT License - see LICENSE.md for details
- pddl-parser - Reference implementation
- MulVAL - For attack graph generation
- PDDL - Planning Domain Definition Language
Lening Li
- GitHub: @leelening