Formula visualization

The formula visualization module allows you to visualize the structure of a formula.

optilog.formulas.visualization.print_clauses_color(sets_of_literals, clauses, colors=None, filter_clauses=True)

Print clauses with literals colored according to the given colors.

Parameters
  • sets_of_literals (List[List[int]]) – List of sets of literals, each set of literals is a list of literals

  • clauses (List[List[int]]) – List of clauses, each clause is a list of literals

  • colors (Union[str, List[str], None]) – If a string, the color to use for all the sets of literals. If a list of strings, the color to use for each set of literals. If None, the default colors will be used.

  • filter_clauses (bool) – If True, only print clauses that contain at least one of the given literals