public bool IsTrue(object goal, object thisValue=null)
{
var t = Term.Structurify(goal, "Argument to IsTrue() should be a valid Prolog goal.");
bool result;
using (var prologContext = PrologContext.Allocate(this, thisValue))
{
try
{
result = Prove(t.Functor, t.Arguments, prologContext, 0).GetEnumerator().MoveNext();
}
catch (InferenceStepsExceededException)
{
throw;
}
catch (Exception e)
{
throw new PrologError(
e,
prologContext.StackTrace(
Prolog.CurrentSourceFile,
Prolog.CurrentSourceLineNumber,
"IsTrue()",
false) + e.StackTrace);
}
}
return result;
}