Check models in parallel

This commit is contained in:
Brandon Rozek 2024-11-26 16:24:49 -05:00
parent fb074ff0e8
commit aeb8ae0440
4 changed files with 26 additions and 14 deletions

View file

@ -1,3 +1,4 @@
from common import immutable
from typing import Optional, Set, Tuple
from functools import lru_cache
@ -6,13 +7,14 @@ class Operation:
self.symbol = symbol
self.arity = arity
self.hashed_value = hash(self.symbol) + self.arity
def immutable(self, name, value):
raise Exception("Operations are immutable")
self.__setattr__ = immutable
def __hash__(self):
return self.hashed_value
def __eq__(self, x):
return self.symbol == x.symbol and self.arity == x.arity
def __call__(self, *args):
# Ensure the arity is met
assert len(args) == self.arity