code: def transitive_closure(implications):
      """
      Computes the transitive closure of a list of implications
  
      Uses Warshall's algorithm, as described at
      http://www.cs.hope.edu/~cusack/Notes/Notes/DiscreteMath/Warshall.pdf.
      """
      full_implications = set(implications)
      literals = set().union(*map(set, full_implications))
  
      for k in literals:
          for i in literals:
              if (i, k) in full_implications:
                  for j in literals:
                      if (k, j) in full_implications:
                          full_implications.add((i, j))
  
      return full_implications
  
imports: from collections import defaultdict
  from typing import Iterator
  from .logic import Logic, And, Or, Not
label_desc: Use image node_id 3 for calling a global function with example usage: transitive_closure(implications) and returns: full_implications