40 return Object.ReferenceEquals(a, b) ||
41 (!Object.ReferenceEquals(a,
null) &&
42 !Object.ReferenceEquals(b,
null) &&
43 a.Context == b.Context &&
44 Native.Z3_is_eq_sort(a.Context.nCtx, a.NativeObject, b.NativeObject) != 0);
64 public override bool Equals(
object o)
67 if (casted ==
null)
return false;
68 return this == casted;
77 return base.GetHashCode();
85 get {
return Native.Z3_get_sort_id(
Context.nCtx, NativeObject); }
103 Contract.Ensures(Contract.Result<
Symbol>() !=
null);
113 return Native.Z3_sort_to_string(
Context.nCtx, NativeObject);
117 internal Sort(
Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx !=
null); }
123 internal override void CheckNativeObject(IntPtr obj)
125 if (Native.Z3_get_ast_kind(Context.nCtx, obj) != (uint)
Z3_ast_kind.Z3_SORT_AST)
126 throw new Z3Exception(
"Underlying object is not a sort");
127 base.CheckNativeObject(obj);
132 new internal static Sort Create(Context ctx, IntPtr obj)
134 Contract.Requires(ctx !=
null);
135 Contract.Ensures(Contract.Result<Sort>() !=
null);
137 switch ((
Z3_sort_kind)Native.Z3_get_sort_kind(ctx.nCtx, obj))
142 case Z3_sort_kind.Z3_DATATYPE_SORT:
return new DatatypeSort(ctx, obj);
145 case Z3_sort_kind.Z3_UNINTERPRETED_SORT:
return new UninterpretedSort(ctx, obj);
147 case Z3_sort_kind.Z3_RELATION_SORT:
return new RelationSort(ctx, obj);
149 case Z3_sort_kind.Z3_ROUNDING_MODE_SORT:
return new FPRMSort(ctx, obj);
153 throw new Z3Exception(
"Unknown sort kind");
Z3_sort_kind
The different kinds of Z3 types (See #Z3_get_sort_kind).
static bool operator !=(Sort a, Sort b)
Comparison operator.
new uint Id
Returns a unique identifier for the sort.
def FiniteDomainSort(name, sz, ctx=None)
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.
def FPSort(ebits, sbits, ctx=None)
Symbol Name
The name of the sort
override int GetHashCode()
Hash code generation for Sorts
The main interaction with Z3 happens via the Context.
The Sort class implements type information for ASTs.
override bool Equals(object o)
Equality operator for objects of type Sort.
The abstract syntax tree (AST) class.
def BitVecSort(sz, ctx=None)
Symbols are used to name several term and type constructors.
Z3_sort_kind SortKind
The kind of the sort.
static bool operator==(Sort a, Sort b)
Comparison operator.
override string ToString()
A string representation of the sort.