在 C# 中创建枚举 Z3 常量问题 API
Create enum Z3 constant issue in C# API
我在 C# 中有一个枚举:
public enum CustomerType
{
Premium,
Gold,
Regular
}
我创建了一个这样的枚举排序:
var enumSort = context.MkEnumSort("CustomerType", "Premium", "Gold", "Regular");
如何创建对应于 CustomerType.Premium
的 Z3 常数?
尝试 context.MkConst("Premium", enumSort);
生成一个可以采用任何 CustomerType 值的枚举排序。
我是通过以下方法实现的:
sort.As<EnumSort>().Consts.First(x => x.FuncDecl.Name.ToString() == "Premium")
.
我不是 Z3 C# 绑定方面的专家,但这里有一个可能会有所帮助的示例:https://github.com/Z3Prover/z3/blob/master/examples/dotnet/Program.cs#L1466-L1501
我在 C# 中有一个枚举:
public enum CustomerType
{
Premium,
Gold,
Regular
}
我创建了一个这样的枚举排序:
var enumSort = context.MkEnumSort("CustomerType", "Premium", "Gold", "Regular");
如何创建对应于 CustomerType.Premium
的 Z3 常数?
尝试 context.MkConst("Premium", enumSort);
生成一个可以采用任何 CustomerType 值的枚举排序。
我是通过以下方法实现的:
sort.As<EnumSort>().Consts.First(x => x.FuncDecl.Name.ToString() == "Premium")
.
我不是 Z3 C# 绑定方面的专家,但这里有一个可能会有所帮助的示例:https://github.com/Z3Prover/z3/blob/master/examples/dotnet/Program.cs#L1466-L1501