private bool consistent(Dictionary<String, bool> sample, Dictionary<String, bool> evidence) { foreach (string key in evidence.Keys) { bool value = (bool)evidence[key]; if (!(value.Equals(sample[key]))) { return false; } } return true; }