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

Added finite domain expressions and numerals to the .NET, Java, and Python APIs.

Relates to #318
This commit is contained in:
Christoph M. Wintersteiger 2015-12-02 17:01:52 +00:00
parent 9e756fb6db
commit cbda38ee80
10 changed files with 380 additions and 12 deletions

View file

@ -2163,13 +2163,14 @@ class JavaExample
FiniteDomainSort s = ctx.mkFiniteDomainSort("S", 10);
FiniteDomainSort t = ctx.mkFiniteDomainSort("T", 10);
Expr s1 = ctx.mkNumeral(1, s);
Expr t1 = ctx.mkNumeral(1, t);
FiniteDomainNum s1 = (FiniteDomainNum)ctx.mkNumeral(1, s);
FiniteDomainNum t1 = (FiniteDomainNum)ctx.mkNumeral(1, t);
System.out.println(s);
System.out.println(t);
System.out.println(s1);
System.out.println(ctx.mkNumeral(2, s));
System.out.println(s1);
System.out.println(t1);
System.out.println(s1.getInt());
System.out.println(t1.getInt());
// But you cannot mix numerals of different sorts
// even if the size of their domains are the same:
// System.out.println(ctx.mkEq(s1, t1));