andTree :: Gate g => Int -> Circuit g
andTree n = buildCircuit $ do
    xs <- symbol n
    ys <- symbol n
    zs <- symbol n
    ws <- zipWithM circXor xs =<< zipWithM circXor ys zs
    output =<< circProd ws
andTree :: Gate g => Int -> Circuit g
andTree n = buildCircuit $ do
    xs <- symbol n
    ys <- symbol n
    zs <- symbol n
    ws <- zipWithM circXor xs =<< zipWithM circXor ys zs
    output =<< circProd ws
andTree n = buildCircuit $ do
    xs <- symbol n
    ys <- symbol n
    zs <- symbol n
    ws <- zipWithM circXor xs =<< zipWithM circXor ys zs
    output =<< circProd ws