예제 #1
0
파일: Context.cs 프로젝트: yuretz/kanrenmo
        private IEnumerable <Context> UnifySequences([NotNull] PairVar left, [NotNull] PairVar right)
        {
            if (left.IsEmpty || right.IsEmpty)
            {
                return(left.IsEmpty && right.IsEmpty ? Just(this) : Nothing);
            }

            return(Unify(left.Head(), right.Head())
                   .SelectMany(c => c.Unify(left.Tail(), right.Tail())));
        }
예제 #2
0
파일: Context.cs 프로젝트: yuretz/kanrenmo
 private Var ReifyImpl([NotNull] PairVar pair) =>
 pair.IsEmpty ? Kanrenmo.Var.Empty : new PairVar(Reify(pair.Head()), Reify(pair.Tail()));