generic hypergraph dynamic programming inference library