Ejemplo n.º 1
0
        private static Ambiguity FindAmbiguity(ISentenceForm original, ISentenceForm replacement)
        {
            Debug.Assert(original.Name == replacement.Name);
            if (original.Equals(replacement))
                return null;

            var replacementsByOriginalTupleIndex = new Dictionary<int, TermFunction>();
            //Make the arguments ?v0, ?v1, ?v2, ... so we can find the tuple indices easily
            Fact originalSentence = original.GetSentenceFromTuple(GetNumberedTuple(original.TupleSize));
            Fact replacementSentence = replacement.GetSentenceFromTuple(GetNumberedTuple(replacement.TupleSize));

            bool success = FindAmbiguity(originalSentence.GetTerms(), replacementSentence.GetTerms(), replacementsByOriginalTupleIndex);
            return success ? new Ambiguity(original, replacementsByOriginalTupleIndex, replacement) : null;
        }
Ejemplo n.º 2
0
 public ISentenceFormDomain GetDomain(ISentenceForm form)
 {
     return form.Equals(_newForm) ? _newFormDomain : _oldModel.GetDomain(form);
 }