https://github.com/Juice-jl/LogicCircuits.jl/blob/a8f9474e8c668607afbe1e3ab9ab8c2c233292f1/src/Logical/Queries.jl#L40