This is the main source code repository of RPL (Rust Pattern Language). It contains the toolchain and documentation of RPL.
RPL is a domain-specific language for modeling Rust code patterns.
The toolchain of RPL, which is a custom configuration of Rust compiler, enables accurate identification of code instances that demonstrate semantic equivalence to existing patterns.
- Model Rust code patterns based on MIR, just like writing real Rust code.✨
- Enable programmatic semantic equivalence checks based on CFG and DDG with graph matching algorithms. 🔍
- Support pattern customization to simplify modeling and predicate integration to ensure precise matching. 🛠️
- Provide clear, user-friendly error messages and actionable suggestions. 💡
-
Clone the repository and enter the directory:
git clone https://github.com/stuuupidcat/RPL.git && cd RPL
-
Install RPL as a cargo subcommand:
cargo install --path .
-
Run RPL analysis on your Rust project:
cargo +nightly-2025-02-14 rpl
(using built-in RPL pattern definitions based on inline MIR)RUSTFLAGS="-Zinline-mir=false" cargo +nightly-2025-02-14 rpl
(using built-in RPL pattern definitions based on MIR)
Just like using
cargo clippy
to check your Rust code.
See this website for the language reference of RPL (Work in progress).
Feel free to open an issue or contact us via email (stuuupidcat@163.com) if you have any questions.
See this document for contribution-related instructions.
This project is licensed under the GNU General Public License v3.0.