CoqStoq
收藏资源简介:
CoqStoq是由加州大学圣地亚哥分校等机构创建的一个用于Coq定理证明的大型数据集,包含2,226个开源Coq项目中的196,929个定理和2,225,515个证明步骤。数据集从GitHub上通过CoqPyt Python客户端挖掘而来,分为训练数据和评估基准。CoqStoq的创建旨在支持自动化软件验证中的定理证明,特别是通过检索增强生成(RAG)技术来提高证明效率。该数据集的应用领域主要集中在形式化验证和软件可靠性方面,旨在解决自动化证明生成中的效率和准确性问题。
CoqStoq is a large-scale dataset for Coq theorem proving, created by the University of California, San Diego and other institutions. It contains 196,929 theorems and 2,225,515 proof steps across 2,226 open-source Coq projects. The dataset was mined from GitHub via the CoqPyt Python client, and is split into training data and evaluation benchmarks. CoqStoq was developed to support theorem proving in automated software verification, with the specific goal of enhancing proof efficiency through retrieval-augmented generation (RAG) techniques. This dataset is primarily applied in the fields of formal verification and software reliability, aiming to address the efficiency and accuracy issues in automated proof generation.
CoqStoq 数据集
概述
CoqStoq 是一个用于评估 Coq 定理证明合成工具的基准数据集。该数据集包含了用于测试证明合成工具的定理和相关环境。
数据集结构
- data_points: 包含 DatasetFile 对象,用于指示在合成证明时可用的前提和证明。每个
.v文件在repos文件夹中都有一个对应的文件。 - repos: 包含所有包含定理的仓库,Rango 将在这些定理上进行评估。
数据集创建示例
假设要创建一个名为 "coqstoq-test" 的数据集,包含 CoqStoq 测试集中的定理,步骤如下:
-
创建目录:
mkdir coqstoq-test -
创建符号链接:
ln -s CoqStoq/test-repos coqstoq-test/repos -
运行脚本生成数据点:
rm -rf ~/.cache/coqpyt_cache python3 scripts/create_coqstoq_data_points CoqStoq test coqstoq-test/data_points coqstoq-test/coqstoq-test-sentences.db
- "CoqStoq" 是 CoqStoq 仓库的路径。
- "test" 是要创建数据的 CoqStoq 分割。
- "coqstoq-test/data_points" 是保存数据点的位置。
- "coqstoq-test-sentences.db" 是保存 sentencedb 的位置(包含文件之间的共享前提)。
数据集评估
可以使用以下脚本在数据集上运行 Rango 进行评估:
python3 src/evaluation/eval.py --conf_loc=example_confs/eval/coqstoq-test.yaml --slurm_conf=example_confs/slurm/gpu8.yaml
python3 src/evaluation/eval.py --conf_loc=example_confs/eval/coqstoq-test.yaml --n_workers=1
- 前者需要访问 slurm 集群。
- 后者将在一个工作线程上运行评估。
数据集处理与训练
数据处理
确保在项目的 raw-data/coq-dataset/data_points 子目录中有 CoqStoq 的 data_points 文件。然后,可以通过运行以下命令预处理数据集:
bash slurm/example-jobs/create_dataset.sh
数据集整合
在训练模型之前,必须将处理后的数据整合到 sqlite 数据库中。可以使用以下命令整合数据集:
python3 src/data_management/consolidate.py <split location> <dataset location> <new dataset location>
模型训练
可以通过运行以下命令训练模型:
sbatch slurm/example-jobs/train_decoder.sh

- 1Rango: Adaptive Retrieval-Augmented Proving for Automated Software Verification加州大学圣地亚哥分校 · 2024年



