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