本文整理汇总了C#中Predicate.ConsistentWith方法的典型用法代码示例。如果您正苦于以下问题:C# Predicate.ConsistentWith方法的具体用法?C# Predicate.ConsistentWith怎么用?C# Predicate.ConsistentWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predicate
的用法示例。
在下文中一共展示了Predicate.ConsistentWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConsistentWith
public bool ConsistentWith(Predicate p)
{
foreach (Predicate pState in Predicates)
{
if (!p.ConsistentWith(pState))
return false;
}
return true;
}
示例2: ConsistentWith
public bool ConsistentWith(Predicate p, bool bConsiderHiddenState)
{
foreach (Predicate pState in Observed)
{
if (!p.ConsistentWith(pState))
return false;
}
if (bConsiderHiddenState)
{
//need to also check whether p is consistent with the hidden state
/*
List<CompoundFormula> lReducedHidden = new List<CompoundFormula>();
List<Predicate> lKnown = new List<Predicate>(Observed);
lKnown.Add(p);
foreach (CompoundFormula cfHidden in m_lHidden)
{
Formula cfReduced = cfHidden.Reduce(lKnown);
if (cfReduced.IsFalse(lKnown))
return false;
if (cfReduced is PredicateFormula)
{
Predicate pReduced = ((PredicateFormula)cfReduced).Predicate;
lKnown.Add(pReduced);
}
else
lReducedHidden.Add((CompoundFormula)cfReduced);
}
if (RunSatSolver(lReducedHidden, 1).Count == 0)
return false;
* */
CompoundFormula cfCNF = (CompoundFormula)m_cfCNFHiddenState.Clone();
cfCNF.AddOperand(p);
throw new NotImplementedException();
List<List<Predicate>> lConsistentAssignments = null;// RunSatSolver(cfCNF, 1);
if (lConsistentAssignments.Count == 0)
{
return false;
}
}
return true;
}