Skip to content

Commit 5fe98a8

Browse files
committed
-added new tests
1 parent 47801ba commit 5fe98a8

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/org/sosy_lab/java_smt/basicimpl/parserInterpreter/Visitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ && isInteger(operators.get(1))) {
16041604
throw new ParserException(
16051605
"fp.isZero requires exactly one " + "FloatingPointFormula operand.");
16061606
}
1607-
case "fp.isInfinity":
1607+
case "fp.isInfinite":
16081608
if (operands.size() == 1) {
16091609
return Objects.requireNonNull(fpmgr).isInfinity((FloatingPointFormula) operands.get(0));
16101610
} else {

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,42 @@ public void testComplexFP()
351351
assertThat(proverEnvironment.isUnsat()).isFalse();
352352
}
353353

354+
@Test
355+
public void testComplexFP2()
356+
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {
357+
requireFloats();
358+
assume().that(solverToUse()).isNotEqualTo(Solvers.BITWUZLA);
359+
assume()
360+
.withMessage("For some reason very slow here")
361+
.that(solverToUse())
362+
.isNotEqualTo(Solvers.MATHSAT5);
363+
String x =
364+
"(declare-fun |c::main::$tmp::return_value_nondet_double$1@1!0&0#1|\n"
365+
+ " ()\n"
366+
+ " (_ FloatingPoint 11 53))\n"
367+
+ "(declare-fun |nondet$symex::nondet0| () (_ FloatingPoint 11 53))\n"
368+
+ "(declare-fun |c::main::main::1::x@1!0&0#1| () (_ FloatingPoint 11 53))\n"
369+
+ "(declare-fun |execution_statet::guard_exec@0!0| () Bool)\n"
370+
+ "(assert (= |nondet$symex::nondet0|\n"
371+
+ " |c::main::$tmp::return_value_nondet_double$1@1!0&0#1|))\n"
372+
+ "(assert (= |c::main::$tmp::return_value_nondet_double$1@1!0&0#1|\n"
373+
+ " |c::main::main::1::x@1!0&0#1|))\n"
374+
+ "(assert (let ((a!1 (not (=> true\n"
375+
+ " (=> |execution_statet::guard_exec@0!0|\n"
376+
+ " (fp.eq |c::main::main::1::x@1!0&0#1|\n"
377+
+ " |c::main::main::1::x@1!0&0#1|))))))\n"
378+
+ " a!1))";
379+
380+
BooleanFormula parsed = mgr.universalParseFromString(x);
381+
Generator.assembleConstraint(parsed);
382+
System.out.println(parsed + "\n-----------\n");
383+
System.out.println(Generator.getSMTLIB2String());
384+
ProverEnvironment proverEnvironment = context.newProverEnvironment();
385+
proverEnvironment.addConstraint(parsed);
386+
assertThat(proverEnvironment.isUnsat()).isFalse();
387+
}
388+
389+
354390
@Test
355391
public void testDeclareFloatingPointsWithBitVectors()
356392
throws IOException, SolverException, InterruptedException, InvalidConfigurationException {

0 commit comments

Comments
 (0)