class_docstr: A simple propositional knowledge base relying on compiled inference rules.
docstr: Update the KB with all the implications of a list of facts.
  
  Facts can be specified as a dictionary or as a list of (key, value)
  pairs.
docstr_tok: ["Update","the","KB","with","all","the","implications","of","a","list","of","facts",".","Facts","can","be","specified","as","a","dictionary","or","as","a","list","of","(","key",",","value",")","pairs","."]
code: def deduce_all_facts(self, facts):
      """
      Update the KB with all the implications of a list of facts.
  
      Facts can be specified as a dictionary or as a list of (key, value)
      pairs.
      """
      # keep frequently used attributes locally, so we'll avoid extra
      # attribute access overhead
      full_implications = self.rules.full_implications
      beta_triggers = self.rules.beta_triggers
      beta_rules = self.rules.beta_rules
  
      if isinstance(facts, dict):
          facts = facts.items()
  
      while facts:
          beta_maytrigger = set()
  
          # --- alpha chains ---
          for k, v in facts:
              if not self._tell(k, v) or v is None:
                  continue
  
              # lookup routing tables
              for key, value in full_implications[k, v]:
                  self._tell(key, value)
  
              beta_maytrigger.update(beta_triggers[k, v])
  
          # --- beta chains ---
          facts = []
          for bidx in beta_maytrigger:
              bcond, bimpl = beta_rules[bidx]
              if all(self.get(k) is v for k, v in bcond):
                  facts.append(bimpl)
  
imports: from collections import defaultdict
  from typing import Iterator
  from .logic import Logic, And, Or, Not
label_desc: Use image node_id 4 for calling the FactKB obj's underlying member method code with example usage: obj.deduce_all_facts(facts) without return types