public void RetractFact(Fact fact)
{
if (fact is IsFact)
{
IsFact isfact = (IsFact)fact;
object current = this.context.GetValue(isfact.Name);
if (current == null || !current.Equals(isfact.Value))
throw new InvalidOperationException();
this.context.SetValue(isfact.Name, null);
this.retracted.Enqueue(fact);
return;
}
if (!this.facts.Contains(fact))
throw new InvalidOperationException();
this.facts.Remove(fact);
this.retracted.Enqueue(fact);
}