VeriEQL is an equivalence verifier for complex SQL queries with integrity constraints using bounded model checking, and reachs the S.O.T.A. performance over three benchmarks.
A SQL pair refuted by VeriEQL.
Python 3.10 or later. (Python 3.11 is recommended.)
To install dependencies, run:
pip install -r requirements.txtand test your environment with the following command:
python -m test.test_envReplacing z3 python scripts with files in your environments could save 10%~20% time in formulation.
If you use conda, please refer to the following commands.
sudo mv ./z3py_libs/*.py ~/anaconda3/envs/z3py311/lib/python3.11/site-packages/z3/- Try a toy example
python -m __main__- Check massive SQL pairs (in parallel) with a 10-min timeout/a max bound size.
# 10-min timeout
python -m parallel.run_with_max_timeout -f benchmarks/leetcode/leetcode.jsonlines -t 600 -o benchmarks/leetcode/leetcode.out
# 10 bound size
python -m parallel.run_with_max_bound -f benchmarks/leetcode/leetcode.jsonlines -s 10 -o benchmarks/leetcode/leetcode.out- List semantic (only works for
OrderBy) - Bag semantics
-
Calcite: 397 pairs
-
Literature: 64 pairs
-
LeetCode: 23,224 pairs
- Bounded Model Checking
- Cosette
- Qex
- Testing
- DataFiller
- XData
- Fully Prover
- SPES
- HoTTSQL
Experimental results on the ALL benchmarks.
| Model | Unsupported | Checked / Not-refuted / Verified | Refuted / Not-verified |
|---|---|---|---|
| VeriEQL(ours) | 5636 | 15200 | 3619 |
| Cossete | 24399 | 23 | 33 |
| Qex | 24399 | 29 | 27 |
| DataFiller | 10722 | 13599 | 134 |
| XData | 19451 | 2964 | 1 |
| SPES | 24169 | 60 | 226 |
| HoTTSQL | 24434 | 21 | 0 |
The results obtained in 03/27/2023 are available here.
Experimental results on the ALL benchmarks.
| Model | Genuine | All |
|---|---|---|
| VeriEQL(ours) | 3617 | 3619 |
| Cossete | 17 | 33 |
| Qex | 14 | 27 |
| DataFiller | 325 | 325 |
| XData | 1 | 1 |
For more details, please read our paper.
Auto dump formulas of a SQL pair in test/test.py for manual inspection.
When instantiate the Environment class, please
- set
verbose=Trueto record SQL query equivalence formulas, and - set
out_file="YourFilePath"as the automated script path.
- install MySQL
- create MySQL users for parallel checking by create_mysql_users.py
- check counterexamples by counterexample_checker.py
If you use this tool in your research, please cite this project as follows,
@article{DBLP:journals/pacmpl/HeZWW24,
author = {Yang He and
Pinhan Zhao and
Xinyu Wang and
Yuepeng Wang},
title = {VeriEQL: Bounded Equivalence Verification for Complex {SQL} Queries
with Integrity Constraints},
journal = {Proc. {ACM} Program. Lang.},
volume = {8},
number = {{OOPSLA1}},
pages = {1071--1099},
year = {2024},
url = {https://doi.org/10.1145/3649849},
doi = {10.1145/3649849}
}


