mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45:51 +00:00
Fixed AST translation functions in .NET and Java APIs. Fixes #1073.
This commit is contained in:
parent
2d1abf2795
commit
d8a02bc040
12 changed files with 133 additions and 62 deletions
|
@ -2152,6 +2152,31 @@ namespace test_mapi
|
|||
Console.WriteLine("OK, model: {0}", s.Model.ToString());
|
||||
}
|
||||
|
||||
public static void TranslationExample()
|
||||
{
|
||||
Context ctx1 = new Context();
|
||||
Context ctx2 = new Context();
|
||||
|
||||
Sort s1 = ctx1.IntSort;
|
||||
Sort s2 = ctx2.IntSort;
|
||||
Sort s3 = s1.Translate(ctx2);
|
||||
|
||||
Console.WriteLine(s1 == s2);
|
||||
Console.WriteLine(s1.Equals(s2));
|
||||
Console.WriteLine(s2.Equals(s3));
|
||||
Console.WriteLine(s1.Equals(s3));
|
||||
|
||||
Expr e1 = ctx1.MkIntConst("e1");
|
||||
Expr e2 = ctx2.MkIntConst("e1");
|
||||
Expr e3 = e1.Translate(ctx2);
|
||||
|
||||
Console.WriteLine(e1 == e2);
|
||||
Console.WriteLine(e1.Equals(e2));
|
||||
Console.WriteLine(e2.Equals(e3));
|
||||
Console.WriteLine(e1.Equals(e3));
|
||||
}
|
||||
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
try
|
||||
|
@ -2225,6 +2250,8 @@ namespace test_mapi
|
|||
QuantifierExample4(ctx);
|
||||
}
|
||||
|
||||
TranslationExample();
|
||||
|
||||
Log.Close();
|
||||
if (Log.isOpen())
|
||||
Console.WriteLine("Log is still open!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue