| 1 |
############################################################################### |
| 2 |
# Top contributors (to current version): |
| 3 |
# Aina Niemetz, Alex Ozdemir, Yoni Zohar |
| 4 |
# |
| 5 |
# This file is part of the cvc5 project. |
| 6 |
# |
| 7 |
# Copyright (c) 2009-2025 by the authors listed in the file AUTHORS |
| 8 |
# in the top-level source directory and their institutional affiliations. |
| 9 |
# All rights reserved. See the file COPYING in the top-level source |
| 10 |
# directory for licensing information. |
| 11 |
# ############################################################################# |
| 12 |
# |
| 13 |
# Test for issue #4889 |
| 14 |
## |
| 15 |
|
| 16 |
import cvc5 |
| 17 |
from cvc5 import Kind |
| 18 |
|
| 19 |
tm = cvc5.TermManager() |
| 20 |
slv = cvc5.Solver(tm) |
| 21 |
sort_int = tm.getIntegerSort() |
| 22 |
sort_array = tm.mkArraySort(sort_int, sort_int) |
| 23 |
sort_fp128 = tm.mkFloatingPointSort(15, 113) |
| 24 |
sort_fp32 = tm.mkFloatingPointSort(8, 24) |
| 25 |
sort_bool = tm.getBooleanSort() |
| 26 |
const0 = tm.mkConst(sort_fp32, "_c0") |
| 27 |
const1 = tm.mkConst(sort_fp32, "_c2") |
| 28 |
const2 = tm.mkConst(sort_bool, "_c4") |
| 29 |
ite = tm.mkTerm(Kind.ITE, const2, const1, const0) |
| 30 |
rem = tm.mkTerm(Kind.FLOATINGPOINT_REM, ite, const1) |
| 31 |
isnan = tm.mkTerm(Kind.FLOATINGPOINT_IS_NAN, rem) |
| 32 |
slv.checkSatAssuming(isnan) |