z3-z3-4.13.0.src.api.dotnet.RelationSort.cs Maven / Gradle / Ivy
The newest version!
/*++
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
{
///
/// Relation sorts.
///
public class RelationSort : Sort
{
///
/// The arity of the relation sort.
///
public uint Arity
{
get { return Native.Z3_get_relation_arity(Context.nCtx, NativeObject); }
}
///
/// The sorts of the columns of the relation sort.
///
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
}
}