コード例 #1
0
ファイル: Clause.cs プロジェクト: hackerlank/trunk-chatbot
        private Clause SaIfRequired(Clause othClause)
        {
            // If performing resolution with self
            // then need to standardize apart in
            // order to work correctly.
            if (this.IsStandardizedApartCheckRequired() || this == othClause)
            {
                var mVariables = _variableCollector.CollectAllVariables(this);
                var oVariables = _variableCollector.CollectAllVariables(othClause);

                var cVariables = new HashSet <Variable>();
                cVariables.UnionWith(mVariables);
                cVariables.UnionWith(oVariables);

                if (cVariables.Count < (mVariables.Count + oVariables.Count))
                {
                    othClause = _standardizeApart.GetStandardizeApartResult(othClause, _saIndexical);
                }
            }

            return(othClause);
        }
コード例 #2
0
 public ISet <Variable> CollectAllVariables(ISentence aSentence)
 {
     return(variableCollector.CollectAllVariables(aSentence));
 }