Created
April 7, 2016 10:11
-
-
Save milesrout/9ae6182f10cbfeb3fbd75d24bdd31a0c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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