Mantis#1931. Thank you kindly, Kinoc for a patch that:

* Yield Prolog 1.0.1 Released : it passes all but 9 of the 
421 tests in the ISO Prolog test suite (97.8%) .
* support dynamic predicates and rules.
* support 'import' to use external static functions 
improves connection to C# functions
* Matches Yield Prolog r831
This commit is contained in:
Charles Krinke
2008-08-13 14:13:49 +00:00
parent e46248ab17
commit 323ada012d
23 changed files with 2060 additions and 584 deletions

View File

@@ -49,6 +49,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
{
}
// disable warning on l1, don't see how we can
// code this differently
#pragma warning disable 0168
/// <summary>
/// If arg is another Functor1, then succeed (yield once) if this and arg have the
/// same name and the functor args unify, otherwise fail (don't yield).
/// If arg is a Variable, then call its unify to unify with this.
/// Otherwise fail (don't yield).
/// </summary>
/// <param name="arg"></param>
/// <returns></returns>
public IEnumerable<bool> unify(object arg)
{
arg = YP.getValue(arg);
@@ -57,25 +68,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
Functor1 argFunctor = (Functor1)arg;
if (_name.Equals(argFunctor._name))
{
// disable warning on l1, don't see how we can
// code this differently
#pragma warning disable 0168
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
yield return false;
#pragma warning restore 0168
}
}
else if (arg is Variable)
{
// disable warning on l1, don't see how we can
// code this differently
#pragma warning disable 0168
foreach (bool l1 in ((Variable)arg).unify(this))
yield return false;
#pragma warning restore 0168
}
}
#pragma warning restore 0168
public override string ToString()
{