Septemberember/PCaE: Program Comprehension and Evolution via Large Language Models Using Automated Testing-Based Formal Verification
Authors/Creators
Description
Official implementation of PCaE
Introduction
📝 Background
Program comprehension and evolution are critical for software maintenance, yet ensuring functional correctness remains a challenge. Current methods face two major bottlenecks:
- Manual Effort: Traditional formal verification relies on loop invariants, which are costly to derive and difficult for LLMs to automate.
- Verification Gap: Standard testing can detect bugs but cannot formally prove that a program satisfies its specification across all paths.
PCaE bridges this gap by introducing:
- FSF (Functional Scenario Form): A concise specification that focuses on input-output relationships rather than complex internal loop logic.
- TBFV (Testing-Based Formal Verification): A method that integrates Hoare logic with testing to provide formal proofs without requiring loop invariants.
This framework allows LLMs to accurately explain code (comprehension) and update implementation (evolution) while maintaining rigorous correctness.
🚀 Quick Start
1. Download & Extract
Download PCaE-release.zip from Releases. Ensure the directory structure is as follows:
.
├── PCaE-1.0.jar # Executable Fat JAR
└── resources/ # Resources folder (Must be in the same directory as the JAR)
2. Setup Environment
- Java 17+: Ensure Java 17 or higher is installed. Verify by running
java -version. - Python 3.9: Required for the Z3 SMT solver. Install the dependency via:
pip install z3-solver
3. Configure API Key
Navigate to resources/config/ and edit your preferred model configuration file (e.g., gpt-5.2.txt):
[name]=openai/gpt-5.2
[url]=https://openrouter.ai/api/v1/chat/completions
[apikey]=your_real_openrouter_key_here
[!TIP] Formatting Matters: Ensure there are no spaces around the
=sign in the config file. Also, keep your[apikey]secure and never commit it to a public repository.
4. Execution
Run the following command in your terminal from the project root:
Windows / Linux / macOS:
java -cp PCaE-1.0.jar org.pcae.verification.FSFGenerator --inputDir resources/dataset --model gpt-5.2 --maxRounds 3 --experimentName Demo_Run
5. Check Results
All outputs will be generated in a folder named Demo_Run.
- FSF files: Functional specifications (Functional Scenario Forms) generated by the LLM.
- Verification Logs: Detailed TBFV proofs and consistency checks ensuring the code matches the FSF.
💻 Development & IDE Setup
If you prefer to run or modify the code using IntelliJ IDEA:
1. Project Initialization
- Open the
PCaEfolder as a Maven project. - Maven will automatically resolve all dependencies defined in the
pom.xml.
2. Configure Run Arguments
To pass parameters to the FSFGenerator:
- Navigate to
src/main/java/org/pcae/verification/FSFGenerator.java. - Right-click and select Modify Run Configuration....
- In the Program arguments box, enter your desired flags:
--inputDir resources/dataset --model gpt-5.2 --maxRounds 3 --experimentName IDE_Test
3. Build from Source (Optional)
If you have modified the source code and want to package your own executable JAR:
mvn clean package -DskipTests
Files
Septemberember/PCaE-v1.1.zip
Files
(39.2 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:30e54968c4d375f2af89687bb492ebd5
|
39.2 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/Septemberember/PCaE/tree/v1.1 (URL)
Software
- Repository URL
- https://github.com/Septemberember/PCaE