From e26d9e2d68fdad4c36e6fc729db297e035024f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Horcas?= Date: Fri, 25 Oct 2024 19:19:17 +0200 Subject: [PATCH] Add eq method to PySAT model --- flamapy/metamodels/pysat_metamodel/models/pysat_model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flamapy/metamodels/pysat_metamodel/models/pysat_model.py b/flamapy/metamodels/pysat_metamodel/models/pysat_model.py index bb906e2..da9cf1a 100644 --- a/flamapy/metamodels/pysat_metamodel/models/pysat_model.py +++ b/flamapy/metamodels/pysat_metamodel/models/pysat_model.py @@ -25,3 +25,6 @@ def get_variable(self, key: str) -> int: def get_all_clauses(self) -> CNF: return self._cnf + + def __eq__(self, other: 'PySATModel') -> bool: + return set(self.get_all_clauses().clauses) == set(other.get_all_clauses().clauses)