21 using System.Diagnostics.Contracts;
23 namespace Microsoft.Z3
35 get {
return Native.Z3_ast_vector_size(Context.nCtx, NativeObject); }
44 public AST this[uint i]
48 Contract.Ensures(Contract.Result<
AST>() != null);
54 Contract.Requires(value != null);
56 Native.Z3_ast_vector_set(Context.nCtx, NativeObject, i, value.NativeObject);
66 Native.Z3_ast_vector_resize(Context.nCtx, NativeObject, newSize);
76 Contract.Requires(a != null);
78 Native.Z3_ast_vector_push(Context.nCtx, NativeObject, a.NativeObject);
88 Contract.Requires(ctx != null);
89 Contract.Ensures(Contract.Result<
ASTVector>() != null);
99 return Native.Z3_ast_vector_to_string(Context.nCtx, NativeObject);
109 for (uint i = 0; i < n; i++)
110 res[i] =
AST.Create(
this.Context,
this[i].NativeObject);
121 for (uint i = 0; i < n; i++)
122 res[i] =
Expr.Create(
this.Context,
this[i].NativeObject);
133 for (uint i = 0; i < n; i++)
134 res[i] = (
BoolExpr) Expr.Create(this.Context,
this[i].NativeObject);
145 for (uint i = 0; i < n; i++)
146 res[i] = (
BitVecExpr)Expr.Create(this.Context,
this[i].NativeObject);
157 for (uint i = 0; i < n; i++)
158 res[i] = (
ArithExpr)Expr.Create(this.Context,
this[i].NativeObject);
169 for (uint i = 0; i < n; i++)
170 res[i] = (
ArrayExpr)Expr.Create(this.Context,
this[i].NativeObject);
181 for (uint i = 0; i < n; i++)
182 res[i] = (
DatatypeExpr)Expr.Create(this.Context,
this[i].NativeObject);
193 for (uint i = 0; i < n; i++)
194 res[i] = (
FPExpr)Expr.Create(this.Context,
this[i].NativeObject);
205 for (uint i = 0; i < n; i++)
206 res[i] = (
FPRMExpr)Expr.Create(this.Context,
this[i].NativeObject);
217 for (uint i = 0; i < n; i++)
218 res[i] = (
IntExpr)Expr.Create(this.Context,
this[i].NativeObject);
229 for (uint i = 0; i < n; i++)
230 res[i] = (
RealExpr)Expr.Create(this.Context,
this[i].NativeObject);
235 internal ASTVector(
Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
236 internal ASTVector(Context ctx) : base(ctx, Native.
Z3_mk_ast_vector(ctx.nCtx)) { Contract.Requires(ctx != null); }
238 internal class DecRefQueue : IDecRefQueue
240 public DecRefQueue() : base() { }
241 public DecRefQueue(uint move_limit) : base(move_limit) { }
242 internal override void IncRef(Context ctx, IntPtr obj)
244 Native.Z3_ast_vector_inc_ref(ctx.nCtx, obj);
247 internal override void DecRef(Context ctx, IntPtr obj)
249 Native.Z3_ast_vector_dec_ref(ctx.nCtx, obj);
253 internal override void IncRef(IntPtr o)
255 Context.ASTVector_DRQ.IncAndClear(Context, o);
259 internal override void DecRef(IntPtr o)
261 Context.ASTVector_DRQ.Add(o);
static Z3_ast Z3_ast_vector_get(Z3_context a0, Z3_ast_vector a1, uint a2)
override string ToString()
Retrieves a string representation of the vector.
void Resize(uint newSize)
Resize the vector to newSize .
FPRMExpr[] ToFPRMExprArray()
Translates an ASTVector into a FPRMExpr[]
ArrayExpr[] ToArrayExprArray()
Translates an ASTVector into a ArrayExpr[]
ASTVector Translate(Context ctx)
Translates all ASTs in the vector to ctx .
RealExpr[] ToRealExprArray()
Translates an ASTVector into a RealExpr[]
Z3_ast_vector Z3_API Z3_mk_ast_vector(Z3_context c)
Return an empty AST vector.
FloatingPoint Expressions
ArithExpr[] ToArithExprArray()
Translates an ASTVector into a ArithExpr[]
BoolExpr[] ToBoolExprArray()
Translates an ASTVector into a BoolExpr[]
IntExpr[] ToIntExprArray()
Translates an ASTVector into a IntExpr[]
BitVecExpr[] ToBitVecExprArray()
Translates an ASTVector into a BitVecExpr[]
void Push(AST a)
Add the AST a to the back of the vector. The size is increased by 1.
static Z3_ast_vector Z3_ast_vector_translate(Z3_context a0, Z3_ast_vector a1, Z3_context a2)
The main interaction with Z3 happens via the Context.
Arithmetic expressions (int/real)
The abstract syntax tree (AST) class.
FloatingPoint RoundingMode Expressions
FPExpr[] ToFPExprArray()
Translates an ASTVector into a FPExpr[]
DatatypeExpr[] ToDatatypeExprArray()
Translates an ASTVector into a DatatypeExpr[]
Expr[] ToExprArray()
Translates an ASTVector into an Expr[]
Internal base class for interfacing with native Z3 objects. Should not be used externally.
AST[] ToArray()
Translates an AST vector into an AST[]