Esempio n. 1
0
File: max1map.py Progetto: rusi/mcdp
    def __init__(self, R, value):
        if do_extra_checks():
            R.belongs(value)

        Map.__init__(self, R, R)
        self.value = value
        self.R = R
Esempio n. 2
0
 def __init__(self, A, B, factor):
     check_isinstance(A, (Rcomp, RcompUnits))
     check_isinstance(B, (Rcomp, RcompUnits))
     Map.__init__(self, A, B)
     self.A = A
     self.B = B
     self.factor = factor
Esempio n. 3
0
 def __init__(self, fs):
     fs = tuple(fs)
     self.fs = fs
     mcdp_dev_warning('add promotion to SpaceProduct')
     dom = PosetProduct(tuple(fi.get_domain() for fi in fs))
     cod = PosetProduct(tuple(fi.get_codomain() for fi in fs))
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 4
0
File: max1map.py Progetto: rusi/mcdp
    def __init__(self, F, value):
        if do_extra_checks():
            F.belongs(value)

        Map.__init__(self, F, F)
        self.value = value
        self.F = F
Esempio n. 5
0
    def __init__(self, F, value):
        if do_extra_checks():
            F.belongs(value)

        Map.__init__(self, F, F)
        self.value = value
        self.F = F
Esempio n. 6
0
    def __init__(self, R, value):
        if do_extra_checks():
            R.belongs(value)

        Map.__init__(self, R, R)
        self.value = value
        self.R = R
Esempio n. 7
0
 def __init__(self, c):
     check_isinstance(c, int)
     if c == 0:
         raise ValueError(c)
     cod = dom = Nat()
     Map.__init__(self, dom, cod)
     self.c = c
Esempio n. 8
0
 def __init__(self, c):
     check_isinstance(c, int)
     if c == 0:
         raise ValueError(c)
     cod = dom = Nat()
     Map.__init__(self, dom, cod)
     self.c = c
Esempio n. 9
0
 def __init__(self, fs):
     fs = tuple(fs)
     self.fs = fs
     mcdp_dev_warning('add promotion to SpaceProduct')
     dom = PosetProduct(tuple(fi.get_domain() for fi in fs))
     cod = PosetProduct(tuple(fi.get_codomain() for fi in fs))
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 10
0
 def __init__(self, P, c_value, c_space):
     c_space.belongs(c_value)
     check_isinstance(P, RcompUnits)
     check_isinstance(c_space, RcompUnits)
     self.c_value = c_value
     self.c_space = c_space
     self.c = express_value_in_isomorphic_space(c_space, c_value, P)
     Map.__init__(self, dom=P, cod=P)
Esempio n. 11
0
 def __init__(self, n):
     self.n = n
     N = Nat()
     dom = PosetProduct((N, ) * n)
     cod = N
     Map.__init__(self, dom=dom, cod=cod)
     self.top = cod.get_top()
     self.n = n
Esempio n. 12
0
 def __init__(self, n):
     self.n = n
     N = Nat()
     dom = PosetProduct((N,) * n)
     cod = N
     Map.__init__(self, dom=dom, cod=cod)
     self.top = cod.get_top()
     self.n = n
Esempio n. 13
0
 def __init__(self, c_value):
     dom = Rcomp()
     dom.belongs(c_value)
     cod = dom
     Map.__init__(self, dom=dom, cod=cod)
     self.c = c_value
     
     self.top = dom.get_top()
Esempio n. 14
0
 def __init__(self, F, R, unit, value):
     check_isinstance(unit, RcompUnits)
     check_isinstance(F, RcompUnits)
     check_isinstance(R, RcompUnits)
     dom = F
     cod = R
     self.value = value
     self.unit = unit
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 15
0
 def __init__(self, F, R, unit, value):
     check_isinstance(unit, RcompUnits)
     check_isinstance(F, RcompUnits)
     check_isinstance(R, RcompUnits)
     dom = F
     cod = R
     self.value = value
     self.unit = unit
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 16
0
    def __init__(self, Fs, R):
        """ Should be all Rcomp or all RcompUnits """
        for _ in Fs:
            check_isinstance(_, (Rcomp, RcompUnits))
        check_isinstance(R, (Rcomp, RcompUnits))

        self.F = dom = PosetProduct(Fs)
        self.R = cod = R
        Map.__init__(self, dom=dom, cod=cod)
Esempio n. 17
0
    def __init__(self, F, coords):
        try:
            R = get_R_from_F_coords(F, coords)
        except ValueError as e:  # pragma: no cover
            msg = 'Cannot create Mux'
            raise_wrapped(DPInternalError, e, msg, F=F, coords=coords)

        self.coords = coords
        Map.__init__(self, F, R)
Esempio n. 18
0
    def __init__(self, Fs, R):
        for _ in Fs:
            check_isinstance(_, RcompUnits)
        check_isinstance(R, RcompUnits)
        self.Fs = Fs
        self.R = R

        sum_dimensionality_works(Fs, R)

        dom = PosetProduct(self.Fs)
        cod = R

        Map.__init__(self, dom=dom, cod=cod)
Esempio n. 19
0
    def __init__(self, Fs, R):
        for _ in Fs:
            check_isinstance(_, RcompUnits)
        check_isinstance(R, RcompUnits)
        self.Fs = Fs
        self.R = R
        
        sum_dimensionality_works(Fs, R)
        
        dom = PosetProduct(self.Fs)
        cod = R

        Map.__init__(self, dom=dom, cod=cod)
Esempio n. 20
0
    def __init__(self, Fs, R):
        dom = PosetProduct(Fs)
        cod = R
        Map.__init__(self, dom=dom, cod=cod)

        tu = get_types_universe()
        self.subs = []
        target = Int()
        for F in Fs:
            # need F to be cast to Int
            F_to_Int, _ = tu.get_embedding(F, target)
            self.subs.append(F_to_Int)

        self.to_R, _ = tu.get_embedding(target, R)
Esempio n. 21
0
    def __init__(self, Fs, R):
        dom = PosetProduct(Fs)
        cod = R
        Map.__init__(self, dom=dom, cod=cod)

        tu = get_types_universe()
        self.subs = []
        target = Int()
        for F in Fs:
            # need F to be cast to Int
            F_to_Int, _ = tu.get_embedding(F, target)
            self.subs.append(F_to_Int)

        self.to_R, _ = tu.get_embedding(target, R)
Esempio n. 22
0
    def __init__(self, dom, cod, space, value):
        if isinstance(dom, RcompUnits):
            check_isinstance(cod, RcompUnits)
            check_isinstance(space, RcompUnits)
            # cod * space = dom
            check_mult_units_consistency(cod, space, dom)
        else:
            check_isinstance(dom, Rcomp)
            check_isinstance(cod, Rcomp)
            check_isinstance(space, Rcomp)

        space.belongs(value)
        self.value = value
        self.space = space
        # XXX: not sure about the units
        # assert (dom * space = cod)
        Map.__init__(self, dom, cod)
Esempio n. 23
0
 def __init__(self, dom, cod, space, value):
     if isinstance(dom, RcompUnits):
         check_isinstance(cod, RcompUnits)
         check_isinstance(space, RcompUnits)
         # cod * space = dom
         check_mult_units_consistency(cod, space, dom)
     else:
         check_isinstance(dom, Rcomp)
         check_isinstance(cod, Rcomp)
         check_isinstance(space, Rcomp)
          
     space.belongs(value)
     self.value = value
     self.space = space
     # XXX: not sure about the units
     # assert (dom * space = cod)
     Map.__init__(self, dom, cod)
Esempio n. 24
0
    def __init__(self, maps):
        """ 
            maps = [f, g, h]
            === h o g o f
            
            They are in order of application.
        """
        self.maps = tuple(maps)
        from mcdp_posets.types_universe import get_types_universe

        tu = get_types_universe()
        for i in range(len(maps)-1):
            first = maps[i]
            second =maps[i+1]
            cod1 = first.get_codomain()
            dom2 = second.get_domain()
            tu.check_equal(cod1, dom2)

        mcdp_dev_warning('Check that the composition makes sense')
        dom = self.maps[0].get_domain()
        cod = self.maps[-1].get_codomain()
        Map.__init__(self, dom=dom, cod=cod)
Esempio n. 25
0
    def __init__(self, maps):
        """ 
            maps = [f, g, h]
            === h o g o f
            
            They are in order of application.
        """
        self.maps = tuple(maps)
        from mcdp_posets.types_universe import get_types_universe

        tu = get_types_universe()
        for i in range(len(maps) - 1):
            first = maps[i]
            second = maps[i + 1]
            cod1 = first.get_codomain()
            dom2 = second.get_domain()
            tu.check_equal(cod1, dom2)

        mcdp_dev_warning('Check that the composition makes sense')
        dom = self.maps[0].get_domain()
        cod = self.maps[-1].get_codomain()
        Map.__init__(self, dom=dom, cod=cod)
Esempio n. 26
0
 def __init__(self, dom, cod):
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 27
0
 def __init__(self, f):
     from mcdp_posets.uppersets import UpperSets
     dom = UpperSets(f.get_domain())
     cod = UpperSets(f.get_codomain())
     self.f = f
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 28
0
 def __init__(self, cod, dom):
     # todo: check dom is Rcomp or Rcompunits
     Map.__init__(self, cod, dom)
Esempio n. 29
0
 def __init__(self, F):
     F2 = PosetProduct((F, F))
     Map.__init__(self, dom=F, cod=F2)
     self.bottom = F.get_bottom()
Esempio n. 30
0
 def __init__(self, c_value):
     dom = Rcomp()
     dom.belongs(c_value)
     cod = dom
     Map.__init__(self, dom=dom, cod=cod)
     self.c_value = c_value
Esempio n. 31
0
 def __init__(self):
     dom = cod = Nat()
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 32
0
 def __init__(self, dom, cod, value):
     cod.belongs(value)
     Map.__init__(self, dom, cod)
     self.value = value
Esempio n. 33
0
 def __init__(self, n):
     self.P = Nat()
     dom = PosetProduct( (self.P,) * n)
     cod = self.P
     Map.__init__(self, dom=dom, cod=cod)
     self.n = n
Esempio n. 34
0
 def __init__(self, n, P):
     dom = PosetProduct((P,) * n)
     cod = P
     Map.__init__(self, dom, cod)
     self.P = P
     self.n = n
Esempio n. 35
0
 def __init__(self, f):
     from mcdp_posets.uppersets import UpperSets
     dom = UpperSets(f.get_domain())
     cod = UpperSets(f.get_codomain())
     self.f = f
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 36
0
 def __init__(self):
     dom = Nat()
     cod = dom
     Map.__init__(self, dom, cod)
Esempio n. 37
0
 def __init__(self, dom, name):
     assert isinstance(dom, (Rcomp, RcompUnits))
     Map.__init__(self, dom, dom)
     self.name = name
Esempio n. 38
0
 def __init__(self):
     dom = cod = Nat()
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 39
0
 def __init__(self, cod, dom):
     # todo: check dom is Rcomp or Rcompunits
     Map.__init__(self, cod, dom)
Esempio n. 40
0
 def __init__(self, value):
     self.c = value
     dom = cod = Nat()
     dom.belongs(value)
     Map.__init__(self, dom, cod)
     self.top  = self.dom.get_top()
Esempio n. 41
0
    def __init__(self, cod, dom):
        Map.__init__(self, cod, dom)

        self.__name__ = 'Identity'
Esempio n. 42
0
 def __init__(self, n):
     self.n = n
     Map.__init__(self, Nat(), Nat())
Esempio n. 43
0
    def __init__(self, cod, dom):
        Map.__init__(self, cod, dom)

        self.__name__ = 'Identity'
Esempio n. 44
0
 def __init__(self, dom, cod):
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 45
0
 def __init__(self, dom, cod):
     check_isinstance(dom, (Rcomp, RcompUnits))
     check_isinstance(cod, Nat)
     Map.__init__(self, dom, cod)
Esempio n. 46
0
 def __init__(self, dom, cod, value):
     cod.belongs(value)
     Map.__init__(self, dom, cod)
     self.value = value
Esempio n. 47
0
 def __init__(self, n):
     self.n = n
     Map.__init__(self, Nat(), Nat())
Esempio n. 48
0
 def __init__(self, f):
     from mcdp_posets import FiniteCollectionsInclusion
     dom = FiniteCollectionsInclusion(f.get_domain())
     cod = FiniteCollectionsInclusion(f.get_codomain())
     self.f = f
     Map.__init__(self, dom=dom, cod=cod)
Esempio n. 49
0
 def __init__(self, value):
     self.value = value
     self.N = Nat()
     self.N.belongs(value)
     Map.__init__(self, dom=self.N, cod=self.N)
Esempio n. 50
0
 def __init__(self, n, P):
     dom = PosetProduct((P, ) * n)
     cod = P
     Map.__init__(self, dom, cod)
     self.P = P
     self.n = n
Esempio n. 51
0
 def __init__(self, P):
     cod = PosetProduct((P, P))
     Map.__init__(self, dom=P, cod=cod)
     self.top = P.get_top()
Esempio n. 52
0
 def __init__(self, F0):
     self.F0 = F0
     F = PosetProduct((F0, F0))
     Map.__init__(self, dom=F, cod=F)
Esempio n. 53
0
 def __init__(self, c):
     cod = dom = Nat()
     dom.belongs(c)
     self.c = c
     Map.__init__(self, dom, cod)
Esempio n. 54
0
 def __init__(self, dom, cod):
     check_isinstance(dom, (Rcomp, RcompUnits))
     check_isinstance(cod, Nat)
     Map.__init__(self, dom, cod)
Esempio n. 55
0
 def __init__(self, n):
     P = Rcomp()
     dom = PosetProduct((P, ) * n)
     cod = P
     self.n = n
     Map.__init__(self, dom, cod)