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

Method finiteDomainExample

examples/java/JavaGenericExample.java:1922–1940  ·  view source on GitHub ↗
(Context ctx)

Source from the content-addressed store, hash-verified

1920 }
1921
1922 public <S, T> void finiteDomainExample(Context ctx)
1923 {
1924 System.out.println("FiniteDomainExample");
1925 Log.append("FiniteDomainExample");
1926
1927 FiniteDomainSort<S> s = ctx.mkFiniteDomainSort("S", 10);
1928 FiniteDomainSort<T> t = ctx.mkFiniteDomainSort("T", 10);
1929 FiniteDomainNum<S> s1 = (FiniteDomainNum<S>) ctx.mkNumeral(1, s);
1930 FiniteDomainNum<T> t1 = (FiniteDomainNum<T>) ctx.mkNumeral(1, t);
1931 System.out.println(s);
1932 System.out.println(t);
1933 System.out.println(s1);
1934 System.out.println(t1);
1935 System.out.println(s1.getInt());
1936 System.out.println(t1.getInt());
1937 // But you cannot mix numerals of different sorts
1938 // even if the size of their domains are the same:
1939 // System.out.println(ctx.mkEq(s1, t1));
1940 }
1941
1942 public void floatingPointExample1(Context ctx) throws TestFailedException
1943 {

Callers 1

mainMethod · 0.95

Calls 4

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

Tested by

no test coverage detected