本文整理汇总了C#中Z3Provider.MkLt方法的典型用法代码示例。如果您正苦于以下问题:C# Z3Provider.MkLt方法的具体用法?C# Z3Provider.MkLt怎么用?C# Z3Provider.MkLt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Z3Provider
的用法示例。
在下文中一共展示了Z3Provider.MkLt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestLanguageIntersection
public void TestLanguageIntersection()
{
Z3Provider Z = new Z3Provider();
var A = (Z.TT.MkRankedAlphabet("A", Z.IntSort, new string[] { "zero", "one", "two" }, new int[] { 0, 1, 2 }));
var B = A;
var C = A;
var a_rule2 = A.MkAcceptorRule(0, "two", Z.MkGe(A.AttrVar, Z.MkInt(2)), 0, 0);
var a_rule1 = A.MkAcceptorRule(0, "one", Z.MkGe(A.AttrVar, Z.MkInt(1)), 0);
var a_rule0 = A.MkAcceptorRule(0, "zero", Z.MkGe(A.AttrVar, Z.MkInt(0)));
var b_rule2 = A.MkAcceptorRule(0, "two", Z.MkLe(A.AttrVar, Z.MkInt(2)), 0, 0);
var b_rule1 = A.MkAcceptorRule(0, "one", Z.MkLt(A.AttrVar, Z.MkInt(1)), 0);
var b_rule0 = A.MkAcceptorRule(0, "zero", Z.MkLe(A.AttrVar, Z.MkInt(0)));
var a = A.MkTreeAcceptor(a_rule2, a_rule1, a_rule0);
var b = A.MkTreeAcceptor(b_rule2, b_rule1, b_rule0);
//all two-nodes have attribute 2, all zero-nodes have attribute 0 and no one-node is possible because the guards conflict
var ab = a.Intersect(b);
var t = A.MkTree("two", Z.MkInt(2), A.MkTree("two", Z.MkInt(2), A.MkTree("zero", Z.MkInt(0)), A.MkTree("zero", Z.MkInt(0))), A.MkTree("zero", Z.MkInt(0)));
var t_out = ab[t];
Assert.AreEqual<int>(1, t_out.Length);
Assert.AreEqual<Expr>(null, t_out[0]);
var t2 = A.MkTree("two", Z.MkInt(2), A.MkTree("two", Z.MkInt(3), A.MkTree("zero", Z.MkInt(0)), A.MkTree("zero", Z.MkInt(0))), A.MkTree("zero", Z.MkInt(0)));
var t_out2 = ab[t2];
Assert.AreEqual<int>(0, t_out2.Length);
var t_a = a[t2];
Assert.AreEqual<int>(1, t_a.Length);
Assert.AreEqual<Expr>(null, t_a[0]);
}