3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 01:55:32 +00:00

Fixed AST translation functions in .NET and Java APIs. Fixes #1073.

This commit is contained in:
Christoph M. Wintersteiger 2017-06-14 13:24:54 +01:00
parent 2d1abf2795
commit d8a02bc040
12 changed files with 133 additions and 62 deletions

View file

@ -281,7 +281,7 @@ class JavaExample
}
void disprove(Context ctx, BoolExpr f, boolean useMBQI)
throws TestFailedException
throws TestFailedException
{
BoolExpr[] a = {};
disprove(ctx, f, useMBQI, a);
@ -2279,6 +2279,29 @@ class JavaExample
System.out.println(my);
}
public void translationExample() {
Context ctx1 = new Context();
Context ctx2 = new Context();
Sort s1 = ctx1.getIntSort();
Sort s2 = ctx2.getIntSort();
Sort s3 = s1.translate(ctx2);
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
System.out.println(s2.equals(s3));
System.out.println(s1.equals(s3));
Expr e1 = ctx1.mkIntConst("e1");
Expr e2 = ctx2.mkIntConst("e1");
Expr e3 = e1.translate(ctx2);
System.out.println(e1 == e2);
System.out.println(e1.equals(e2));
System.out.println(e2.equals(e3));
System.out.println(e1.equals(e3));
}
public static void main(String[] args)
{
JavaExample p = new JavaExample();
@ -2300,8 +2323,8 @@ class JavaExample
HashMap<String, String> cfg = new HashMap<String, String>();
cfg.put("model", "true");
Context ctx = new Context(cfg);
p.optimizeExample(ctx);
p.optimizeExample(ctx);
p.basicTests(ctx);
p.castingTest(ctx);
p.sudokuExample(ctx);
@ -2355,7 +2378,9 @@ class JavaExample
Context ctx = new Context(cfg);
p.quantifierExample3(ctx);
p.quantifierExample4(ctx);
}
}
p.translationExample();
Log.close();
if (Log.isOpen())