Skip to content

Commit 22b8d1f

Browse files
committed
- removed all define-fun tests, because they didn't even test define-fun and JavaSMT does not support it.
1 parent 739dd7b commit 22b8d1f

File tree

1 file changed

+0
-158
lines changed

1 file changed

+0
-158
lines changed

src/org/sosy_lab/java_smt/test/SMTLIB2ParserInterpreterTest.java

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,164 +3145,6 @@ public void testExceptionPush()
31453145

31463146
/*PARSE MODEL TESTS*/
31473147

3148-
@Test
3149-
public void testDefineFunctionBoolEmptyInput()
3150-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3151-
3152-
String x = "(define-fun bla () Bool true)\n";
3153-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3154-
3155-
BooleanFormula constraint = bmgr.makeTrue();
3156-
3157-
BooleanFormula expectedResult = constraint;
3158-
3159-
assertThat(actualResult).isEqualTo(expectedResult);
3160-
}
3161-
3162-
@Test
3163-
public void testDefineFunctionBoolWithInput()
3164-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3165-
requireBooleanUFs();
3166-
3167-
String x = "(define-fun bla ((x Bool)) Bool (= x true))\n";
3168-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3169-
3170-
BooleanFormula constraint = bmgr.makeTrue();
3171-
3172-
BooleanFormula expectedResult = constraint;
3173-
3174-
assertThat(actualResult).isEqualTo(expectedResult);
3175-
}
3176-
3177-
@Test
3178-
public void testDefineFunctionInt()
3179-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3180-
requireIntegers();
3181-
3182-
String x = "(define-fun bla () Int (- 3 4))\n" + "(assert (= bla bla))\n";
3183-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3184-
IntegerFormula drei = imgr.makeNumber(3);
3185-
IntegerFormula vier = imgr.makeNumber(4);
3186-
IntegerFormula sub = imgr.subtract(drei, vier);
3187-
BooleanFormula constraint = imgr.equal(sub, sub);
3188-
3189-
BooleanFormula expectedResult = constraint;
3190-
3191-
assertThat(actualResult).isEqualTo(expectedResult);
3192-
}
3193-
3194-
@Test
3195-
public void testDefineFunctionIntWithInput()
3196-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3197-
requireIntegers();
3198-
3199-
String x = "(define-fun bla ((x Int)) Int (- 3 x))\n" + "(assert (= bla bla))\n";
3200-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3201-
IntegerFormula drei = imgr.makeNumber(3);
3202-
IntegerFormula xVar = imgr.makeVariable("x");
3203-
IntegerFormula sub = imgr.subtract(drei, xVar);
3204-
BooleanFormula constraint = imgr.equal(sub, sub);
3205-
3206-
BooleanFormula expectedResult = constraint;
3207-
3208-
assertThat(actualResult).isEqualTo(expectedResult);
3209-
}
3210-
3211-
@Test
3212-
public void testDefineFunctionReal()
3213-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3214-
requireRationals();
3215-
assume().that(solverToUse()).isNotEqualTo(Solvers.OPENSMT);
3216-
3217-
String x = "(define-fun bla () Real (- 3 4.0))\n" + "(assert (= bla bla))\n";
3218-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3219-
IntegerFormula drei = imgr.makeNumber(3);
3220-
RationalFormula vier = Objects.requireNonNull(rmgr).makeNumber(4.0);
3221-
RationalFormula sub = rmgr.subtract(drei, vier);
3222-
BooleanFormula constraint = rmgr.equal(sub, sub);
3223-
3224-
BooleanFormula expectedResult = constraint;
3225-
3226-
assertThat(actualResult).isEqualTo(expectedResult);
3227-
}
3228-
3229-
@Test
3230-
public void testDefineFunctionRealWithInput()
3231-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3232-
requireRationals();
3233-
assume().that(solverToUse()).isNotEqualTo(Solvers.OPENSMT);
3234-
3235-
String x = "(define-fun bla ((x Real)) Real (- 3 x))\n" + "(assert (= bla bla))\n";
3236-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3237-
IntegerFormula drei = imgr.makeNumber(3);
3238-
RationalFormula xVar = Objects.requireNonNull(rmgr).makeVariable("x");
3239-
RationalFormula sub = rmgr.subtract(drei, xVar);
3240-
BooleanFormula constraint = rmgr.equal(sub, sub);
3241-
3242-
BooleanFormula expectedResult = constraint;
3243-
3244-
assertThat(actualResult).isEqualTo(expectedResult);
3245-
}
3246-
3247-
@Test
3248-
public void testDefineFunctionBitVec()
3249-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3250-
requireBitvectors();
3251-
3252-
String x =
3253-
"(define-fun bla () (_ BitVec 5) (bvsub #b10000 #b00001))\n" + "(assert (= bla bla))\n";
3254-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3255-
BitvectorFormula first = Objects.requireNonNull(bvmgr).makeBitvector(5, 16);
3256-
BitvectorFormula second = bvmgr.makeBitvector(5, 1);
3257-
BitvectorFormula sub = bvmgr.subtract(first, second);
3258-
BooleanFormula constraint = bvmgr.equal(sub, sub);
3259-
3260-
BooleanFormula expectedResult = constraint;
3261-
3262-
assertThat(actualResult).isEqualTo(expectedResult);
3263-
}
3264-
3265-
@Test
3266-
public void testDefineFunctionBitVecWithInput()
3267-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3268-
requireBitvectors();
3269-
3270-
String x =
3271-
"(define-fun bla ((x (_ BitVec 5))) (_ BitVec 5) (bvsub #b10000 x))\n"
3272-
+ "(assert (= bla bla))\n";
3273-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3274-
BitvectorFormula first = Objects.requireNonNull(bvmgr).makeBitvector(5, 16);
3275-
BitvectorFormula second = bvmgr.makeVariable(5, "x");
3276-
BitvectorFormula sub = bvmgr.subtract(first, second);
3277-
BooleanFormula constraint = bvmgr.equal(sub, sub);
3278-
3279-
BooleanFormula expectedResult = constraint;
3280-
3281-
assertThat(actualResult).isEqualTo(expectedResult);
3282-
}
3283-
3284-
@Test
3285-
public void testDefineFunctionArray()
3286-
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
3287-
requireIntegers();
3288-
requireArrays();
3289-
3290-
String x =
3291-
"(declare-const a (Array Int Int))\n"
3292-
+ "(define-fun bla () (Array Int Int) a)\n"
3293-
+ "(assert (= a a))\n";
3294-
BooleanFormula actualResult = mgr.universalParseFromString(x);
3295-
3296-
ArrayFormula<IntegerFormula, IntegerFormula> a =
3297-
Objects.requireNonNull(amgr)
3298-
.makeArray("a", FormulaType.IntegerType, FormulaType.IntegerType);
3299-
BooleanFormula constraint = amgr.equivalence(a, a);
3300-
BooleanFormula expectedResult = constraint;
3301-
3302-
assertThat(actualResult).isEqualTo(expectedResult);
3303-
}
3304-
3305-
/* OTHER FUNCTION TESTS*/
33063148

33073149
@Test
33083150
public void testLetExpression()

0 commit comments

Comments
 (0)