本文整理汇总了C#中Prolog.PrologContext.ProveAllWokenGoals方法的典型用法代码示例。如果您正苦于以下问题:C# PrologContext.ProveAllWokenGoals方法的具体用法?C# PrologContext.ProveAllWokenGoals怎么用?C# PrologContext.ProveAllWokenGoals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prolog.PrologContext
的用法示例。
在下文中一共展示了PrologContext.ProveAllWokenGoals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Prove
internal override IEnumerable<CutState> Prove(object[] args, PrologContext context, ushort parentFrame)
{
object[] goal1Args = null;
object[] goal2Args = null;
object[] goal3Args = null;
object[] goal4Args = null;
object[] goal5Args = null;
object[] goal6Args = null;
object[] goal7Args = null;
object[] goal8Args = null;
var newVars = new LogicVariable[FreeVariables.Count];
object[] newArgs = Term.AlphaConvertArglist(HeadArgs, FreeVariables, newVars, context, true);
// ReSharper disable UnusedVariable
foreach (bool ignore in Term.UnifyArraysFast(args, newArgs, context))
{
if (goal1Args == null)
goal1Args = Term.AlphaConvertArglist(BodyGoals[0].Arguments, FreeVariables, newVars, context, false);
foreach (CutState ignoreFreeze in context.ProveAllWokenGoals())
// ReSharper restore UnusedVariable
foreach (CutState state1 in context.KnowledgeBase.Prove(BodyGoals[0].Functor, goal1Args, context, parentFrame))
{
if (state1 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal2Args == null)
goal2Args = Term.AlphaConvertArglist(BodyGoals[1].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state2 in context.KnowledgeBase.Prove(BodyGoals[1].Functor, goal2Args, context, parentFrame))
{
if (state2 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal3Args == null)
goal3Args = Term.AlphaConvertArglist(BodyGoals[2].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state3 in context.KnowledgeBase.Prove(BodyGoals[2].Functor, goal3Args, context, parentFrame))
{
if (state3 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal4Args == null)
goal4Args = Term.AlphaConvertArglist(BodyGoals[3].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state4 in context.KnowledgeBase.Prove(BodyGoals[3].Functor, goal4Args, context, parentFrame))
{
if (state4 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal5Args == null)
goal5Args = Term.AlphaConvertArglist(BodyGoals[4].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state5 in context.KnowledgeBase.Prove(BodyGoals[4].Functor, goal5Args, context, parentFrame))
{
if (state5 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal6Args == null)
goal6Args = Term.AlphaConvertArglist(BodyGoals[5].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state6 in context.KnowledgeBase.Prove(BodyGoals[5].Functor, goal6Args, context, parentFrame))
{
if (state6 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal7Args == null)
goal7Args = Term.AlphaConvertArglist(BodyGoals[6].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state7 in context.KnowledgeBase.Prove(BodyGoals[6].Functor, goal7Args, context, parentFrame))
{
if (state7 == CutState.ForceFail) yield return CutState.ForceFail;
if (goal8Args == null)
goal8Args = Term.AlphaConvertArglist(BodyGoals[7].Arguments, FreeVariables, newVars, context, false);
foreach (CutState state8 in context.KnowledgeBase.Prove(BodyGoals[7].Functor, goal8Args, context, parentFrame))
{
yield return state8;
}
}
}
}
}
}
}
}
}
}