Skip to content

Instantly share code, notes, and snippets.

@milesrout
Created April 7, 2016 10:11
Show Gist options
  • Save milesrout/9ae6182f10cbfeb3fbd75d24bdd31a0c to your computer and use it in GitHub Desktop.
Save milesrout/9ae6182f10cbfeb3fbd75d24bdd31a0c to your computer and use it in GitHub Desktop.
def enumerate_vs(S, G):
"""Enumerate all hypotheses contained in the version space bounded by S and G."""
hypotheses = set()
for s in S:
for g in G:
places = [i for i in range(len(s)) if s[i] != g[i]]
for ss in all_subsets(places):
conj = Conjunction(g[i] if (i in ss) else s[i] for i in range(len(s)))
hypotheses.add(conj)
return hypotheses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment