Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The function
save_as_dot
is defined insrc/IO/IO.jl
, but not implemented. This patch simply adapts the equivalent functionsave_as_dot
defined inProbabilisticCircuits
(https://github.com/Juice-jl/ProbabilisticCircuits.jl/blob/master/src/IO/CircuitSaver.jl) but forLogicCircuits
.Obviously this isn't the best approach to solving this issue, as ideally we should have these two
save_as_dot
functions call some other more general function. But this would require changing how nodes are printed (perhaps adding aprintdot
method for each node and simply calling it instead of having two differentsave_as_dot
functions with a bunch ofif
andelse
s?) or changing how nodes are typed (in the sense disjunction and conjunction nodes would have a common ancestor, e.g.\bigveeNode
andProb\bigveeNode
would be subtypes ofDisjunctionNode
or whatever).There is another flaw to this implementation as well: structured nodes are unsupported. Since I'm only working (so far) with the regular
Logical\DeltaNode
s, and I'm not so familiar with this library yet, I'm choosing to keep it the way it is for now.Added a test case for the function as well. Not sure the right way of doing it, so will be happy to fix if needed.