MCPcopy Create free account
hub / github.com/Z3Prover/z3 / finiteDomainExample

Method finiteDomainExample

examples/java/JavaExample.java:2116–2134  ·  view source on GitHub ↗
(Context ctx)

Source from the content-addressed store, hash-verified

2114 }
2115
2116 public void finiteDomainExample(Context ctx)
2117 {
2118 System.out.println("FiniteDomainExample");
2119 Log.append("FiniteDomainExample");
2120
2121 FiniteDomainSort s = ctx.mkFiniteDomainSort("S", 10);
2122 FiniteDomainSort t = ctx.mkFiniteDomainSort("T", 10);
2123 FiniteDomainNum s1 = (FiniteDomainNum)ctx.mkNumeral(1, s);
2124 FiniteDomainNum t1 = (FiniteDomainNum)ctx.mkNumeral(1, t);
2125 System.out.println(s);
2126 System.out.println(t);
2127 System.out.println(s1);
2128 System.out.println(t1);
2129 System.out.println(s1.getInt());
2130 System.out.println(t1.getInt());
2131 // But you cannot mix numerals of different sorts
2132 // even if the size of their domains are the same:
2133 // System.out.println(ctx.mkEq(s1, t1));
2134 }
2135
2136 public void floatingPointExample1(Context ctx) throws TestFailedException
2137 {

Callers 1

mainMethod · 0.95

Calls 4

appendMethod · 0.95
getIntMethod · 0.95
mkFiniteDomainSortMethod · 0.80
mkNumeralMethod · 0.80

Tested by

no test coverage detected