2022-04-05 13:38:57 -07:00
|
|
|
###############################################################################
|
2021-11-16 20:56:37 +02:00
|
|
|
# Top contributors (to current version):
|
2025-01-23 09:54:20 -08:00
|
|
|
# Aina Niemetz, Alex Ozdemir, Yoni Zohar
|
2021-11-16 20:56:37 +02:00
|
|
|
#
|
|
|
|
|
# This file is part of the cvc5 project.
|
|
|
|
|
#
|
2025-01-23 09:54:20 -08:00
|
|
|
# Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
|
2021-11-16 20:56:37 +02:00
|
|
|
# in the top-level source directory and their institutional affiliations.
|
|
|
|
|
# All rights reserved. See the file COPYING in the top-level source
|
|
|
|
|
# directory for licensing information.
|
2022-04-05 13:38:57 -07:00
|
|
|
# #############################################################################
|
2021-11-16 20:56:37 +02:00
|
|
|
#
|
|
|
|
|
# Test for issue #4889
|
|
|
|
|
##
|
|
|
|
|
|
2022-02-02 15:45:42 -08:00
|
|
|
import cvc5
|
|
|
|
|
from cvc5 import Kind
|
2021-11-16 20:56:37 +02:00
|
|
|
|
2024-03-14 14:34:58 -07:00
|
|
|
tm = cvc5.TermManager()
|
|
|
|
|
slv = cvc5.Solver(tm)
|
|
|
|
|
sort_int = tm.getIntegerSort()
|
|
|
|
|
sort_array = tm.mkArraySort(sort_int, sort_int)
|
|
|
|
|
sort_fp128 = tm.mkFloatingPointSort(15, 113)
|
|
|
|
|
sort_fp32 = tm.mkFloatingPointSort(8, 24)
|
|
|
|
|
sort_bool = tm.getBooleanSort()
|
|
|
|
|
const0 = tm.mkConst(sort_fp32, "_c0")
|
|
|
|
|
const1 = tm.mkConst(sort_fp32, "_c2")
|
|
|
|
|
const2 = tm.mkConst(sort_bool, "_c4")
|
|
|
|
|
ite = tm.mkTerm(Kind.ITE, const2, const1, const0)
|
|
|
|
|
rem = tm.mkTerm(Kind.FLOATINGPOINT_REM, ite, const1)
|
|
|
|
|
isnan = tm.mkTerm(Kind.FLOATINGPOINT_IS_NAN, rem)
|
2021-11-16 20:56:37 +02:00
|
|
|
slv.checkSatAssuming(isnan)
|