MetaVarUnify() public method

Called after the variable bound to this Metastructure is unified with an unbound variable that is not (itself) bound to a Metastructure.
public MetaVarUnify ( LogicVariable them, IEnumerable &filter ) : Metastructure
them LogicVariable The logic variable with which to unify
filter IEnumerable Test for whether the merging succeeded. Generally a woken goal.
return Metastructure
示例#1
0
        IEnumerable <bool> UnifyMetaVar(Metastructure m, LogicVariable l)
        {
            System.Diagnostics.Debug.Assert(l.MetaBinding == null);
            l.Value = this;
            IEnumerable <CutState> goal;

            mValue = m.MetaVarUnify(l, out goal);
            try
            {
#pragma warning disable 414, 168, 219
                // ReSharper disable UnusedVariable
                foreach (var ignore in goal)
                // ReSharper restore UnusedVariable
#pragma warning restore 414, 168, 219
                {
                    yield return(false);
                }
            }
            finally
            {
                // Reset our own binding to its previous binding
                mValue = m;
                // Reset binding of l
                l.mValue = l;
                //l.IsBound = false;
            }
        }
示例#2
0
 IEnumerable<bool> UnifyMetaVar(Metastructure m, LogicVariable l)
 {
     Debug.Assert(l.MetaBinding == null);
     l.Value = this;
     IEnumerable<CutState> goal;
     mValue = (object)m.MetaVarUnify(l, out goal)??this;
     try
     {
     #pragma warning disable 414, 168, 219
         // ReSharper disable UnusedVariable
         foreach (var ignore in goal)
             // ReSharper restore UnusedVariable
     #pragma warning restore 414, 168, 219
             yield return false;
     }
     finally
     {
         // Reset our own binding to its previous binding
         mValue = m;
         // Reset binding of l
         l.mValue = l;
         //l.IsBound = false;
     }
 }
示例#3
0
 /// <summary>
 /// This is an atributed variable with metastructure m, unify with unattributed and unbound variable v.
 /// </summary>
 /// <param name="m">This variable's metavalue</param>
 /// <param name="l">The completely unbound logic variable to which we are binding.</param>
 /// <param name="context">Prolog context</param>
 void UnifyMetaVar(Metastructure m, LogicVariable l, PrologContext context)
 {
     Debug.Assert(l.MetaBinding == null);
     l.SaveAndUpdate(this, context);
     this.SaveAndUpdate(m.MetaVarUnify(l, context), context);
 }
示例#4
0
 void UnifyMetaVar(Metastructure m, LogicVariable l, PrologContext context)
 {
     System.Diagnostics.Debug.Assert(l.MetaBinding == null);
     l.SaveAndUpdate(this, context);
     m.MetaVarUnify(l, context);
 }
示例#5
0
 /// <summary>
 /// This is an atributed variable with metastructure m, unify with unattributed and unbound variable v.
 /// </summary>
 /// <param name="m">This variable's metavalue</param>
 /// <param name="l">The completely unbound logic variable to which we are binding.</param>
 /// <param name="context">Prolog context</param>
 void UnifyMetaVar(Metastructure m, LogicVariable l, PrologContext context)
 {
     System.Diagnostics.Debug.Assert(l.MetaBinding == null);
     l.SaveAndUpdate(this, context);
     this.SaveAndUpdate(m.MetaVarUnify(l, context), context);
 }