This repository accompanies the paper Symbolic World Models in Lean 4 for Reinforcement Learning accepted to the RLC 2025 Workshop on Programmatic Reinforcement Learning.
Notable files and folders are described below:
.
βββ common.py - Data structures for the evolutionary algorithm.
βββ gp.py - Implementation of the evolutionary / genetic algorithm.
βββ llm.py - The mutation function guided by a LLM.
βββ world_model.py - Wrapper around lean-server to enable Python interaction.
βββ mutation_prompt.txt - The mutation prompt listed in Appendix A in the paper.
βββ plot.py - Script for generating various plots.
βββ compute_series.py - Script for computing the time series shown in Figure 4 in the paper.
βββ eval.py - Script for evaluating a specific world model.
βββ requirements.txt
βββ lean-server - The Lean server for executing the synthesized world models.
βββ lakefile.toml
βββ lake-manifest.json
βββ lean-toolchain
βββ Server
β βββ Chess
β β βββ Common.lean
β β βββ Fitness.lean
β βββ Common.lean
β βββ OracleRules.lean
β βββ REPL.lean
β βββ Rules.lean
βββ Server.lean