Search in sources :

Example 1 with ComputeInterpolantResult

use of com.microsoft.z3.InterpolationContext.ComputeInterpolantResult in project bmoth by hhu-stups.

the class Z3InterpolationTest method testSimpleInterpolation.

@Test
public void testSimpleInterpolation() {
    IntExpr x = ctx.mkIntConst("x");
    BoolExpr xGtZero = ctx.mkGt(x, ctx.mkInt(0));
    BoolExpr xLtZero = ctx.mkLt(x, ctx.mkInt(0));
    BoolExpr xGtZeroInterpolant = ctx.MkInterpolant(xGtZero);
    s.add(xGtZero);
    s.add(xLtZero);
    Status check = s.check();
    assertEquals(Status.UNSATISFIABLE, check);
    ComputeInterpolantResult ir = ctx.ComputeInterpolant(ctx.mkAnd(xGtZeroInterpolant, xLtZero), ctx.mkParams());
    assertEquals(1, ir.interp.length);
    assertEquals("(not (<= x 0))", ir.interp[0].toString());
}
Also used : ComputeInterpolantResult(com.microsoft.z3.InterpolationContext.ComputeInterpolantResult) Test(org.junit.Test)

Aggregations

ComputeInterpolantResult (com.microsoft.z3.InterpolationContext.ComputeInterpolantResult)1 Test (org.junit.Test)1