ProbSMT is a Z3-based research prototype that injects distribution-aware sampling into SMT solving.
This prototype extends constant declarations with distribution annotations:
(declare-const x Real UD 0 1000)
(declare-const y Real GD 0 0.1)UD: uniform-style distribution parameters (center + spread in this implementation)GD: gaussian-style distribution parameters (mean + scale)
See runnable examples under test/ and test/smt/.
If you want to trace execution from input to sampling behavior:
- Parser accepts extended declarations:
src/parsers/smt2/smt2parser.cpp- distribution metadata is collected into a temporary
.extractfile.
- NLSAT solver loads those metadata:
src/nlsat/nlsat_solver.cpp
- Sampling and interval probability logic:
src/nlsat/nlsat_interval_set.hsrc/nlsat/nlsat_interval_set.cpp
This means distribution annotations are not standard SMT-LIB behavior and only work in this fork.
Prob_Circle.smt2 uses two probabilistic variables with additional geometric constraints:
(set-logic QF_NRA)
(declare-const x Real UD 0 1000)
(declare-const y Real UD 0 1000)
(assert (and (>= x -1) (<= x 1)))
(assert (and (>= y -1) (<= y 1)))
(check-sat)
(get-model)
(exit)cd test
../build/z3 Prob_Circle.smt2You should see sat and one model assignment.
The case-study goal is not only to "run commands", but to observe the two trends reported in the paper:
- Fix variance, shift mean -> sampled points shift in the feasible triangle.
- Fix mean, increase variance -> sampled points spread out while staying feasible.
Benchmark groups (in test/smt/) are aligned with these claims:
GD_Triangle_0_*: mean = 0GD_Triangle_5_*: mean = 0.5GD_Triangle_7_*: mean = -0.5- Suffix
_1,_2,_5correspond to increasing variance settings.
Run one configuration quickly (sanity check + log generation):
cd test
./case_study_run.sh GD_Triangle_0_1.smt2 200Run the full Gaussian case-study matrix:
cd test
./case_study_batch.sh 1000Inspect one generated log:
cd test
./case_study_report.sh GD_Triangle_0_1.smt2All logs are stored in test/res/.
If you use this project, please cite:
Fuqi Jia, Rui Han, Xutong Ma, Baoquan Cui, Minghao Liu, Pei Huang,
Feifei Ma, Jian Zhang.
PSMT: Satisfiability Modulo Theories Meets Probability Distribution.
ASE 2023.