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

Method of

src/api/java/Constructor.java:99–118  ·  view source on GitHub ↗
(Context ctx, Symbol name, Symbol recognizer,
            Symbol[] fieldNames, Sort[] sorts, int[] sortRefs)

Source from the content-addressed store, hash-verified

97 }
98
99 static <R> Constructor<R> of(Context ctx, Symbol name, Symbol recognizer,
100 Symbol[] fieldNames, Sort[] sorts, int[] sortRefs) {
101 int n = AST.arrayLength(fieldNames);
102
103 if (n != AST.arrayLength(sorts))
104 throw new Z3Exception(
105 "Number of field names does not match number of sorts");
106 if (sortRefs != null && sortRefs.length != n)
107 throw new Z3Exception(
108 "Number of field names does not match number of sort refs");
109
110 if (sortRefs == null)
111 sortRefs = new int[n];
112
113 long nativeObj = Native.mkConstructor(ctx.nCtx(), name.getNativeObject(),
114 recognizer.getNativeObject(), n, Symbol.arrayToNative(fieldNames),
115 Sort.arrayToNative(sorts), sortRefs);
116 return new Constructor<>(ctx, n, nativeObj);
117
118 }
119
120 private static class ConstructorRef extends Z3ReferenceQueue.Reference<Constructor<?>> {
121

Callers

nothing calls this directly

Calls 5

arrayLengthMethod · 0.80
mkConstructorMethod · 0.80
nCtxMethod · 0.80
getNativeObjectMethod · 0.80
arrayToNativeMethod · 0.80

Tested by

no test coverage detected