本文整理汇总了C#中Prolog.PrologContext.WakeUpGoal方法的典型用法代码示例。如果您正苦于以下问题:C# PrologContext.WakeUpGoal方法的具体用法?C# PrologContext.WakeUpGoal怎么用?C# PrologContext.WakeUpGoal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prolog.PrologContext
的用法示例。
在下文中一共展示了PrologContext.WakeUpGoal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetaMetaUnify
internal override Metastructure MetaMetaUnify(Metastructure theirMetaStructure, PrologContext context)
{
var s = theirMetaStructure as Suspension;
if (s == null) throw new ArgumentTypeException("MetaMetaUnify", "theirMetaStructure", theirMetaStructure, typeof(Suspension));
if (context != s.context) throw new ArgumentException("Can't unify suspended goals across PrologContexts.");
context.WakeUpGoal(CombineGoals(DelayedGoal, s.DelayedGoal));
return MakeSuspension(null, CombineGoals(FrozenGoal, s.FrozenGoal));
}
示例2: MetaVarUnify
/// <summary>
/// Called after the variable bound to this Metastructure is unified with an unbound variable
/// that is not (itself) bound to a Metastructure.
/// </summary>
/// <param name="l">The logic variable with which to Unify.</param>
/// <param name="context">Context in which to execute suspended goals.</param>
/// <returns>The Metastructure to bind to the newly aliased variables.</returns>
public Metastructure MetaVarUnify(LogicVariable l, PrologContext context)
{
if (DelayedGoal != null)
context.WakeUpGoal(DelayedGoal);
return MakeSuspension(null, FrozenGoal);
}
示例3: MetaTermUnify
/// <summary>
/// Called after the variable bound to this Metastructure is unified with a non-variable term.
/// </summary>
/// <param name="value">The term to which to unify</param>
/// <param name="contextOfBinding">Context in which to execute suspended goals.</param>
public void MetaTermUnify(object value, PrologContext contextOfBinding)
{
Debug.Assert(contextOfBinding == Context, "Delayed goal woken in a different context than it was created in.");
contextOfBinding.WakeUpGoal(CombineGoals(DelayedGoal, FrozenGoal));
}
示例4: MetaMetaUnify
/// <summary>
/// Merge the information from two Metastructures into one new metastructure.
/// </summary>
/// <param name="theirMetaStructure">The Metastructure to merge with.</param>
/// <param name="context">Context in which to execute suspended goals.</param>
/// <returns>The merged Metastructure.</returns>
public Metastructure MetaMetaUnify(Metastructure theirMetaStructure, PrologContext context)
{
if (theirMetaStructure == null) throw new ArgumentTypeException("MetaMetaUnify", "theirMetaStructure", theirMetaStructure, typeof(Metastructure));
if (context != theirMetaStructure.Context) throw new ArgumentException("Can't unify suspended goals across PrologContexts.");
context.WakeUpGoal(CombineGoals(DelayedGoal, theirMetaStructure.DelayedGoal));
return MakeSuspension(null, CombineGoals(FrozenGoal, theirMetaStructure.FrozenGoal));
}