diff options
author | Andrea Censi <acensi@ethz.ch> | 2022-02-21 18:01:11 +0100 |
---|---|---|
committer | Andrea Censi <acensi@ethz.ch> | 2022-02-21 18:01:11 +0100 |
commit | 0611a2faef0ac8fdc8e65c92d7efb4c12a4f1879 (patch) | |
tree | a2c18ec0844e0c447f825ba2fa52e56e74788c2a /src/act4e_solutions/maps.py | |
parent | fix (diff) | |
parent | Bump to version 7.1.2202211124 [ci skip] (diff) | |
download | act4e-0611a2faef0ac8fdc8e65c92d7efb4c12a4f1879.tar.gz act4e-0611a2faef0ac8fdc8e65c92d7efb4c12a4f1879.zip |
Merge branch 'alphubel-stage' of github.com:ACT4E/ACT4E-exercises-template into alphubel-stage
Diffstat (limited to 'src/act4e_solutions/maps.py')
-rw-r--r-- | src/act4e_solutions/maps.py | 26 |
1 files changed, 26 insertions, 0 deletions
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() |