18 package com.microsoft.z3;
38 casted = Sort.class.cast(o);
39 }
catch (ClassCastException e) {
47 (getContext().nCtx() == casted.getContext().nCtx()) &&
48 (Native.isEqSort(getContext().nCtx(), getNativeObject(), casted.getNativeObject()));
58 return super.hashCode();
66 return Native.getSortId(getContext().nCtx(), getNativeObject());
74 return Z3_sort_kind.fromInt(Native.getSortKind(getContext().nCtx(),
83 return Symbol.create(getContext(),
84 Native.getSortName(getContext().nCtx(), getNativeObject()));
94 return Native.sortToString(getContext().nCtx(), getNativeObject());
97 return "Z3Exception: " + e.getMessage();
109 void checkNativeObject(
long obj)
111 if (Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_SORT_AST
113 throw new Z3Exception(
"Underlying object is not a sort");
114 super.checkNativeObject(obj);
117 static Sort create(Context ctx,
long obj)
119 Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(ctx.nCtx(), obj));
129 return new DatatypeSort(ctx, obj);
135 return new UninterpretedSort(ctx, obj);
139 return new RelationSort(ctx, obj);
141 return new FPSort(ctx, obj);
143 return new FPRMSort(ctx, obj);
145 throw new Z3Exception(
"Unknown sort kind");
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
Z3_sort_kind getSortKind()