/// <summary> /// Unify Bag with the result. This frees the internal answers, so you can only call this once. /// </summary> /// <param name="Bag"></param> /// <returns></returns> public IEnumerable <bool> result(object Bag) { object result = ListPair.make(_bagArray); // Try to free the memory. _bagArray = null; return(YP.unify(Bag, result)); }
/// <summary> /// For each result, unify the _freeVariables and unify Bag with the associated bag. /// </summary> /// <param name="Bag"></param> /// <returns></returns> public IEnumerable <bool> result(object Bag) { Variable bagArrayVariable = new Variable(); foreach (bool l1 in resultArray(bagArrayVariable)) { foreach (bool l2 in YP.unify(Bag, ListPair.make((List <object>)bagArrayVariable.getValue()))) { yield return(false); } } }