-- | Get all groundings from a Markov logic network, keeping the weights
-- assigned to the original formula in the Markov logic network.
allWGroundings :: [Term] -> MLN -> MLN
allWGroundings ts (MLN m) =
  MLN $ Map.foldrWithKey
    (\k v a -> Set.foldr' (\k' a' -> Map.insert k' v a') a (FOL.groundings ts k))
    Map.empty
    m
allWGroundings :: [Term] -> MLN -> MLN
allWGroundings ts (MLN m) =
  MLN $ Map.foldrWithKey
    (\k v a -> Set.foldr' (\k' a' -> Map.insert k' v a') a (FOL.groundings ts k))
    Map.empty
    m
allWGroundings ts (MLN m) =
  MLN $ Map.foldrWithKey
    (\k v a -> Set.foldr' (\k' a' -> Map.insert k' v a') a (FOL.groundings ts k))
    Map.empty
    m