3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00
z3/src/api/dotnet/RelationSort.cs
Nikolaj Bjorner 3d37060fa9 remove dependencies on contracts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-20 10:24:36 -07:00

67 lines
1.4 KiB
C#

/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
RelationSort.cs
Abstract:
Z3 Managed API: Relation Sorts
Author:
Christoph Wintersteiger (cwinter) 2012-11-23
Notes:
--*/
using System.Diagnostics;
using System;
namespace Microsoft.Z3
{
/// <summary>
/// Relation sorts.
/// </summary>
public class RelationSort : Sort
{
/// <summary>
/// The arity of the relation sort.
/// </summary>
public uint Arity
{
get { return Native.Z3_get_relation_arity(Context.nCtx, NativeObject); }
}
/// <summary>
/// The sorts of the columns of the relation sort.
/// </summary>
public Sort[] ColumnSorts
{
get
{
if (m_columnSorts != null)
return m_columnSorts;
uint n = Arity;
Sort[] res = new Sort[n];
for (uint i = 0; i < n; i++)
res[i] = Sort.Create(Context, Native.Z3_get_relation_column(Context.nCtx, NativeObject, i));
return res;
}
}
#region Internal
private Sort[] m_columnSorts = null;
internal RelationSort(Context ctx, IntPtr obj)
: base(ctx, obj)
{
Debug.Assert(ctx != null);
}
#endregion
}
}