本文整理汇总了C#中Predicate.Canonical方法的典型用法代码示例。如果您正苦于以下问题:C# Predicate.Canonical方法的具体用法?C# Predicate.Canonical怎么用?C# Predicate.Canonical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predicate
的用法示例。
在下文中一共展示了Predicate.Canonical方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddHidden
private void AddHidden(Predicate pHidden)
{
m_lHidden.Add(pHidden.Canonical());
m_lObserved.Remove(pHidden);
}
示例2: AddToObservedList
private bool AddToObservedList(Predicate p)
{
#if DEBUG
if (p.Name != "Choice" && !p.Negation)
{
Debug.Assert(UnderlyingEnvironmentState == null || (UnderlyingEnvironmentState.Contains(p)), "Adding a predicate that does not exist");
if (UnderlyingEnvironmentState != null && !UnderlyingEnvironmentState.Contains(p))
Console.WriteLine("Adding a predicate that does not exist");
}
#endif
if (m_lObserved.Contains(p))
return false;
Predicate pNegate = p.Negate();
if (m_lObserved.Contains(pNegate))
m_lObserved.Remove(pNegate);
m_lObserved.Add(p);
if (p.Negation)
p = pNegate;
Predicate pCanonical = p.Canonical();
if (m_lHidden.Contains(pCanonical))
m_lHidden.Remove(pCanonical);
return true;
}
示例3: AddObserved
public bool AddObserved(Predicate p)
{
bool bNew = false;
if (p.Name == Domain.TRUE_PREDICATE)
return false;
Debug.Assert(p.Name != Domain.FALSE_PREDICATE, "Adding P_FALSE");
#if DEBUG
if (UnderlyingEnvironmentState != null &&
((p.Negation == false && !UnderlyingEnvironmentState.Contains(p)) ||
(p.Negation == true && UnderlyingEnvironmentState.Contains(p.Negate()))))
Console.WriteLine("Adding a predicate that doesn't exist");
#endif
Unknown.Remove(p.Canonical());
if (!m_lObserved.Contains(p))
{
Predicate pNegate = p.Negate();
if(m_lObserved.Contains(pNegate))
m_lObserved.Remove(pNegate);
bNew = true;
}
m_lObserved.Add(p);
return bNew;
}