piLattice :: (Eq a, Fractional prob) => [a] -> PILattice prob a
piLattice modelNodes =
  let nodes = autoLabel $ map (\n -> PINode { partial = n, value = 0 })
              $ piSet modelNodes
      size = (length nodes)-1
      edges = [ (i,j,()) | i <- [0..size], j <- [0..size],
                i /= j && -- Reflexive reduction
                (partial $ snd $ nodes !! i) -<= (partial $ snd $ nodes !! j) ]
      compositionEdges = [ (i,k,()) | (i,j,()) <- edges, k <- [0..size],
                               (j,k,()) `elem` edges]
      reducedEdges = edges \\ compositionEdges
  in mkGraph nodes reducedEdges
piLattice :: (Eq a, Fractional prob) => [a] -> PILattice prob a
piLattice modelNodes =
  let nodes = autoLabel $ map (\n -> PINode { partial = n, value = 0 })
              $ piSet modelNodes
      size = (length nodes)-1
      edges = [ (i,j,()) | i <- [0..size], j <- [0..size],
                i /= j && -- Reflexive reduction
                (partial $ snd $ nodes !! i) -<= (partial $ snd $ nodes !! j) ]
      compositionEdges = [ (i,k,()) | (i,j,()) <- edges, k <- [0..size],
                               (j,k,()) `elem` edges]
      reducedEdges = edges \\ compositionEdges
  in mkGraph nodes reducedEdges
piLattice modelNodes =
  let nodes = autoLabel $ map (\n -> PINode { partial = n, value = 0 })
              $ piSet modelNodes
      size = (length nodes)-1
      edges = [ (i,j,()) | i <- [0..size], j <- [0..size],
                i /= j && -- Reflexive reduction
                (partial $ snd $ nodes !! i) -<= (partial $ snd $ nodes !! j) ]
      compositionEdges = [ (i,k,()) | (i,j,()) <- edges, k <- [0..size],
                               (j,k,()) `elem` edges]
      reducedEdges = edges \\ compositionEdges
  in mkGraph nodes reducedEdges