Skip to content

Commit

Permalink
stub out nativesolver
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Mar 2, 2022
1 parent bbadd17 commit bf14aeb
Show file tree
Hide file tree
Showing 3 changed files with 559 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api/dotnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ set(Z3_DOTNET_ASSEMBLY_SOURCES_IN_SRC_TREE
NativeContext.cs
NativeFuncInterp.cs
NativeModel.cs
NativeSolver.cs
Optimize.cs
ParamDescrs.cs
Params.cs
Expand Down
18 changes: 18 additions & 0 deletions src/api/dotnet/NativeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,23 @@ internal void InitContext()

#endregion


/// <summary>
/// Utility to convert a vector object of ast to a .Net array
/// </summary>
/// <param name="vec"></param>
/// <returns></returns>
public Z3_ast[] ToArray(Z3_ast_vector vec)
{
Native.Z3_ast_vector_inc_ref(nCtx, vec);
var sz = Native.Z3_ast_vector_size(nCtx, vec);
var result = new Z3_ast[sz];
for (uint i = 0; i < sz; ++i)
result[i] = Native.Z3_ast_vector_get(nCtx, vec, i);
Native.Z3_ast_vector_dec_ref(nCtx, vec);
return result;

}

}
}
Loading

0 comments on commit bf14aeb

Please sign in to comment.