Type Trees

The following code snippet provides an easy way to print the type tree of probabilistic circuits.

using InteractiveUtils;
using ProbabilisticCircuits;
using AbstractTrees;
AbstractTrees.children(x::Type) = subtypes(x);

For example, we can see ProbabilisticCircuits.ProbCircuit's type tree.

AbstractTrees.print_tree(ProbCircuit)
ProbCircuit
├─ PlainProbCircuit
│  ├─ PlainProbInnerNode
│  │  ├─ PlainMulNode
│  │  └─ PlainSumNode
│  └─ PlainProbLeafNode
│     └─ PlainProbLiteralNode
├─ SharedProbCircuit
│  ├─ SharedProbInnerNode
│  │  ├─ SharedMulNode
│  │  └─ SharedSumNode
│  └─ SharedProbLeafNode
│     └─ SharedProbLiteralNode
└─ StructProbCircuit
   ├─ StructProbInnerNode
   │  ├─ StructMulNode
   │  └─ StructSumNode
   └─ StructProbLeafNode
      └─ StructProbLiteralNode