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

Method of

src/api/java/Quantifier.java:175–207  ·  view source on GitHub ↗

Create a quantified expression. @param ctx Context to create the quantifier on. @param isForall Quantifier type. @param sorts Sorts of bound variables. @param names Names of bound variables @param body Body of quantifier @param weight Weight used to indicate priority for quantifier instantiation @p

(
            Context ctx, boolean isForall, Sort[] sorts, Symbol[] names,
            Expr<BoolSort> body, int weight, Pattern[] patterns, Expr<?>[] noPatterns,
            Symbol quantifierID, Symbol skolemID)

Source from the content-addressed store, hash-verified

173 * @param skolemID Nullable skolemID
174 */
175 public static Quantifier of(
176 Context ctx, boolean isForall, Sort[] sorts, Symbol[] names,
177 Expr<BoolSort> body, int weight, Pattern[] patterns, Expr<?>[] noPatterns,
178 Symbol quantifierID, Symbol skolemID) {
179 ctx.checkContextMatch(patterns);
180 ctx.checkContextMatch(noPatterns);
181 ctx.checkContextMatch(sorts);
182 ctx.checkContextMatch(names);
183 ctx.checkContextMatch(body);
184
185 if (sorts.length != names.length) {
186 throw new Z3Exception(
187 "Number of sorts does not match number of names");
188 }
189
190 long nativeObj;
191 if (noPatterns == null && quantifierID == null && skolemID == null) {
192 nativeObj = Native.mkQuantifier(ctx.nCtx(), (isForall), weight, AST.arrayLength(patterns), AST
193 .arrayToNative(patterns), AST.arrayLength(sorts), AST
194 .arrayToNative(sorts), Symbol.arrayToNative(names), body
195 .getNativeObject());
196 } else {
197 nativeObj = Native.mkQuantifierEx(ctx.nCtx(),
198 (isForall), weight, AST.getNativeObject(quantifierID),
199 AST.getNativeObject(skolemID),
200 AST.arrayLength(patterns), AST.arrayToNative(patterns),
201 AST.arrayLength(noPatterns), AST.arrayToNative(noPatterns),
202 AST.arrayLength(sorts), AST.arrayToNative(sorts),
203 Symbol.arrayToNative(names),
204 body.getNativeObject());
205 }
206 return new Quantifier(ctx, nativeObj);
207 }
208
209
210 /**

Callers 2

mkForallMethod · 0.95
mkExistsMethod · 0.95

Calls 6

checkContextMatchMethod · 0.80
mkQuantifierMethod · 0.80
nCtxMethod · 0.80
arrayLengthMethod · 0.80
arrayToNativeMethod · 0.80
getNativeObjectMethod · 0.80

Tested by

no test coverage detected