Skip to content

Plumbing

This section describes a few DPs that are used mainly for "plumbing".

Simple bounds on functionality and resources

Limit dataclass

Bases: Generic[T], PrimitiveDP[T, tuple[]]

Implements a bound on the functionality.

This is the dual of Constant.

Relation:

$$
  \fun \leq  c
$$

Note that the resources \(\res\) do not appear in the relation. As long as the functionality is below the limit, the resources can be anything.

Attributes:

F (Poset): The functionality poset $\F$
R (Poset): The resources poset $\R$
c: The constant $c$
Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class Limit(Generic[T], PrimitiveDP[T, tuple[()]]):
    r"""
    Implements a bound on the functionality.

    This is the dual of [Constant][act4e_mcdp.primitivedps.Constant].

    Relation:

        $$
          \fun \leq  c
        $$

    Note that the resources $\res$ do not appear in the relation.
    As long as the functionality is below the limit, the resources can be anything.

    Attributes:

        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        c: The constant $c$

    """

    F: Poset[T]
    R: Poset[tuple[()]]

    c: ValueFromPoset[T]

Constant dataclass

Bases: Generic[T], PrimitiveDP[tuple[], T]

Implements a bound on the resources.

This is the dual of Limit.

Relation:

$$
  c \leq  \res
$$

Note that the functionality $\fun$ do not appear in the relation.
As long as the resources is above the limit, the functionality can be anything.

Attributes:

F (Poset): The functionality poset $\F$
R (Poset): The resources poset $\R$
c: The constant $c$
Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class Constant(Generic[T], PrimitiveDP[tuple[()], T]):
    r"""
    Implements a bound on the resources.

    This is the dual of [Limit][act4e_mcdp.primitivedps.Limit].

    Relation:

        $$
          c \leq  \res
        $$

        Note that the functionality $\fun$ do not appear in the relation.
        As long as the resources is above the limit, the functionality can be anything.

    Attributes:

        F (Poset): The functionality poset $\F$
        R (Poset): The resources poset $\R$
        c: The constant $c$

    """

    F: Poset[tuple[()]]
    R: Poset[T]

    c: ValueFromPoset[T]

"Splitters"

JoinNDP dataclass

Bases: Generic[T], PrimitiveDP[tuple[T, ...], T]

This DP is used as plumbing. It is the dual of MeetNDualDP.

The functionality posets is a PosetProduct of, in general, \(n\) elements \(\F_1, \F_2, \dots\).

We ask that the resource is greater than each of the functionalities.

The comparison is done in a poset \(\opspace\) which contains \(\R, \F_1, \F_2, \dots\).

Relation:

$$
    (\fun_1 \leq_{\opspace}  \res) \wedge (\fun_2 \leq_{\opspace} \res) \wedge \dots
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

opspace Poset[T]

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

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class JoinNDP(Generic[T], PrimitiveDP[tuple[T, ...], T]):
    r"""
    This DP is used as plumbing. It is the dual of [MeetNDualDP][act4e_mcdp.primitivedps.MeetNDualDP].


    The functionality posets is a PosetProduct of, in general, $n$ elements $\F_1, \F_2, \dots$.

    We ask that the resource is greater than each of the functionalities.

    The comparison is done in a poset $\opspace$ which contains $\R, \F_1, \F_2,  \dots$.

    Relation:

        $$
            (\fun_1 \leq_{\opspace}  \res) \wedge (\fun_2 \leq_{\opspace} \res) \wedge \dots
        $$

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


    """
    F: PosetProduct[T]
    R: Poset[T]
    opspace: Poset[T]

MeetNDualDP dataclass

Bases: Generic[T], PrimitiveDP[T, tuple[T, ...]]

This DP is used as plumbing. It is the dual of JoinNDP.

The resources posets is a PosetProduct of, in general, \(n\) elements \(\R_1, \R_2, \dots\).

We ask that the functionality is less than each of the resources.

The comparison is done in a poset \(\opspace\) which contains \(\F, \R_1, \R_2, \dots\).

Relation:

$$
    (\fun \leq_{\opspace}  \res_1) \wedge (\fun \leq_{\opspace} \res_2) \wedge \dots
$$

Attributes:

Name Type Description
F Poset

The functionality poset \(\F\)

R Poset

The resources poset \(\R\)

opspace Poset[T]

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

Source code in src/act4e_mcdp/primitivedps.py
@dataclass(frozen=True)
class MeetNDualDP(Generic[T], PrimitiveDP[T, tuple[T, ...]]):
    r"""
    This DP is used as plumbing. It is the dual of [JoinNDP][act4e_mcdp.primitivedps.JoinNDP].

    The resources posets is a PosetProduct of, in general, $n$ elements $\R_1, \R_2, \dots$.

    We ask that the functionality is less than each of the resources.

    The comparison is done in a poset $\opspace$ which contains $\F, \R_1, \R_2, \dots$.

    Relation:

        $$
            (\fun \leq_{\opspace}  \res_1) \wedge (\fun \leq_{\opspace} \res_2) \wedge \dots
        $$

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


    """
    F: Poset[T]
    R: PosetProduct[T]
    opspace: Poset[T]

Multiplexers

Mux dataclass

Bases: PrimitiveDP[object, object]

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

    coords: Coords
    coords2: Coords

    def __post_init__(self):
        assert isinstance(self.coords, Coords), self