summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2026-05-27 11:38:26 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2026-06-06 10:51:46 +0200
commit1491804eaa33097d4edb6fd5be0bd95914a768c8 (patch)
tree56de0d916209ea7af66278cd57b699c2cde58148 /gnu
parent961d63665cf2aa5b7d333693163fe118bae8d370 (diff)
gnu: cvc5: Restore compatibility with packaged symfpu.
* gnu/packages/patches/cvc5-symfpu-1.2.0.patch: New patch. * gnu/local.mk dist_patch_DATA) Register it. * gnu/packages/maths.scm (cvc5)[patches]: Use it. Change-Id: I8571adf12a3c5d4b7a77b1ff60cb467841d749be
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/maths.scm4
-rw-r--r--gnu/packages/patches/cvc5-symfpu-1.2.0.patch129
3 files changed, 133 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index fe54c64aa11..244e847246b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1179,6 +1179,7 @@ dist_patch_DATA = \
1179 %D%/packages/patches/curlftpfs-fix-memory-leak.patch \ 1179 %D%/packages/patches/curlftpfs-fix-memory-leak.patch \
1180 %D%/packages/patches/curlftpfs-fix-no_verify_hostname.patch \ 1180 %D%/packages/patches/curlftpfs-fix-no_verify_hostname.patch \
1181 %D%/packages/patches/cursynth-wave-rand.patch \ 1181 %D%/packages/patches/cursynth-wave-rand.patch \
1182 %D%/packages/patches/cvc5-symfpu-1.2.0.patch \
1182 %D%/packages/patches/cvs-CVE-2017-12836.patch \ 1183 %D%/packages/patches/cvs-CVE-2017-12836.patch \
1183 %D%/packages/patches/cyrus-sasl-fix-time-h.patch \ 1184 %D%/packages/patches/cyrus-sasl-fix-time-h.patch \
1184 %D%/packages/patches/d-feet-drop-unused-meson-argument.patch \ 1185 %D%/packages/patches/d-feet-drop-unused-meson-argument.patch \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 36f63758c74..45c2b76d14a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -467,7 +467,9 @@ programming languages.")
467 (commit (string-append "cvc5-" version)))) 467 (commit (string-append "cvc5-" version))))
468 (file-name (git-file-name name version)) 468 (file-name (git-file-name name version))
469 (sha256 469 (sha256
470 (base32 "1xix197pyd45jakk10apam3bhl38nk14zjk0fzr9rj4knh10x5rx")))) 470 (base32 "1xix197pyd45jakk10apam3bhl38nk14zjk0fzr9rj4knh10x5rx"))
471 (patches
472 (search-patches "cvc5-symfpu-1.2.0.patch"))))
471 (build-system cmake-build-system) 473 (build-system cmake-build-system)
472 (arguments 474 (arguments
473 (list 475 (list
diff --git a/gnu/packages/patches/cvc5-symfpu-1.2.0.patch b/gnu/packages/patches/cvc5-symfpu-1.2.0.patch
new file mode 100644
index 00000000000..83c43d6d81c
--- /dev/null
+++ b/gnu/packages/patches/cvc5-symfpu-1.2.0.patch
@@ -0,0 +1,129 @@
1Makes CVC5 compatible with our packaged version of symfpu.
2
3Taken from https://github.com/cvc5/cvc5/commit/7bff291851c0debf099b431daf25e9a5f9751af0.
4
5diff --git a/COPYING b/COPYING
6index 8cdf9df1c..6faf5f48d 100644
7--- a/COPYING
8+++ b/COPYING
9@@ -65,7 +65,7 @@ this library does not affect the license terms of the cvc5 code.
10
11 The implementation of the floating point solver in cvc5 depends on symfpu
12 (https://github.com/martin-cs/symfpu) written by Martin Brain.
13-See https://raw.githubusercontent.com/martin-cs/symfpu/CVC4/LICENSE for
14+See https://raw.githubusercontent.com/martin-cs/symfpu/main/LICENSE for
15 copyright and licensing information.
16
17 When building with GCC, cvc5 links against the libgcc and libstdc++ libraries,
18diff --git a/INSTALL.rst b/INSTALL.rst
19index f0f41f3d8..10a88c14d 100644
20--- a/INSTALL.rst
21+++ b/INSTALL.rst
22@@ -180,7 +180,7 @@ versions; more recent versions should be compatible.
23 + module `pyparsing <https://pypi.org/project/pyparsing/>`_
24 - `GMP v6.3 (GNU Multi-Precision arithmetic library) <https://gmplib.org>`_
25 - `CaDiCaL >= 2.1.0 (SAT solver) <https://github.com/arminbiere/cadical>`_
26-- `SymFPU <https://github.com/martin-cs/symfpu/tree/CVC4>`_
27+- `SymFPU <https://github.com/martin-cs/symfpu/tree/main>`_
28
29 If ``--auto-download`` is given, the Python modules will be installed automatically in
30 a virtual environment if they are missing. To install the modules globally and skip
31@@ -205,7 +205,7 @@ automatically when ``--auto-download`` is given.
32 SymFPU (Support for the Theory of Floating Point Numbers)
33 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34
35-`SymFPU <https://github.com/martin-cs/symfpu/tree/CVC4>`_ is an implementation
36+`SymFPU <https://github.com/martin-cs/symfpu/tree/main>`_ is an implementation
37 of SMT-LIB/IEEE-754 floating-point operations in terms of bit-vector operations.
38 It is required for supporting the theory of floating-point numbers and can be
39 downloaded and built automatically.
40diff --git a/cmake/FindSymFPU.cmake b/cmake/FindSymFPU.cmake
41index 05a86e9ee..c95184d02 100644
42--- a/cmake/FindSymFPU.cmake
43+++ b/cmake/FindSymFPU.cmake
44@@ -29,13 +29,13 @@ if(NOT SymFPU_FOUND_SYSTEM)
45 include(ExternalProject)
46 include(deps-helper)
47
48- set(SymFPU_COMMIT "227a7246b8ce513b393cc2645d6d65d3490ea1de")
49- set(SymFPU_CHECKSUM "ff22e37dbc133120ada5760878974811737bec65b12a8883f92b1ed9e3f96e99")
50+ set(SymFPU_COMMIT "40bdec00e99f8ea1b96c3dac0a05eed11c541639")
51+ set(SymFPU_CHECKSUM "ba17877fbf0c851e113fddaab225152f1c0b2044429396b56b2f113832e36ce5")
52
53 ExternalProject_Add(
54 SymFPU-EP
55 ${COMMON_EP_CONFIG}
56- URL https://github.com/cvc5/symfpu/archive/${SymFPU_COMMIT}.tar.gz
57+ URL https://github.com/martin-cs/symfpu/archive/${SymFPU_COMMIT}.tar.gz
58 URL_HASH SHA256=${SymFPU_CHECKSUM}
59 CONFIGURE_COMMAND ""
60 BUILD_COMMAND ""
61diff --git a/src/base/configuration.cpp b/src/base/configuration.cpp
62index 50715e53d..300cffcc6 100644
63--- a/src/base/configuration.cpp
64+++ b/src/base/configuration.cpp
65@@ -110,7 +110,7 @@ std::string Configuration::copyright()
66 }
67
68 ss << " SymFPU - The Symbolic Floating Point Unit\n"
69- << " See https://github.com/martin-cs/symfpu/tree/CVC4 for copyright "
70+ << " See https://github.com/martin-cs/symfpu/tree/main for copyright "
71 << "information.\n\n";
72
73 if (isBuiltWithGmp() || isBuiltWithPoly())
74diff --git a/test/regress/cli/CMakeLists.txt b/test/regress/cli/CMakeLists.txt
75index 458b97ce0..8dc32a6ea 100644
76--- a/test/regress/cli/CMakeLists.txt
77+++ b/test/regress/cli/CMakeLists.txt
78@@ -958,10 +958,12 @@ set(regress_0_tests
79 regress0/fp/issue6164.smt2
80 regress0/fp/issue7002.smt2
81 regress0/fp/issue7569.smt2
82+ regress0/fp/issue7858-1.smt2
83 regress0/fp/issue9078-1.smt2
84 regress0/fp/issue9078-2.smt2
85 regress0/fp/issue9078-3.smt2
86 regress0/fp/issue9505.smt2
87+ regress0/fp/issue9697.smt2
88 regress0/fp/issue9854.smt2
89 regress0/fp/issue9858.smt2
90 regress0/fp/issue9864.smt2
91diff --git a/test/regress/cli/regress0/fp/issue7858-1.smt2 b/test/regress/cli/regress0/fp/issue7858-1.smt2
92new file mode 100644
93index 000000000..7f96a55be
94--- /dev/null
95+++ b/test/regress/cli/regress0/fp/issue7858-1.smt2
96@@ -0,0 +1,13 @@
97+;; An issue with the rounder in SymFPU not handling some exotic formats
98+;; Fixed in SymFPU 1.2.0
99+; COMMAND-LINE: --fp-exp
100+(set-info :smt-lib-version 2.6)
101+(set-logic QF_FP)
102+(set-info :source |https://github.com/cvc5/cvc5/issues/7858|)
103+(set-option :produce-models true)
104+(set-option :check-models true)
105+(set-info :status sat)
106+
107+(declare-fun v () Float64)
108+(assert (= ((_ to_fp 9 53) RNE v) (fp (_ bv0 1) (_ bv0 9) (_ bv0 52))))
109+(check-sat)
110diff --git a/test/regress/cli/regress0/fp/issue9697.smt2 b/test/regress/cli/regress0/fp/issue9697.smt2
111new file mode 100644
112index 000000000..222f6108c
113--- /dev/null
114+++ b/test/regress/cli/regress0/fp/issue9697.smt2
115@@ -0,0 +1,14 @@
116+;; Originally a seg fault cause by a zero width vector, fixed by SymFPU 1.2.0
117+
118+(set-info :smt-lib-version 2.6)
119+(set-logic QF_BVFP)
120+(set-info :source |https://github.com/cvc5/cvc5/issues/9697|)
121+(set-option :produce-models true)
122+(set-option :check-models true)
123+(set-info :status sat)
124+
125+(declare-const c5 (_ BitVec 1))
126+(declare-const c35 (_ FloatingPoint 8 24))
127+(declare-const c72 RoundingMode)
128+(assert (not (= c5 ((_ fp.to_sbv 1) c72 c35))))
129+(check-sat)