https://github.com/florianschanda/fp_test_generator
Random floating-point testcase generator for SMT-LIB
https://github.com/florianschanda/fp_test_generator
floating-point ieee-754 smt-lib
Last synced: 6 months ago
JSON representation
Random floating-point testcase generator for SMT-LIB
- Host: GitHub
- URL: https://github.com/florianschanda/fp_test_generator
- Owner: florianschanda
- License: gpl-3.0
- Created: 2019-03-27T14:53:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T08:13:12.000Z (over 5 years ago)
- Last Synced: 2025-02-06T04:09:44.140Z (8 months ago)
- Topics: floating-point, ieee-754, smt-lib
- Language: Python
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FP test generator
Random floating-point testcase generator for SMT-LIB. This was
originally part of [PyMPF](https://github.com/florianschanda/PyMPF),
but it is actually cleaner to separate out the library part from the
test-case generator.This program creates small benchmarks for SMT-LIB that involve the
[Floating Point](http://smtlib.cs.uiowa.edu/theories-FloatingPoint.shtml)
theory. The benchmarks created focus on checking for correct behaviour
as opposed to performance. This was part of the verification argument of our
[TACAS'2019](https://link.springer.com/chapter/10.1007/978-3-030-17462-0_5)
paper.Since running this tool is quite slow, the generated benchmarks are
available in [here](https://github.com/florianschanda/fptg_testsuite)
as a convenience.We used this to find soundness and completness bugs in *all* floating
point solvers we tried (that could understand SMT-LIB). For the FP
solvers that do not support SMT-LIB we're pretty sure we could also
find bugs but honestly we can't be bothered to support different
formats other than SMT-LIB. We have even found bugs in gcc and
[glibc](https://sourceware.org/bugzilla/show_bug.cgi?id=26045) using
this approach.To make sure the expected status (SAT/UNSAT) of each test is correct
we are independently checking against as many of the following as is
possible:* PyMPF (this is the main test oracle and the only library that
supports everything)* MPFR (does not support RNA, except for roundToIntegral)
* Your FPU (probably only supports float32 and float64, and does not
support RNA except for roundToIntegral)Note that the tests generated may rely on unspecified behaviour
(following a strict reading of the FP theory): for example tests that
involve min/max for +0 and -0 may rely on min/max being returning
*either* of the two. Similarly for conversions to bitvectors that are
out of range.## Dependencies
This project requires the following Python3 packages:
* [PyMPF](https://pypi.org/project/pympf) (the main test oracle)
* [gmpy2](https://pypi.org/project/gmpy2) (to interface with MPFR)This project requires the following system dependencies:
* gcc (to build tiny C programs)To install these on Debian based systems do as root:
```
$ apt-get install python3-pip libmpc-dev libmpfr-dev
```And then:
```
$ pip3 install PyMPF gmpy2
```## Work in progress
This is a complete re-write of the original tool in Python3. It does
not yet work completely. If you want the original tool, look at the
python2 branch of PyMPF.# License and Copyright
Everything in this repository is licensed under the GNU GPL v3. The
sole copyright owner is Florian Schanda.