mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
overloading support for C# expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e4b7ac37f3
commit
662e43d264
5 changed files with 225 additions and 29 deletions
|
@ -20,6 +20,8 @@ Notes:
|
|||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.Z3
|
||||
{
|
||||
|
@ -135,6 +137,23 @@ namespace Microsoft.Z3
|
|||
return an;
|
||||
}
|
||||
|
||||
[Pure]
|
||||
internal static IntPtr[] EnumToNative(IEnumerable<Z3Object> a)
|
||||
{
|
||||
Contract.Ensures(a == null || Contract.Result<IntPtr[]>() != null);
|
||||
Contract.Ensures(a == null || Contract.Result<IntPtr[]>().Length == a.Count());
|
||||
|
||||
if (a == null) return null;
|
||||
IntPtr[] an = new IntPtr[a.Count()];
|
||||
int i = 0;
|
||||
foreach (var ai in a)
|
||||
{
|
||||
if (ai != null) an[i] = ai.NativeObject;
|
||||
++i;
|
||||
}
|
||||
return an;
|
||||
}
|
||||
|
||||
[Pure]
|
||||
internal static uint ArrayLength(Z3Object[] a)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue