本文整理汇总了C#中YieldProlog.Variable.unify方法的典型用法代码示例。如果您正苦于以下问题:C# Variable.unify方法的具体用法?C# Variable.unify怎么用?C# Variable.unify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YieldProlog.Variable
的用法示例。
在下文中一共展示了Variable.unify方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: rangeList
static IEnumerable<bool> rangeList(int M, int N, Variable List)
{
if (M >= N)
{
foreach (bool l1 in List.unify(new ListPair(N, Atom.NIL)))
yield return false;
}
else
{
Variable Tail = new Variable();
foreach (bool l1 in rangeList(M + 1, N, Tail))
{
foreach (bool l2 in List.unify(new ListPair(M, Tail)))
yield return false;
}
}
}
示例2: attack3
static IEnumerable<bool> attack3(object X, object N, object Arg3)
{
Variable Y = new Variable();
foreach (bool l in new ListPair(Y, new Variable()).unify(Arg3))
{
if ((int)YP.getValue(X) == (int)Y.getValue() + (int)YP.getValue(N))
yield return false;
if ((int)YP.getValue(X) == (int)Y.getValue() - (int)YP.getValue(N))
yield return false;
}
Variable Ys = new Variable();
Variable N1 = new Variable();
foreach (bool l1 in new ListPair(new Variable(), Ys).unify(Arg3))
{
foreach (bool l2 in N1.unify((int)YP.getValue(N) + 1))
{
foreach (bool l3 in attack3(X, N1, Ys))
yield return false;
}
}
}
示例3: queens3
static IEnumerable<bool> queens3(object UnplacedQs, object SafeQs, Variable Qs)
{
ListPair UnplacedQsListPair = YP.getValue(UnplacedQs) as ListPair;
if (UnplacedQsListPair != null)
{
Variable UnplacedQs1 = new Variable();
Variable Q = new Variable();
foreach (bool l1 in selectq(Q, UnplacedQsListPair, UnplacedQs1))
{
if (!(SafeQs is ListPair && hasAttack((int)Q.getValue(), (ListPair)SafeQs)))
{
foreach (bool l2 in queens3(UnplacedQs1, new ListPair(Q, SafeQs), Qs))
yield return false;
}
}
}
else
{
foreach (bool l1 in Qs.unify(SafeQs))
yield return false;
}
}
示例4: selectq
static IEnumerable<bool> selectq(Variable X, ListPair Arg2, Variable Arg3)
{
foreach (bool l1 in X.unify(Arg2._arg1))
{
foreach (bool l2 in Arg3.unify(Arg2._arg2))
yield return false;
}
ListPair Arg2Tail = YP.getValue(Arg2._arg2) as ListPair;
if (Arg2Tail != null)
{
Variable Zs = new Variable();
foreach (bool l1 in selectq(X, Arg2Tail, Zs))
{
foreach (bool l2 in Arg3.unify(new ListPair(Arg2._arg1, Zs)))
yield return false;
}
}
}