Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

something like this maybe (not tested)

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) for g in Jsc)

something like this maybe (not tested)

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc JSc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) all(in_ISc(g) for g in Jsc)
JSc)