def single_jump(self, addr: Addr, relation: Value) -> Set[Addr]: if relation not in self.relations: raise RelationUnknownToCanvas( canvas=self, addr=addr, relation=relation ) i = addr.index_as_int() try: return {replace(addr, index=self.jump_table[(i, relation)])} except KeyError: return set()
def __setitem__(self, addr: Addr, v: Value) -> None: i = addr.index_as_int() if i < 1 or i > len(self._cells): raise NotImplementedError # TODO raise specific exception self._cells[i - 1].set_contents(v)
def __getitem__(self, addr: Addr) -> CellContents: i = addr.index_as_int() if i < 1 or i > len(self._cells): raise NotImplementedError # TODO raise specific exception return self._cells[i - 1].contents