本文整理匯總了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;
}
}
}