Beispiel #1
0
def eval_constant_Minimals(op, context):
    from .eval_space_imp import eval_space  # @Reimport
    space = eval_space(op.space, context)
    elements = space.get_minimal_elements()
    v = FiniteCollection(elements=elements, S=space)
    S = FiniteCollectionsInclusion(space)
    return ValueWithUnits(unit=S, value=v)
Beispiel #2
0
def eval_EmptySet(op, context):
    check_isinstance(op, CDP.EmptySet)
    from .eval_space_imp import eval_space
    space = eval_space(op.space, context)

    P = FiniteCollectionsInclusion(space)
    value = FiniteCollection(set([]), space)
    return ValueWithUnits(unit=P, value=value)
Beispiel #3
0
def eval_constant_collection(op, context):
    ops = get_odd_ops(unwrap_list(op.elements))
    if len(ops) == 0:
        raise DPSemanticError('empty list')
    elements = [eval_constant(_, context) for _ in ops]

    e0 = elements[0]

    u0 = e0.unit

    elements = [_.cast_value(u0) for _ in elements]

    value = FiniteCollection(set(elements), u0)
    unit = FiniteCollectionsInclusion(u0)
    vu = ValueWithUnits(value, unit)
    return vu
Beispiel #4
0
 def _call(self, x):
     elements = x.elements
     elements2 = set(self.f(_) for _ in elements)
     from mcdp_posets import FiniteCollection
     return FiniteCollection(elements2, self.cod)