From 5a5331537c3fa89ac1a553e101997e945ce97bc0 Mon Sep 17 00:00:00 2001 From: Andrea Censi Date: Mon, 21 Feb 2022 12:22:37 +0100 Subject: skeletons --- src/act4e_solutions/maps.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/act4e_solutions/maps.py (limited to 'src/act4e_solutions/maps.py') diff --git a/src/act4e_solutions/maps.py b/src/act4e_solutions/maps.py new file mode 100644 index 0000000..cf4e98f --- /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 MyFiniteMapOperations(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() -- cgit v1.2.1