mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
Managed API: Refactoring and formatting.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
edc9dccbcf
commit
7defd469bb
52 changed files with 2006 additions and 1657 deletions
69
src/api/dotnet/RelationSort.cs
Normal file
69
src/api/dotnet/RelationSort.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*++
|
||||
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;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
namespace Microsoft.Z3
|
||||
{
|
||||
/// <summary>
|
||||
/// Relation sorts.
|
||||
/// </summary>
|
||||
[ContractVerification(true)]
|
||||
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
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Sort[]>() != null);
|
||||
|
||||
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)
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue