Skip to content

Simple unary mathematical operations

M_Ceil_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Relation:

$$
    \text{ceil}(\fun) ≤_{\opspace} \res
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\) must be Numbers

R Poset

The resources poset \(\R\) must be Numbers

opspace Numbers

The poset \(\opspace\) where the comparisons take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Ceil_DP(PrimitiveDP[Decimal, Decimal]):
    r"""

    Relation:

        $$
            \text{ceil}(\fun) ≤_{\opspace} \res
        $$

    Attributes:
       F (Poset): The functionality poset $\F$ must be Numbers
       R (Poset): The resources poset $\R$ must be Numbers
       opspace: The poset $\opspace$ where the comparisons take place.

    """
    F: Numbers
    R: Numbers
    opspace: Numbers

M_FloorFun_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Relation:

$$
    \fun ≤_{\opspace} \text{floor}(\res)
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

opspace Numbers

The poset \(\opspace\) where the comparisons take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_FloorFun_DP(PrimitiveDP[Decimal, Decimal]):
    r"""

    Relation:

        $$
            \fun ≤_{\opspace} \text{floor}(\res)
        $$

    Attributes:
       F (Poset): The functionality poset $\F$
       R (Poset): The resources poset $\R$
       opspace: The poset $\opspace$ where the comparisons take place.

    """

    opspace: Numbers
    F: Numbers
    R: Numbers

M_Power_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Exponentiation of functionalities.

Relation:

$$
    \fun ^ (n / d) \leq_{\opspace}  \res
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

num int

numerator of the exponent

den int

denominator of the exponent

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Power_DP(PrimitiveDP[Decimal, Decimal]):
    r"""
    Exponentiation of functionalities.


    Relation:

        $$
            \fun ^ (n / d) \leq_{\opspace}  \res
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        num: numerator of the exponent
        den: denominator of the exponent

    """
    num: int
    den: int

Adding or multiplying by a constant

The next set of DPs implement addition or multiplication by a constant. The constant is specified by an object of type ValueFromPoset.

Adding a constant

M_Fun_AddConstant_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Addition of a constant on the right side.

Relation:

$$
    \fun \leq_{\opspace} \res +_{\opspace} v
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

vu ValueFromPoset[Decimal]

The value \(v\) to be added.

opspace Numbers

The poset \(\opspace\) where the multiplication and comparison take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Fun_AddConstant_DP(PrimitiveDP[Decimal, Decimal]):
    r"""
    Addition of a constant on the right side.

    Relation:

        $$
            \fun \leq_{\opspace} \res +_{\opspace} v
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        vu: The value $v$ to be added.
        opspace: The poset $\opspace$ where the multiplication and comparison take place.

    """
    F: Numbers
    R: Numbers
    vu: ValueFromPoset[Decimal]
    opspace: Numbers

M_Res_AddConstant_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Addition of a constant on the left side.

Relation:

$$
    \fun +_{\opspace} v \leq_{\opspace} \res
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

vu ValueFromPoset[Decimal]

The value \(v\) to be added.

opspace Numbers

The poset \(\opspace\) where the multiplication and comparison take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Res_AddConstant_DP(PrimitiveDP[Decimal, Decimal]):
    r"""
    Addition of a constant on the left side.

    Relation:

        $$
            \fun +_{\opspace} v \leq_{\opspace} \res
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        vu: The value $v$ to be added.
        opspace: The poset $\opspace$ where the multiplication and comparison take place.

    """
    F: Numbers
    R: Numbers
    vu: ValueFromPoset[Decimal]
    opspace: Numbers

Multiplying by a constant

M_Fun_MultiplyConstant_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Multiplication by a constant on the right side.

Relation:

$$
    \fun \leq_{\opspace} \res  \cdot_{\opspace} v
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

vu ValueFromPoset[Decimal]

The value \(v\) to be added.

opspace Numbers

The poset \(\opspace\) where the multiplication and comparison take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Fun_MultiplyConstant_DP(PrimitiveDP[Decimal, Decimal]):
    r"""
    Multiplication by a constant on the right side.

    Relation:

        $$
            \fun \leq_{\opspace} \res  \cdot_{\opspace} v
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        vu: The value $v$ to be added.
        opspace: The poset $\opspace$ where the multiplication and comparison take place.

    """
    F: Numbers
    R: Numbers
    vu: ValueFromPoset[Decimal]
    opspace: Numbers

M_Res_MultiplyConstant_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Multiplication by a constant on the left side.

Relation:

$$
    \fun \cdot_{\opspace} v \leq_{\opspace} \res
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

vu ValueFromPoset[Decimal]

The value \(v\) to be added.

opspace Numbers

The poset \(\opspace\) where the multiplication and comparison take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Res_MultiplyConstant_DP(PrimitiveDP[Decimal, Decimal]):
    r"""
    Multiplication by a constant on the left side.

    Relation:

        $$
            \fun \cdot_{\opspace} v \leq_{\opspace} \res
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        vu: The value $v$ to be added.
        opspace: The poset $\opspace$ where the multiplication and comparison take place.

    """
    F: Numbers
    R: Numbers
    vu: ValueFromPoset[Decimal]
    opspace: Numbers

M_Res_DivideConstant_DP dataclass

Bases: PrimitiveDP[Decimal, Decimal]

Division by a constant

Relation:

$$
    \fun /_{\opspace} v \leq_{\opspace} \res
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

vu ValueFromPoset[Decimal]

The value \(v\) to be added.

opspace Numbers

The poset \(\opspace\) where the division and comparison take place.

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class M_Res_DivideConstant_DP(PrimitiveDP[Decimal, Decimal]):
    r"""

    Division by a constant

    Relation:

        $$
            \fun /_{\opspace} v \leq_{\opspace} \res
        $$

    Attributes:
        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        vu: The value $v$ to be added.
        opspace: The poset $\opspace$ where the division and comparison take place.
    """

    F: Numbers
    R: Numbers
    vu: ValueFromPoset[Decimal]
    opspace: Numbers