Prolog.KnowledgeBase.Prove C# (CSharp) Метод

Prove() приватный Метод

Attempts to prove the specified goal.
private Prove ( Symbol functor, object args, PrologContext context, ushort parentFrame ) : IEnumerable
functor Symbol
args object
context PrologContext
parentFrame ushort
Результат IEnumerable
        internal IEnumerable<CutState> Prove(Symbol functor, object[] args, PrologContext context, ushort parentFrame)
        {
            context.PushGoalStack(functor, args, parentFrame);
            context.NewStep();
            PrologPrimitives.PrimitiveImplementation prim;
            if (PrologPrimitives.Implementations.TryGetValue(functor, out prim))
            {
                return CallPrimitive(functor, prim, args, context);
            }
            return ProveFromDB(functor, args, context);
        }

Same methods

KnowledgeBase::Prove ( Structure t ) : IEnumerable

Usage Example

Пример #1
0
 /// <summary>
 /// Resets the context (clears stack, etc.) and starts a proof of the specified goal.
 /// </summary>
 /// <param name="goal">Goal to attempt to prove</param>
 /// <returns>Enumerator for solutions</returns>
 public IEnumerable <bool> ResetStackAndProve(Structure goal)
 {
     Reset(this.This);
     foreach (var state in KnowledgeBase.Prove(goal.Functor, goal.Arguments, this, 0))
     {
         if (state == CutState.ForceFail)
         {
             yield break;
         }
         else
         {
             yield return(false);
         }
     }
 }
All Usage Examples Of Prolog.KnowledgeBase::Prove