Prolog.KnowledgeBase.SolveFor C# (CSharp) Method

SolveFor() public method

True if the specified goal is provable within this KnowledgeBase.
public SolveFor ( LogicVariable result, object goal, object thisValue, bool throwOnFailure = true ) : object
result LogicVariable Value of variable to return
goal object Goal to attempt to prove
thisValue object Value to give ot the indexical $this during execution
throwOnFailure bool If true, SolveFor will throw a GoalException if the goal fails
return object
        public object SolveFor(LogicVariable result, object goal, object thisValue, bool throwOnFailure = true)
        {
            if (this.IsTrue(Term.Structurify(goal, "Argument to SolveFor() should be a valid Prolog goal."), thisValue))
                return Term.CopyInstantiation(result);
            if (throwOnFailure)
                throw new GoalException(goal, "Goal is unsatisfiable");
            return null;
        }