diff options
25 files changed, 492 insertions, 1 deletions
@@ -11,7 +11,7 @@ "modules": [ "act4e_solutions" ], - "version": "7.1.2110170951", + "version": "7.1.2202211124", "author": "", "author_email": "", "url": "" diff --git a/src/act4e_solutions/intro.py b/src/act4e_solutions/intro.py new file mode 100644 index 0000000..2a4856d --- /dev/null +++ b/src/act4e_solutions/intro.py @@ -0,0 +1,6 @@ +import act4e_interfaces as I + + +class SolSimpleIntro(I.SimpleIntro): + def sum(self, a: int, b: int) -> int: + raise NotImplementedError() diff --git a/src/act4e_solutions/maps.py b/src/act4e_solutions/maps.py new file mode 100644 index 0000000..4984eef --- /dev/null +++ b/src/act4e_solutions/maps.py @@ -0,0 +1,26 @@ +from typing import overload, TypeVar + +import act4e_interfaces as I + +A = TypeVar("A") +B = TypeVar("B") +C = TypeVar("C") + + +class SolFiniteMapOperations(I.FiniteMapOperations): + @overload + def identity(self, s: I.FiniteSet[A]) -> I.FiniteMap[A, A]: + ... + + @overload + def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]: + ... + + def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]: + raise NotImplementedError() + + def compose(self, f: I.FiniteMap[A, B], g: I.FiniteMap[B, C]) -> I.FiniteMap[A, C]: + raise NotImplementedError() + + def as_relation(self, f: I.FiniteMap[A, B]) -> I.FiniteRelation[A, B]: + raise NotImplementedError() diff --git a/src/act4e_solutions/maps_representation.py b/src/act4e_solutions/maps_representation.py new file mode 100644 index 0000000..45c816e --- /dev/null +++ b/src/act4e_solutions/maps_representation.py @@ -0,0 +1,16 @@ +from typing import Any, TypeVar + +import act4e_interfaces as I + + +A = TypeVar("A") +B = TypeVar("B") + + +class SolFiniteMapRepresentation(I.FiniteMapRepresentation): + + def load(self, h: I.IOHelper, s: I.FiniteMap_desc) -> I.FiniteMap[A, B]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, m: I.FiniteMap[Any, Any]) -> I.FiniteMap_desc: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets.py b/src/act4e_solutions/posets.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/act4e_solutions/posets.py diff --git a/src/act4e_solutions/posets_bounds.py b/src/act4e_solutions/posets_bounds.py new file mode 100644 index 0000000..73adc98 --- /dev/null +++ b/src/act4e_solutions/posets_bounds.py @@ -0,0 +1,73 @@ +from typing import Any, List, Optional, overload, TypeVar + +import act4e_interfaces as I + +E = TypeVar("E") +X = TypeVar("X") + +class SolFinitePosetMeasurement(I.FinitePosetMeasurement): + def height(self, fp: I.FinitePoset[Any]) -> int: + raise NotImplementedError() + + def width(self, fp: I.FinitePoset[Any]) -> int: + raise NotImplementedError() + + +class SolFinitePosetConstructionOpposite(I.FinitePosetConstructionOpposite): + @overload + def opposite(self, p: I.FinitePoset[X]) -> I.FinitePoset[X]: + ... + + @overload + def opposite(self, p: I.Poset[X]) -> I.Poset[X]: + ... + + def opposite(self, m: I.Poset[X]) -> I.Poset[X]: + raise NotImplementedError() + + +class SolFinitePosetSubsetProperties(I.FinitePosetSubsetProperties): + def is_chain(self, fp: I.FinitePoset[X], s: List[X]) -> bool: + raise NotImplementedError() + + def is_antichain(self, fp: I.FinitePoset[X], s: List[X]) -> bool: + raise NotImplementedError() + + +class SolFinitePosetSubsetProperties2(I.FinitePosetSubsetProperties2): + + def is_lower_set(self, fp: I.FinitePoset[X], s: List[X]) -> bool: + raise NotImplementedError() + + def is_upper_set(self, fp: I.FinitePoset[X], s: List[X]) -> bool: + raise NotImplementedError() + + +class SolFinitePosetClosures(I.FinitePosetClosures): + def upper_closure(self, fp: I.FinitePoset[X], s: List[X]) -> List[X]: + raise NotImplementedError() + + def lower_closure(self, fp: I.FinitePoset[X], s: List[X]) -> List[X]: + raise NotImplementedError() + + +class SolFinitePosetInfSup(I.FinitePosetInfSup): + def lower_bounds(self, fp: I.FinitePoset[E], s: List[E]) -> List[E]: + raise NotImplementedError() + + def upper_bounds(self, fp: I.FinitePoset[E], s: List[E]) -> List[E]: + raise NotImplementedError() + + def infimum(self, fp: I.FinitePoset[E], s: List[E]) -> Optional[E]: + raise NotImplementedError() + + def supremum(self, fp: I.FinitePoset[E], s: List[E]) -> Optional[E]: + raise NotImplementedError() + + +class SolFinitePosetMinMax(I.FinitePosetMinMax): + def minimal(self, fp: I.FinitePoset[E], S: List[E]) -> List[E]: + raise NotImplementedError() + + def maximal(self, fp: I.FinitePoset[E], S: List[E]) -> List[E]: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_construction.py b/src/act4e_solutions/posets_construction.py new file mode 100644 index 0000000..065f931 --- /dev/null +++ b/src/act4e_solutions/posets_construction.py @@ -0,0 +1,18 @@ +from typing import Any, overload, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolPosetConstructionPower(I.PosetConstructionPower): + @overload + def powerposet(self, s: I.FiniteSet[X]) -> I.FinitePosetOfFiniteSubsets[X, Any]: + ... + + @overload + def powerposet(self, s: I.Setoid[X]) -> I.PosetOfFiniteSubsets[X, Any]: + ... + + def powerposet(self, s: I.Setoid[X]) -> I.PosetOfFiniteSubsets[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_interval.py b/src/act4e_solutions/posets_interval.py new file mode 100644 index 0000000..bd164eb --- /dev/null +++ b/src/act4e_solutions/posets_interval.py @@ -0,0 +1,33 @@ +from typing import Any, overload, TypeVar + +import act4e_interfaces as I + +C = TypeVar("C") +E = TypeVar("E") +X = TypeVar("X") + + +class SolFinitePosetConstructionTwisted(I.FinitePosetConstructionTwisted): + @overload + def twisted(self, s: I.FinitePoset[X]) -> I.FinitePosetOfIntervals[X, Any]: + ... + + @overload + def twisted(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: + ... + + def twisted(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: + raise NotImplementedError() + + +class SolFinitePosetConstructionArrow(I.FinitePosetConstructionArrow): + @overload + def arrow(self, s: I.FinitePoset[X]) -> I.FinitePosetOfIntervals[X, Any]: + ... + + @overload + def arrow(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: + ... + + def arrow(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_map.py b/src/act4e_solutions/posets_map.py new file mode 100644 index 0000000..a91d4d8 --- /dev/null +++ b/src/act4e_solutions/posets_map.py @@ -0,0 +1,15 @@ +from typing import TypeVar + +import act4e_interfaces as I + +A = TypeVar("A") +B = TypeVar("B") +X = TypeVar("X") + + +class SolFiniteMonotoneMapProperties(I.FiniteMonotoneMapProperties): + def is_monotone(self, p1: I.FinitePoset[A], p2: I.FinitePoset[B], m: I.FiniteMap[A, B]) -> bool: + raise NotImplementedError() + + def is_antitone(self, p1: I.FinitePoset[A], p2: I.FinitePoset[B], m: I.FiniteMap[A, B]) -> bool: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_monoidal.py b/src/act4e_solutions/posets_monoidal.py new file mode 100644 index 0000000..96afedc --- /dev/null +++ b/src/act4e_solutions/posets_monoidal.py @@ -0,0 +1,12 @@ +from typing import TypeVar + +import act4e_interfaces as I + +A = TypeVar("A") +B = TypeVar("B") +X = TypeVar("X") + + +class SolMonoidalPosetOperations(I.MonoidalPosetOperations): + def is_monoidal_poset(self, fp: I.FinitePoset[X], fm: I.FiniteMonoid[X]) -> bool: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_product.py b/src/act4e_solutions/posets_product.py new file mode 100644 index 0000000..bf67efd --- /dev/null +++ b/src/act4e_solutions/posets_product.py @@ -0,0 +1,10 @@ +from typing import Any, Sequence, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolFinitePosetConstructionProduct(I.FinitePosetConstructionProduct): + def product(self, ps: Sequence[I.FinitePoset[X]]) -> I.FinitePosetProduct[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_representation.py b/src/act4e_solutions/posets_representation.py new file mode 100644 index 0000000..d7b2991 --- /dev/null +++ b/src/act4e_solutions/posets_representation.py @@ -0,0 +1,12 @@ +from typing import Any + +import act4e_interfaces as I + + +class SolFinitePosetRepresentation(I.FinitePosetRepresentation): + + def load(self, h: I.IOHelper, s: I.FinitePoset_desc) -> I.FinitePoset[Any]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, p: I.FinitePoset[Any]) -> I.FinitePoset_desc: + raise NotImplementedError() diff --git a/src/act4e_solutions/posets_sum.py b/src/act4e_solutions/posets_sum.py new file mode 100644 index 0000000..3081c7f --- /dev/null +++ b/src/act4e_solutions/posets_sum.py @@ -0,0 +1,18 @@ +from typing import Any, overload, Sequence, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolFinitePosetConstructionSum(I.FinitePosetConstructionSum): + @overload + def disjoint_union(self, ps: Sequence[I.FinitePoset[X]]) -> I.FinitePosetDisjointUnion[X, Any]: + ... + + @overload + def disjoint_union(self, ps: Sequence[I.Poset[X]]) -> I.PosetDisjointUnion[X, Any]: + ... + + def disjoint_union(self, ps: Sequence[I.Poset[X]]) -> I.PosetDisjointUnion[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/py.typed b/src/act4e_solutions/py.typed new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/act4e_solutions/py.typed diff --git a/src/act4e_solutions/relations.py b/src/act4e_solutions/relations.py new file mode 100644 index 0000000..048b500 --- /dev/null +++ b/src/act4e_solutions/relations.py @@ -0,0 +1,61 @@ +from typing import Any, TypeVar + +import act4e_interfaces as I +from act4e_interfaces import FiniteRelation + +E1 = TypeVar("E1") +E2 = TypeVar("E2") +E3 = TypeVar("E3") +E = TypeVar("E") + +A = TypeVar("A") +B = TypeVar("B") + + +class SolFiniteRelationProperties(I.FiniteRelationProperties): + def is_surjective(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_defined_everywhere(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_injective(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_single_valued(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + +class SolFiniteRelationOperations(I.FiniteRelationOperations): + def transpose(self, fr: I.FiniteRelation[A, B]) -> I.FiniteRelation[B, A]: + raise NotImplementedError() + + +class SolFiniteEndorelationProperties(I.FiniteEndorelationProperties): + def is_reflexive(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_irreflexive(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_transitive(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_symmetric(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_antisymmetric(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + def is_asymmetric(self, fr: I.FiniteRelation[Any, Any]) -> bool: + raise NotImplementedError() + + +class SolFiniteEndorelationOperations(I.FiniteEndorelationOperations): + def transitive_closure(self, fr: I.FiniteRelation[E, E]) -> I.FiniteRelation[E, E]: + raise NotImplementedError() + + +class SolFiniteRelationCompose(I.FiniteRelationCompose): + def compose(self, fr1: FiniteRelation[E1, E2], fr2: FiniteRelation[E2, E3]) -> I.FiniteRelation[E1, E3]: + raise NotImplementedError() diff --git a/src/act4e_solutions/relations_representation.py b/src/act4e_solutions/relations_representation.py new file mode 100644 index 0000000..8dbde1c --- /dev/null +++ b/src/act4e_solutions/relations_representation.py @@ -0,0 +1,15 @@ +from typing import TypeVar + +import act4e_interfaces as I + +A = TypeVar("A") +B = TypeVar("B") + + +class SolFiniteRelationRepresentation(I.FiniteRelationRepresentation): + + def load(self, h: I.IOHelper, data: I.FiniteRelation_desc) -> I.FiniteRelation[A, B]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, f: I.FiniteRelation[A, B]) -> I.FiniteRelation_desc: + raise NotImplementedError() diff --git a/src/act4e_solutions/semigroups.py b/src/act4e_solutions/semigroups.py new file mode 100644 index 0000000..1b02766 --- /dev/null +++ b/src/act4e_solutions/semigroups.py @@ -0,0 +1,10 @@ +from typing import List, TypeVar + +import act4e_interfaces as I + +C = TypeVar("C") + + +class SolFiniteSemigroupConstruct(I.FiniteSemigroupConstruct): + def free(self, fs: I.FiniteSet[C]) -> I.FreeSemigroup[C, List[C]]: + raise NotImplementedError() diff --git a/src/act4e_solutions/semigroups_representation.py b/src/act4e_solutions/semigroups_representation.py new file mode 100644 index 0000000..23e2ba1 --- /dev/null +++ b/src/act4e_solutions/semigroups_representation.py @@ -0,0 +1,30 @@ +from typing import Any, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolFiniteSemigroupRepresentation(I.FiniteSemigroupRepresentation): + + def load(self, h: I.IOHelper, s: I.FiniteSemigroup_desc) -> I.FiniteSemigroup[Any]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, m: I.FiniteSemigroup[Any]) -> I.FiniteSemigroup_desc: + raise NotImplementedError() + + +class SolFiniteMonoidRepresentation(I.FiniteMonoidRepresentation): + def load(self, h: I.IOHelper, s: I.FiniteMonoid_desc) -> I.FiniteMonoid[X]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, m: I.FiniteMonoid[Any]) -> I.FiniteMonoid_desc: + raise NotImplementedError() + + +class SolFiniteGroupRepresentation(I.FiniteGroupRepresentation): + def load(self, h: I.IOHelper, s: I.FiniteGroup_desc) -> I.FiniteGroup[X]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, m: I.FiniteGroup[Any]) -> I.FiniteGroup_desc: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets.py b/src/act4e_solutions/sets.py new file mode 100644 index 0000000..1dc635f --- /dev/null +++ b/src/act4e_solutions/sets.py @@ -0,0 +1,14 @@ +from typing import Callable, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolEnumerableSetsOperations(I.EnumerableSetsOperations): + def make_set_sequence(self, f: Callable[[int], X]) -> I.EnumerableSet[X]: + raise NotImplementedError() + + def union_esets(self, a: I.EnumerableSet[X], b: I.EnumerableSet[X]) -> I.EnumerableSet[X]: + """Creates the union of two EnumerableSet.""" + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_power.py b/src/act4e_solutions/sets_power.py new file mode 100644 index 0000000..2e9c970 --- /dev/null +++ b/src/act4e_solutions/sets_power.py @@ -0,0 +1,18 @@ +from typing import Any, overload, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolMakePowerSet(I.MakePowerSet): + @overload + def powerset(self, s: I.FiniteSet[X]) -> I.FiniteSetOfFiniteSubsets[X, Any]: + ... + + @overload + def powerset(self, s: I.Setoid[X]) -> I.SetOfFiniteSubsets[X, Any]: + ... + + def powerset(self, s: I.Setoid[X]) -> I.SetOfFiniteSubsets[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_product.py b/src/act4e_solutions/sets_product.py new file mode 100644 index 0000000..d3e5558 --- /dev/null +++ b/src/act4e_solutions/sets_product.py @@ -0,0 +1,18 @@ +from typing import Any, overload, Sequence, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolMakeSetProduct(I.MakeSetProduct): + @overload + def product(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetProduct[X, Any]: + ... + + @overload + def product(self, components: Sequence[I.Setoid[X]]) -> I.SetProduct[X, Any]: + ... + + def product(self, components: Sequence[I.Setoid[X]]) -> I.SetProduct[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_properties.py b/src/act4e_solutions/sets_properties.py new file mode 100644 index 0000000..1a2ab88 --- /dev/null +++ b/src/act4e_solutions/sets_properties.py @@ -0,0 +1,28 @@ +from typing import Any, overload, Sequence, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolFiniteSetProperties(I.FiniteSetProperties): + def is_subset(self, a: I.FiniteSet[X], b: I.FiniteSet[X]) -> bool: + raise NotImplementedError() + + +class SolMakeSetUnion(I.MakeSetUnion): + @overload + def union(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetUnion[X, Any]: + ... + + @overload + def union(self, components: Sequence[I.EnumerableSet[X]]) -> I.EnumerableSetUnion[X, Any]: + ... + + def union(self, components: Sequence[I.Setoid[X]]) -> I.SetUnion[X, Any]: + raise NotImplementedError() + + +class SolMakeSetIntersection(I.MakeSetIntersection): + def intersection(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSet[X]: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_representation.py b/src/act4e_solutions/sets_representation.py new file mode 100644 index 0000000..10d89c9 --- /dev/null +++ b/src/act4e_solutions/sets_representation.py @@ -0,0 +1,11 @@ +from typing import Any + +import act4e_interfaces as I + + +class SolFiniteSetRepresentation(I.FiniteSetRepresentation): + def load(self, h: I.IOHelper, data: I.FiniteSet_desc) -> I.FiniteSet[Any]: + raise NotImplementedError() + + def save(self, h: I.IOHelper, f: I.FiniteSet[Any]) -> I.FiniteSet_desc: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_sum.py b/src/act4e_solutions/sets_sum.py new file mode 100644 index 0000000..ee82985 --- /dev/null +++ b/src/act4e_solutions/sets_sum.py @@ -0,0 +1,19 @@ +from typing import Any, overload, Sequence, TypeVar + +import act4e_interfaces as I + + +X = TypeVar("X") + + +class SolMakeSetDisjointUnion(I.MakeSetDisjointUnion): + @overload + def disjoint_union(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetDisjointUnion[X, Any]: + ... + + @overload + def disjoint_union(self, components: Sequence[I.Setoid[X]]) -> I.SetDisjointUnion[X, Any]: + ... + + def disjoint_union(self, components: Sequence[I.Setoid[X]]) -> I.SetDisjointUnion[X, Any]: + raise NotImplementedError() diff --git a/src/act4e_solutions/sets_union_inter.py b/src/act4e_solutions/sets_union_inter.py new file mode 100644 index 0000000..3a4c419 --- /dev/null +++ b/src/act4e_solutions/sets_union_inter.py @@ -0,0 +1,28 @@ +from typing import Any, overload, Sequence, TypeVar + +import act4e_interfaces as I + +X = TypeVar("X") + + +class SolMakeSetUnion(I.MakeSetUnion): + @overload + def union(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetUnion[X, Any]: + ... + + @overload + def union(self, components: Sequence[I.EnumerableSet[X]]) -> I.EnumerableSetUnion[X, Any]: + ... + + def union(self, components: Sequence[I.EnumerableSet[X]]) -> I.EnumerableSetUnion[X, Any]: + raise NotImplementedError() + + +class SolSetoidOperations(I.SetoidOperations): + @classmethod + def union_setoids(cls, a: I.Setoid[X], b: I.Setoid[X]) -> I.Setoid[X]: + raise NotImplementedError() + + @classmethod + def intersection_setoids(cls, a: I.Setoid[X], b: I.Setoid[X]) -> I.Setoid[X]: + raise NotImplementedError() |