Automated P&ID Compliance Checking via LLM-Based Code Generation
DOI: 10.35490/EC3.2026.260
Abstract: Manual P&ID review is time-consuming, while existing image-based or hard-coded automation methods lack efficiency. We propose a hybrid framework that extracts P&ID data from DXF files and converts natural language rules into FOL-based Python verification modules. By restricting the LLM to code generation, the framework ensures deterministic rule verification via formal logic. Evaluated on four industrial drawings (140 objects, 587 checks), our approach achieves a 97.5% F1-score, compared to 55.9% for the image-based LLM baseline. This enables non-experts to automate design, conditional, and engineering rules, advancing QA in digital twin environments.
Keywords: compliance checking, Digital Twin, Large Language Model(LLM), P&ID, rule set