The new IncidenceGraph and PrimalGraph command return Graph objects which encode the incidence graph and the primal graph of a logical expression.
If e is a Boolean expression in conjunctive normal form (CNF), the primal graph of e is a graph whose vertices are the variables of e. An edge exists between two variables if these variables occur together in a clause of e, in either negated or non-negated form.
In the following example, the variables a and b share an edge because they appear together in the first clause, while a and c do not share an edge because they appear in distinct clauses.
Similarly, if e is a Boolean expression in CNF, the incidence graph of e is a bipartite graph whose vertices correspond to the variables and clauses of e. Edges in the graph consist of pairs (v,c) where v is a variable and c is a clause, and clause c contains v in negated or non-negated form.
In the example seen earlier, the vertex Clause 1 shares edges with variables a, b, and d because each of these appears in the first clause of expr, but does not share an edge with c as it does not appear in this clause.