@@ -5,11 +5,6 @@ import org.scalatest.funsuite.AnyFunSuite
5
5
import smtlib .trees .Commands ._
6
6
import smtlib .trees .CommandsResponses ._
7
7
import smtlib .trees .Terms ._
8
- import smtlib .theories .FloatingPoint .FloatingPointSort
9
- import smtlib .theories .FixedSizeBitVectors .BitVectorSort
10
- import smtlib .trees .TreesOps
11
- import smtlib .trees .Tree
12
- import smtlib .theories .FixedSizeBitVectors
13
8
14
9
/** Checks that formula build with theories module are correctly handled by solvers */
15
10
class TheoriesBuilderTests extends AnyFunSuite with TestHelpers {
@@ -62,43 +57,8 @@ class TheoriesBuilderTests extends AnyFunSuite with TestHelpers {
62
57
ignore(cvc5Test) {}
63
58
}
64
59
65
- /**
66
- * Is test in the fragment supported by bitwuzla?
67
- *
68
- * May not contain ints, reals, arrays, ADTs
69
- *
70
- */
71
- def testIsBitwuzlaCompatible : Boolean =
72
- def isCompat (term : Term ): Boolean =
73
- def violatingTerm (term : Tree , children : Seq [Boolean ]): Boolean = {
74
- import smtlib .theories .*
75
- term match
76
- case FixedSizeBitVectors .BitVectorConstant (_, _) => false // internally contains IntNumeral, but in a valid place
77
- case Ints .NumeralLit (_) => true
78
- case Reals .DecimalLit (_) => true
79
- case FixedSizeBitVectors .Int2BV (_, _) => true
80
- case FixedSizeBitVectors .BV2Nat (_) => true
81
- // this is enough to rule out the current problematic tests,
82
- // but may need refinement
83
- case _ => children.contains(true )
84
- }
85
- ! TreesOps .fold(violatingTerm)(term)
86
-
87
- def compatibleCommand (cmd : Command ): Boolean =
88
- cmd match
89
- case DeclareFun (_, paramSorts, sort) => (sort +: paramSorts).forall {
90
- case BitVectorSort (_) => true
91
- case FloatingPointSort (_, _) => true
92
- case _ => false
93
- }
94
- case DeclareSort (_, _) => false
95
- case DeclareDatatypes (_) => false
96
- case Assert (term) => isCompat(term)
97
- case _ => true // may need refinement
98
- cmds.forall(compatibleCommand) && (isCompat(formula))
99
-
100
60
val bitwuzlaTest = prefix + " : with Bitwuzla"
101
- if (isBitwuzlaAvailable && testIsBitwuzlaCompatible) {
61
+ if (isBitwuzlaAvailable && testIsBitwuzlaCompatible(cmds, formula) ) {
102
62
test(bitwuzlaTest) {
103
63
runAndCheck(getBitwuzlaInterpreter)
104
64
}
0 commit comments