当前位置: 首页>>代码示例>>C#>>正文


C# Sentence.accept方法代码示例

本文整理汇总了C#中Sentence.accept方法的典型用法代码示例。如果您正苦于以下问题:C# Sentence.accept方法的具体用法?C# Sentence.accept怎么用?C# Sentence.accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sentence的用法示例。


在下文中一共展示了Sentence.accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: convertToCNF

        public CNF convertToCNF(Sentence aSentence)
        {
            // I)mplications Out:
            Sentence implicationsOut = (Sentence)aSentence.accept(
                    new ImplicationsOut(), null);

            // N)egations In:
            Sentence negationsIn = (Sentence)implicationsOut.accept(
                    new NegationsIn(), null);

            // S)tandardize variables:
            // For sentences like:
            // (FORALL x P(x)) V (EXISTS x Q(x)),
            // which use the same variable name twice, change the name of one of the
            // variables.
            Sentence saQuantifiers = (Sentence)negationsIn.accept(
                    new StandardizeQuantiferVariables(substVisitor),
                    new List<Variable>());

            // Remove explicit quantifiers, by skolemizing existentials
            // and dropping universals:
            // E)xistentials Out
            // A)lls Out:
            Sentence andsAndOrs = (Sentence)saQuantifiers.accept(
                    new RemoveQuantifiers(parser), new List<Variable>());

            // D)istribution
            // V over ^:
            Sentence orDistributedOverAnd = (Sentence)andsAndOrs.accept(
                    new DistributeOrOverAnd(), null);

            // O)perators Out
            return (new CNFConstructor()).construct(orDistributedOverAnd);
        }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:34,代码来源:CNFConverter.cs

示例2: collectAllVariables

        // Note: The set guarantees the order in which they were
        // found.
        public List<Variable> collectAllVariables(Sentence sentence)
        {
            List<Variable> variables = new List<Variable>();

            sentence.accept(this, variables);

            return variables;
        }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:10,代码来源:VariableCollector.cs

示例3: getPredicates

 public List<Predicate> getPredicates(Sentence s)
 {
     return (List<Predicate>)s.accept(this, new List<Predicate>());
 }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:4,代码来源:PredicateCollector.cs

示例4: construct

        public CNF construct(Sentence orDistributedOverAnd)
        {
            ArgData ad = new ArgData();

            orDistributedOverAnd.accept(this, ad);

            return new CNF(ad.clauses);
        }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:8,代码来源:CNFConverter.cs

示例5: subst

 /**
  * Note: Refer to Artificial Intelligence A Modern Approach (3rd Edition):
  * page 323.
  * 
  * @param theta
  *            a substitution.
  * @param aSentence
  *            the substitution has been applied to.
  * @return a new Sentence representing the result of applying the
  *         substitution theta to aSentence.
  * 
  */
 public Sentence subst(Dictionary<Variable, Term> theta, Sentence aSentence)
 {
     return (Sentence)aSentence.accept(this, theta);
 }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:16,代码来源:SubstVisitor.cs

示例6: collectAllVariables

 private static void collectAllVariables(Sentence s, List<Variable> vars)
 {
     s.accept(_collectAllVariables, vars);
 }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:4,代码来源:StandardizeApartInPlace.cs


注:本文中的Sentence.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。