本文整理汇总了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);
}
示例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;
}
示例3: getPredicates
public List<Predicate> getPredicates(Sentence s)
{
return (List<Predicate>)s.accept(this, new List<Predicate>());
}
示例4: construct
public CNF construct(Sentence orDistributedOverAnd)
{
ArgData ad = new ArgData();
orDistributedOverAnd.accept(this, ad);
return new CNF(ad.clauses);
}
示例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);
}
示例6: collectAllVariables
private static void collectAllVariables(Sentence s, List<Variable> vars)
{
s.accept(_collectAllVariables, vars);
}