18 package com.microsoft.z3;
37 casted = FuncDecl.class.cast(o);
38 }
catch (ClassCastException e) {
46 (getContext().nCtx() == casted.getContext().nCtx()) &&
47 (Native.isEqFuncDecl(getContext().nCtx(), getNativeObject(), casted.getNativeObject()));
55 return super.hashCode();
65 return Native.funcDeclToString(getContext().nCtx(), getNativeObject());
68 return "Z3Exception: " + e.getMessage();
77 return Native.getFuncDeclId(getContext().nCtx(), getNativeObject());
85 return Native.getArity(getContext().nCtx(), getNativeObject());
94 return Native.getDomainSize(getContext().nCtx(), getNativeObject());
106 for (
int i = 0; i < n; i++)
107 res[i] =
Sort.create(getContext(),
118 return Sort.create(getContext(),
119 Native.getRange(getContext().nCtx(), getNativeObject()));
127 return Z3_decl_kind.fromInt(Native.getDeclKind(getContext().nCtx(),
137 return Symbol.create(getContext(),
138 Native.getDeclName(getContext().nCtx(), getNativeObject()));
146 return Native.getDeclNumParameters(getContext().nCtx(), getNativeObject());
157 for (
int i = 0; i < num; i++)
160 .getDeclParameterKind(getContext().nCtx(), getNativeObject(), i));
165 .nCtx(), getNativeObject(), i));
169 getContext().nCtx(), getNativeObject(), i));
173 .getDeclSymbolParameter(getContext().nCtx(),
174 getNativeObject(), i)));
178 .getDeclSortParameter(getContext().nCtx(), getNativeObject(),
184 getNativeObject(), i)));
189 getNativeObject(), i)));
193 getContext().nCtx(), getNativeObject(), i));
197 "Unknown function declaration parameter kind encountered");
233 throw new Z3Exception(
"parameter is not a double ");
243 throw new Z3Exception(
"parameter is not a Symbol");
273 throw new Z3Exception(
"parameter is not a function declaration");
283 throw new Z3Exception(
"parameter is not a rational String");
338 FuncDecl(Context ctx,
long obj)
344 FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range)
347 super(ctx, Native.mkFuncDecl(ctx.nCtx(), name.getNativeObject(),
348 AST.arrayLength(domain), AST.arrayToNative(domain),
349 range.getNativeObject()));
353 FuncDecl(Context ctx, String prefix, Sort[] domain, Sort range)
356 super(ctx, Native.mkFreshFuncDecl(ctx.nCtx(), prefix,
357 AST.arrayLength(domain), AST.arrayToNative(domain),
358 range.getNativeObject()));
362 void checkNativeObject(
long obj)
364 if (Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_FUNC_DECL_AST
366 throw new Z3Exception(
367 "Underlying object is not a function declaration");
368 super.checkNativeObject(obj);
379 getContext().checkContextMatch(args);
380 return Expr.create(getContext(),
this, args);
static long getDeclFuncDeclParameter(long a0, long a1, int a2)
Z3_parameter_kind getParameterKind()
static String getDeclRationalParameter(long a0, long a1, int a2)
static long getDomain(long a0, long a1, int a2)
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
static long getDeclAstParameter(long a0, long a1, int a2)
static int getDeclIntParameter(long a0, long a1, int a2)
Z3_decl_kind getDeclKind()
Z3_parameter_kind
The different kinds of parameters that can be associated with function symbols.
static double getDeclDoubleParameter(long a0, long a1, int a2)
Parameter[] getParameters()
Z3_decl_kind
The different kinds of interpreted function kinds.